Kaydet (Commit) 541800fa authored tarafından Michael Stahl's avatar Michael Stahl

reportdesign: avoid assertion on duplicate properties ...

... from XMLAutoStylePoolProperties that happens when opening bugdoc
from fdo#87044.

Change-Id: I7002cf5176cd326f57b50fb6030ffb89160c237b
üst fbcb2556
...@@ -1229,7 +1229,20 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted ...@@ -1229,7 +1229,20 @@ void ORptExport::exportAutoStyle(XPropertySet* _xProp,const Reference<XFormatted
sal_Int32 nStyleMapIndex = m_xCellStylesExportPropertySetMapper->getPropertySetMapper()->FindEntryIndex( CTF_RPT_NUMBERFORMAT ); sal_Int32 nStyleMapIndex = m_xCellStylesExportPropertySetMapper->getPropertySetMapper()->FindEntryIndex( CTF_RPT_NUMBERFORMAT );
addDataStyle(nNumberFormat); addDataStyle(nNumberFormat);
XMLPropertyState aNumberStyleState( nStyleMapIndex, uno::makeAny( getDataStyleName(nNumberFormat) ) ); XMLPropertyState aNumberStyleState( nStyleMapIndex, uno::makeAny( getDataStyleName(nNumberFormat) ) );
aPropertyStates.push_back( aNumberStyleState ); auto const iter(::std::find_if(
aPropertyStates.begin(), aPropertyStates.end(),
[nStyleMapIndex] (XMLPropertyState const& rItem)
{ return rItem.mnIndex == nStyleMapIndex; } ));
if (iter == aPropertyStates.end())
{
aPropertyStates.push_back( aNumberStyleState );
}
else
{ // there is already a property but it has the wrong type
// (integer not string); TODO: can we prevent it
// getting added earlier?
(*iter) = aNumberStyleState;
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment