[Libreoffice-commits] core.git: dbaccess/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri Aug 7 18:46:55 UTC 2020
dbaccess/source/ui/querydesign/ConnectionLine.cxx | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
New commits:
commit d7d09fd881ff56ea1a7b6863cafb298387f20f98
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Aug 7 09:47:21 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Aug 7 20:46:12 2020 +0200
cid#1465673 Unchecked return value
Change-Id: I6213d9c0f0450b5e600553c18deb5fbef3a05230
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100295
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/dbaccess/source/ui/querydesign/ConnectionLine.cxx b/dbaccess/source/ui/querydesign/ConnectionLine.cxx
index 791f89247a52..5411e22e9457 100644
--- a/dbaccess/source/ui/querydesign/ConnectionLine.cxx
+++ b/dbaccess/source/ui/querydesign/ConnectionLine.cxx
@@ -82,13 +82,20 @@ namespace
{
const OTableWindowListBox* pListBox = _pWin->GetListBox();
_rNewConPos.setY( _pWin->GetPosPixel().Y() );
+
+ std::unique_ptr<weld::TreeIter> xEntry;
+ const weld::TreeView& rTreeView = pListBox->get_widget();
+
if (_nEntry != -1)
{
_rNewConPos.AdjustY(pListBox->GetPosPixel().Y() );
- const weld::TreeView& rTreeView = pListBox->get_widget();
- std::unique_ptr<weld::TreeIter> xEntry = rTreeView.make_iterator();
- rTreeView.get_iter_first(*xEntry);
- rTreeView.iter_nth_sibling(*xEntry, _nEntry);
+ xEntry = rTreeView.make_iterator();
+ if (!rTreeView.get_iter_first(*xEntry) || !rTreeView.iter_nth_sibling(*xEntry, _nEntry))
+ xEntry.reset();
+ }
+
+ if (xEntry)
+ {
auto nEntryPos = rTreeView.get_row_area(*xEntry).Center().Y();
if( nEntryPos >= 0 )
More information about the Libreoffice-commits
mailing list