clang-tidy modernize-loop-convert in oox to sax

Change-Id: If0d87b6679765fc6d1f9300c6972845cf3742b9c
Reviewed-on: https://gerrit.libreoffice.org/24674
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Noel Grandin 2016-05-05 10:10:54 +02:00 committed by Noel Grandin
parent 931a72efbc
commit f07ff7ed8a
21 changed files with 98 additions and 99 deletions

View File

@ -423,8 +423,8 @@ static OUString convertToOOEquation( CustomShapeProperties& rCustomShapeProperti
if ( !pCommandHashMap )
{
FormulaCommandHMap* pHM = new FormulaCommandHMap();
for( sal_Int32 i = 0; i < FC_LAST; i++ )
(*pHM)[ OUString::createFromAscii( pFormularCommandNameTable[ i ].pS ) ] = pFormularCommandNameTable[ i ].pE;
for(const FormularCommandNameTable& i : pFormularCommandNameTable)
(*pHM)[ OUString::createFromAscii( i.pS ) ] = i.pE;
pCommandHashMap = pHM;
}

View File

@ -360,13 +360,13 @@ ContextHandlerRef ArtisticEffectContext::onCreateContext(
XML_size, XML_brushSize, XML_scaling, XML_detail, XML_bright, XML_contrast,
XML_colorTemp, XML_sat, XML_amount
};
for( sal_Int32 i=0; i<19; ++i )
for(sal_Int32 nAttrib : aAttribs)
{
if( rAttribs.hasAttribute( aAttribs[i] ) )
if( rAttribs.hasAttribute( nAttrib ) )
{
OUString sName = ArtisticEffectProperties::getEffectString( aAttribs[i] );
OUString sName = ArtisticEffectProperties::getEffectString( nAttrib );
if( !sName.isEmpty() )
maEffect.maAttribs[sName] = uno::makeAny( rAttribs.getInteger( aAttribs[i], 0 ) );
maEffect.maAttribs[sName] = uno::makeAny( rAttribs.getInteger( nAttrib, 0 ) );
}
}

View File

@ -833,13 +833,13 @@ Reference< XShape > Shape::createAndInsert(
{
PROP_TopBorder, PROP_LeftBorder, PROP_BottomBorder, PROP_RightBorder
};
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aBorders); ++i)
for (sal_Int32 nBorder : aBorders)
{
css::table::BorderLine2 aBorderLine = xPropertySet->getPropertyValue(PropertyMap::getPropertyName(aBorders[i])).get<css::table::BorderLine2>();
css::table::BorderLine2 aBorderLine = xPropertySet->getPropertyValue(PropertyMap::getPropertyName(nBorder)).get<css::table::BorderLine2>();
aBorderLine.Color = aShapeProps.getProperty(PROP_LineColor).get<sal_Int32>();
if (aLineProperties.moLineWidth.has())
aBorderLine.LineWidth = convertEmuToHmm(aLineProperties.moLineWidth.get());
aShapeProps.setProperty(aBorders[i], uno::makeAny(aBorderLine));
aShapeProps.setProperty(nBorder, uno::makeAny(aBorderLine));
}
aShapeProps.erase(PROP_LineColor);
}

View File

@ -237,18 +237,18 @@ static uno::Reference<io::XInputStream> lcl_StoreOwnAsOOXML(
const char * pFilterName(nullptr);
SvGlobalName const classId(xObj->getClassID());
for (size_t i = 0; i < SAL_N_ELEMENTS(s_Mapping); ++i)
for (auto & i : s_Mapping)
{
auto const& rId(s_Mapping[i].ClassId);
auto const& rId(i.ClassId);
SvGlobalName const temp(rId.n1, rId.n2, rId.n3, rId.b8, rId.b9, rId.b10, rId.b11, rId.b12, rId.b13, rId.b14, rId.b15);
if (temp == classId)
{
assert(SvGlobalName(SO3_SCH_CLASSID_60) != classId); // chart should be written elsewhere!
assert(SvGlobalName(SO3_SM_CLASSID_60) != classId); // formula should be written elsewhere!
pFilterName = s_Mapping[i].pFilterName;
o_rMediaType = OUString::createFromAscii(s_Mapping[i].pMediaType);
o_rpProgID = s_Mapping[i].pProgID;
o_rSuffix = OUString::createFromAscii(s_Mapping[i].pSuffix);
pFilterName = i.pFilterName;
o_rMediaType = OUString::createFromAscii(i.pMediaType);
o_rpProgID = i.pProgID;
o_rSuffix = OUString::createFromAscii(i.pSuffix);
o_rRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
break;
}

View File

@ -504,13 +504,13 @@ void ShapeBase::convertShapeProperties( const Reference< XShape >& rxShape ) con
static const sal_Int32 aBorders[] = {
PROP_TopBorder, PROP_LeftBorder, PROP_BottomBorder, PROP_RightBorder
};
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aBorders); ++i)
for (sal_Int32 nBorder : aBorders)
{
table::BorderLine2 aBorderLine = xPropertySet->getPropertyValue(PropertyMap::getPropertyName(aBorders[i])).get<table::BorderLine2>();
table::BorderLine2 aBorderLine = xPropertySet->getPropertyValue(PropertyMap::getPropertyName(nBorder)).get<table::BorderLine2>();
aBorderLine.Color = aPropMap.getProperty(PROP_LineColor).get<sal_Int32>();
if (oLineWidth)
aBorderLine.LineWidth = *oLineWidth;
aPropMap.setProperty(aBorders[i], uno::makeAny(aBorderLine));
aPropMap.setProperty(nBorder, uno::makeAny(aBorderLine));
}
aPropMap.erase(PROP_LineColor);
}

View File

@ -71,9 +71,8 @@ OString generateMD5(const void* pData, size_t length)
OStringBuffer aBuffer;
const char* pString = "0123456789ABCDEF";
for(size_t i = 0; i < RTL_DIGEST_LENGTH_MD5; ++i)
for(sal_uInt8 val : pBuffer)
{
sal_uInt8 val = pBuffer[i];
aBuffer.append(pString[val/16]);
aBuffer.append(pString[val%16]);
}
@ -272,12 +271,12 @@ void releaseOpenCLEnv( GPUEnv *gpuInfo )
return;
}
for (int i = 0; i < OPENCL_CMDQUEUE_SIZE; ++i)
for (_cl_command_queue* & i : gpuEnv.mpCmdQueue)
{
if (gpuEnv.mpCmdQueue[i])
if (i)
{
clReleaseCommandQueue(gpuEnv.mpCmdQueue[i]);
gpuEnv.mpCmdQueue[i] = nullptr;
clReleaseCommandQueue(i);
i = nullptr;
}
}
gpuEnv.mnCmdQueuePos = 0;

View File

@ -374,9 +374,9 @@ OUString ManifestImport::PushNameAndNamespaces( const OUString& aName, const uno
aStack.push_back( ManifestScopeEntry( aConvertedName, aNamespaces ) );
for ( size_t nInd = 0; nInd < aAttribsStrs.size(); nInd++ ) {
for (const std::pair<OUString,OUString> & rAttribsStr : aAttribsStrs) {
// convert the attribute names on filling
o_aConvertedAttribs[ConvertName( aAttribsStrs[nInd].first )] = aAttribsStrs[nInd].second;
o_aConvertedAttribs[ConvertName( rAttribsStr.first )] = rAttribsStr.second;
}
return aConvertedName;

View File

@ -179,10 +179,10 @@ void ZipOutputStream::finish()
consumeAllScheduledThreadEntries();
sal_Int32 nOffset= static_cast < sal_Int32 > (m_aChucker.GetPosition());
for (size_t i = 0; i < m_aZipList.size(); i++)
for (ZipEntry* p : m_aZipList)
{
writeCEN( *m_aZipList[i] );
delete m_aZipList[i];
writeCEN( *p );
delete p;
}
writeEND( nOffset, static_cast < sal_Int32 > (m_aChucker.GetPosition()) - nOffset);
m_xStream->flush();

View File

@ -1569,8 +1569,8 @@ void ORptExport::exportGroupsExpressionAsFunction(const Reference< XGroups>& _xG
if ( !sFunction.isEmpty() )
{
const sal_Unicode pReplaceChars[] = { '(',')',';',',','+','-','[',']','/','*'};
for(sal_uInt32 j= 0; j < SAL_N_ELEMENTS(pReplaceChars);++j)
sFunctionName = sFunctionName.replace(pReplaceChars[j],'_');
for(sal_Unicode ch : pReplaceChars)
sFunctionName = sFunctionName.replace(ch,'_');
xFunction->setName(sFunctionName);
if ( !sInitialFormula.isEmpty() )

View File

@ -87,8 +87,8 @@ ODateTimeDialog::ODateTimeDialog( vcl::Window* _pParent
m_aTimeControlling.enableOnCheckMark( *m_pTime, *m_pFTTimeFormat, *m_pTimeListBox);
CheckBox* aCheckBoxes[] = { m_pDate,m_pTime};
for ( size_t i = 0 ; i < SAL_N_ELEMENTS(aCheckBoxes); ++i)
aCheckBoxes[i]->SetClickHdl(LINK(this,ODateTimeDialog,CBClickHdl));
for (CheckBox* pCheckBox : aCheckBoxes)
pCheckBox->SetClickHdl(LINK(this,ODateTimeDialog,CBClickHdl));
}

View File

@ -961,11 +961,11 @@ OGroupsSortingDialog::OGroupsSortingDialog(vcl::Window* _pParent, bool _bReadOnl
m_pFieldExpression->set_vexpand(true);
Control* pControlsLst[] = { m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pKeepTogetherLst, m_pOrderLst, m_pGroupIntervalEd};
for (size_t i = 0; i < SAL_N_ELEMENTS(pControlsLst); ++i)
for (Control* i : pControlsLst)
{
pControlsLst[i]->SetGetFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusGot));
pControlsLst[i]->SetLoseFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusLost));
pControlsLst[i]->Show();
i->SetGetFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusGot));
i->SetLoseFocusHdl(LINK(this, OGroupsSortingDialog, OnControlFocusLost));
i->Show();
}
for (size_t i = 0; i < SAL_N_ELEMENTS(pControlsLst) - 1; ++i)
@ -1072,8 +1072,8 @@ void OGroupsSortingDialog::SaveData( sal_Int32 _nRow)
xGroup->setSortAscending( m_pOrderLst->GetSelectEntryPos() == 0 );
ListBox* pControls[] = { m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pKeepTogetherLst, m_pOrderLst};
for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
pControls[i]->SaveValue();
for (ListBox* pControl : pControls)
pControl->SaveValue();
}
@ -1305,13 +1305,13 @@ void OGroupsSortingDialog::displayGroup(const uno::Reference<report::XGroup>& _x
m_pOrderLst->SelectEntryPos(_xGroup->getSortAscending() ? 0 : 1);
ListBox* pControls[] = { m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pKeepTogetherLst, m_pOrderLst};
for (size_t i = 0; i < SAL_N_ELEMENTS(pControls); ++i)
pControls[i]->SaveValue();
for (ListBox* pControl : pControls)
pControl->SaveValue();
ListBox* pControlsLst2[] = { m_pHeaderLst, m_pFooterLst, m_pGroupOnLst, m_pKeepTogetherLst, m_pOrderLst};
bool bReadOnly = !m_pController->isEditable();
for (size_t i = 0; i < SAL_N_ELEMENTS(pControlsLst2); ++i)
pControlsLst2[i]->SetReadOnly(bReadOnly);
for (ListBox* i : pControlsLst2)
i->SetReadOnly(bReadOnly);
m_pGroupIntervalEd->SetReadOnly(bReadOnly);
}

View File

@ -374,9 +374,9 @@ uno::Sequence< beans::Property > SAL_CALL DataProviderHandler::getSupportedPrope
,OUString(PROPERTY_PREVIEW_COUNT)
};
for (size_t nPos = 0; nPos < SAL_N_ELEMENTS(s_pProperties); ++nPos )
for (const OUString & rName : s_pProperties)
{
aValue.Name = s_pProperties[nPos];
aValue.Name = rName;
aNewProps.push_back(aValue);
}
}

View File

@ -119,9 +119,9 @@ namespace rptui
const size_t nFactories = SAL_N_ELEMENTS( aFactories );
Sequence< Any > aReturn( nFactories );
Any* pReturn = aReturn.getArray();
for ( size_t i = 0; i < nFactories; ++i )
for (const auto& rFactory : aFactories)
{
*pReturn++ <<= OUString::createFromAscii( aFactories[i].serviceName );
*pReturn++ <<= OUString::createFromAscii( rFactory.serviceName );
}
return aReturn;

View File

@ -1309,15 +1309,15 @@ uno::Sequence< beans::Property > SAL_CALL GeometryHandler::getSupportedPropertie
};
const uno::Reference < beans::XPropertySetInfo > xInfo = m_xReportComponent->getPropertySetInfo();
const uno::Sequence< beans::Property> aSeq = xInfo->getProperties();
for (size_t i = 0; i < SAL_N_ELEMENTS(pIncludeProperties); ++i )
for (const auto & rIncludeProp : pIncludeProperties)
{
const beans::Property* pIter = aSeq.getConstArray();
const beans::Property* pEnd = pIter + aSeq.getLength();
const beans::Property* pFind = ::std::find_if(pIter,pEnd,::std::bind2nd(PropertyCompare(),boost::cref(pIncludeProperties[i])));
const beans::Property* pFind = ::std::find_if(pIter,pEnd,::std::bind2nd(PropertyCompare(),boost::cref(rIncludeProp)));
if ( pFind != pEnd )
{
// special case for controls which contain a data field
if ( PROPERTY_DATAFIELD == pIncludeProperties[i] )
if ( PROPERTY_DATAFIELD == rIncludeProp )
{
beans::Property aValue;
aValue.Name = PROPERTY_FORMULALIST;

View File

@ -540,13 +540,13 @@ namespace
,{ITEMID_LANGUAGE_ASIAN,OUString(PROPERTY_CHARLOCALEASIAN)}
,{ITEMID_LANGUAGE_COMPLEX,OUString(PROPERTY_CHARLOCALECOMPLEX)}
};
for(size_t k = 0; k < SAL_N_ELEMENTS(pItems); ++k)
for(const auto & k : pItems)
{
if ( SfxItemState::SET == _rItemSet.GetItemState( pItems[k].nWhich,true,&pItem) && dynamic_cast< const SvxLanguageItem *>( pItem ) != nullptr)
if ( SfxItemState::SET == _rItemSet.GetItemState( k.nWhich,true,&pItem) && dynamic_cast< const SvxLanguageItem *>( pItem ) != nullptr)
{
const SvxLanguageItem* pFontItem = static_cast<const SvxLanguageItem*>(pItem);
lang::Locale aCharLocale( LanguageTag( pFontItem->GetLanguage()).getLocale());
lcl_pushBack( _out_rProperties, pItems[k].sPropertyName, uno::makeAny( aCharLocale ) );
lcl_pushBack( _out_rProperties, k.sPropertyName, uno::makeAny( aCharLocale ) );
}
}
if ( SfxItemState::SET == _rItemSet.GetItemState( ITEMID_ESCAPEMENT,true,&pItem) && dynamic_cast< const SvxEscapementItem *>( pItem ) != nullptr)
@ -730,8 +730,8 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
}
SfxItemPool::Free(pPool);
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(pDefaults); ++i)
delete pDefaults[i];
for (SfxPoolItem* pDefault : pDefaults)
delete pDefault;
return bSuccess;
}

View File

@ -2093,10 +2093,10 @@ void OReportController::onLoadedMenu(const Reference< frame::XLayoutManager >& _
,OUString("private:resource/toolbar/resizebar")
,OUString("private:resource/toolbar/sectionshrinkbar")
};
for (size_t i = 0; i< SAL_N_ELEMENTS(s_sMenu); ++i)
for (const auto & i : s_sMenu)
{
_xLayoutManager->createElement( s_sMenu[i] );
_xLayoutManager->requestElement( s_sMenu[i] );
_xLayoutManager->createElement( i );
_xLayoutManager->requestElement( i );
}
}
}
@ -2536,8 +2536,8 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
}
SfxItemPool::Free(pPool);
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(pDefaults); ++i)
delete pDefaults[i];
for (SfxPoolItem* pDefault : pDefaults)
delete pDefault;
}
@ -2735,11 +2735,11 @@ uno::Any SAL_CALL OReportController::getViewData() throw( uno::RuntimeException,
};
::comphelper::NamedValueCollection aCommandProperties;
for ( size_t i=0; i < SAL_N_ELEMENTS(nCommandIDs); ++i )
for (sal_Int32 nCommandID : nCommandIDs)
{
const FeatureState aFeatureState = GetState( nCommandIDs[i] );
const FeatureState aFeatureState = GetState( nCommandID );
OUString sCommandURL( getURLForId( nCommandIDs[i] ).Main );
OUString sCommandURL( getURLForId( nCommandID ).Main );
OSL_ENSURE( sCommandURL.startsWith( ".uno:" ), "OReportController::getViewData: illegal command URL!" );
sCommandURL = sCommandURL.copy( 5 );
@ -3208,10 +3208,10 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
,OUString(PROPERTY_FORMATSSUPPLIER)
,OUString(PROPERTY_BACKGROUNDCOLOR)
};
for(size_t i = 0; i < SAL_N_ELEMENTS(sProps); ++i)
for(const auto & sProp : sProps)
{
if ( xInfo->hasPropertyByName(sProps[i]) && xShapeInfo->hasPropertyByName(sProps[i]) )
xUnoProp->setPropertyValue(sProps[i],xShapeProp->getPropertyValue(sProps[i]));
if ( xInfo->hasPropertyByName(sProp) && xShapeInfo->hasPropertyByName(sProp) )
xUnoProp->setPropertyValue(sProp,xShapeProp->getPropertyValue(sProp));
}
if ( xInfo->hasPropertyByName(PROPERTY_BORDER) && xShapeInfo->hasPropertyByName(PROPERTY_CONTROLBORDER) )
@ -3507,10 +3507,10 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
,OUString(PROPERTY_BORDER)
,OUString(PROPERTY_BACKGROUNDCOLOR)
};
for(size_t k = 0; k < SAL_N_ELEMENTS(sProps); ++k)
for(const auto & sProp : sProps)
{
if ( xInfo->hasPropertyByName(sProps[k]) && xShapeInfo->hasPropertyByName(sProps[k]) )
xUnoProp->setPropertyValue(sProps[k],xShapeProp->getPropertyValue(sProps[k]));
if ( xInfo->hasPropertyByName(sProp) && xShapeInfo->hasPropertyByName(sProp) )
xUnoProp->setPropertyValue(sProp,xShapeProp->getPropertyValue(sProp));
}
if ( xInfo->hasPropertyByName(PROPERTY_DATAFIELD) )
{
@ -3618,8 +3618,8 @@ void OReportController::addPairControls(const Sequence< PropertyValue >& aArgs)
}
else
{
for(size_t i = 0; i < SAL_N_ELEMENTS(pControl); ++i)
delete pControl[i];
for(SdrUnoObj* i : pControl)
delete i;
}
}
}
@ -3679,8 +3679,8 @@ void OReportController::listen(const bool _bAdd)
void (SAL_CALL XPropertySet::*pPropertyListenerAction)( const OUString&, const uno::Reference< XPropertyChangeListener >& ) =
_bAdd ? &XPropertySet::addPropertyChangeListener : &XPropertySet::removePropertyChangeListener;
for (size_t i = 0; i < SAL_N_ELEMENTS(aProps); ++i)
(m_xReportDefinition.get()->*pPropertyListenerAction)( aProps[i], static_cast< XPropertyChangeListener* >( this ) );
for (const auto & aProp : aProps)
(m_xReportDefinition.get()->*pPropertyListenerAction)( aProp, static_cast< XPropertyChangeListener* >( this ) );
OXUndoEnvironment& rUndoEnv = m_aReportModel->GetUndoEnv();
uno::Reference< XPropertyChangeListener > xUndo = &rUndoEnv;
@ -4259,8 +4259,8 @@ void OReportController::openZoomDialog()
}
SfxItemPool::Free(pPool);
for (sal_uInt16 i=0; i<SAL_N_ELEMENTS(pDefaults); ++i)
delete pDefaults[i];
for (SfxPoolItem* pDefault : pDefaults)
delete pDefault;
}
}

View File

@ -194,8 +194,8 @@ void PropBrw::dispose()
const OUString pProps[] = { OUString( "ContextDocument" )
, OUString( "DialogParentWindow" )
, OUString( "ActiveConnection" )};
for (size_t i = 0; i < SAL_N_ELEMENTS(pProps); ++i)
xName->removeByName(pProps[i]);
for (const auto & i : pProps)
xName->removeByName(i);
}
}
catch(Exception&)

View File

@ -208,21 +208,21 @@ bool onInitSignal()
sigfillset(&(act.sa_mask));
/* Initialize the rest of the signals */
for (int i = 0; i < NoSignals; ++i)
for (SignalAction & rSignal : Signals)
{
#if defined HAVE_VALGRIND_HEADERS
if (Signals[i].Signal == SIGUSR2 && RUNNING_ON_VALGRIND)
Signals[i].Action = ACT_IGNORE;
if (rSignal.Signal == SIGUSR2 && RUNNING_ON_VALGRIND)
rSignal.Action = ACT_IGNORE;
#endif
/* hack: stomcatd is attaching JavaVM which does not work with an sigaction(SEGV) */
if ((bSetSEGVHandler || Signals[i].Signal != SIGSEGV)
&& (bSetWINCHHandler || Signals[i].Signal != SIGWINCH)
&& (bSetILLHandler || Signals[i].Signal != SIGILL))
if ((bSetSEGVHandler || rSignal.Signal != SIGSEGV)
&& (bSetWINCHHandler || rSignal.Signal != SIGWINCH)
&& (bSetILLHandler || rSignal.Signal != SIGILL))
{
if (Signals[i].Action != ACT_SYSTEM)
if (rSignal.Action != ACT_SYSTEM)
{
if (Signals[i].Action == ACT_HIDE)
if (rSignal.Action == ACT_HIDE)
{
struct sigaction ign;
@ -231,18 +231,18 @@ bool onInitSignal()
sigemptyset(&ign.sa_mask);
struct sigaction oact;
if (sigaction(Signals[i].Signal, &ign, &oact) == 0)
Signals[i].Handler = oact.sa_handler;
if (sigaction(rSignal.Signal, &ign, &oact) == 0)
rSignal.Handler = oact.sa_handler;
else
Signals[i].Handler = SIG_DFL;
rSignal.Handler = SIG_DFL;
}
else
{
struct sigaction oact;
if (sigaction(Signals[i].Signal, &act, &oact) == 0)
Signals[i].Handler = oact.sa_handler;
if (sigaction(rSignal.Signal, &act, &oact) == 0)
rSignal.Handler = oact.sa_handler;
else
Signals[i].Handler = SIG_DFL;
rSignal.Handler = SIG_DFL;
}
}
}

View File

@ -58,10 +58,10 @@ getNextSize (sal_uInt32 nSize)
2097143, 4194301, 8388593, 16777213,
33554393, 67108859, 134217689 };
for (sal_uInt32 i = 0; i < SAL_N_ELEMENTS(nPrimes); i++)
for (sal_uInt32 nPrime : nPrimes)
{
if (nPrimes[i] > nSize)
return nPrimes[i];
if (nPrime > nSize)
return nPrime;
}
return nSize * 2;
}

View File

@ -120,8 +120,8 @@ void FastAttributeList::addUnknown( const OString& rName, const OString& value )
// XFastAttributeList
sal_Bool FastAttributeList::hasAttribute( ::sal_Int32 Token ) throw (RuntimeException, std::exception)
{
for (size_t i = 0; i < maAttributeTokens.size(); ++i)
if (maAttributeTokens[i] == Token)
for (sal_Int32 i : maAttributeTokens)
if (i == Token)
return true;
return false;

View File

@ -255,11 +255,11 @@ namespace sax_fastparser {
#ifdef DBG_UTIL
::std::set<OString> DebugAttributes;
#endif
for (size_t j = 0; j < maTokenValues.size(); j++)
for (const TokenValue & rTokenValue : maTokenValues)
{
writeBytes(sSpace, N_CHARS(sSpace));
sal_Int32 nToken = maTokenValues[j].nToken;
sal_Int32 nToken = rTokenValue.nToken;
writeId(nToken);
#ifdef DBG_UTIL
@ -271,7 +271,7 @@ namespace sax_fastparser {
writeBytes(sEqualSignAndQuote, N_CHARS(sEqualSignAndQuote));
write(maTokenValues[j].pValue, -1, true);
write(rTokenValue.pValue, -1, true);
writeBytes(sQuote, N_CHARS(sQuote));
}