[Libreoffice-commits] core.git: vcl/source
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Fri Mar 12 04:09:13 UTC 2021
vcl/source/app/salvtables.cxx | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
New commits:
commit 0ed63ed088d23e48f050c34e49f713281468f6f8
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Mar 11 13:39:52 2021 +0100
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri Mar 12 05:08:20 2021 +0100
Avoid modifying then restoring this const iterator, its copy is trivial
Change-Id: I2a129714f726fb2b15f76550f7e2e265205d0112
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112299
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 103b7bc4a22c..64294c4686de 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -4502,12 +4502,8 @@ int SalInstanceTreeView::get_iter_depth(const weld::TreeIter& rIter) const
bool SalInstanceTreeView::iter_has_child(const weld::TreeIter& rIter) const
{
- weld::TreeIter& rNonConstIter = const_cast<weld::TreeIter&>(rIter);
- SalInstanceTreeIter& rVclIter = static_cast<SalInstanceTreeIter&>(rNonConstIter);
- SvTreeListEntry* restore(rVclIter.iter);
- bool ret = iter_children(rNonConstIter);
- rVclIter.iter = restore;
- return ret;
+ SalInstanceTreeIter aTempCopy(static_cast<const SalInstanceTreeIter*>(&rIter));
+ return iter_children(aTempCopy);
}
bool SalInstanceTreeView::get_row_expanded(const weld::TreeIter& rIter) const
More information about the Libreoffice-commits
mailing list