Kaydet (Commit) 0d06d1d1 authored tarafından Julien Nabet's avatar Julien Nabet

Use for-range loops in oox (part2)

Change-Id: I7cbeb67a1adcdb9b0003e22b61789a882fc336c9
Reviewed-on: https://gerrit.libreoffice.org/52182Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJulien Nabet <serval2412@yahoo.fr>
üst 67c04cec
......@@ -785,10 +785,10 @@ css::beans::PropertyValue ArtisticEffectProperties::getEffect()
css::uno::Sequence< css::beans::PropertyValue > aSeq( maAttribs.size() + 1 );
sal_uInt32 i = 0;
for( std::map< OUString, css::uno::Any >::iterator it = maAttribs.begin(); it != maAttribs.end(); ++it )
for (auto const& attrib : maAttribs)
{
aSeq[i].Name = it->first;
aSeq[i].Value = it->second;
aSeq[i].Name = attrib.first;
aSeq[i].Value = attrib.second;
i++;
}
......
......@@ -386,10 +386,10 @@ void Shape::addChildren(
<< aChildTransformation.get(2, 1) << " "
<< aChildTransformation.get(2, 2));
std::vector< ShapePtr >::iterator aIter( rMaster.maChildren.begin() );
while( aIter != rMaster.maChildren.end() ) {
(*aIter)->setMasterTextListStyle( mpMasterTextListStyle );
(*aIter++)->addShape( rFilterBase, pTheme, rxShapes, aChildTransformation, getFillProperties(), pShapeMap );
for (auto const& child : rMaster.maChildren)
{
child->setMasterTextListStyle( mpMasterTextListStyle );
child->addShape( rFilterBase, pTheme, rxShapes, aChildTransformation, getFillProperties(), pShapeMap );
}
}
......
......@@ -67,8 +67,12 @@ void TextBody::insertAt(
Reference<css::beans::XPropertySet> xPropertySet(xAt, UNO_QUERY);
float nCharHeight = xPropertySet->getPropertyValue("CharHeight").get<float>();
for( TextParagraphVector::const_iterator aBeg = maParagraphs.begin(), aIt = aBeg, aEnd = maParagraphs.end(); aIt != aEnd; ++aIt )
(*aIt)->insertAt( rFilterBase, xText, xAt, rTextStyleProperties, aCombinedTextStyle, aIt == aBeg, nCharHeight );
size_t nIndex = 0;
for (auto const& paragraph : maParagraphs)
{
paragraph->insertAt( rFilterBase, xText, xAt, rTextStyleProperties, aCombinedTextStyle, (nIndex == 0), nCharHeight );
++nIndex;
}
}
bool TextBody::isEmpty() const
......
......@@ -64,18 +64,16 @@ TextListStyle& TextListStyle::operator=(const TextListStyle& rStyle)
void applyStyleList( const TextParagraphPropertiesVector& rSourceListStyle, TextParagraphPropertiesVector& rDestListStyle )
{
TextParagraphPropertiesVector::const_iterator aSourceListStyleIter( rSourceListStyle.begin() );
TextParagraphPropertiesVector::iterator aDestListStyleIter( rDestListStyle.begin() );
while( aSourceListStyleIter != rSourceListStyle.end() )
for (auto const& elemSource : rSourceListStyle)
{
if ( aDestListStyleIter != rDestListStyle.end() )
{
(*aDestListStyleIter)->apply( **aSourceListStyleIter );
(*aDestListStyleIter)->apply(*elemSource);
++aDestListStyleIter;
}
else
rDestListStyle.push_back( std::make_shared<TextParagraphProperties>( **aSourceListStyleIter ) );
++aSourceListStyleIter;
rDestListStyle.push_back( std::make_shared<TextParagraphProperties>(*elemSource) );
}
}
......
......@@ -194,26 +194,28 @@ void DffStreamObject::dumpDffOpt()
}
mxOut->resetItemIndex();
for( PropInfoVector::iterator aIt = aPropInfos.begin(), aEnd = aPropInfos.end(); !mxStrm->isEof() && (aIt != aEnd); ++aIt )
for (auto const& propInfo : aPropInfos)
{
if (mxStrm->isEof())
break;
mxOut->startMultiItems();
writeEmptyItem( "#complex-data" );
writeHexItem( "id", aIt->mnId, "DFFOPT-PROPERTY-NAMES" );
writeHexItem( "id", propInfo.mnId, "DFFOPT-PROPERTY-NAMES" );
mxOut->endMultiItems();
IndentGuard aIndent( mxOut );
switch( aIt->meType )
switch(propInfo.meType)
{
case PROPTYPE_BINARY:
dumpBinary( aIt->maName, aIt->mnSize );
dumpBinary( propInfo.maName, propInfo.mnSize );
break;
case PROPTYPE_STRING:
dumpUnicodeArray( aIt->maName, aIt->mnSize / 2, true );
dumpUnicodeArray( propInfo.maName, propInfo.mnSize / 2, true );
break;
case PROPTYPE_BLIP:
dumpBinary( aIt->maName, aIt->mnSize );
dumpBinary( propInfo.maName, propInfo.mnSize );
break;
case PROPTYPE_COLORARRAY:
dumpBinary( aIt->maName, aIt->mnSize );
dumpBinary( propInfo.maName, propInfo.mnSize );
break;
}
}
......
......@@ -872,8 +872,8 @@ void NameListBase::includeList( const NameListRef& rxList )
{
if( rxList.get() )
{
for( const_iterator aIt = rxList->begin(), aEnd = rxList->end(); aIt != aEnd; ++aIt )
maMap[ aIt->first ] = aIt->second;
for (auto const& elem : *rxList)
maMap[ elem.first ] = elem.second;
implIncludeList( *rxList );
}
}
......@@ -915,23 +915,25 @@ void NameListBase::include( const OUString& rListKeys )
{
OUStringVector aVec;
StringHelper::convertStringToStringList( aVec, rListKeys, true );
for( OUStringVector::const_iterator aIt = aVec.begin(), aEnd = aVec.end(); aIt != aEnd; ++aIt )
includeList( mrCfgData.getNameList( *aIt ) );
for (auto const& elem : aVec)
includeList( mrCfgData.getNameList(elem) );
}
void NameListBase::exclude( const OUString& rKeys )
{
Int64Vector aVec;
StringHelper::convertStringToIntList( aVec, rKeys, true );
for( Int64Vector::const_iterator aIt = aVec.begin(), aEnd = aVec.end(); aIt != aEnd; ++aIt )
maMap.erase( *aIt );
for (auto const& elem : aVec)
maMap.erase(elem);
}
void ItemFormatMap::insertFormats( const NameListRef& rxNameList )
{
if( Base::isValid( rxNameList ) )
for( NameListBase::const_iterator aIt = rxNameList->begin(), aEnd = rxNameList->end(); aIt != aEnd; ++aIt )
maMap[ aIt->first ].parse( aIt->second );
{
for (auto const& elemName : *rxNameList)
maMap[ elemName.first ].parse( elemName.second );
}
}
ConstList::ConstList( const SharedConfigData& rCfgData ) :
......@@ -993,9 +995,12 @@ MultiList::MultiList( const SharedConfigData& rCfgData ) :
void MultiList::setNamesFromVec( sal_Int64 nStartKey, const OUStringVector& rNames )
{
sal_Int64 nKey = nStartKey;
for( OUStringVector::const_iterator aIt = rNames.begin(), aEnd = rNames.end(); aIt != aEnd; ++aIt, ++nKey )
if( !mbIgnoreEmpty || !aIt->isEmpty() )
insertRawName( nKey, *aIt );
for (auto const& name : rNames)
{
if( !mbIgnoreEmpty || !name.isEmpty() )
insertRawName( nKey, name);
++nKey;
}
}
void MultiList::implProcessConfigItemStr(
......@@ -1119,13 +1124,12 @@ void CombiList::implSetName( sal_Int64 nKey, const OUString& rName )
{
if( (nKey & (nKey - 1)) != 0 ) // more than a single bit set?
{
typedef ::std::set< ExtItemFormatKey > ExtItemFormatKeySet;
::std::set< ExtItemFormatKey > aItemKeys;
ExtItemFormat aItemFmt;
OUStringVector aRemain = aItemFmt.parse( rName );
for( OUStringVector::iterator aIt = aRemain.begin(), aEnd = aRemain.end(); aIt != aEnd; ++aIt )
for (auto const& elemRemain : aRemain)
{
OUStringPair aPair = StringHelper::convertStringToPair( *aIt );
OUStringPair aPair = StringHelper::convertStringToPair(elemRemain);
if ( aPair.first == "noshift" )
{
aItemFmt.mbShiftValue = StringHelper::convertStringToBool( aPair.second );
......@@ -1145,8 +1149,8 @@ void CombiList::implSetName( sal_Int64 nKey, const OUString& rName )
}
if( aItemKeys.empty() )
aItemKeys.insert( ExtItemFormatKey( nKey ) );
for( ExtItemFormatKeySet::iterator aIt = aItemKeys.begin(), aEnd = aItemKeys.end(); aIt != aEnd; ++aIt )
maFmtMap[ *aIt ] = aItemFmt;
for (auto const& itemKey : aItemKeys)
maFmtMap[itemKey] = aItemFmt;
}
else
{
......@@ -1159,13 +1163,13 @@ OUString CombiList::implGetName( const Config& rCfg, sal_Int64 nKey ) const
sal_Int64 nFound = 0;
OUStringBuffer aName;
// add known flag fields
for( ExtItemFormatMap::const_iterator aIt = maFmtMap.begin(), aEnd = maFmtMap.end(); aIt != aEnd; ++aIt )
for (auto const& fmt : maFmtMap)
{
const ExtItemFormatKey& rMapKey = aIt->first;
const ExtItemFormatKey& rMapKey = fmt.first;
sal_Int64 nMask = rMapKey.mnKey;
if( (nMask != 0) && ((nKey & rMapKey.maFilter.first) == rMapKey.maFilter.second) )
{
const ExtItemFormat& rItemFmt = aIt->second;
const ExtItemFormat& rItemFmt = fmt.second;
sal_uInt64 nUFlags = static_cast< sal_uInt64 >( nKey );
sal_uInt64 nUMask = static_cast< sal_uInt64 >( nMask );
......@@ -1877,8 +1881,10 @@ void StorageObjectBase::extractStorage( const StorageRef& rxStrg, const OUString
// process preferred storages and streams in root storage first
if( rStrgPath.isEmpty() )
for( PreferredItemVector::iterator aIt = maPreferred.begin(), aEnd = maPreferred.end(); aIt != aEnd; ++aIt )
extractItem( rxStrg, rStrgPath, aIt->maName, rSysPath, aIt->mbStorage, !aIt->mbStorage );
{
for (auto const& elemPreferred : maPreferred)
extractItem( rxStrg, rStrgPath, elemPreferred.maName, rSysPath, elemPreferred.mbStorage, !elemPreferred.mbStorage );
}
// process children of the storage
for( StorageIterator aIt( rxStrg ); aIt.isValid(); ++aIt )
......@@ -1887,8 +1893,14 @@ void StorageObjectBase::extractStorage( const StorageRef& rxStrg, const OUString
OUString aItemName = aIt.getName();
bool bFound = false;
if( rStrgPath.isEmpty() )
for( PreferredItemVector::iterator aIIt = maPreferred.begin(), aIEnd = maPreferred.end(); !bFound && (aIIt != aIEnd); ++aIIt )
bFound = aIIt->maName == aItemName;
{
for (auto const& elemPreferred : maPreferred)
{
bFound = elemPreferred.maName == aItemName;
if (bFound)
break;
}
}
if( !bFound )
extractItem( rxStrg, rStrgPath, aItemName, rSysPath, aIt.isStorage(), aIt.isStream() );
}
......
......@@ -281,8 +281,8 @@ void OlePropertyStreamObject::dumpSection( const OUString& rGuid, sal_uInt32 nSt
}
// other properties
for( PropertyPosMap::const_iterator aIt = aPropMap.begin(), aEnd = aPropMap.end(); aIt != aEnd; ++aIt )
dumpProperty( aIt->first, aIt->second );
for (auto const& elem : aPropMap)
dumpProperty( elem.first, elem.second );
// remove the user defined list of property ID names
cfg().eraseNameList( "OLEPROP-IDS" );
......@@ -1067,14 +1067,16 @@ void AxPropertyObjectBase::dumpLargeProperties()
{
writeEmptyItem( "large-properties" );
IndentGuard aIndGuard( mxOut );
for( LargePropertyVector::iterator aIt = maLargeProps.begin(), aEnd = maLargeProps.end(); ensureValid() && (aIt != aEnd); ++aIt )
for (auto const& largeProp : maLargeProps)
{
switch( aIt->mePropType )
if (!ensureValid())
break;
switch( largeProp.mePropType )
{
case LargeProperty::PROPTYPE_POS:
{
MultiItemsGuard aMultiGuard( mxOut );
writeEmptyItem( aIt->maItemName );
writeEmptyItem( largeProp.maItemName );
dumpDec< sal_Int32 >( "top", "CONV-HMM-TO-CM" );
dumpDec< sal_Int32 >( "left", "CONV-HMM-TO-CM" );
}
......@@ -1082,31 +1084,31 @@ void AxPropertyObjectBase::dumpLargeProperties()
case LargeProperty::PROPTYPE_SIZE:
{
MultiItemsGuard aMultiGuard( mxOut );
writeEmptyItem( aIt->maItemName );
writeEmptyItem( largeProp.maItemName );
dumpDec< sal_Int32 >( "width", "CONV-HMM-TO-CM" );
dumpDec< sal_Int32 >( "height", "CONV-HMM-TO-CM" );
}
break;
case LargeProperty::PROPTYPE_GUID:
{
OUString aGuid = dumpGuid( aIt->maItemName );
if( aIt->mpItemValue )
*aIt->mpItemValue = cfg().getStringOption( aGuid, OUString() );
OUString aGuid = dumpGuid( largeProp.maItemName );
if( largeProp.mpItemValue )
*largeProp.mpItemValue = cfg().getStringOption( aGuid, OUString() );
}
break;
case LargeProperty::PROPTYPE_STRING:
{
OUString aString = dumpString( aIt->maItemName, aIt->mnDataSize, false );
if( aIt->mpItemValue )
*aIt->mpItemValue = aString;
OUString aString = dumpString( largeProp.maItemName, largeProp.mnDataSize, false );
if( largeProp.mpItemValue )
*largeProp.mpItemValue = aString;
}
break;
case LargeProperty::PROPTYPE_STRINGARRAY:
{
writeEmptyItem( aIt->maItemName );
writeEmptyItem( largeProp.maItemName );
IndentGuard aIndGuard2( mxOut );
mxOut->resetItemIndex();
sal_Int64 nEndPos = mxStrm->tell() + aIt->mnDataSize;
sal_Int64 nEndPos = mxStrm->tell() + largeProp.mnDataSize;
while( mxStrm->tell() < nEndPos )
{
MultiItemsGuard aMultiGuard( mxOut );
......@@ -1125,10 +1127,12 @@ void AxPropertyObjectBase::dumpLargeProperties()
{
writeEmptyItem( "stream-properties" );
IndentGuard aIndGuard( mxOut );
for( StreamPropertyVector::iterator aIt = maStreamProps.begin(), aEnd = maStreamProps.end(); ensureValid() && (aIt != aEnd); ++aIt )
for (auto const& streamProp : maStreamProps)
{
writeEmptyItem( aIt->maItemName );
if( ensureValid( aIt->mnData == 0xFFFF ) )
if (!ensureValid())
break;
writeEmptyItem( streamProp.maItemName );
if( ensureValid( streamProp.mnData == 0xFFFF ) )
{
IndentGuard aIndGuard2( mxOut );
OUString aClassName = cfg().getStringOption( dumpGuid(), OUString() );
......@@ -1720,16 +1724,18 @@ VbaOStreamObject::VbaOStreamObject( const ObjectBase& rParent,
void VbaOStreamObject::implDump()
{
for( VbaFormSiteInfoVector::iterator aIt = mrFormData.maSiteInfos.begin(), aEnd = mrFormData.maSiteInfos.end(); !mxStrm->isEof() && (aIt != aEnd); ++aIt )
for (auto const& siteInfo : mrFormData.maSiteInfos)
{
if( (aIt->mbInStream) && (aIt->mnLength > 0) )
if (mxStrm->isEof())
break;
if( (siteInfo.mbInStream) && (siteInfo.mnLength > 0) )
{
mxOut->emptyLine();
writeDecItem( "control-id", aIt->mnId );
writeInfoItem( "prog-id", aIt->maProgId );
writeDecItem( "control-id", siteInfo.mnId );
writeInfoItem( "prog-id", siteInfo.maProgId );
IndentGuard aIndGuard( mxOut );
BinaryInputStreamRef xRelStrm( new RelativeInputStream( *mxStrm, aIt->mnLength ) );
FormControlStreamObject( *this, xRelStrm, &aIt->maProgId ).dump();
BinaryInputStreamRef xRelStrm( new RelativeInputStream( *mxStrm, siteInfo.mnLength ) );
FormControlStreamObject( *this, xRelStrm, &siteInfo.maProgId ).dump();
}
}
dumpRemainingStream();
......@@ -1833,8 +1839,8 @@ bool VbaContainerStorageObject::isFormStorage( const OUString& rStrgPath ) const
aId = aId.copy( 1 );
sal_Int32 nId = aId.toInt32();
if( (nId > 0) && (OUString::number( nId ) == aId) )
for( VbaFormSiteInfoVector::const_iterator aIt = maFormData.maSiteInfos.begin(), aEnd = maFormData.maSiteInfos.end(); aIt != aEnd; ++aIt )
if( aIt->mnId == nId )
for (auto const& siteInfo : maFormData.maSiteInfos)
if( siteInfo.mnId == nId )
return true;
}
return false;
......
......@@ -1601,10 +1601,9 @@ void ChartExport::exportLineChart( const Reference< chart2::XChartType >& xChart
{
FSHelperPtr pFS = GetFS();
std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitDataSeries = splitDataSeriesByAxis(xChartType);
for (auto itr = aSplitDataSeries.begin(), itrEnd = aSplitDataSeries.end();
itr != itrEnd; ++itr)
for (auto & splitDataSeries : aSplitDataSeries)
{
if (itr->getLength() == 0)
if (splitDataSeries.getLength() == 0)
continue;
sal_Int32 nTypeId = XML_lineChart;
......@@ -1618,7 +1617,7 @@ void ChartExport::exportLineChart( const Reference< chart2::XChartType >& xChart
exportVaryColors(xChartType);
// TODO: show marker symbol in series?
bool bPrimaryAxes = true;
exportSeries(xChartType, *itr, bPrimaryAxes);
exportSeries(xChartType, splitDataSeries, bPrimaryAxes);
// show marker?
sal_Int32 nSymbolType = css::chart::ChartSymbolType::NONE;
......@@ -1734,14 +1733,13 @@ void ChartExport::exportScatterChart( const Reference< chart2::XChartType >& xCh
FSHelperPtr pFS = GetFS();
std::vector<Sequence<Reference<chart2::XDataSeries> > > aSplitDataSeries = splitDataSeriesByAxis(xChartType);
bool bExported = false;
for (auto itr = aSplitDataSeries.begin(), itrEnd = aSplitDataSeries.end();
itr != itrEnd; ++itr)
for (auto & splitDataSeries : aSplitDataSeries)
{
if (itr->getLength() == 0)
if (splitDataSeries.getLength() == 0)
continue;
bExported = true;
exportScatterChartSeries(xChartType, &(*itr));
exportScatterChartSeries(xChartType, &splitDataSeries);
}
if (!bExported)
exportScatterChartSeries(xChartType, nullptr);
......
......@@ -2500,10 +2500,10 @@ void DrawingML::WritePresetShape( const char* pShape , std::vector< std::pair<sa
{
mpFS->startElementNS( XML_a, XML_avLst, FSEND );
for(auto iter = rAvList.begin() ; iter != rAvList.end() ; ++iter)
for (auto const& elem : rAvList)
{
OString sName = OString("adj") + ( ( iter->first > 0 ) ? OString::number(iter->first) : OString() );
OString sFmla = OString("val ") + OString::number( iter->second );
OString sName = OString("adj") + ( ( elem.first > 0 ) ? OString::number(elem.first) : OString() );
OString sFmla = OString("val ") + OString::number( elem.second );
mpFS->singleElementNS( XML_a, XML_gd,
XML_name, sName.getStr(),
......
......@@ -402,9 +402,9 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
bool bAlreadyWritten[ 0xFFF ];
memset( bAlreadyWritten, 0, sizeof( bAlreadyWritten ) );
const EscherProperties &rOpts = rProps.GetOpts();
for ( EscherProperties::const_iterator it = rOpts.begin(); it != rOpts.end(); ++it )
for (auto const& opt : rOpts)
{
sal_uInt16 nId = ( it->nPropId & 0x0FFF );
sal_uInt16 nId = ( opt.nPropId & 0x0FFF );
if ( bAlreadyWritten[ nId ] )
continue;
......@@ -414,7 +414,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
case ESCHER_Prop_WrapText: // 133
{
const char *pWrapType = nullptr;
switch ( it->nPropValue )
switch ( opt.nPropValue )
{
case ESCHER_WrapSquare:
case ESCHER_WrapByPoints: pWrapType = "square"; break; // these two are equivalent according to the docu
......@@ -438,12 +438,12 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
if ( nId == ESCHER_Prop_geoLeft )
{
nLeft = it->nPropValue;
nLeft = opt.nPropValue;
rProps.GetOpt( ESCHER_Prop_geoTop, nTop );
}
else
{
nTop = it->nPropValue;
nTop = opt.nPropValue;
rProps.GetOpt( ESCHER_Prop_geoLeft, nLeft );
}
if(nTop!=0 && nLeft!=0)
......@@ -466,12 +466,12 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
if ( nId == ESCHER_Prop_geoRight )
{
nRight = it->nPropValue;
nRight = opt.nPropValue;
rProps.GetOpt( ESCHER_Prop_geoBottom, nBottom );
}
else
{
nBottom = it->nPropValue;
nBottom = opt.nPropValue;
rProps.GetOpt( ESCHER_Prop_geoRight, nRight );
}
......@@ -859,7 +859,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
break;
case ESCHER_Prop_fHidden:
if ( !it->nPropValue )
if ( !opt.nPropValue )
m_ShapeStyle.append( ";visibility:hidden" );
break;
case ESCHER_Prop_shadowColor:
......@@ -895,9 +895,9 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
if (rProps.GetOpt(ESCHER_Prop_gtextUNICODE, aUnicode))
{
SvMemoryStream aStream;
aStream.WriteBytes(it->pBuf, it->nPropSize);
aStream.WriteBytes(opt.pBuf, opt.nPropSize);
aStream.Seek(0);
OUString aTextPathString = SvxMSDffManager::MSDFFReadZString(aStream, it->nPropSize, true);
OUString aTextPathString = SvxMSDffManager::MSDFFReadZString(aStream, opt.nPropSize, true);
aStream.Seek(0);
m_pSerializer->singleElementNS( XML_v, XML_path,
......@@ -939,23 +939,23 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
case ESCHER_Prop_Rotation:
{
// The higher half of the variable contains the angle.
m_ShapeStyle.append(";rotation:").append(double(it->nPropValue >> 16));
m_ShapeStyle.append(";rotation:").append(double(opt.nPropValue >> 16));
bAlreadyWritten[ESCHER_Prop_Rotation] = true;
}
break;
case ESCHER_Prop_fNoLineDrawDash:
{
// See DffPropertyReader::ApplyLineAttributes().
impl_AddBool( m_pShapeAttrList, XML_stroked, (it->nPropValue & 8) != 0 );
impl_AddBool( m_pShapeAttrList, XML_stroked, (opt.nPropValue & 8) != 0 );
bAlreadyWritten[ESCHER_Prop_fNoLineDrawDash] = true;
}
break;
case ESCHER_Prop_wzName:
{
SvMemoryStream aStream;
aStream.WriteBytes(it->pBuf, it->nPropSize);
aStream.WriteBytes(opt.pBuf, opt.nPropSize);
aStream.Seek(0);
OUString idStr = SvxMSDffManager::MSDFFReadZString(aStream, it->nPropSize, true);
OUString idStr = SvxMSDffManager::MSDFFReadZString(aStream, opt.nPropSize, true);
aStream.Seek(0);
if (!IsWaterMarkShape(m_pSdrObject->GetName()) && !m_bSkipwzName)
m_pShapeAttrList->add(XML_ID, OUStringToOString(idStr, RTL_TEXTENCODING_UTF8).getStr());
......@@ -966,12 +966,12 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle&
default:
#if OSL_DEBUG_LEVEL > 0
fprintf( stderr, "TODO VMLExport::Commit(), unimplemented id: %d, value: %" SAL_PRIuUINT32 ", data: [%" SAL_PRIuUINT32 ", %p]\n",
nId, it->nPropValue, it->nPropSize, it->pBuf );
if ( it->nPropSize )
nId, opt.nPropValue, opt.nPropSize, opt.pBuf );
if ( opt.nPropSize )
{
const sal_uInt8 *pIt = it->pBuf;
const sal_uInt8 *pIt = opt.pBuf;
fprintf( stderr, " ( " );
for ( int nCount = it->nPropSize; nCount; --nCount )
for ( int nCount = opt.nPropSize; nCount; --nCount )
{
fprintf( stderr, "%02x ", *pIt );
++pIt;
......
......@@ -90,8 +90,8 @@ OUString BinaryInputStream::readUnicodeArray( sal_Int32 nChars )
OUStringBuffer aStringBuffer;
aStringBuffer.ensureCapacity( nCharsRead );
for( ::std::vector< sal_uInt16 >::iterator aIt = aBuffer.begin(), aEnd = aBuffer.end(); aIt != aEnd; ++aIt )
aStringBuffer.append( static_cast< sal_Unicode >( *aIt ) );
for (auto const& elem : aBuffer)
aStringBuffer.append( static_cast< sal_Unicode >(elem) );
return aStringBuffer.makeStringAndClear();
}
......
......@@ -153,12 +153,13 @@ Sequence< Property > SAL_CALL GenericPropertySet::getProperties()
{
Sequence< Property > aSeq( static_cast< sal_Int32 >( maPropMap.size() ) );
Property* pProperty = aSeq.getArray();
for( PropertyNameMap::iterator aIt = maPropMap.begin(), aEnd = maPropMap.end(); aIt != aEnd; ++aIt, ++pProperty )
for (auto const& prop : maPropMap)
{
pProperty->Name = aIt->first;
pProperty->Name = prop.first;
pProperty->Handle = 0;
pProperty->Type = aIt->second.getValueType();
pProperty->Type = prop.second.getValueType();
pProperty->Attributes = 0;
++pProperty;
}
return aSeq;
}
......@@ -230,8 +231,8 @@ const OUString& PropertyMap::getPropertyName( sal_Int32 nPropId )
void PropertyMap::assignAll( const PropertyMap& rPropMap )
{
for( PropertyMapType::const_iterator it=rPropMap.maProperties.begin(); it != rPropMap.maProperties.end(); ++it )
maProperties[it->first] = it->second;
for (auto const& prop : rPropMap.maProperties)
maProperties[prop.first] = prop.second;
}
Sequence< PropertyValue > PropertyMap::makePropertyValueSequence() const
......@@ -240,12 +241,13 @@ Sequence< PropertyValue > PropertyMap::makePropertyValueSequence() const
if( !maProperties.empty() )
{
PropertyValue* pValues = aSeq.getArray();
for( PropertyMapType::const_iterator aIt = maProperties.begin(), aEnd = maProperties.end(); aIt != aEnd; ++aIt, ++pValues )
for (auto const& prop : maProperties)
{
OSL_ENSURE( (0 <= aIt->first) && (aIt->first < PROP_COUNT), "PropertyMap::makePropertyValueSequence - invalid property identifier" );
pValues->Name = (*mpPropNames)[ aIt->first ];
pValues->Value = aIt->second;
OSL_ENSURE( (0 <= prop.first) && (prop.first < PROP_COUNT), "PropertyMap::makePropertyValueSequence - invalid property identifier" );
pValues->Name = (*mpPropNames)[ prop.first ];
pValues->Value = prop.second;
pValues->State = PropertyState_DIRECT_VALUE;
++pValues;
}
}
return aSeq;
......@@ -259,21 +261,22 @@ void PropertyMap::fillSequences( Sequence< OUString >& rNames, Sequence< Any >&
{
OUString* pNames = rNames.getArray();
Any* pValues = rValues.getArray();
for( PropertyMapType::const_iterator aIt = maProperties.begin(), aEnd = maProperties.end(); aIt != aEnd; ++aIt, ++pNames, ++pValues )
for (auto const& prop : maProperties)
{
OSL_ENSURE( (0 <= aIt->first) && (aIt->first < PROP_COUNT), "PropertyMap::fillSequences - invalid property identifier" );
*pNames = (*mpPropNames)[ aIt->first ];
*pValues = aIt->second;
OSL_ENSURE( (0 <= prop.first) && (prop.first < PROP_COUNT), "PropertyMap::fillSequences - invalid property identifier" );
*pNames = (*mpPropNames)[ prop.first ];
*pValues = prop.second;
++pNames;
++pValues;
}
}
}
void PropertyMap::fillPropertyNameMap(PropertyNameMap& rMap) const
{
for(PropertyMapType::const_iterator itr = maProperties.begin(),
itrEnd = maProperties.end(); itr != itrEnd; ++itr)
for (auto const& prop : maProperties)
{
rMap.insert(std::pair<OUString, Any>((*mpPropNames)[itr->first], itr->second));
rMap.insert(std::pair<OUString, Any>((*mpPropNames)[prop.first], prop.second));
}
}
......
......@@ -224,8 +224,8 @@ void StorageBase::copyStorageToStorage( StorageBase& rDestStrg )
{
::std::vector< OUString > aElements;
getElementNames( aElements );
for( ::std::vector< OUString >::iterator aIt = aElements.begin(), aEnd = aElements.end(); aIt != aEnd; ++aIt )
copyToStorage( rDestStrg, *aIt );
for (auto const& elem : aElements)
copyToStorage(rDestStrg, elem);
}
}
......
......@@ -249,9 +249,11 @@ bool AxBinaryPropertyReader::finalizeImport()
maInStrm.align( 4 );
if( ensureValid( mnPropFlags == 0 ) && !maLargeProps.empty() )
{
for( ComplexPropVector::iterator aIt = maLargeProps.begin(), aEnd = maLargeProps.end(); ensureValid() && (aIt != aEnd); ++aIt )
for (auto const& largeProp : maLargeProps)
{
ensureValid( (*aIt)->readProperty( maInStrm ) );
if (!ensureValid())
break;
ensureValid( largeProp->readProperty( maInStrm ) );
maInStrm.align( 4 );
}
}
......@@ -259,8 +261,14 @@ bool AxBinaryPropertyReader::finalizeImport()
// read stream properties (no stream alignment between properties!)
if( ensureValid() && !maStreamProps.empty() )
for( ComplexPropVector::iterator aIt = maStreamProps.begin(), aEnd = maStreamProps.end(); ensureValid() && (aIt != aEnd); ++aIt )