[Libreoffice-commits] core.git: include/vcl sc/source svtools/source vcl/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Feb 19 17:11:57 UTC 2021


 include/vcl/builder.hxx                 |   45 --------------------------------
 include/vcl/dockwin.hxx                 |    1 
 include/vcl/notebookbar/notebookbar.hxx |    2 -
 include/vcl/syswin.hxx                  |   33 ++++++++++++++++++++++-
 sc/source/ui/cctrl/checklistmenu.cxx    |    2 -
 svtools/source/control/toolbarmenu.cxx  |    2 -
 vcl/source/control/NotebookbarPopup.cxx |    2 -
 vcl/source/control/calendar.cxx         |    2 -
 vcl/source/window/dialog.cxx            |    7 ++++
 9 files changed, 44 insertions(+), 52 deletions(-)

New commits:
commit 40496a1910c2fc453f010b0492a79aa62afbbc75
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Feb 19 14:58:30 2021 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Feb 19 18:11:15 2021 +0100

    forward declare VclBuilder in VclBuilderContainer
    
    so we can hide it as a detail
    
    Change-Id: I8ab9097c04a16684ee89a92713ef5975d83b76bc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111225
    Tested-by: Caolán McNamara <caolanm at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx
index 1fe1ef85f243..c7d7f645532c 100644
--- a/include/vcl/builder.hxx
+++ b/include/vcl/builder.hxx
@@ -438,51 +438,6 @@ inline T* VclBuilder::get(const OString& sID)
     return static_cast<T*>(w);
 }
 
-
-//helper baseclass to ease retro fitting dialogs/tabpages that load a resource
-//to load a .ui file instead
-//
-//vcl requires the Window Children of a Parent Window to be destroyed before
-//the Parent Window.  VclBuilderContainer owns the VclBuilder which owns the
-//Children Window. So the VclBuilderContainer dtor must be called before
-//the Parent Window dtor.
-//
-//i.e.  class Dialog : public SystemWindow, public VclBuilderContainer
-//not   class Dialog : public VclBuilderContainer, public SystemWindow
-//
-//With the new 'dispose' framework, it is necessary to force the builder
-//dispose before the Window dispose; so a Dialog::dispose() method would
-//finish: disposeBuilder(); SystemWindow::dispose() to capture this ordering.
-
-class VCL_DLLPUBLIC VclBuilderContainer
-{
-public:
-                    VclBuilderContainer();
-    virtual         ~VclBuilderContainer();
-    void            disposeBuilder();
-
-    template <typename T> T* get(VclPtr<T>& ret, const OString& sID)
-    {
-        return m_pUIBuilder->get<T>(ret, sID);
-    }
-    template <typename T = vcl::Window> T* get(const OString & sID)
-    {
-        return m_pUIBuilder->get<T>(sID);
-    }
-    void setDeferredProperties()
-    {
-        if (!m_pUIBuilder)
-            return;
-        m_pUIBuilder->setDeferredProperties();
-    }
-
-protected:
-    std::unique_ptr<VclBuilder> m_pUIBuilder;
-
-    friend class ::SalInstanceBuilder;
-    friend class ::ScreenshotTest;
-};
-
 /*
  * @return true if rValue is "True", "true", "1", etc.
  */
diff --git a/include/vcl/dockwin.hxx b/include/vcl/dockwin.hxx
index 0dd5988c23e7..b52091f0c642 100644
--- a/include/vcl/dockwin.hxx
+++ b/include/vcl/dockwin.hxx
@@ -22,7 +22,6 @@
 
 #include <vcl/dllapi.h>
 #include <o3tl/deleter.hxx>
-#include <vcl/builder.hxx>
 #include <vcl/floatwin.hxx>
 #include <memory>
 #include <vector>
diff --git a/include/vcl/notebookbar/notebookbar.hxx b/include/vcl/notebookbar/notebookbar.hxx
index 4e5c24631eb0..635bea058f2a 100644
--- a/include/vcl/notebookbar/notebookbar.hxx
+++ b/include/vcl/notebookbar/notebookbar.hxx
@@ -9,7 +9,7 @@
 
 #pragma once
 
-#include <vcl/builder.hxx>
+#include <vcl/syswin.hxx>
 #include <vcl/ctrl.hxx>
 #include <vcl/notebookbar/NotebookBarAddonsMerger.hxx>
 #include <vcl/settings.hxx>
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index 6238e9f382ca..1551f32e5389 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_VCL_SYSWIN_HXX
 
 #include <vcl/dllapi.h>
-#include <vcl/builder.hxx>
 #include <vcl/idle.hxx>
 #include <vcl/vclenum.hxx>
 #include <vcl/window.hxx>
@@ -32,6 +31,7 @@
 class MenuBar;
 class NotebookBar;
 class TaskPaneList;
+class VclBuilder;
 
 #define ICON_LO_DEFAULT                 1
 #define ICON_TEXT_DOCUMENT              2
@@ -55,6 +55,37 @@ enum class TitleButton
     Menu           = 4,
 };
 
+//helper baseclass to ease retro fitting dialogs/tabpages that load a resource
+//to load a .ui file instead
+//
+//vcl requires the Window Children of a Parent Window to be destroyed before
+//the Parent Window.  VclBuilderContainer owns the VclBuilder which owns the
+//Children Window. So the VclBuilderContainer dtor must be called before
+//the Parent Window dtor.
+//
+//i.e.  class Dialog : public SystemWindow, public VclBuilderContainer
+//not   class Dialog : public VclBuilderContainer, public SystemWindow
+//
+//With the new 'dispose' framework, it is necessary to force the builder
+//dispose before the Window dispose; so a Dialog::dispose() method would
+//finish: disposeBuilder(); SystemWindow::dispose() to capture this ordering.
+
+class VCL_DLLPUBLIC VclBuilderContainer
+{
+public:
+                    VclBuilderContainer();
+    virtual         ~VclBuilderContainer();
+    void            disposeBuilder();
+
+    void setDeferredProperties();
+
+protected:
+    std::unique_ptr<VclBuilder> m_pUIBuilder;
+
+    friend class ::SalInstanceBuilder;
+    friend class ::ScreenshotTest;
+};
+
 class VCL_DLLPUBLIC SystemWindow
     : public vcl::Window
     , public VclBuilderContainer
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index dcd287527ca6..8a9184f3ee2e 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -569,7 +569,7 @@ ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* p
                                              vcl::ILibreOfficeKitNotifier* pNotifier)
     : DockingWindow(pParent, "InterimDockParent", "svx/ui/interimdockparent.ui")
     , mxParentMenu(pParentMenu)
-    , mxBox(get("box"))
+    , mxBox(m_pUIBuilder->get("box"))
 {
     if (pNotifier)
         SetLOKNotifier(pNotifier);
diff --git a/svtools/source/control/toolbarmenu.cxx b/svtools/source/control/toolbarmenu.cxx
index 0181b2627f2d..9b8e0afe290e 100644
--- a/svtools/source/control/toolbarmenu.cxx
+++ b/svtools/source/control/toolbarmenu.cxx
@@ -175,7 +175,7 @@ InterimToolbarPopup::InterimToolbarPopup(const css::uno::Reference<css::frame::X
                     !bTearable ? OString("InterimDockParent") : OString("InterimTearableParent"),
                     !bTearable ? OUString("svx/ui/interimdockparent.ui") : OUString("svx/ui/interimtearableparent.ui"),
                     rFrame)
-    , m_xBox(get("box"))
+    , m_xBox(m_pUIBuilder->get("box"))
     , m_xFrame(rFrame)
     , m_xBuilder(Application::CreateInterimBuilder(m_xBox.get(), "svx/ui/interimparent.ui", false))
     , m_xContainer(m_xBuilder->weld_container("container"))
diff --git a/vcl/source/control/NotebookbarPopup.cxx b/vcl/source/control/NotebookbarPopup.cxx
index a1a3571d2dc0..f382ea19c8f8 100644
--- a/vcl/source/control/NotebookbarPopup.cxx
+++ b/vcl/source/control/NotebookbarPopup.cxx
@@ -15,7 +15,7 @@ NotebookbarPopup::NotebookbarPopup(const VclPtr<VclHBox>& pParent)
     : FloatingWindow(pParent, "Popup", "sfx/ui/notebookbarpopup.ui")
     , m_pParent(pParent)
 {
-    get(m_pBox, "box");
+    m_pUIBuilder->get(m_pBox, "box");
     m_pBox->SetSizePixel(Size(100, 75));
     const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
     const BitmapEx& aPersona = rStyleSettings.GetPersonaHeader();
diff --git a/vcl/source/control/calendar.cxx b/vcl/source/control/calendar.cxx
index 5b6ae6e7262f..0e425dd29b03 100644
--- a/vcl/source/control/calendar.cxx
+++ b/vcl/source/control/calendar.cxx
@@ -1558,7 +1558,7 @@ struct ImplCFieldFloatWin : public DockingWindow
 
 ImplCFieldFloatWin::ImplCFieldFloatWin(vcl::Window* pParent)
     : DockingWindow(pParent, "InterimDockParent", "svx/ui/interimdockparent.ui")
-    , mxBox(get("box"))
+    , mxBox(m_pUIBuilder->get("box"))
 {
     setDeferredProperties();
     mxWidget.reset(new ImplCFieldFloat(mxBox.get()));
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 0001353e9060..1a967be0a272 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -1573,6 +1573,13 @@ VclBuilderContainer::VclBuilderContainer()
 {
 }
 
+void VclBuilderContainer::setDeferredProperties()
+{
+    if (!m_pUIBuilder)
+        return;
+    m_pUIBuilder->setDeferredProperties();
+}
+
 VclBuilderContainer::~VclBuilderContainer()
 {
 }


More information about the Libreoffice-commits mailing list