[Libreoffice-commits] core.git: sd/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 22 06:32:06 UTC 2018


 sd/source/ui/animations/CustomAnimationDialog.cxx |    8 ++++----
 sd/source/ui/animations/CustomAnimationDialog.hxx |    3 ++-
 sd/source/ui/animations/CustomAnimationPane.cxx   |   17 ++++++++++-------
 3 files changed, 16 insertions(+), 12 deletions(-)

New commits:
commit bde6f794b1650c4f6ef15d276f2b1238d77bc44a
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Aug 21 15:50:26 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Aug 22 08:31:43 2018 +0200

    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 at collabora.co.uk>

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()


More information about the Libreoffice-commits mailing list