diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-12-03 19:22:07 +0000 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-12-03 22:12:17 +0100 |
commit | 44739ff1ee17eb8baf39fd8e40e686fbf31bcf4a (patch) | |
tree | dd110e9dd6d710ee544adfa2ca02dcbd7f36cd85 /vcl | |
parent | 5f17c6385fbff08ec72eab3fde6121c488bc1149 (diff) |
cid#1546503 Using invalid iterator
and:
cid#1546480 Using invalid iterator
cid#1546479 Using invalid iterator
cid#1546454 Using invalid iterator
cid#1546419 Using invalid iterator
cid#1546410 Using invalid iterator
cid#1546150 Using invalid iterator
cid#1546039 Using invalid iterator
cid#1545831 Using invalid iterator
cid#1545736 Using invalid iterator
cid#1545701 Using invalid iterator
cid#1545630 Using invalid iterator
cid#1545381 Using invalid iterator
Change-Id: I9e151b623f751ee1e982b5da0011ff08ab0ad5e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160270
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/treelist/treelist.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtkinst.cxx | 24 |
2 files changed, 22 insertions, 8 deletions
diff --git a/vcl/source/treelist/treelist.cxx b/vcl/source/treelist/treelist.cxx index 9cc441d2c249..f7eb41311912 100644 --- a/vcl/source/treelist/treelist.cxx +++ b/vcl/source/treelist/treelist.cxx @@ -1124,7 +1124,9 @@ void SvListView::Impl::ActionMoving( SvTreeListEntry* pEntry ) DBG_ASSERT(pParent,"Model not consistent"); if (pParent != m_rThis.pModel->pRootItem.get() && pParent->m_Children.size() == 1) { - SvViewDataEntry* pViewData = m_DataTable.find( pParent )->second.get(); + const auto iter = m_DataTable.find(pParent); + assert(iter != m_DataTable.end()); + SvViewDataEntry* pViewData = iter->second.get(); pViewData->SetExpanded(false); } // preliminary @@ -1320,7 +1322,7 @@ void SvListView::SetEntryFocus( SvTreeListEntry* pEntry, bool bFocus ) { DBG_ASSERT(pEntry,"SetEntryFocus:No Entry"); SvDataTable::iterator itr = m_pImpl->m_DataTable.find(pEntry); - DBG_ASSERT(itr != m_pImpl->m_DataTable.end(),"Entry not in Table"); + assert(itr != m_pImpl->m_DataTable.end() && "Entry not in Table"); itr->second->SetFocus(bFocus); } diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 04e46f12d132..bf78cf85eeff 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -15565,7 +15565,9 @@ public: else col = to_internal_model(col); - if (get_bool(pos, m_aToggleTriStateMap.find(col)->second)) + const auto iter = m_aToggleTriStateMap.find(col); + assert(iter != m_aToggleTriStateMap.end()); + if (get_bool(pos, iter->second)) return TRISTATE_INDET; return get_bool(pos, col) ? TRISTATE_TRUE : TRISTATE_FALSE; } @@ -15578,7 +15580,9 @@ public: col = to_internal_model(col); const GtkInstanceTreeIter& rGtkIter = static_cast<const GtkInstanceTreeIter&>(rIter); - if (get_bool(rGtkIter.iter, m_aToggleTriStateMap.find(col)->second)) + const auto iter = m_aToggleTriStateMap.find(col); + assert(iter != m_aToggleTriStateMap.end()); + if (get_bool(rGtkIter.iter, iter->second)) return TRISTATE_INDET; return get_bool(rGtkIter.iter, col) ? TRISTATE_TRUE : TRISTATE_FALSE; } @@ -15641,13 +15645,17 @@ public: { const GtkInstanceTreeIter& rGtkIter = static_cast<const GtkInstanceTreeIter&>(rIter); col = to_internal_model(col); - return get_int(rGtkIter.iter, m_aWeightMap.find(col)->second) == PANGO_WEIGHT_BOLD; + const auto iter = m_aWeightMap.find(col); + assert(iter != m_aWeightMap.end()); + return get_int(rGtkIter.iter, iter->second) == PANGO_WEIGHT_BOLD; } virtual bool get_text_emphasis(int pos, int col) const override { col = to_internal_model(col); - return get_int(pos, m_aWeightMap.find(col)->second) == PANGO_WEIGHT_BOLD; + const auto iter = m_aWeightMap.find(col); + assert(iter != m_aWeightMap.end()); + return get_int(pos, iter->second) == PANGO_WEIGHT_BOLD; } virtual void set_text_align(const weld::TreeIter& rIter, double fAlign, int col) override @@ -15683,7 +15691,9 @@ public: virtual bool get_sensitive(int pos, int col) const override { col = to_internal_model(col); - return get_bool(pos, m_aSensitiveMap.find(col)->second); + const auto iter = m_aSensitiveMap.find(col); + assert(iter != m_aSensitiveMap.end()); + return get_bool(pos, iter->second); } virtual void set_sensitive(const weld::TreeIter& rIter, bool bSensitive, int col) override @@ -15705,7 +15715,9 @@ public: { const GtkInstanceTreeIter& rGtkIter = static_cast<const GtkInstanceTreeIter&>(rIter); col = to_internal_model(col); - return get_bool(rGtkIter.iter, m_aSensitiveMap.find(col)->second); + const auto iter = m_aSensitiveMap.find(col); + assert(iter != m_aSensitiveMap.end()); + return get_bool(rGtkIter.iter, iter->second); } void set_image(const GtkTreeIter& iter, int col, GdkPixbuf* pixbuf) |