summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-06-21 15:34:16 +0200
committerAndras Timar <andras.timar@collabora.com>2018-12-06 09:07:06 +0100
commit79e2ed05012d5b40c0c6203889e43b9c034060ec (patch)
treec7ecae4ad08f31553a31e67318c370dc1abd4811 /sd/source
parent808359e4def4f9dd1318c7d0330a14eacda7d02c (diff)
loplugin:useuniqueptr in CustomAnimationDialog
Reviewed-on: https://gerrit.libreoffice.org/56328 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit e5dfdbcc2084bfdb213afbe03d00136e93d5c4d2) Change-Id: Ic2e93c1493159c9602bd68b409052117766dcc02 (cherry picked from commit 130b9aa636200db1d349c1376f8166657f680c7c)
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.cxx26
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.hxx6
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx12
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.hxx2
4 files changed, 22 insertions, 24 deletions
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index 28f96d559121..71f5abb15b0a 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -2169,9 +2169,9 @@ CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, STLPropertySe
sal_uInt16 nTimingId = mpTabControl->GetPageId("timing");
sal_uInt16 nTextAnimId = mpTabControl->GetPageId("textanim");
- mpEffectTabPage = VclPtr<CustomAnimationEffectTabPage>::Create( mpTabControl, mpSet );
+ mpEffectTabPage = VclPtr<CustomAnimationEffectTabPage>::Create( mpTabControl, mpSet.get() );
mpTabControl->SetTabPage( nEffectId, mpEffectTabPage );
- mpDurationTabPage = VclPtr<CustomAnimationDurationTabPage>::Create( mpTabControl, mpSet );
+ mpDurationTabPage = VclPtr<CustomAnimationDurationTabPage>::Create( mpTabControl, mpSet.get() );
mpTabControl->SetTabPage( nTimingId, mpDurationTabPage );
bool bHasText = false;
@@ -2180,7 +2180,7 @@ CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, STLPropertySe
if( bHasText )
{
- mpTextAnimTabPage = VclPtr<CustomAnimationTextAnimTabPage>::Create( mpTabControl, mpSet );
+ mpTextAnimTabPage = VclPtr<CustomAnimationTextAnimTabPage>::Create( mpTabControl, mpSet.get() );
mpTabControl->SetTabPage( nTextAnimId, mpTextAnimTabPage );
}
else
@@ -2204,8 +2204,8 @@ void CustomAnimationDialog::dispose()
mpDurationTabPage.disposeAndClear();
mpTextAnimTabPage.disposeAndClear();
- delete mpSet;
- delete mpResultSet;
+ mpSet.reset();
+ mpResultSet.reset();
mpTabControl.clear();
TabDialog::dispose();
@@ -2213,24 +2213,22 @@ void CustomAnimationDialog::dispose()
STLPropertySet* CustomAnimationDialog::getResultSet()
{
- delete mpResultSet;
-
mpResultSet = createDefaultSet();
- mpEffectTabPage->update( mpResultSet );
- mpDurationTabPage->update( mpResultSet );
+ mpEffectTabPage->update( mpResultSet.get() );
+ mpDurationTabPage->update( mpResultSet.get() );
if( mpTextAnimTabPage )
- mpTextAnimTabPage->update( mpResultSet );
+ mpTextAnimTabPage->update( mpResultSet.get() );
- return mpResultSet;
+ return mpResultSet.get();
}
-STLPropertySet* CustomAnimationDialog::createDefaultSet()
+std::unique_ptr<STLPropertySet> CustomAnimationDialog::createDefaultSet()
{
Any aEmpty;
- STLPropertySet* pSet = new STLPropertySet();
- pSet->setPropertyDefaultValue( nHandleMaxParaDepth, makeAny( (sal_Int32)-1 ) );
+ std::unique_ptr<STLPropertySet> pSet(new STLPropertySet());
+ pSet->setPropertyDefaultValue( nHandleMaxParaDepth, makeAny( sal_Int32(-1) ) );
pSet->setPropertyDefaultValue( nHandleHasAfterEffect, makeAny( false ) );
pSet->setPropertyDefaultValue( nHandleAfterEffectOnNextEffect, makeAny( false ) );
diff --git a/sd/source/ui/animations/CustomAnimationDialog.hxx b/sd/source/ui/animations/CustomAnimationDialog.hxx
index 4d0c685dabb1..50977844a77a 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.hxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.hxx
@@ -148,11 +148,11 @@ public:
STLPropertySet* getResultSet();
- static STLPropertySet* createDefaultSet();
+ static std::unique_ptr<STLPropertySet> createDefaultSet();
private:
- STLPropertySet* mpSet;
- STLPropertySet* mpResultSet;
+ std::unique_ptr<STLPropertySet> mpSet;
+ std::unique_ptr<STLPropertySet> mpResultSet;
VclPtr<TabControl> mpTabControl;
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index c00aedf6c607..b999ec95e893 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -919,7 +919,7 @@ void CustomAnimationPane::UpdateLook()
}
}
-void addValue( STLPropertySet* pSet, sal_Int32 nHandle, const Any& rValue )
+void addValue( std::unique_ptr<STLPropertySet>& pSet, sal_Int32 nHandle, const Any& rValue )
{
switch( pSet->getPropertyState( nHandle ) )
{
@@ -1124,9 +1124,9 @@ static bool hasVisibleShape( const Reference< XShape >& xShape )
return true;
}
-STLPropertySet* CustomAnimationPane::createSelectionSet()
+std::unique_ptr<STLPropertySet> CustomAnimationPane::createSelectionSet()
{
- STLPropertySet* pSet = CustomAnimationDialog::createDefaultSet();
+ std::unique_ptr<STLPropertySet> pSet = CustomAnimationDialog::createDefaultSet();
pSet->setPropertyValue( nHandleCurrentPage, makeAny( mxCurrentPage ) );
@@ -1649,13 +1649,13 @@ void CustomAnimationPane::changeSelection( STLPropertySet const * pResultSet, ST
void CustomAnimationPane::showOptions(const OString& sPage)
{
- STLPropertySet* pSet = createSelectionSet();
+ std::unique_ptr<STLPropertySet> pSet = createSelectionSet();
- VclPtrInstance< CustomAnimationDialog > pDlg(this, pSet, sPage);
+ VclPtrInstance< CustomAnimationDialog > pDlg(this, pSet.get(), sPage);
if( pDlg->Execute() )
{
addUndo();
- changeSelection( pDlg->getResultSet(), pSet );
+ changeSelection( pDlg->getResultSet(), pSet.get() );
updateControls();
}
}
diff --git a/sd/source/ui/animations/CustomAnimationPane.hxx b/sd/source/ui/animations/CustomAnimationPane.hxx
index 086b717dbc84..f1aff2e25cdc 100644
--- a/sd/source/ui/animations/CustomAnimationPane.hxx
+++ b/sd/source/ui/animations/CustomAnimationPane.hxx
@@ -109,7 +109,7 @@ private:
void moveSelection( bool bUp );
void onPreview( bool bForcePreview );
- STLPropertySet* createSelectionSet();
+ std::unique_ptr<STLPropertySet> createSelectionSet();
void changeSelection( STLPropertySet const * pResultSet, STLPropertySet const * pOldSet );
static css::uno::Any getProperty1Value( sal_Int32 nType, const CustomAnimationEffectPtr& pEffect );