Kaydet (Commit) 9f4b7c50 authored tarafından Matteo Casalin's avatar Matteo Casalin

Use more proper integer types and range-based for loops

Change-Id: Ifb7edfa11855afff373e638d583efd6ce55e93d3
üst abfb418c
...@@ -94,23 +94,19 @@ HTMLOptionEnum aHTMLImgVAlignTable[] = ...@@ -94,23 +94,19 @@ HTMLOptionEnum aHTMLImgVAlignTable[] =
ImageMap *SwHTMLParser::FindImageMap( const OUString& rName ) const ImageMap *SwHTMLParser::FindImageMap( const OUString& rName ) const
{ {
ImageMap *pMap = 0;
OSL_ENSURE( rName[0] != '#', "FindImageName: Name beginnt mit #!" ); OSL_ENSURE( rName[0] != '#', "FindImageName: Name beginnt mit #!" );
if( pImageMaps ) if( pImageMaps )
{ {
for( sal_uInt16 i=0; i<pImageMaps->size(); i++ ) for( auto &rIMap : *pImageMaps )
{ {
ImageMap *pIMap = &(*pImageMaps)[i]; if( rName.equalsIgnoreAsciiCase( rIMap.GetName() ) )
if( rName.equalsIgnoreAsciiCase( pIMap->GetName() ) )
{ {
pMap = pIMap; return &rIMap;
break;
} }
} }
} }
return pMap; return nullptr;
} }
void SwHTMLParser::ConnectImageMaps() void SwHTMLParser::ConnectImageMaps()
...@@ -779,7 +775,7 @@ IMAGE_SETEVENT: ...@@ -779,7 +775,7 @@ IMAGE_SETEVENT:
SFX_EVENT_MOUSEOUT_OBJECT, SFX_EVENT_MOUSEOUT_OBJECT,
0 }; 0 };
for( sal_uInt16 n = 0; aEvents[ n ]; ++n ) for( int n = 0; aEvents[ n ]; ++n )
{ {
const SvxMacro *pMacro = rINetFormat.GetMacro( aEvents[ n ] ); const SvxMacro *pMacro = rINetFormat.GetMacro( aEvents[ n ] );
if( 0 != pMacro ) if( 0 != pMacro )
...@@ -991,7 +987,7 @@ void SwHTMLParser::InsertBodyOptions() ...@@ -991,7 +987,7 @@ void SwHTMLParser::InsertBodyOptions()
static const sal_uInt16 aWhichIds[3] = { RES_CHRATR_FONTSIZE, static const sal_uInt16 aWhichIds[3] = { RES_CHRATR_FONTSIZE,
RES_CHRATR_CJK_FONTSIZE, RES_CHRATR_CJK_FONTSIZE,
RES_CHRATR_CTL_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, if( SfxItemState::SET == aItemSet.GetItemState( aWhichIds[i], false,
&pItem ) && &pItem ) &&
...@@ -1302,7 +1298,7 @@ bool SwHTMLParser::HasCurrentParaBookmarks( bool bIgnoreStack ) const ...@@ -1302,7 +1298,7 @@ bool SwHTMLParser::HasCurrentParaBookmarks( bool bIgnoreStack ) const
// to check the last bookmark // to check the last bookmark
if( !bIgnoreStack ) if( !bIgnoreStack )
{ {
for( sal_uInt16 i = aSetAttrTab.size(); i; ) for( auto i = aSetAttrTab.size(); i; )
{ {
_HTMLAttr* pAttr = aSetAttrTab[ --i ]; _HTMLAttr* pAttr = aSetAttrTab[ --i ];
if( RES_FLTR_BOOKMARK == pAttr->pItem->Which() ) if( RES_FLTR_BOOKMARK == pAttr->pItem->Which() )
...@@ -1354,9 +1350,8 @@ void SwHTMLParser::StripTrailingPara() ...@@ -1354,9 +1350,8 @@ void SwHTMLParser::StripTrailingPara()
const SwFrameFormats& rFrameFormatTable = *pDoc->GetSpzFrameFormats(); 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(); SwFormatAnchor const*const pAnchor = &pFormat->GetAnchor();
SwPosition const*const pAPos = pAnchor->GetContentAnchor(); SwPosition const*const pAPos = pAnchor->GetContentAnchor();
if (pAPos && if (pAPos &&
......
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