[Libreoffice-commits] core.git: include/vcl sc/source svx/source vcl/inc vcl/source vcl/unx

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 3 12:50:33 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 16ab6e5b162641e5dc0ba6c0664aa8de50bf8e53
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 Jul 3 14:49:46 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>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97834
    Tested-by: Jenkins

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 4cf23a71d64a..2532504b8c16 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1329,7 +1329,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,
diff --git a/sc/source/ui/cctrl/cbnumberformat.cxx b/sc/source/ui/cctrl/cbnumberformat.cxx
index 93f003ebe01d..9407b08e491c 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 43d3b140cb35..09e8a849fb68 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>
@@ -483,7 +484,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 36c51d990d5c..e82f5b55a393 100644
--- a/vcl/inc/salinst.hxx
+++ b/vcl/inc/salinst.hxx
@@ -165,7 +165,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 3402aa6e3ca3..2e582356dc67 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -235,7 +235,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 4ea4d1b568d9..6e1bac5e91b3 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6768,7 +6768,7 @@ weld::Builder* SalInstance::CreateBuilder(weld::Widget* pParent, const OUString&
 }
 
 weld::Builder* SalInstance::CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot,
-                                                 const OUString& rUIFile)
+                                                 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 3e1b71105a2c..422babaae27a 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -172,16 +172,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 9791b7f28cc2..144cb6b66563 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -15934,7 +15934,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