From 344a87f0bc4027825480e1c44235bd6d8d8fc2aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 2 Apr 2020 17:17:06 +0100 Subject: [PATCH] make SvListView::IsSelected take const arg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I1e6d2ed5b092741499505bdfd65c6a583495204c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91594 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- include/vcl/treelist.hxx | 2 +- vcl/source/treelist/treelist.cxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/vcl/treelist.hxx b/include/vcl/treelist.hxx index 433cd5db91f7..a6cdbe0aa60e 100644 --- a/include/vcl/treelist.hxx +++ b/include/vcl/treelist.hxx @@ -281,7 +281,7 @@ public: bool IsExpanded( SvTreeListEntry* pEntry ) const; bool IsAllExpanded( SvTreeListEntry* pEntry) const; - bool IsSelected( SvTreeListEntry* pEntry ) const; + bool IsSelected(const SvTreeListEntry* pEntry) const; void SetEntryFocus( SvTreeListEntry* pEntry, bool bFocus ); const SvViewDataEntry* GetViewData( const SvTreeListEntry* pEntry ) const; SvViewDataEntry* GetViewData( SvTreeListEntry* pEntry ); diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx index 1f16f1d1a150..2f99060ac1ea 100644 --- a/vcl/source/treelist/treelist.cxx +++ b/vcl/source/treelist/treelist.cxx @@ -1355,10 +1355,10 @@ bool SvListView::IsAllExpanded( SvTreeListEntry* pEntry ) const return true; } -bool SvListView::IsSelected( SvTreeListEntry* pEntry ) const +bool SvListView::IsSelected(const SvTreeListEntry* pEntry) const { DBG_ASSERT(pEntry,"IsExpanded:No Entry"); - SvDataTable::const_iterator itr = m_pImpl->m_DataTable.find(pEntry); + SvDataTable::const_iterator itr = m_pImpl->m_DataTable.find(const_cast(pEntry)); if (itr == m_pImpl->m_DataTable.end()) return false; return itr->second->IsSelected();