cid#1545597 Using invalid iterator

and :

cid#1545537 Using invalid iterator
cid#1545508 Using invalid iterator
cid#1545494 Using invalid iterator
cid#1545478 Using invalid iterator
cid#1545427 Using invalid iterator
cid#1545420 Using invalid iterator
cid#1545400 Using invalid iterator
cid#1545300 Using invalid iterator
cid#1545258 Using invalid iterator
cid#1545257 Using invalid iterator
cid#1545200 Using invalid iterator
cid#1545183 Using invalid iterator

Change-Id: Ibf3a41902f34286967195c5c3b22e337a4b06809
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160322
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
This commit is contained in:
Julien Nabet
2023-12-04 22:10:20 +01:00
parent 8472365774
commit 67c2a47861
11 changed files with 45 additions and 17 deletions
+6 -2
View File
@@ -2279,8 +2279,10 @@ void PlainStructType::dumpComprehensiveGetCppuType(FileStream & out)
for (std::vector< unoidl::PlainStructTypeEntity::Member >::const_iterator i(
entity_->getDirectMembers().begin());
i != entity_->getDirectMembers().end();) {
const auto iter = types.find(i->type);
assert(iter != types.end());
out << indent() << "{ { " << getTypeClass(i->type, true)
<< ", the_tname" << types.find(i->type)->second
<< ", the_tname" << iter->second
<< ".pData, the_name" << n++ << ".pData }, false }";
++i;
out << (i == entity_->getDirectMembers().end() ? " };" : ",") << "\n";
@@ -2851,8 +2853,10 @@ void PolyStructType::dumpComprehensiveGetCppuType(FileStream & out)
sal_uInt32 k = parameters.find(i->type)->second;
out << "the_pclass" << k << ", the_pname" << k << ".pData";
} else {
const auto iter = types.find(i->type);
assert(iter != types.end());
out << getTypeClass(i->type, true) << ", the_tname"
<< types.find(i->type)->second << ".pData";
<< iter->second << ".pData";
}
out << ", the_name" << n++ << ".pData }, "
<< (i->parameterized ? "true" : "false") << " }";
+3 -1
View File
@@ -912,7 +912,9 @@ void OKeySet::deleteRow(const ORowSetRow& _rDeleteRow,const connectivity::OSQLTa
if(m_bDeleted)
{
sal_Int32 nBookmark = ::comphelper::getINT32((*_rDeleteRow)[0].getAny());
if(m_aKeyIter == m_aKeyMap.find(nBookmark) && m_aKeyIter != m_aKeyMap.end())
const auto iter = m_aKeyMap.find(nBookmark);
assert(iter != m_aKeyMap.end());
if(m_aKeyIter == iter && m_aKeyIter != m_aKeyMap.end())
++m_aKeyIter;
m_aKeyMap.erase(nBookmark);
m_bDeleted = true;
+7 -3
View File
@@ -1687,7 +1687,9 @@ SvxAutoCorrectLanguageLists& SvxAutoCorrect::GetLanguageList_(
LanguageTag aLanguageTag( eLang);
if (m_aLangTable.find(aLanguageTag) == m_aLangTable.end())
(void)CreateLanguageFile(aLanguageTag);
return m_aLangTable.find(aLanguageTag)->second;
const auto iter = m_aLangTable.find(aLanguageTag);
assert(iter != m_aLangTable.end());
return iter->second;
}
void SvxAutoCorrect::SaveCplSttExceptList( LanguageType eLang )
@@ -1912,14 +1914,16 @@ void SvxAutoCorrect::MakeCombinedChanges( std::vector<SvxAutocorrWord>& aNewEntr
LanguageType eLang )
{
LanguageTag aLanguageTag( eLang);
auto const iter = m_aLangTable.find(aLanguageTag);
auto iter = m_aLangTable.find(aLanguageTag);
if (iter != m_aLangTable.end())
{
iter->second.MakeCombinedChanges( aNewEntries, aDeleteEntries );
}
else if(CreateLanguageFile( aLanguageTag ))
{
m_aLangTable.find( aLanguageTag )->second.MakeCombinedChanges( aNewEntries, aDeleteEntries );
iter = m_aLangTable.find(aLanguageTag);
assert(iter != m_aLangTable.end());
iter->second.MakeCombinedChanges( aNewEntries, aDeleteEntries );
}
}
+1 -1
View File
@@ -120,7 +120,7 @@ void PropertySetBase::initializePropertyValueCache( sal_Int32 nHandle )
PropertyAccessorBase& PropertySetBase::locatePropertyHandler( sal_Int32 nHandle ) const
{
PropertyAccessors::const_iterator aPropertyPos = m_aAccessors.find( nHandle );
OSL_ENSURE( aPropertyPos != m_aAccessors.end() && aPropertyPos->second,
assert( aPropertyPos != m_aAccessors.end() && aPropertyPos->second &&
"PropertySetBase::locatePropertyHandler: accessor map is corrupted!" );
// neither should this be called for handles where there is no accessor, nor should a
// NULL accessor be in the map
+3 -2
View File
@@ -70,8 +70,9 @@ OUString const & lclGetNameForElementId(sal_uInt32 aId)
{ OOX_TOKEN(w14, stylisticSets), "stylisticSets" },
{ OOX_TOKEN(w14, cntxtAlts) , "cntxtAlts" },
};
return aIdMap.find(aId)->second;
const auto iter = aIdMap.find(aId);
assert(iter != aIdMap.end());
return iter->second;
}
OUString const & lclGetGrabBagName(sal_uInt32 aId)
+10 -2
View File
@@ -280,9 +280,17 @@ bool ScNameDlg::IsFormulaValid()
ScRangeName* ScNameDlg::GetRangeName(const OUString& rScope)
{
if (rScope == maGlobalNameStr)
return &m_RangeMap.find(STR_GLOBAL_RANGE_NAME)->second;
{
const auto iter = m_RangeMap.find(STR_GLOBAL_RANGE_NAME);
assert(iter != m_RangeMap.end());
return &iter->second;
}
else
return &m_RangeMap.find(rScope)->second;
{
const auto iter = m_RangeMap.find(rScope);
assert(iter != m_RangeMap.end());
return &iter->second;
}
}
void ScNameDlg::ShowOptions(const ScRangeNameLine& rLine)
@@ -497,6 +497,7 @@ const GraphicsContext& PDFIProcessor::getGraphicsContext( sal_Int32 nGCId ) cons
auto it = m_aIdToGC.find( nGCId );
if( it == m_aIdToGC.end() )
it = m_aIdToGC.find( 0 );
assert(it != m_aIdToGC.end());
return it->second;
}
+4 -1
View File
@@ -683,7 +683,10 @@ Box2DBodySharedPtr makeBodyDynamic(const Box2DBodySharedPtr& pBox2DBody)
Box2DBodySharedPtr box2DWorld::makeShapeStatic(const slideshow::internal::ShapeSharedPtr& pShape)
{
assert(mpBox2DWorld);
Box2DBodySharedPtr pBox2DBody = mpXShapeToBodyMap.find(pShape->getXShape())->second;
assert(pShape && pShape->getXShape());
const auto iter = mpXShapeToBodyMap.find(pShape->getXShape());
assert(iter != mpXShapeToBodyMap.end());
Box2DBodySharedPtr pBox2DBody = iter->second;
return makeBodyStatic(pBox2DBody);
}
@@ -180,7 +180,7 @@ inline void AdapterImpl::release()
{
t_ptr_map::iterator iFind(
m_pFactory->m_receiver2adapters.find( m_key ) );
OSL_ASSERT( m_pFactory->m_receiver2adapters.end() != iFind );
assert( m_pFactory->m_receiver2adapters.end() != iFind );
t_ptr_set & adapter_set = iFind->second;
if (adapter_set.erase( this ) != 1) {
OSL_ASSERT( false );
+6 -3
View File
@@ -285,12 +285,15 @@ void ItemSetToPageDesc( const SfxItemSet& rSet, SwPageDesc& rPageDesc )
if (const SfxGrabBagItem* pGrabBag = rSet.GetItemIfSet(SID_ATTR_CHAR_GRABBAG))
{
bool bValue;
if (pGrabBag->GetGrabBag().find("BackgroundFullSize")->second >>= bValue)
const auto pGrabBagInner = pGrabBag->GetGrabBag();
const auto iter = pGrabBagInner.find("BackgroundFullSize");
assert(iter != pGrabBagInner.end());
if (iter->second >>= bValue)
{
rMaster.SetFormatAttr(SfxBoolItem(RES_BACKGROUND_FULL_SIZE, bValue));
}
auto it = pGrabBag->GetGrabBag().find("RtlGutter");
if (it != pGrabBag->GetGrabBag().end() && (it->second >>= bValue))
auto it = pGrabBagInner.find("RtlGutter");
if (it != pGrabBagInner.end() && (it->second >>= bValue))
{
rMaster.SetFormatAttr(SfxBoolItem(RES_RTL_GUTTER, bValue));
}
+3 -1
View File
@@ -1167,7 +1167,9 @@ void UnoControlModel::getFastPropertyValue( std::unique_lock<std::mutex>& /*rGua
rValue = *pProp;
else if ( ( nPropId >= BASEPROPERTY_FONTDESCRIPTORPART_START ) && ( nPropId <= BASEPROPERTY_FONTDESCRIPTORPART_END ) )
{
pProp = &( maData.find( BASEPROPERTY_FONTDESCRIPTOR )->second );
const auto iter = maData.find( BASEPROPERTY_FONTDESCRIPTOR );
assert(iter != maData.end());
pProp = &(iter->second);
css::awt::FontDescriptor aFD;
(*pProp) >>= aFD;
switch ( nPropId )