cppu/source/uno/lbenv.cxx | 2 +- cui/source/customize/macropg.cxx | 2 ++ dbaccess/source/core/api/KeySet.cxx | 1 + editeng/source/misc/svxacorr.cxx | 4 +++- sfx2/source/view/viewsh.cxx | 2 +- svx/source/items/customshapeitem.cxx | 1 + vcl/source/treelist/treelist.cxx | 6 ++++-- vcl/unx/gtk3/gtkinst.cxx | 24 ++++++++++++++++++------ 8 files changed, 31 insertions(+), 11 deletions(-)
New commits: commit 59d26784582041232968b7d52fa40389965e90fd Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Dec 3 19:39:11 2023 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Dec 3 22:12:27 2023 +0100 cid#1557920 COPY_INSTEAD_OF_MOVE a better example conversion Change-Id: I120fb8e4b505bc5d761f6e7c69766cd610c8a662 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160271 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index fd7a21931c4f..885b6877761a 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -1243,7 +1243,7 @@ LOKDocumentFocusListener::getSelectedObject(const accessibility::AccessibleEvent uno::Reference< accessibility::XAccessible > xSelectedObject; if (isText(m_nDocumentType)) { - xSelectedObject = uno::Reference<accessibility::XAccessible>(aEvent.Source, uno::UNO_QUERY); + xSelectedObject.set(aEvent.Source, uno::UNO_QUERY); } else { commit 44739ff1ee17eb8baf39fd8e40e686fbf31bcf4a Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Dec 3 19:22:07 2023 +0000 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sun Dec 3 22:12:17 2023 +0100 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.mcnam...@collabora.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx index f9d6633b2bed..472feae34b4e 100644 --- a/cppu/source/uno/lbenv.cxx +++ b/cppu/source/uno/lbenv.cxx @@ -346,7 +346,7 @@ static void s_stub_defenv_revokeInterface(va_list * pParam) Ptr2ObjectMap::const_iterator const iFind( that->aPtr2ObjectMap.find( pInterface ) ); - OSL_ASSERT( iFind != that->aPtr2ObjectMap.end() ); + assert(iFind != that->aPtr2ObjectMap.end()); ObjectEntry * pOEntry = iFind->second; if (! --pOEntry->nRef) { diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index 79b54eb941ef..79197be4bf43 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -514,12 +514,14 @@ IMPL_LINK_NOARG(SvxMacroTabPage_, DeleteAllHdl_Impl, weld::Button&, void) if (bAppEvents) { EventsHash::iterator h_it = m_appEventsHash.find(sEventName); + assert(h_it != m_appEventsHash.end()); h_it->second.first = sEventType; h_it->second.second = sEmptyString; } else { EventsHash::iterator h_it = m_docEventsHash.find(sEventName); + assert(h_it != m_docEventsHash.end()); h_it->second.first = sEventType; h_it->second.second = sEmptyString; } diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index d075dea04985..7a2ec55fa5c2 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -583,6 +583,7 @@ void OKeySet::executeUpdate(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rO { const sal_Int32 nBookmark = ::comphelper::getINT32((*_rInsertRow)[0].getAny()); m_aKeyIter = m_aKeyMap.find(nBookmark); + assert(m_aKeyIter != m_aKeyMap.end()); m_aKeyIter->second.second.first = 2; m_aKeyIter->second.second.second = xRow; copyRowValue(_rInsertRow,m_aKeyIter->second.first,nBookmark); diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index ab8a43091b00..61bc805993ce 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -2153,7 +2153,9 @@ bool SvxAutoCorrect::FindInCplSttExceptList(LanguageType eLang, CreateLanguageFile(aLanguageTag, false)) { //the language is available - so bring it on - const SvStringsISortDtor* pList = m_aLangTable.find(aLanguageTag)->second.GetCplSttExceptList(); + const auto iter = m_aLangTable.find(aLanguageTag); + assert(iter != m_aLangTable.end() && "CreateLanguageFile can't fail"); + const SvStringsISortDtor* pList = iter->second.GetCplSttExceptList(); if(bAbbreviation ? lcl_FindAbbreviation(pList, sWord) : pList->find(sWord) != pList->end() ) return true; } diff --git a/svx/source/items/customshapeitem.cxx b/svx/source/items/customshapeitem.cxx index 7fc4a0601d30..84e9af4de2b8 100644 --- a/svx/source/items/customshapeitem.cxx +++ b/svx/source/items/customshapeitem.cxx @@ -208,6 +208,7 @@ void SdrCustomShapeGeometryItem::ClearPropertyValue( const OUString& rPropName ) if ( nIndex != ( nLength - 1 ) ) // resizing sequence { PropertyHashMap::iterator aHashIter2( m_aPropHashMap.find( m_aPropSeq[ nLength - 1 ].Name ) ); + assert(aHashIter2 != m_aPropHashMap.end()); (*aHashIter2).second = nIndex; pPropSeq[ nIndex ] = m_aPropSeq[ nLength - 1 ]; } 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)