diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-21 15:50:26 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-22 08:31:43 +0200 |
commit | bde6f794b1650c4f6ef15d276f2b1238d77bc44a (patch) | |
tree | 0a7a9f8429ddb5d483edfc54561923b388ca9096 /sd | |
parent | ddfed109ebaa854582bc59750a1988af3f6ad3d6 (diff) |
lokdialog: Convert the SideBar->Animation->Effect Options to async exec.
and move the ownership of the propertyset, so it lives as long as the
dialog (which appears to fix a double delete here as a bonus)
Change-Id: Iaff931a048211ae8453cc8955344453abdd3f4ab
Reviewed-on: https://gerrit.libreoffice.org/59399
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/animations/CustomAnimationDialog.cxx | 8 | ||||
-rw-r--r-- | sd/source/ui/animations/CustomAnimationDialog.hxx | 3 | ||||
-rw-r--r-- | sd/source/ui/animations/CustomAnimationPane.cxx | 17 |
3 files changed, 16 insertions, 12 deletions
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index cd2d4c393ea7..dea31a7edce4 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -2154,9 +2154,9 @@ IMPL_LINK_NOARG(CustomAnimationTextAnimTabPage, implSelectHdl, ListBox&, void) updateControlStates(); } -CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, STLPropertySet* pSet, const OString& sPage) +CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, std::unique_ptr<STLPropertySet> pSet, const OString& sPage) : TabDialog( pParent, "CustomAnimationProperties", "modules/simpress/ui/customanimationproperties.ui") -, mpSet( pSet ) +, mpSet( std::move(pSet) ) , mpResultSet( nullptr ) { get(mpTabControl, "tabs"); @@ -2171,8 +2171,8 @@ CustomAnimationDialog::CustomAnimationDialog(vcl::Window* pParent, STLPropertySe mpTabControl->SetTabPage( nTimingId, mpDurationTabPage ); bool bHasText = false; - if( pSet->getPropertyState( nHandleHasText ) != STLPropertyState::Ambiguous ) - pSet->getPropertyValue( nHandleHasText ) >>= bHasText; + if( mpSet->getPropertyState( nHandleHasText ) != STLPropertyState::Ambiguous ) + mpSet->getPropertyValue( nHandleHasText ) >>= bHasText; if( bHasText ) { diff --git a/sd/source/ui/animations/CustomAnimationDialog.hxx b/sd/source/ui/animations/CustomAnimationDialog.hxx index 14f605b2984f..6aaf713cfaea 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.hxx +++ b/sd/source/ui/animations/CustomAnimationDialog.hxx @@ -142,11 +142,12 @@ class STLPropertySet; class CustomAnimationDialog : public TabDialog { public: - CustomAnimationDialog(vcl::Window* pParent, STLPropertySet* pSet, const OString& Page); + CustomAnimationDialog(vcl::Window* pParent, std::unique_ptr<STLPropertySet> pSet, const OString& Page); virtual ~CustomAnimationDialog() override; virtual void dispose() override; STLPropertySet* getResultSet(); + STLPropertySet* getPropertySet() const { return mpSet.get(); } static std::unique_ptr<STLPropertySet> createDefaultSet(); diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index dea81a9cd6c9..ca2a57dc099a 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -1668,13 +1668,16 @@ void CustomAnimationPane::showOptions(const OString& sPage) { std::unique_ptr<STLPropertySet> pSet = createSelectionSet(); - VclPtrInstance< CustomAnimationDialog > pDlg(this, pSet.get(), sPage); - if( pDlg->Execute() ) - { - addUndo(); - changeSelection( pDlg->getResultSet(), pSet.get() ); - updateControls(); - } + auto pDlg = VclPtr<CustomAnimationDialog>::Create(this, std::move(pSet), sPage); + + pDlg->StartExecuteAsync([=](sal_Int32 nResult){ + if (nResult ) + { + addUndo(); + changeSelection( pDlg->getResultSet(), pDlg->getPropertySet() ); + updateControls(); + } + }); } void CustomAnimationPane::onChangeCurrentPage() |