[Libreoffice-commits] core.git: 2 commits - desktop/source include/LibreOfficeKit vcl/inc vcl/jsdialog

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 3 12:49:28 UTC 2020


 desktop/source/lib/init.cxx               |    4 ++--
 include/LibreOfficeKit/LibreOfficeKit.h   |    2 +-
 include/LibreOfficeKit/LibreOfficeKit.hxx |    2 +-
 vcl/inc/jsdialog/jsdialogbuilder.hxx      |    1 +
 vcl/jsdialog/jsdialogbuilder.cxx          |   12 +++++++++++-
 5 files changed, 16 insertions(+), 5 deletions(-)

New commits:
commit 126c5e57d732359788010d6a364a5011d2e4a8c8
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Jun 25 11:24:15 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Jul 3 14:48:53 2020 +0200

    revert jsdialog: always clean remember widgets
    
    Don't delete all widgets when nested tab page
    is used
    
    Change-Id: I0ce2ce976791ca0c8325013df10f01abe341b78d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97119
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97833
    Tested-by: Jenkins

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index ba4641171a2c..1ef216f18c99 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -53,6 +53,7 @@ class JSInstanceBuilder : public SalInstanceBuilder
     /// used in case of tab pages where dialog is not a direct top level
     VclPtr<vcl::Window> m_aParentDialog;
     bool m_bHasTopLevelDialog;
+    bool m_bIsNotebookbar;
 
     friend VCL_DLLPUBLIC weld::Widget* jsdialog::FindWeldWidgetsMap(sal_uInt64 nWindowId,
                                                                     const OString& rWidget);
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 767a465c5f3f..8f12489ed44c 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -72,6 +72,7 @@ JSInstanceBuilder::JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIR
     , m_nWindowId(0)
     , m_aParentDialog(nullptr)
     , m_bHasTopLevelDialog(false)
+    , m_bIsNotebookbar(false)
 {
     vcl::Window* pRoot = m_xBuilder->get_widget_root();
     if (pRoot && pRoot->GetParent())
@@ -91,6 +92,7 @@ JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRo
     , m_nWindowId(0)
     , m_aParentDialog(nullptr)
     , m_bHasTopLevelDialog(false)
+    , m_bIsNotebookbar(false)
 {
     vcl::Window* pRoot = m_xBuilder->get_widget_root();
     if (pRoot && pRoot->GetParent())
@@ -99,12 +101,19 @@ JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRo
         if (m_aParentDialog)
             m_nWindowId = m_aParentDialog->GetLOKWindowId();
         if (!m_nWindowId && nWindowId)
+        {
             m_nWindowId = nWindowId;
+            m_bIsNotebookbar = true;
+        }
         InsertWindowToMap(m_nWindowId);
     }
 }
 
-JSInstanceBuilder::~JSInstanceBuilder() { GetLOKWeldWidgetsMap().erase(m_nWindowId); }
+JSInstanceBuilder::~JSInstanceBuilder()
+{
+    if (m_nWindowId && (m_bHasTopLevelDialog || m_bIsNotebookbar))
+        GetLOKWeldWidgetsMap().erase(m_nWindowId);
+}
 
 std::map<sal_uInt64, WidgetMap>& JSInstanceBuilder::GetLOKWeldWidgetsMap()
 {
@@ -144,6 +153,7 @@ void JSInstanceBuilder::RememberWidget(const OString& id, weld::Widget* pWidget)
     auto it = GetLOKWeldWidgetsMap().find(m_nWindowId);
     if (it != GetLOKWeldWidgetsMap().end())
     {
+        it->second.erase(id);
         it->second.insert(WidgetMap::value_type(id, pWidget));
     }
 }
commit af2c3124332c02b3ef4065481c1c5b72baf032e8
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Jun 24 11:27:39 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Jul 3 14:48:46 2020 +0200

    jsdialog: change sendDialogEvent API parameter
    
    WindowId with 64bit length is needed
    
    Change-Id: Ia11530fb4666fc64d7acde653085ed258058c169
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97100
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97832
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 6e25e8c71b7a..a34565e9d0c1 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -1008,7 +1008,7 @@ static void doc_removeTextContext(LibreOfficeKitDocument* pThis,
                                   int nCharBefore,
                                   int nCharAfter);
 static void doc_sendDialogEvent(LibreOfficeKitDocument* pThis,
-                               unsigned nLOKWindowId,
+                               unsigned long long int nLOKWindowId,
                                const char* pArguments);
 static void doc_postWindowKeyEvent(LibreOfficeKitDocument* pThis,
                                    unsigned nLOKWindowId,
@@ -3597,7 +3597,7 @@ public:
 
 } // anonymous namespace
 
-static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned nWindowId, const char* pArguments)
+static void doc_sendDialogEvent(LibreOfficeKitDocument* /*pThis*/, unsigned long long int nWindowId, const char* pArguments)
 {
     SolarMutexGuard aGuard;
 
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 8b68452697b3..f4244def5a6b 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -416,7 +416,7 @@ struct _LibreOfficeKitDocumentClass
 
     /// @see lok::Document::sendDialogEvent
     void (*sendDialogEvent) (LibreOfficeKitDocument* pThis,
-                            unsigned nLOKWindowId,
+                            unsigned long long int nLOKWindowId,
                             const char* pArguments);
 
     /// @see lok::Document::renderFontOrientation().
diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx
index c85143821717..db6c87725bce 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.hxx
+++ b/include/LibreOfficeKit/LibreOfficeKit.hxx
@@ -308,7 +308,7 @@ public:
      * @param nWindowId id of the window to notify
      * @param pArguments arguments of the event.
      */
-    void sendDialogEvent(unsigned nWindowId, const char* pArguments = NULL)
+    void sendDialogEvent(unsigned long long int nWindowId, const char* pArguments = NULL)
     {
         mpDoc->pClass->sendDialogEvent(mpDoc, nWindowId, pArguments);
     }


More information about the Libreoffice-commits mailing list