diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-06-01 20:21:20 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-06-02 09:20:59 +0200 |
commit | 9f4b7c50d3017bb47956267bd4970080a6276132 (patch) | |
tree | dcda17c07610249b63a26dc796611bb8483eb7f3 | |
parent | abfb418cbf8bfbec0de0f1a3b89871c8f38ee667 (diff) |
Use more proper integer types and range-based for loops
Change-Id: Ifb7edfa11855afff373e638d583efd6ce55e93d3
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 1246d1df8fd3..c87c59094845 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -94,23 +94,19 @@ HTMLOptionEnum aHTMLImgVAlignTable[] = ImageMap *SwHTMLParser::FindImageMap( const OUString& rName ) const { - ImageMap *pMap = 0; - OSL_ENSURE( rName[0] != '#', "FindImageName: Name beginnt mit #!" ); if( pImageMaps ) { - for( sal_uInt16 i=0; i<pImageMaps->size(); i++ ) + for( auto &rIMap : *pImageMaps ) { - ImageMap *pIMap = &(*pImageMaps)[i]; - if( rName.equalsIgnoreAsciiCase( pIMap->GetName() ) ) + if( rName.equalsIgnoreAsciiCase( rIMap.GetName() ) ) { - pMap = pIMap; - break; + return &rIMap; } } } - return pMap; + return nullptr; } void SwHTMLParser::ConnectImageMaps() @@ -779,7 +775,7 @@ IMAGE_SETEVENT: SFX_EVENT_MOUSEOUT_OBJECT, 0 }; - for( sal_uInt16 n = 0; aEvents[ n ]; ++n ) + for( int n = 0; aEvents[ n ]; ++n ) { const SvxMacro *pMacro = rINetFormat.GetMacro( aEvents[ n ] ); if( 0 != pMacro ) @@ -991,7 +987,7 @@ void SwHTMLParser::InsertBodyOptions() static const sal_uInt16 aWhichIds[3] = { RES_CHRATR_FONTSIZE, RES_CHRATR_CJK_FONTSIZE, RES_CHRATR_CTL_FONTSIZE }; - for( sal_uInt16 i=0; i<3; i++ ) + for( size_t i=0; i<SAL_N_ELEMENTS(aWhichIds); ++i ) { if( SfxItemState::SET == aItemSet.GetItemState( aWhichIds[i], false, &pItem ) && @@ -1302,7 +1298,7 @@ bool SwHTMLParser::HasCurrentParaBookmarks( bool bIgnoreStack ) const // to check the last bookmark if( !bIgnoreStack ) { - for( sal_uInt16 i = aSetAttrTab.size(); i; ) + for( auto i = aSetAttrTab.size(); i; ) { _HTMLAttr* pAttr = aSetAttrTab[ --i ]; if( RES_FLTR_BOOKMARK == pAttr->pItem->Which() ) @@ -1354,9 +1350,8 @@ void SwHTMLParser::StripTrailingPara() const SwFrameFormats& rFrameFormatTable = *pDoc->GetSpzFrameFormats(); - for( sal_uInt16 i=0; i<rFrameFormatTable.size(); i++ ) + for( auto pFormat : rFrameFormatTable ) { - SwFrameFormat const*const pFormat = rFrameFormatTable[i]; SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor(); SwPosition const*const pAPos = pAnchor->GetContentAnchor(); if (pAPos && |