include/svtools/treelistbox.hxx | 4 ++++ svtools/source/contnr/treelistbox.cxx | 5 +++++ 2 files changed, 9 insertions(+)
New commits: commit 89594b646eb53df91329d5e68cba068b1ec49492 Author: Muhammet Kara <muhammet.k...@pardus.org.tr> Date: Mon Jun 19 16:50:50 2017 +0300 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 <c...@libreoffice.org> Reviewed-by: Eike Rathke <er...@redhat.com> 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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits