dbaccess/source/core/api/KeySet.cxx | 3 +-- editeng/source/editeng/impedit4.cxx | 12 +++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-)
New commits: commit aff6d3aa461b737130606ed1271568b94f4733a7 Author: Caolán McNamara <[email protected]> AuthorDate: Sat Jan 13 19:33:30 2024 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Jan 13 22:09:28 2024 +0100 cid#1545795 silence Using invalid iterator Change-Id: I5fc75150ce38a960fab092b2e7ac9a0fe642b26a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162026 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 7fa5389475e3..337d30b096df 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -467,7 +467,9 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) SfxStyleSheet* pParent = static_cast<SfxStyleSheet*>(GetStyleSheetPool()->Find( pStyle->GetParent(), pStyle->GetFamily() )); DBG_ASSERT( pParent, "Parent not found!" ); rOutput.WriteOString( OOO_STRING_SVTOOLS_RTF_SBASEDON ); - nNumber = aStyleSheetToIdMap.find(pParent)->second; + auto iter = aStyleSheetToIdMap.find(pParent); + assert(iter != aStyleSheetToIdMap.end()); + nNumber = iter->second; rOutput.WriteNumberAsString( nNumber ); } @@ -479,7 +481,9 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) DBG_ASSERT( pNext, "Next not found!" ); rOutput.WriteOString( OOO_STRING_SVTOOLS_RTF_SNEXT ); - nNumber = aStyleSheetToIdMap.find(pNext)->second; + auto iter = aStyleSheetToIdMap.find(pNext); + assert(iter != aStyleSheetToIdMap.end()); + nNumber = iter->second; rOutput.WriteNumberAsString( nNumber ); // Name of the template... @@ -526,7 +530,9 @@ ErrCode ImpEditEngine::WriteRTF( SvStream& rOutput, EditSelection aSel ) { // Number of template rOutput.WriteOString( OOO_STRING_SVTOOLS_RTF_S ); - sal_uInt32 nNumber = aStyleSheetToIdMap.find(pNode->GetStyleSheet())->second; + auto iter = aStyleSheetToIdMap.find(pNode->GetStyleSheet()); + assert(iter != aStyleSheetToIdMap.end()); + sal_uInt32 nNumber = iter->second; rOutput.WriteNumberAsString( nNumber ); // All Attribute commit 44d77f760cdac0c4a1c89421f8e02514f57d411c Author: Caolán McNamara <[email protected]> AuthorDate: Sat Jan 13 19:22:58 2024 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Jan 13 22:09:21 2024 +0100 cid#1546059 xRow is always empty Change-Id: Ic5c6b2463600cd449bf2e0fed829ce199172578c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162025 Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx index cfbec6afecef..d137dc9ab16b 100644 --- a/dbaccess/source/core/api/KeySet.cxx +++ b/dbaccess/source/core/api/KeySet.cxx @@ -539,7 +539,6 @@ void OKeySet::executeUpdate(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rO Reference< XParameters > xParameter(xPrep,UNO_QUERY); bool bRefetch = true; - Reference<XRow> xRow; sal_Int32 i = 1; // first the set values for (auto const& columnName : *m_pColumnNames) @@ -585,7 +584,7 @@ void OKeySet::executeUpdate(const ORowSetRow& _rInsertRow ,const ORowSetRow& _rO m_aKeyIter = m_aKeyMap.find(nBookmark); assert(m_aKeyIter != m_aKeyMap.end()); m_aKeyIter->second.second.first = 2; - m_aKeyIter->second.second.second = xRow; + m_aKeyIter->second.second.second.clear(); copyRowValue(_rInsertRow,m_aKeyIter->second.first,nBookmark); tryRefetch(_rInsertRow,bRefetch); }
