summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-03-02 19:49:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-03-03 13:02:16 +0100
commitbbb9500ebf9ce5522b3c2c8e07e7fa227620dc40 (patch)
treee015b3c5d4aeb2c3863afc89d39881603822f568 /vcl/source/app
parentb55bf0cbdfdc68200ebf191b828a912373f1b7dc (diff)
deem placeholders entries currently expanding as logically still placeholders
Change-Id: I87ebc1d7e095f465c76fcd9b76c01749fe6b57df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89871 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/salvtables.cxx20
1 files changed, 16 insertions, 4 deletions
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index e4aafd793bba..f42448890b11 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -19,7 +19,7 @@
#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
#include <com/sun/star/awt/XWindow.hpp>
-#include <o3tl/safeint.hxx>
+#include <o3tl/sorted_vector.hxx>
#include <officecfg/Office/Common.hxx>
#include <iconview.hxx>
#include <salframe.hxx>
@@ -3251,6 +3251,9 @@ private:
VclPtr<SvTabListBox> m_xTreeView;
SvLBoxButtonData m_aCheckButtonData;
SvLBoxButtonData m_aRadioButtonData;
+ // currently expanding parent that logically, but not currently physically,
+ // contain placeholders
+ o3tl::sorted_vector<SvTreeListEntry*> m_aExpandingPlaceHolderParents;
bool m_bDisableCheckBoxAutoWidth;
int m_nSortColumn;
@@ -4197,6 +4200,8 @@ public:
virtual bool get_children_on_demand(const weld::TreeIter& rIter) const override
{
const SalInstanceTreeIter& rVclIter = static_cast<const SalInstanceTreeIter&>(rIter);
+ if (m_aExpandingPlaceHolderParents.count(rVclIter.iter))
+ return true;
return GetPlaceHolderChild(rVclIter.iter) != nullptr;
}
@@ -4690,14 +4695,21 @@ IMPL_LINK_NOARG(SalInstanceTreeView, ExpandingHdl, SvTreeListBox*, bool)
// potentially expandable in the first place, now we remove it
SvTreeListEntry* pPlaceHolder = GetPlaceHolderChild(pEntry);
if (pPlaceHolder)
+ {
+ m_aExpandingPlaceHolderParents.insert(pEntry);
m_xTreeView->RemoveEntry(pPlaceHolder);
+ }
bool bRet = signal_expanding(aIter);
- //expand disallowed, restore placeholder
- if (!bRet && pPlaceHolder)
+ if (pPlaceHolder)
{
- m_xTreeView->InsertEntry("<dummy>", pEntry, false, 0, nullptr);
+ //expand disallowed, restore placeholder
+ if (!bRet)
+ {
+ m_xTreeView->InsertEntry("<dummy>", pEntry, false, 0, nullptr);
+ }
+ m_aExpandingPlaceHolderParents.erase(pEntry);
}
return bRet;