[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - include/vcl sc/source svx/source vcl/inc vcl/source vcl/unx

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 26 09:35:27 UTC 2020


 include/vcl/InterimItemWindow.hxx           |    3 ++-
 include/vcl/svapp.hxx                       |    2 +-
 sc/source/ui/cctrl/cbnumberformat.cxx       |    2 +-
 svx/source/tbxctrls/StylesPreviewWindow.cxx |    4 +++-
 vcl/inc/salinst.hxx                         |    2 +-
 vcl/inc/unx/gtk/gtkinst.hxx                 |    2 +-
 vcl/source/app/salvtables.cxx               |    2 +-
 vcl/source/control/InterimItemWindow.cxx    |    5 +++--
 vcl/source/window/builder.cxx               |    6 +++---
 vcl/unx/gtk3/gtk3gtkinst.cxx                |    2 +-
 10 files changed, 17 insertions(+), 13 deletions(-)

New commits:
commit 3230ba0b3701ab3c7c4be284a2cb79d5025982c6
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Jun 25 12:48:51 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Jun 26 11:34:55 2020 +0200

    notebookbar: remember LOKWindowId in interim builders
    
    In case of notebookbar we need to remember the same id
    in every builder for each view to be able to use
    interim widgets. Then widgets are added to the same
    map as main notebookbar widgets. SfxViewShell is
    used as a common id as it is easily accessible.
    
    Change-Id: I4fbf2da320396efc80b08bcee9e341c165b1a290
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97199
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/include/vcl/InterimItemWindow.hxx b/include/vcl/InterimItemWindow.hxx
index 3ba842a3eca1..2ff2dd6d2303 100644
--- a/include/vcl/InterimItemWindow.hxx
+++ b/include/vcl/InterimItemWindow.hxx
@@ -24,7 +24,8 @@ public:
     virtual void GetFocus() override;
 
 protected:
-    InterimItemWindow(vcl::Window* pParent, const OUString& rUIXMLDescription, const OString& rID);
+    InterimItemWindow(vcl::Window* pParent, const OUString& rUIXMLDescription, const OString& rID,
+                      sal_uInt64 nLOKWindowId = 0);
 
     // pass keystrokes from our child window through this to handle focus changes correctly
     // returns true if keystroke is consumed
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 5129ed16f210..db4563b7ba82 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1341,7 +1341,7 @@ public:
     static void setDeInitHook(Link<LinkParamNone*,void> const & hook);
 
     static weld::Builder* CreateBuilder(weld::Widget* pParent, const OUString &rUIFile, bool bMobile = false);
-    static weld::Builder* CreateInterimBuilder(vcl::Window* pParent, const OUString &rUIFile); //for the duration of vcl parent windows
+    static weld::Builder* CreateInterimBuilder(vcl::Window* pParent, const OUString &rUIFile, sal_uInt64 nLOKWindowId = 0); //for the duration of vcl parent windows
     static weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent, VclMessageType eMessageType,
                                                     VclButtonsType eButtonType, const OUString& rPrimaryMessage,
                                                     bool bMobile = false);
diff --git a/sc/source/ui/cctrl/cbnumberformat.cxx b/sc/source/ui/cctrl/cbnumberformat.cxx
index 830e24761d08..f1c863801490 100644
--- a/sc/source/ui/cctrl/cbnumberformat.cxx
+++ b/sc/source/ui/cctrl/cbnumberformat.cxx
@@ -27,7 +27,7 @@
 #include <sc.hrc>
 
 ScNumberFormat::ScNumberFormat(vcl::Window* pParent)
-    : InterimItemWindow(pParent, "modules/scalc/ui/numberbox.ui", "NumberBox")
+    : InterimItemWindow(pParent, "modules/scalc/ui/numberbox.ui", "NumberBox", reinterpret_cast<sal_uInt64>(SfxViewShell::Current()))
     , m_xWidget(m_xBuilder->weld_combo_box("numbertype"))
 {
     m_xWidget->append_text(ScResId(STR_GENERAL));
diff --git a/svx/source/tbxctrls/StylesPreviewWindow.cxx b/svx/source/tbxctrls/StylesPreviewWindow.cxx
index cf1fba02a2d7..01bd8037b0f7 100644
--- a/svx/source/tbxctrls/StylesPreviewWindow.cxx
+++ b/svx/source/tbxctrls/StylesPreviewWindow.cxx
@@ -26,6 +26,7 @@
 #include <sfx2/tbxctrl.hxx>
 #include <sfx2/sfxsids.hrc>
 #include <sfx2/tplpitem.hxx>
+#include <sfx2/viewsh.hxx>
 
 #include <editeng/editids.hrc>
 #include <editeng/fontitem.hxx>
@@ -484,7 +485,8 @@ IMPL_LINK(StylesPreviewWindow_Base, GoDown, const OString&, /*rItem*/, void)
 StylesPreviewWindow_Impl::StylesPreviewWindow_Impl(
     vcl::Window* pParent, std::vector<OUString>& aDefaultStyles,
     css::uno::Reference<css::frame::XDispatchProvider>& xDispatchProvider)
-    : InterimItemWindow(pParent, "svx/ui/stylespreview.ui", "ApplyStyleBox")
+    : InterimItemWindow(pParent, "svx/ui/stylespreview.ui", "ApplyStyleBox",
+                        reinterpret_cast<sal_uInt64>(SfxViewShell::Current()))
     , StylesPreviewWindow_Base(*m_xBuilder, aDefaultStyles, xDispatchProvider)
 {
     SetOptimalSize();
diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx
index c6a88673830f..33c29589133a 100644
--- a/vcl/inc/salinst.hxx
+++ b/vcl/inc/salinst.hxx
@@ -164,7 +164,7 @@ public:
     virtual OpenGLContext*  CreateOpenGLContext() = 0;
 
     virtual weld::Builder* CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile);
-    virtual weld::Builder* CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile);
+    virtual weld::Builder* CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile, sal_uInt64 nLOKWindowId = 0);
     virtual weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent, VclMessageType eMessageType,
                                                      VclButtonsType eButtonType, const OUString& rPrimaryMessage);
     virtual weld::Window* GetFrameWeld(const css::uno::Reference<css::awt::XWindow>& rWindow);
diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index d83ecc4f80fe..4cf7369c7992 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -227,7 +227,7 @@ public:
     virtual css::uno::Reference< css::uno::XInterface > CreateDropTarget() override;
     virtual OpenGLContext* CreateOpenGLContext() override;
     virtual weld::Builder* CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile) override;
-    virtual weld::Builder* CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile) override;
+    virtual weld::Builder* CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile, sal_uInt64 nLOKWindowId = 0) override;
     virtual weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage) override;
     virtual weld::Window* GetFrameWeld(const css::uno::Reference<css::awt::XWindow>& rWindow) override;
 
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 553bd6c44f42..a8ef10f9f127 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6140,7 +6140,7 @@ weld::Builder* SalInstance::CreateBuilder(weld::Widget* pParent, const OUString&
     return new SalInstanceBuilder(pParentWidget, rUIRoot, rUIFile);
 }
 
-weld::Builder* SalInstance::CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile)
+weld::Builder* SalInstance::CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile, sal_uInt64)
 {
     return new SalInstanceBuilder(pParent, rUIRoot, rUIFile);
 }
diff --git a/vcl/source/control/InterimItemWindow.cxx b/vcl/source/control/InterimItemWindow.cxx
index f9f54d757fd5..67554e226b5b 100644
--- a/vcl/source/control/InterimItemWindow.cxx
+++ b/vcl/source/control/InterimItemWindow.cxx
@@ -11,12 +11,13 @@
 #include <vcl/layout.hxx>
 
 InterimItemWindow::InterimItemWindow(vcl::Window* pParent, const OUString& rUIXMLDescription,
-                                     const OString& rID)
+                                     const OString& rID, sal_uInt64 nLOKWindowId)
     : Control(pParent, WB_TABSTOP | WB_DIALOGCONTROL)
 {
     m_xVclContentArea = VclPtr<VclVBox>::Create(this);
     m_xVclContentArea->Show();
-    m_xBuilder.reset(Application::CreateInterimBuilder(m_xVclContentArea, rUIXMLDescription));
+    m_xBuilder.reset(
+        Application::CreateInterimBuilder(m_xVclContentArea, rUIXMLDescription, nLOKWindowId));
     m_xContainer = m_xBuilder->weld_container(rID);
 
     SetBackground();
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index c543736cb650..9c9e9e1d623d 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -165,16 +165,16 @@ weld::Builder* Application::CreateBuilder(weld::Widget* pParent, const OUString
         return ImplGetSVData()->mpDefInst->CreateBuilder(pParent, VclBuilderContainer::getUIRootDir(), rUIFile);
 }
 
-weld::Builder* Application::CreateInterimBuilder(vcl::Window* pParent, const OUString &rUIFile)
+weld::Builder* Application::CreateInterimBuilder(vcl::Window* pParent, const OUString &rUIFile, sal_uInt64 nLOKWindowId)
 {
     if (comphelper::LibreOfficeKit::isActive()
         && (rUIFile == "svx/ui/stylespreview.ui"
         || rUIFile == "modules/scalc/ui/numberbox.ui"))
     {
-        return new JSInstanceBuilder(pParent, VclBuilderContainer::getUIRootDir(), rUIFile, css::uno::Reference<css::frame::XFrame>());
+        return new JSInstanceBuilder(pParent, VclBuilderContainer::getUIRootDir(), rUIFile, css::uno::Reference<css::frame::XFrame>(), nLOKWindowId);
     }
 
-    return ImplGetSVData()->mpDefInst->CreateInterimBuilder(pParent, VclBuilderContainer::getUIRootDir(), rUIFile);
+    return ImplGetSVData()->mpDefInst->CreateInterimBuilder(pParent, VclBuilderContainer::getUIRootDir(), rUIFile, nLOKWindowId);
 }
 
 weld::MessageDialog* Application::CreateMessageDialog(weld::Widget* pParent, VclMessageType eMessageType,
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index dba983bc7c84..3197e2bd033d 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -13243,7 +13243,7 @@ weld::Builder* GtkInstance::CreateBuilder(weld::Widget* pParent, const OUString&
     return new GtkInstanceBuilder(pBuilderParent, rUIRoot, rUIFile, nullptr);
 }
 
-weld::Builder* GtkInstance::CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile)
+weld::Builder* GtkInstance::CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile, sal_uInt64)
 {
     // Create a foreign window which we know is a GtkGrid and make the native widgets a child of that, so we can
     // support GtkWidgets within a vcl::Window


More information about the Libreoffice-commits mailing list