cid#1448220 Explicit null dereferenced
Change-Id: I0e612cf738d54e2108458da5c4afe78f1699f475 Reviewed-on: https://gerrit.libreoffice.org/76105 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
@@ -408,26 +408,26 @@ std::unique_ptr<SfxModelessDialogController> ScTabViewShell::CreateRefDialogCont
|
|||||||
}
|
}
|
||||||
case WID_CONDFRMT_REF:
|
case WID_CONDFRMT_REF:
|
||||||
{
|
{
|
||||||
bool bFound = false;
|
|
||||||
const ScCondFormatDlgItem* pDlgItem = nullptr;
|
const ScCondFormatDlgItem* pDlgItem = nullptr;
|
||||||
// Get the pool item stored by Conditional Format Manager Dialog.
|
// Get the pool item stored by Conditional Format Manager Dialog.
|
||||||
const SfxPoolItem* pItem = nullptr;
|
|
||||||
auto itemsRange = GetPool().GetItemSurrogates(SCITEM_CONDFORMATDLGDATA);
|
auto itemsRange = GetPool().GetItemSurrogates(SCITEM_CONDFORMATDLGDATA);
|
||||||
if (itemsRange.begin() != itemsRange.end())
|
if (itemsRange.begin() != itemsRange.end())
|
||||||
{
|
{
|
||||||
pItem = *itemsRange.begin();
|
const SfxPoolItem* pItem = *itemsRange.begin();
|
||||||
pDlgItem = static_cast<const ScCondFormatDlgItem*>(pItem);
|
pDlgItem = static_cast<const ScCondFormatDlgItem*>(pItem);
|
||||||
bFound = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScViewData& rViewData = GetViewData();
|
if (pDlgItem)
|
||||||
rViewData.SetRefTabNo( rViewData.GetTabNo() );
|
{
|
||||||
|
ScViewData& rViewData = GetViewData();
|
||||||
|
rViewData.SetRefTabNo( rViewData.GetTabNo() );
|
||||||
|
|
||||||
xResult.reset(new ScCondFormatDlg(pB, pCW, pParent, &rViewData, pDlgItem));
|
xResult.reset(new ScCondFormatDlg(pB, pCW, pParent, &rViewData, pDlgItem));
|
||||||
|
|
||||||
|
// Remove the pool item stored by Conditional Format Manager Dialog.
|
||||||
|
GetPool().Remove(*pDlgItem);
|
||||||
|
}
|
||||||
|
|
||||||
// Remove the pool item stored by Conditional Format Manager Dialog.
|
|
||||||
if ( bFound && pItem )
|
|
||||||
GetPool().Remove( *pItem );
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user