[Libreoffice-commits] core.git: sw/source
Shivam Kumar Singh (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jul 28 19:19:46 UTC 2020
sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx | 23 ++++++++++++++----
sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx | 9 ++++++-
2 files changed, 27 insertions(+), 5 deletions(-)
New commits:
commit 3b8c893b487a3ee27bac710da74856225fb72950
Author: Shivam Kumar Singh <shivamhere247 at gmail.com>
AuthorDate: Tue Jul 28 18:50:17 2020 +0530
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Tue Jul 28 21:19:03 2020 +0200
tdf#135178 tdf#135179 tdf#134820 Issue in SetChgLnk in Inspector
Change-Id: I39755d333506ffe3fa2b6302f9ec72c15cd9eff9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99629
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index b2c346353e52..4959f4b52344 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -58,9 +58,21 @@ WriterInspectorTextPanel::WriterInspectorTextPanel(vcl::Window* pParent,
: InspectorTextPanel(pParent, rxFrame)
{
SwDocShell* pDocSh = static_cast<SwDocShell*>(SfxObjectShell::Current());
- SwWrtShell* pShell = pDocSh->GetWrtShell();
- if (pShell)
- pShell->SetChgLnk(LINK(this, WriterInspectorTextPanel, AttrChangedNotify));
+ m_pShell = pDocSh->GetWrtShell();
+ if (m_pShell)
+ {
+ m_oldLink = m_pShell->GetChgLnk();
+ m_pShell->SetChgLnk(LINK(this, WriterInspectorTextPanel, AttrChangedNotify));
+ }
+}
+
+WriterInspectorTextPanel::~WriterInspectorTextPanel() { disposeOnce(); }
+
+void WriterInspectorTextPanel::dispose()
+{
+ m_pShell->SetChgLnk(m_oldLink);
+
+ InspectorTextPanel::dispose();
}
static void InsertValues(const css::uno::Reference<css::uno::XInterface>& rSource,
@@ -188,8 +200,11 @@ static void UpdateTree(SwDocShell* pDocSh, std::vector<svx::sidebar::TreeNode>&
aStore.push_back(aDFNode);
}
-IMPL_LINK_NOARG(WriterInspectorTextPanel, AttrChangedNotify, LinkParamNone*, void)
+IMPL_LINK(WriterInspectorTextPanel, AttrChangedNotify, LinkParamNone*, pLink, void)
{
+ if (m_oldLink.IsSet())
+ m_oldLink.Call(pLink);
+
SwDocShell* pDocSh = static_cast<SwDocShell*>(SfxObjectShell::Current());
std::vector<svx::sidebar::TreeNode> aStore;
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx
index 43acb654411b..5fd3402af222 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx
@@ -21,6 +21,8 @@
#include <sfx2/weldutils.hxx>
#include <svx/sidebar/InspectorTextPanel.hxx>
+class SwWrtShell;
+
namespace sw::sidebar
{
class WriterInspectorTextPanel final : public svx::sidebar::InspectorTextPanel
@@ -32,7 +34,12 @@ public:
WriterInspectorTextPanel(vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame);
- // virtual ~WriterInspectorTextPanel();
+ virtual ~WriterInspectorTextPanel() override;
+ virtual void dispose() override;
+
+private:
+ SwWrtShell* m_pShell;
+ Link<LinkParamNone*, void> m_oldLink;
// attributes have changed
DECL_LINK(AttrChangedNotify, LinkParamNone*, void);
More information about the Libreoffice-commits
mailing list