diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-08-31 08:57:50 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-08-31 11:28:25 +0200 |
commit | 379d6042cd379df4988f891d068996ba8035f9da (patch) | |
tree | 2e4c2f10c7b053772af97fa3073f65f16c1f837c /cui | |
parent | 2279fce1292fb5d699dda51e3bd19efdff8fb077 (diff) |
cid#1542448 make_iterator always succeeds
so (!xEntry) here doesn't happen
Change-Id: I9d4d63a14220ba69bf57f1a58a6d36e270252e8e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156325
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/treeopt.cxx | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 4af68df0171a..d514b7deeb7f 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -820,7 +820,6 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, ImplUpdateDataHdl, Timer*, void) void OfaTreeOptionsDialog::selectFirstEntry() { - std::unique_ptr<weld::TreeIter> xEntry; std::unique_ptr<weld::TreeIter> xTemp = xTreeLB->make_iterator(); bool bTemp = xTreeLB->get_iter_first(*xTemp); @@ -829,17 +828,7 @@ void OfaTreeOptionsDialog::selectFirstEntry() // select only the first child if (xTreeLB->get_iter_depth(*xTemp) && xTreeLB->get_id(*xTemp).toInt64()) { - xEntry = xTreeLB->make_iterator(xTemp.get()); - - if (!xEntry) - { - xEntry = xTreeLB->make_iterator(); - if (!xTreeLB->get_iter_first(*xEntry) || !xTreeLB->iter_next(*xEntry)) - xEntry.reset(); - } - - if (!xEntry) - return; + std::unique_ptr<weld::TreeIter> xEntry(xTreeLB->make_iterator(xTemp.get())); std::unique_ptr<weld::TreeIter> xParent(xTreeLB->make_iterator(xEntry.get())); xTreeLB->iter_parent(*xParent); |