diff options
author | Muhammet Kara <muhammet.kara@pardus.org.tr> | 2017-06-19 16:50:50 +0300 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-06-22 16:31:41 +0200 |
commit | 89594b646eb53df91329d5e68cba068b1ec49492 (patch) | |
tree | bbf70d09e175ddfdb1d3de82baebe5e1e879c3e4 | |
parent | 05447e09f511a6a754a3671451b29a3b6b3f458f (diff) |
Add RemoveEntry method to SvTreeListBox
Allows you to remove an entry along with its children
without selecting the entry.
Change-Id: Ie833df5e0d2d3bc86ed01a70dc6f042ebb6d6a47
Reviewed-on: https://gerrit.libreoffice.org/38971
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | include/svtools/treelistbox.hxx | 4 | ||||
-rw-r--r-- | svtools/source/contnr/treelistbox.cxx | 5 |
2 files changed, 9 insertions, 0 deletions
diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx index 3bc9168cbc00..5080ebcff5df 100644 --- a/include/svtools/treelistbox.hxx +++ b/include/svtools/treelistbox.hxx @@ -380,6 +380,10 @@ public: bool CopySelection( SvTreeListBox* pSource, SvTreeListEntry* pTarget ); bool MoveSelectionCopyFallbackPossible( SvTreeListBox* pSource, SvTreeListEntry* pTarget, bool bAllowCopyFallback ); void RemoveSelection(); + /** + * Removes the entry along with all of its descendants + */ + void RemoveEntry(SvTreeListEntry* pEntry); DragDropMode GetDragDropMode() const { return nDragDropMode; } SelectionMode GetSelectionMode() const { return eSelMode; } diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx index 17da61af2333..0b728f512c38 100644 --- a/svtools/source/contnr/treelistbox.cxx +++ b/svtools/source/contnr/treelistbox.cxx @@ -676,6 +676,11 @@ void SvTreeListBox::RemoveSelection() pModel->Remove(*it); } +void SvTreeListBox::RemoveEntry(SvTreeListEntry* pEntry) +{ + pModel->Remove(pEntry); +} + void SvTreeListBox::RecalcViewData() { SvTreeListEntry* pEntry = First(); |