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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Feb 11 11:28:43 UTC 2020


 include/svtools/ctrlbox.hxx             |    2 +-
 include/vcl/weld.hxx                    |    3 ++-
 include/vcl/window.hxx                  |    1 +
 svtools/source/control/ctrlbox.cxx      |    5 -----
 svx/source/tbxctrls/tbunocontroller.cxx |   21 ++++++++-------------
 svx/uiconfig/ui/fontsizebox.ui          |    2 +-
 vcl/inc/window.h                        |    1 +
 vcl/source/app/salvtables.cxx           |    4 ++--
 vcl/source/window/window.cxx            |   10 ++++++++++
 vcl/unx/gtk3/gtk3gtkinst.cxx            |    3 +--
 10 files changed, 27 insertions(+), 25 deletions(-)

New commits:
commit 1783d7b1f522810dec3cdd02e8ac8bf688c734cf
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Feb 10 20:23:26 2020 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Feb 11 12:28:03 2020 +0100

    cypress: mobile: Font size combobox is broken on core/master.
    
    so https://cgit.freedesktop.org/libreoffice/online/commit/?id=08d6c3fdf9bac4ad8318151ab1402690eb950f52
    isn't needed
    
    Change-Id: I8836969ae064342835287a63065e591f083f2220
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88433
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx
index 279b514b679c..66a9a73cd988 100644
--- a/include/svtools/ctrlbox.hxx
+++ b/include/svtools/ctrlbox.hxx
@@ -452,7 +452,7 @@ public:
     bool has_focus() const { return m_xComboBox->has_focus(); }
     void connect_entry_activate(const Link<weld::ComboBox&, bool>& rLink) { m_xComboBox->connect_entry_activate(rLink); }
     void disable_entry_completion() { m_xComboBox->set_entry_completion(false, false); }
-    boost::property_tree::ptree get_property_tree() const;
+    void connect_get_property_tree(const Link<boost::property_tree::ptree&, void>& rLink) { m_xComboBox->connect_get_property_tree(rLink); }
 
 private:
     FontSizeBox(const FontSizeBox&) = delete;
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index 9ed79878ea70..a98563a9680f 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -267,7 +267,8 @@ public:
 
     virtual css::uno::Reference<css::datatransfer::dnd::XDropTarget> get_drop_target() = 0;
 
-    virtual boost::property_tree::ptree get_property_tree() const = 0;
+    virtual void connect_get_property_tree(const Link<boost::property_tree::ptree&, void>& rLink)
+        = 0;
 
     virtual ~Widget() {}
 };
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 6d98bec0576b..1a67b8cd797a 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -1580,6 +1580,7 @@ public:
     void SetHelpHdl(const Link<vcl::Window&, bool>& rLink);
     void SetMnemonicActivateHdl(const Link<vcl::Window&, bool>& rLink);
     void SetModalHierarchyHdl(const Link<bool, void>& rLink);
+    void SetDumpAsPropertyTreeHdl(const Link<boost::property_tree::ptree&, void>& rLink);
 };
 
 }
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index ea75417b75c9..f1b0c7e7ba3c 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -867,11 +867,6 @@ FontSizeBox::FontSizeBox(std::unique_ptr<weld::ComboBox> p)
     m_xComboBox->connect_changed(LINK(this, FontSizeBox, ModifyHdl));
 }
 
-boost::property_tree::ptree FontSizeBox::get_property_tree() const
-{
-    return m_xComboBox->get_property_tree();
-}
-
 IMPL_LINK(FontSizeBox, ReformatHdl, weld::Widget&, rWidget, void)
 {
     FontSizeNames aFontSizeNames(Application::GetSettings().GetUILanguageTag().getLanguageType());
diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index f03a9b36848d..22e78a397a79 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -99,8 +99,6 @@ public:
     void                UpdateFont( const css::awt::FontDescriptor& rCurrentFont );
     void                SetOptimalSize();
 
-    virtual boost::property_tree::ptree DumpAsPropertyTree() override;
-
     virtual void        DataChanged( const DataChangedEvent& rDCEvt ) override;
     virtual void        GetFocus() override;
 
@@ -119,6 +117,7 @@ private:
     DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
     DECL_LINK(ActivateHdl, weld::ComboBox&, bool);
     DECL_LINK(FocusOutHdl, weld::Widget&, void);
+    DECL_LINK(DumpAsPropertyTreeHdl, boost::property_tree::ptree&, void);
 };
 
 SvxFontSizeBox_Impl::SvxFontSizeBox_Impl(
@@ -131,9 +130,8 @@ SvxFontSizeBox_Impl::SvxFontSizeBox_Impl(
     m_rCtrl             ( _rCtrl ),
     m_bRelease          ( true ),
     m_xFrame            ( _xFrame ),
-    m_xWidget(new FontSizeBox(m_xBuilder->weld_combo_box("fontsize")))
+    m_xWidget(new FontSizeBox(m_xBuilder->weld_combo_box("fontsizecombobox")))
 {
-    set_id("fontsizecombobox");
     m_xWidget->set_value(0);
     m_xWidget->set_active_text("");
     m_xWidget->disable_entry_completion();
@@ -142,6 +140,7 @@ SvxFontSizeBox_Impl::SvxFontSizeBox_Impl(
     m_xWidget->connect_key_press(LINK(this, SvxFontSizeBox_Impl, KeyInputHdl));
     m_xWidget->connect_entry_activate(LINK(this, SvxFontSizeBox_Impl, ActivateHdl));
     m_xWidget->connect_focus_out(LINK(this, SvxFontSizeBox_Impl, FocusOutHdl));
+    m_xWidget->connect_get_property_tree(LINK(this, SvxFontSizeBox_Impl, DumpAsPropertyTreeHdl));
 }
 
 void SvxFontSizeBox_Impl::dispose()
@@ -291,10 +290,8 @@ void SvxFontSizeBox_Impl::DataChanged( const DataChangedEvent& rDCEvt )
     }
 }
 
-boost::property_tree::ptree SvxFontSizeBox_Impl::DumpAsPropertyTree()
+IMPL_LINK(SvxFontSizeBox_Impl, DumpAsPropertyTreeHdl, boost::property_tree::ptree&, rTree, void)
 {
-    boost::property_tree::ptree aTree(m_xWidget->get_property_tree());
-
     boost::property_tree::ptree aEntries;
 
     for (int i = 0, nCount = m_xWidget->get_count(); i < nCount; ++i)
@@ -304,7 +301,7 @@ boost::property_tree::ptree SvxFontSizeBox_Impl::DumpAsPropertyTree()
         aEntries.push_back(std::make_pair("", aEntry));
     }
 
-    aTree.add_child("entries", aEntries);
+    rTree.add_child("entries", aEntries);
 
     boost::property_tree::ptree aSelected;
 
@@ -316,12 +313,10 @@ boost::property_tree::ptree SvxFontSizeBox_Impl::DumpAsPropertyTree()
         aSelected.push_back(std::make_pair("", aEntry));
     }
 
-    aTree.put("selectedCount", nActive == -1 ? 0 : 1);
-    aTree.add_child("selectedEntries", aSelected);
-
-    aTree.put("command", ".uno:FontHeight");
+    rTree.put("selectedCount", nActive == -1 ? 0 : 1);
+    rTree.add_child("selectedEntries", aSelected);
 
-    return aTree;
+    rTree.put("command", ".uno:FontHeight");
 }
 
 FontHeightToolBoxControl::FontHeightToolBoxControl( const uno::Reference< uno::XComponentContext >& rxContext )
diff --git a/svx/uiconfig/ui/fontsizebox.ui b/svx/uiconfig/ui/fontsizebox.ui
index c1702822b3e2..97c6f47fd4bd 100644
--- a/svx/uiconfig/ui/fontsizebox.ui
+++ b/svx/uiconfig/ui/fontsizebox.ui
@@ -8,7 +8,7 @@
     <property name="hexpand">True</property>
     <property name="spacing">6</property>
     <child>
-      <object class="GtkComboBoxText" id="fontsize">
+      <object class="GtkComboBoxText" id="fontsizecombobox">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="hexpand">True</property>
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index 4da4a3adc5d2..11271261f335 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -247,6 +247,7 @@ public:
     std::set<Link<VclWindowEvent&,void>> maChildEventListenersDeleted;
     Link<vcl::Window&, bool> maHelpRequestHdl;
     Link<vcl::Window&, bool> maMnemonicActivateHdl;
+    Link<boost::property_tree::ptree&, void> maDumpAsPropertyTreeHdl;
 
     // The canvas interface for this VCL window. Is persistent after the first GetCanvas() call
     css::uno::WeakReference< css::rendering::XCanvas >    mxCanvas;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 6867bcc32ec1..942aa3e9d928 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -724,9 +724,9 @@ public:
         return m_xWidget->GetDropTarget();
     }
 
-    virtual boost::property_tree::ptree get_property_tree() const override
+    virtual void connect_get_property_tree(const Link<boost::property_tree::ptree&, void>& rLink) override
     {
-        return m_xWidget->DumpAsPropertyTree();
+        m_xWidget->SetDumpAsPropertyTreeHdl(rLink);
     }
 
     virtual void set_stack_background() override
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 1b888b559a10..d18acc024625 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1787,6 +1787,14 @@ void Window::ImplNewInputContext()
     pFocusWin->ImplGetFrame()->SetInputContext( &aNewContext );
 }
 
+void Window::SetDumpAsPropertyTreeHdl(const Link<boost::property_tree::ptree&, void>& rLink)
+{
+    if (mpWindowImpl) // may be called after dispose
+    {
+        mpWindowImpl->maDumpAsPropertyTreeHdl = rLink;
+    }
+}
+
 void Window::SetModalHierarchyHdl(const Link<bool, void>& rLink)
 {
     ImplGetFrame()->SetModalHierarchyHdl(rLink);
@@ -3423,6 +3431,8 @@ boost::property_tree::ptree Window::DumpAsPropertyTree()
         aTree.add_child("children", aChildren);
     }
 
+    mpWindowImpl->maDumpAsPropertyTreeHdl.Call(aTree);
+
     return aTree;
 }
 
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 5fc58f466515..342658c0de74 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -2867,10 +2867,9 @@ public:
         return m_xDropTarget.get();
     }
 
-    virtual boost::property_tree::ptree get_property_tree() const override
+    virtual void connect_get_property_tree(const Link<boost::property_tree::ptree&, void>& /*rLink*/) override
     {
         //not implemented for the gtk variant
-        return boost::property_tree::ptree();
     }
 
     virtual void set_stack_background() override


More information about the Libreoffice-commits mailing list