[Libreoffice-commits] core.git: 2 commits - sw/source vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri May 10 20:27:21 UTC 2019


 sw/source/ui/fldui/flddinf.cxx |    6 +++++-
 vcl/source/window/dialog.cxx   |   36 ++++++++++--------------------------
 2 files changed, 15 insertions(+), 27 deletions(-)

New commits:
commit 243aad91e17960405b472eadd9f9976fec8b7028
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri May 10 11:03:36 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri May 10 22:26:42 2019 +0200

    Related: tdf#125198 centralize notifyWindow:created to one place
    
    Change-Id: I2729cb85f156ddafec69cc3280e9d8544f7c6182
    Reviewed-on: https://gerrit.libreoffice.org/72117
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index c1921d238c67..7f7fc3a9ef7d 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -752,23 +752,25 @@ void Dialog::StateChanged( StateChangedType nType )
 {
     if (nType == StateChangedType::InitShow)
     {
-        if (comphelper::LibreOfficeKit::isActive() && !GetLOKNotifier())
+        DoInitialLayout();
+
+        const bool bKitActive = comphelper::LibreOfficeKit::isActive();
+        if (bKitActive)
         {
-            vcl::ILibreOfficeKitNotifier* pViewShell = mpDialogImpl->m_aInstallLOKNotifierHdl.Call(nullptr);
-            if (pViewShell)
+            if (!GetLOKNotifier())
+                SetLOKNotifier(mpDialogImpl->m_aInstallLOKNotifierHdl.Call(nullptr));
+
+            if (const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
             {
-                SetLOKNotifier(pViewShell);
                 std::vector<vcl::LOKPayloadItem> aItems;
                 aItems.emplace_back("type", "dialog");
                 aItems.emplace_back("size", GetSizePixel().toString());
                 if (!GetText().isEmpty())
                     aItems.emplace_back("title", GetText().toUtf8());
-                pViewShell->notifyWindow(GetLOKWindowId(), "created", aItems);
+                pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
             }
         }
 
-        DoInitialLayout();
-
         if ( !HasChildPathFocus() || HasFocus() )
             GrabFocusToFirstControl();
         if ( !(GetStyle() & WB_CLOSEABLE) )
@@ -889,12 +891,7 @@ bool Dialog::ImplStartExecute()
     if (bModal)
     {
         if (bKitActive && !GetLOKNotifier())
-        {
-            if (vcl::ILibreOfficeKitNotifier* pViewShell = mpDialogImpl->m_aInstallLOKNotifierHdl.Call(nullptr))
-            {
-                SetLOKNotifier(pViewShell);
-            }
-        }
+            SetLOKNotifier(mpDialogImpl->m_aInstallLOKNotifierHdl.Call(nullptr));
 
         switch ( Application::GetDialogCancelMode() )
         {
@@ -925,19 +922,6 @@ bool Dialog::ImplStartExecute()
             std::abort();
         }
 
-        if (bKitActive)
-        {
-            if(const vcl::ILibreOfficeKitNotifier* pNotifier = GetLOKNotifier())
-            {
-                std::vector<vcl::LOKPayloadItem> aItems;
-                aItems.emplace_back("type", "dialog");
-                aItems.emplace_back("size", GetSizePixel().toString());
-                if (!GetText().isEmpty())
-                    aItems.emplace_back("title", GetText().toUtf8());
-                pNotifier->notifyWindow(GetLOKWindowId(), "created", aItems);
-            }
-        }
-
 #ifdef DBG_UTIL
         vcl::Window* pParent = GetParent();
         if ( pParent )
commit 8da6a8fcf1a71588a22bf4afae8d5e54b7b0bcad
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri May 10 16:21:46 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri May 10 22:26:30 2019 +0200

    fix assert for expand_row while frozen
    
    Change-Id: I78578cd1578317a16d2eb62e23ddcc01bc39347a
    Reviewed-on: https://gerrit.libreoffice.org/72130
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index 6ec3db4e8cf8..0603774eb127 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -126,6 +126,7 @@ void SwFieldDokInfPage::Reset(const SfxItemSet* )
     std::vector<OUString> aLst;
     GetFieldMgr().GetSubTypes(TYP_DOCINFOFLD, aLst);
     std::unique_ptr<weld::TreeIter> xEntry(m_xTypeTLB->make_iterator());
+    std::unique_ptr<weld::TreeIter> xExpandEntry;
     for(size_t i = 0; i < aLst.size(); ++i)
     {
         if (!IsFieldEdit() || nSubType == i)
@@ -155,7 +156,7 @@ void SwFieldDokInfPage::Reset(const SfxItemSet* )
                             if (m_sOldCustomFieldName == sEntry)
                             {
                                 m_xSelEntry = m_xTypeTLB->make_iterator(xEntry.get());
-                                m_xTypeTLB->expand_row(*xInfo);
+                                xExpandEntry = m_xTypeTLB->make_iterator(xInfo.get());
                             }
                         }
                     }
@@ -176,6 +177,9 @@ void SwFieldDokInfPage::Reset(const SfxItemSet* )
 
     m_xTypeTLB->thaw();
 
+    if (xExpandEntry)
+        m_xTypeTLB->expand_row(*xExpandEntry);
+
     // select old Pos
     if (m_xSelEntry)
     {


More information about the Libreoffice-commits mailing list