summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-02-04 09:17:42 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-02-04 09:30:11 +0000
commit2ce227a7642647267c982909a8b3175d22c58b74 (patch)
treef1c024b33ead35fb551c3cf0c34f278697642346 /sc/source/ui
parentc4ac8af7da53567fa91148a8c7319eb3e6870196 (diff)
coverity#1351755 Dereference null return value
Change-Id: I144a2c498763534b8aff604bdb3440180ac0f2ff
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/dbgui/PivotLayoutDialog.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 03a8db215c91..d7982a915c96 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -517,12 +517,16 @@ void ScPivotLayoutDialog::ApplyChanges()
{
const ScRange& rOldRange = pOldDPObj->GetOutRange();
+ ScDPObject *pDPObj = nullptr;
// FIXME: if the new range overlaps with the old one, the table actually doesn't move
// and shouldn't therefore be deleted
if ( ( ( rOldRange != aDestinationRange ) && !rOldRange.In( aDestinationRange ) )
|| bToNewSheet )
{
- ScDPObject *pDPObj = mpDocument->GetDPAtCursor( maPivotParameters.nCol, maPivotParameters.nRow, maPivotParameters.nTab);
+ mpDocument->GetDPAtCursor( maPivotParameters.nCol, maPivotParameters.nRow, maPivotParameters.nTab);
+ }
+ if (pDPObj)
+ {
ScDBDocFunc aFunc( *(mpViewData->GetDocShell() ));
aFunc.RemovePivotTable( *pDPObj, true, false);
mpViewData->GetView()->CursorPosChanged();