[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - include/vcl vcl/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 19 14:57:34 UTC 2021


 include/vcl/salvtables.hxx    |   28 ++++++++++++
 vcl/source/app/salvtables.cxx |   97 +++++++++++++++++++-----------------------
 vcl/source/control/button.cxx |    9 +++
 3 files changed, 81 insertions(+), 53 deletions(-)

New commits:
commit 871a723ca41d79798b386bf3ec2c6faab3635e41
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Dec 30 12:15:50 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Jan 19 15:57:09 2021 +0100

    Move SalInstanceRadioButton decl to header file
    
    Change-Id: Ic99187477459d424e9c731a29b41a8f06d598864
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109608
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/include/vcl/salvtables.hxx b/include/vcl/salvtables.hxx
index c46f1a0668f1..498cd1c6d94e 100644
--- a/include/vcl/salvtables.hxx
+++ b/include/vcl/salvtables.hxx
@@ -1511,4 +1511,32 @@ public:
     virtual ~SalInstanceIconView() override;
 };
 
+class SalInstanceRadioButton : public SalInstanceButton, public virtual weld::RadioButton
+{
+private:
+    VclPtr<::RadioButton> m_xRadioButton;
+
+    DECL_LINK(ToggleHdl, ::RadioButton&, void);
+
+public:
+    SalInstanceRadioButton(::RadioButton* pButton, SalInstanceBuilder* pBuilder,
+                           bool bTakeOwnership);
+
+    virtual void set_active(bool active) override;
+
+    virtual bool get_active() const override;
+
+    virtual void set_image(VirtualDevice* pDevice) override;
+
+    virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) override;
+
+    virtual void set_from_icon_name(const OUString& rIconName) override;
+
+    virtual void set_inconsistent(bool /*inconsistent*/) override;
+
+    virtual bool get_inconsistent() const override;
+
+    virtual ~SalInstanceRadioButton() override;
+};
+
 #endif
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 844e36775ea8..4450ca3d1ee2 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -2669,68 +2669,59 @@ IMPL_LINK(SalInstanceLinkButton, ClickHdl, FixedHyperlink&, rButton, void)
         m_aOrigClickHdl.Call(rButton);
 }
 
-class SalInstanceRadioButton : public SalInstanceButton, public virtual weld::RadioButton
+SalInstanceRadioButton::SalInstanceRadioButton(::RadioButton* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+    : SalInstanceButton(pButton, pBuilder, bTakeOwnership)
+    , m_xRadioButton(pButton)
 {
-private:
-    VclPtr<::RadioButton> m_xRadioButton;
-
-    DECL_LINK(ToggleHdl, ::RadioButton&, void);
-
-public:
-    SalInstanceRadioButton(::RadioButton* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership)
-        : SalInstanceButton(pButton, pBuilder, bTakeOwnership)
-        , m_xRadioButton(pButton)
-    {
-        m_xRadioButton->SetToggleHdl(LINK(this, SalInstanceRadioButton, ToggleHdl));
-    }
+    m_xRadioButton->SetToggleHdl(LINK(this, SalInstanceRadioButton, ToggleHdl));
+}
 
-    virtual void set_active(bool active) override
-    {
-        disable_notify_events();
-        m_xRadioButton->Check(active);
-        enable_notify_events();
-    }
+void SalInstanceRadioButton::set_active(bool active)
+{
+    disable_notify_events();
+    m_xRadioButton->Check(active);
+    enable_notify_events();
+}
 
-    virtual bool get_active() const override
-    {
-        return m_xRadioButton->IsChecked();
-    }
+bool SalInstanceRadioButton::get_active() const
+{
+    return m_xRadioButton->IsChecked();
+}
 
-    virtual void set_image(VirtualDevice* pDevice) override
-    {
-        m_xRadioButton->SetImageAlign(ImageAlign::Center);
-        if (pDevice)
-            m_xRadioButton->SetModeImage(createImage(*pDevice));
-        else
-            m_xRadioButton->SetModeImage(Image());
-    }
+void SalInstanceRadioButton::set_image(VirtualDevice* pDevice)
+{
+    m_xRadioButton->SetImageAlign(ImageAlign::Center);
+    if (pDevice)
+        m_xRadioButton->SetModeImage(createImage(*pDevice));
+    else
+        m_xRadioButton->SetModeImage(Image());
+}
 
-    virtual void set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage) override
-    {
-        m_xRadioButton->SetImageAlign(ImageAlign::Center);
-        m_xRadioButton->SetModeImage(Image(rImage));
-    }
+void SalInstanceRadioButton::set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage)
+{
+    m_xRadioButton->SetImageAlign(ImageAlign::Center);
+    m_xRadioButton->SetModeImage(Image(rImage));
+}
 
-    virtual void set_from_icon_name(const OUString& rIconName) override
-    {
-        m_xRadioButton->SetModeRadioImage(Image(StockImage::Yes, rIconName));
-    }
+void SalInstanceRadioButton::set_from_icon_name(const OUString& rIconName)
+{
+    m_xRadioButton->SetModeRadioImage(Image(StockImage::Yes, rIconName));
+}
 
-    virtual void set_inconsistent(bool /*inconsistent*/) override
-    {
-        //not available
-    }
+void SalInstanceRadioButton::set_inconsistent(bool /*inconsistent*/)
+{
+    //not available
+}
 
-    virtual bool get_inconsistent() const override
-    {
-        return false;
-    }
+bool SalInstanceRadioButton::get_inconsistent() const
+{
+    return false;
+}
 
-    virtual ~SalInstanceRadioButton() override
-    {
-        m_xRadioButton->SetToggleHdl(Link<::RadioButton&, void>());
-    }
-};
+SalInstanceRadioButton::~SalInstanceRadioButton()
+{
+    m_xRadioButton->SetToggleHdl(Link<::RadioButton&, void>());
+}
 
 IMPL_LINK_NOARG(SalInstanceRadioButton, ToggleHdl, ::RadioButton&, void)
 {
commit ba9704b24b382fefd35a66a5dbf81d05c1498cbd
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Jan 19 09:16:06 2021 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Jan 19 15:56:56 2021 +0100

    jsdialog: dump radio groups
    
    Change-Id: I64bb8c7c87a2d4f054c3f2c8e5ac28812230cf70
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109609
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index fecb052628b7..82862583a7aa 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -2886,6 +2886,15 @@ boost::property_tree::ptree RadioButton::DumpAsPropertyTree()
 {
     boost::property_tree::ptree aTree(Button::DumpAsPropertyTree());
     aTree.put("checked", IsChecked());
+
+    OUString sGroupId;
+    std::vector<VclPtr<RadioButton>> aGroup = GetRadioButtonGroup();
+    for(auto& pButton : aGroup)
+        sGroupId += pButton->get_id();
+
+    if (!sGroupId.isEmpty())
+        aTree.put("group", sGroupId);
+
     return aTree;
 }
 


More information about the Libreoffice-commits mailing list