diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-05-31 23:22:30 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2015-05-31 23:35:56 +0200 |
commit | c8eb473ff1895ad01fe01e82b0a422f6cf5c351e (patch) | |
tree | dde9c68fbde3c3013ec9368662d26ab513a84e62 /sw | |
parent | ac52b11a150cd260cfb58aa3013abcf499d04468 (diff) |
Use more proper integer types and range-based for loops
Change-Id: I04a53b2e6f48e597b5d2de79587458a9f7f61f4d
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/html/htmlform.cxx | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index d3bd58c9cf5d..eda765bc9142 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -762,9 +762,8 @@ static void lcl_html_setEvents( { // Erstmal muss die Anzahl der Events ermittelt werden ... sal_Int32 nEvents = 0; - sal_uInt16 i; - for( i = 0; HTML_ET_END != aEventTypeTable[i]; i++ ) + for( int i = 0; HTML_ET_END != aEventTypeTable[i]; ++i ) { const SvxMacro *pMacro = rMacroTable.Get( aEventTypeTable[i] ); // Solange nicht alle Events implementiert sind, enthaelt die @@ -772,9 +771,8 @@ static void lcl_html_setEvents( if( pMacro && aEventListenerTable[i] ) nEvents++; } - for( i=0; i< rUnoMacroTable.size(); i++ ) + for( const auto &rStr : rUnoMacroTable ) { - const OUString& rStr(rUnoMacroTable[i]); sal_Int32 nIndex = 0; if( rStr.getToken( 0, '-', nIndex ).isEmpty() || -1 == nIndex ) continue; @@ -791,7 +789,7 @@ static void lcl_html_setEvents( script::ScriptEventDescriptor* pDescs = aDescs.getArray(); sal_Int32 nEvent = 0; - for( i=0; HTML_ET_END != aEventTypeTable[i]; i++ ) + for( int i=0; HTML_ET_END != aEventTypeTable[i]; ++i ) { const SvxMacro *pMacro = rMacroTable.Get( aEventTypeTable[i] ); if( pMacro && aEventListenerTable[i] ) @@ -805,9 +803,8 @@ static void lcl_html_setEvents( } } - for( i=0; i< rUnoMacroTable.size(); ++i ) + for( const auto &rStr : rUnoMacroTable ) { - const OUString& rStr = rUnoMacroTable[i]; sal_Int32 nIndex = 0; OUString sListener( rStr.getToken( 0, '-', nIndex ) ); if( sListener.isEmpty() || -1 == nIndex ) @@ -884,8 +881,10 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl( if( !bHidden ) { Any aTmp; - sal_uInt16 nLeftSpace = 0, nRightSpace = 0, - nUpperSpace = 0, nLowerSpace = 0; + sal_Int32 nLeftSpace = 0; + sal_Int32 nRightSpace = 0; + sal_Int32 nUpperSpace = 0; + sal_Int32 nLowerSpace = 0; const uno::Reference< XMultiServiceFactory > & rServiceFactory = pFormImpl->GetServiceFactory(); @@ -919,12 +918,12 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl( aLRItem.SetTextFirstLineOfst( 0 ); if( rCSS1PropInfo.bLeftMargin ) { - nLeftSpace = static_cast< sal_uInt16 >(convertTwipToMm100( aLRItem.GetLeft() )); + nLeftSpace = convertTwipToMm100( aLRItem.GetLeft() ); rCSS1PropInfo.bLeftMargin = false; } if( rCSS1PropInfo.bRightMargin ) { - nRightSpace = static_cast< sal_uInt16 >(convertTwipToMm100( aLRItem.GetRight() )); + nRightSpace = convertTwipToMm100( aLRItem.GetRight() ); rCSS1PropInfo.bRightMargin = false; } rCSS1ItemSet.ClearItem( RES_LR_SPACE ); @@ -932,10 +931,10 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl( if( nLeftSpace || nRightSpace ) { Any aAny2; - aAny2 <<= (sal_Int32)nLeftSpace; + aAny2 <<= nLeftSpace; xShapePropSet->setPropertyValue("LeftMargin", aAny2 ); - aAny2 <<= (sal_Int32)nRightSpace; + aAny2 <<= nRightSpace; xShapePropSet->setPropertyValue("RightMargin", aAny2 ); } @@ -961,10 +960,10 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl( if( nUpperSpace || nLowerSpace ) { uno::Any aAny2; - aAny2 <<= (sal_Int32)nUpperSpace; + aAny2 <<= nUpperSpace; xShapePropSet->setPropertyValue("TopMargin", aAny2 ); - aAny2 <<= (sal_Int32)nLowerSpace; + aAny2 <<= nLowerSpace; xShapePropSet->setPropertyValue("BottomMargin", aAny2 ); } |