summaryrefslogtreecommitdiff
path: root/sd/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-02-24 21:38:01 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-02-25 11:33:39 +0100
commit843ec02fcbc6e1dbc0fbac7e0ee90fd6177711e7 (patch)
treed2f9c921e4318e80d7ed796a5802d0e5ca299f9f /sd/source
parent81d29720267f49d4af1bcdc278bcc30453df23e9 (diff)
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@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source')
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx13
-rw-r--r--sd/source/ui/inc/sdtreelb.hxx4
2 files changed, 16 insertions, 1 deletions
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