[Libreoffice-commits] core.git: sd/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Feb 25 10:34:01 UTC 2019


 sd/source/ui/dlg/sdtreelb.cxx |   13 +++++++++++++
 sd/source/ui/inc/sdtreelb.hxx |    4 +++-
 2 files changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 843ec02fcbc6e1dbc0fbac7e0ee90fd6177711e7
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Feb 24 21:38:01 2019 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Feb 25 11:33:39 2019 +0100

    set m_bLinkableSelected before calling handler
    
    Change-Id: I82bbd43e135490f97e2b7c78e48a01d573b0702a
    Reviewed-on: https://gerrit.libreoffice.org/68295
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 450e28360b46..c0340f871181 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -1434,6 +1434,19 @@ SdPageObjsTLV::SdPageObjsTLV(std::unique_ptr<weld::TreeView> xTreeView)
     , m_bShowAllShapes(false)
 {
     m_xTreeView->connect_expanding(LINK(this, SdPageObjsTLV, RequestingChildrenHdl));
+    m_xTreeView->connect_changed(LINK(this, SdPageObjsTLV, SelectHdl));
+}
+
+IMPL_LINK_NOARG(SdPageObjsTLV, SelectHdl, weld::TreeView&, void)
+{
+    m_bLinkableSelected = true;
+
+    m_xTreeView->selected_foreach([this](weld::TreeIter& rEntry){
+        if (m_xTreeView->get_id(rEntry).toInt64() == 0)
+            m_bLinkableSelected = false;
+    });
+
+    m_aChangeHdl.Call(*m_xTreeView);
 }
 
 OUString SdPageObjsTLV::GetObjectName(
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index bedeb526b44e..80905d5a6560 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -310,6 +310,7 @@ private:
     bool m_bShowAllShapes;
     OUString m_aDocName;
     ::sd::DrawDocShellRef m_xBookmarkDocShRef; ///< for the loading of bookmarks
+    Link<weld::TreeView&, void> m_aChangeHdl;
 
     /** Return the name of the object.  When the object has no user supplied
         name and the bCreate flag is <TRUE/> then a name is created
@@ -331,6 +332,7 @@ private:
     void CloseBookmarkDoc();
 
     DECL_LINK(RequestingChildrenHdl, weld::TreeIter&, bool);
+    DECL_LINK(SelectHdl, weld::TreeView&, void);
 
 public:
 
@@ -364,7 +366,7 @@ public:
 
     void connect_changed(const Link<weld::TreeView&, void>& rLink)
     {
-        m_xTreeView->connect_changed(rLink);
+        m_aChangeHdl = rLink;
     }
 
     bool is_selected(const weld::TreeIter& rIter) const


More information about the Libreoffice-commits mailing list