summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/cellsh1.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/cellsh1.cxx')
-rw-r--r--sc/source/ui/view/cellsh1.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index be04ff40351b..400a0273c9dd 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2758,7 +2758,7 @@ void ScCellShell::ExecuteDataPilotDialog()
ScViewData* pData = GetViewData();
ScDocument* pDoc = pData->GetDocument();
- std::unique_ptr<ScDPObject> pNewDPObject(nullptr);
+ std::unique_ptr<ScDPObject> pNewDPObject;
// ScPivot is no longer used...
ScDPObject* pDPObj = pDoc->GetDPAtCursor(
@@ -2917,8 +2917,9 @@ void ScCellShell::ExecuteDataPilotDialog()
pNewDPObject->SetOutRange( aDestPos );
}
- pTabViewShell->SetDialogDPObject( pNewDPObject.get() ); // is copied
- if ( pNewDPObject )
+ bool bHadNewDPObject = pNewDPObject != nullptr;
+ pTabViewShell->SetDialogDPObject( std::move(pNewDPObject) );
+ if ( bHadNewDPObject )
{
// start layout dialog