Caolán has fixed the code around in a way to ensure pPV always initialized.
Ah OK. I see that now when I pulled a fresher version.
But unless I am mistaken, now then pArgs might in theory be de-references while NULL?
Consider this code path:
const SfxItemSet* pArgs = rReq.GetArgs();
SFX_REQUEST_ARG (rReq, pHelpLineIndex, SfxUInt32Item, ID_VAL_INDEX, FALSE);
// Assume pHelpLineIndex gets set to non-NULL
if (pHelpLineIndex != NULL)
{
// so pArgs gets set to NULL
pArgs = NULL;
}
if ( !pArgs )
{
// Thus this block is entered
SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
// Assume pFact gets set to NULL. Clearly that is possible as the code right after bothers
to check for it?
AbstractSdSnapLineDlg* pDlg = pFact ? pFact->CreateSdSnapLineDlg( NULL, aNewAttr, mpView ) :
0;
// and thus pDlg is NULL
if( pDlg )
{
// so this block is not entered, which is the only place where pArgs gets
// set to non-NULL.
}
}
// Thus pArgs can be NULL here
aHlpPos.X() = ((const SfxUInt32Item&) pArgs->Get(ATTR_SNAPLINE_X)).GetValue();
aHlpPos.Y() = ((const SfxUInt32Item&) pArgs->Get(ATTR_SNAPLINE_Y)).GetValue();
Or am I missing something...
--tml
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.