[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Mar 12 10:24:47 UTC 2021
vcl/unx/gtk3/gtk3gtkinst.cxx | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
New commits:
commit 9aa60d592925e2e9d5219799c26639eec3fb4a53
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Mar 11 13:50:09 2021 +0000
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Mar 12 11:23:58 2021 +0100
Avoid modifying then restoring this const iterator, its copy is trivial
Change-Id: I354010fbc47087bf7587a9662b9218606ba37dd4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112344
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index f1e99eccca07..bdebc7985ba4 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -11902,12 +11902,8 @@ public:
virtual bool iter_has_child(const weld::TreeIter& rIter) const override
{
- weld::TreeIter& rNonConstIter = const_cast<weld::TreeIter&>(rIter);
- GtkInstanceTreeIter& rGtkIter = static_cast<GtkInstanceTreeIter&>(rNonConstIter);
- GtkTreeIter restore(rGtkIter.iter);
- bool ret = iter_children(rNonConstIter);
- rGtkIter.iter = restore;
- return ret;
+ GtkInstanceTreeIter aTempCopy(static_cast<const GtkInstanceTreeIter*>(&rIter));
+ return iter_children(aTempCopy);
}
virtual bool get_row_expanded(const weld::TreeIter& rIter) const override
More information about the Libreoffice-commits
mailing list