[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.3' - cui/source include/sfx2 sfx2/source

Pranav Kant pranavk at collabora.co.uk
Wed Nov 29 10:54:12 UTC 2017


 cui/source/dialogs/iconcdlg.cxx |    2 +-
 include/sfx2/basedlgs.hxx       |    1 +
 sfx2/source/dialog/basedlgs.cxx |   21 +++++++++++++++++++++
 3 files changed, 23 insertions(+), 1 deletion(-)

New commits:
commit 45d17c5a19b74d9942e3550f6bb8eb75815b7c04
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Tue Nov 28 16:59:26 2017 +0530

    lokdialog: Make hyperlink dialog work
    
    (cherry picked from commit 29f23a47f02b05ddd9a3a626a6cf8bfa7083d1bc)
    (cherry picked from commit 9ad0c1815e137c55f2d356c46630e67570262196)
    
    Change-Id: Ifd8c721b001b09ddab8d4fe06ae6818980d6ee76

diff --git a/cui/source/dialogs/iconcdlg.cxx b/cui/source/dialogs/iconcdlg.cxx
index ba096454466e..152d272c7b8a 100644
--- a/cui/source/dialogs/iconcdlg.cxx
+++ b/cui/source/dialogs/iconcdlg.cxx
@@ -256,7 +256,7 @@ void IconChoiceDialog::dispose()
     m_pHelpBtn.clear();
     m_pResetBtn.clear();
     m_pTabContainer.clear();
-    ModalDialog::dispose();
+    SfxModalDialog::dispose();
 }
 
 /**********************************************************************
diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index 30ad2fb0a2d5..b16aec1bd83d 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -75,6 +75,7 @@ public:
     virtual short       Execute() override;
     const SfxItemSet*   GetOutputItemSet() const { return pOutputSet; }
     const SfxItemSet*   GetInputItemSet() const { return pInputSet; }
+    void                StateChanged( StateChangedType nStateChange ) override;
 };
 
 // class SfxModelessDialog --------------------------------------------------
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx
index ce028f908472..97d3c1c8b45e 100644
--- a/sfx2/source/dialog/basedlgs.cxx
+++ b/sfx2/source/dialog/basedlgs.cxx
@@ -211,6 +211,27 @@ void SfxModalDialog::CreateOutputItemSet( const SfxItemSet& rSet )
 }
 
 
+void SfxModalDialog::StateChanged( StateChangedType nType )
+{
+    if (comphelper::LibreOfficeKit::isActive() && nType == StateChangedType::InitShow)
+    {
+        // There are some dialogs, like Hyperlink dialog, which inherit from
+        // SfxModalDialog even though they are modeless, i.e., their Execute method
+        // isn't called.
+        if (!GetLOKNotifier())
+        {
+            SetLOKNotifier(SfxViewShell::Current());
+            const Size aSize = GetOptimalSize();
+            std::vector<vcl::LOKPayloadItem> aItems;
+            aItems.emplace_back(std::make_pair("size", aSize.toString()));
+            SfxViewShell::Current()->notifyWindow(GetLOKWindowId(), "created", aItems);
+        }
+    }
+
+    ModalDialog::StateChanged(nType);
+}
+
+
 void SfxModelessDialog::StateChanged( StateChangedType nStateChange )
 {
     if ( nStateChange == StateChangedType::InitShow )


More information about the Libreoffice-commits mailing list