[Libreoffice-commits] .: 2 commits - sc/source
Caolán McNamara
caolan at kemper.freedesktop.org
Fri Dec 3 07:24:38 PST 2010
sc/source/filter/html/htmlpars.cxx | 21 +++++++--------------
sc/source/filter/rtf/eeimpars.cxx | 21 ++++++++++-----------
sc/source/filter/rtf/rtfparse.cxx | 3 +--
3 files changed, 18 insertions(+), 27 deletions(-)
New commits:
commit 2db4aba5f6732b244d7e706f43b17c7ff09ce487
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 3 15:20:11 2010 +0000
WaE, shadowed variables
diff --git a/sc/source/filter/html/htmlpars.cxx b/sc/source/filter/html/htmlpars.cxx
index d5a2ccf..87f444a 100644
--- a/sc/source/filter/html/htmlpars.cxx
+++ b/sc/source/filter/html/htmlpars.cxx
@@ -126,11 +126,10 @@ ScHTMLLayoutParser::ScHTMLLayoutParser( EditEngine* pEditP, const String& rBaseU
ScHTMLLayoutParser::~ScHTMLLayoutParser()
{
ScHTMLTableStackEntry* pS;
- size_t ListSize = maList.size();
while ( (pS = aTableStack.Pop()) != 0 )
{
bool found = false;
- for ( size_t i = 0; i < ListSize; ++i )
+ for ( size_t i = 0, nListSize = maList.size(); i < nListSize; ++i )
{
if ( pS->pCellEntry == maList[ i ] )
{
@@ -408,8 +407,7 @@ void ScHTMLLayoutParser::Adjust()
SCROW nCurRow = 0;
USHORT nPageWidth = (USHORT) aPageSize.Width();
Table* pTab = NULL;
- size_t ListSize = maList.size();
- for ( size_t i = 0; i < ListSize; ++i )
+ for ( size_t i = 0, nListSize = maList.size(); i < nListSize; ++i )
{
ScEEParseEntry* pE = maList[ i ];
if ( pE->nTab < nTab )
@@ -551,8 +549,7 @@ void ScHTMLLayoutParser::SetWidths()
MakeColNoRef( pLocalColOffset, nOff, 0, 0, 0 );
}
nTableWidth = (USHORT)((*pLocalColOffset)[pLocalColOffset->Count() -1 ] - (*pLocalColOffset)[0]);
- size_t ListSize = maList.size();
- for ( size_t i = nFirstTableCell; i < ListSize; ++i )
+ for ( size_t i = nFirstTableCell, nListSize = maList.size(); i < nListSize; ++i )
{
pE = maList[ i ];
if ( pE->nTab == nTable )
@@ -572,8 +569,7 @@ void ScHTMLLayoutParser::SetWidths()
USHORT* pWidths = new USHORT[ nColsPerRow ];
memset( pWidths, 0, nColsPerRow * sizeof(USHORT) );
pOffsets[0] = nColOffsetStart;
- size_t ListSize = maList.size();
- for ( size_t i = nFirstTableCell; i < ListSize; ++i )
+ for ( size_t i = nFirstTableCell, nListSize = maList.size(); i < nListSize; ++i )
{
pE = maList[ i ];
if ( pE->nTab == nTable && pE->nWidth )
@@ -644,8 +640,7 @@ void ScHTMLLayoutParser::SetWidths()
}
nTableWidth = pOffsets[nColsPerRow] - pOffsets[0];
- ListSize = maList.size();
- for ( size_t i = nFirstTableCell; i < ListSize; ++i )
+ for ( size_t i = nFirstTableCell, nListSize = maList.size(); i < nListSize; ++i )
{
pE = maList[ i ];
if ( pE->nTab == nTable )
@@ -673,8 +668,7 @@ void ScHTMLLayoutParser::SetWidths()
if ( aPageSize.Width() < nMax )
aPageSize.Width() = nMax;
}
- size_t ListSize = maList.size();
- for ( size_t i = nFirstTableCell; i < ListSize; ++i )
+ for ( size_t i = nFirstTableCell, nListSize = maList.size(); i < nListSize; ++i )
{
pE = maList[ i ];
if ( pE->nTab == nTable )
@@ -725,9 +719,8 @@ void ScHTMLLayoutParser::CloseEntry( ImportInfo* pInfo )
if ( bTabInTabCell )
{ // in TableOff vom Stack geholt
bTabInTabCell = FALSE;
- size_t ListSize = maList.size();
bool found = false;
- for ( size_t i = 0; i < ListSize; ++i )
+ for ( size_t i = 0, nListSize = maList.size(); i < nListSize; ++i )
{
if ( pActEntry == maList[ i ] )
{
commit 2eaa2ed77e733edeb04e742c64d57ff5685f9f43
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 3 15:13:10 2010 +0000
WaE, shadowed variables
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index 818d8cc..231c55a 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -160,8 +160,7 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNu
}
ScDocumentPool* pDocPool = mpDoc->GetPool();
ScRangeName* pRangeNames = mpDoc->GetRangeName();
- size_t ListSize = mpParser->ListSize();
- for ( size_t i = 0; i < ListSize; ++i )
+ for ( size_t i = 0, nListSize = mpParser->ListSize(); i < nListSize; ++i )
{
pE = mpParser->ListEntry( i );
SCROW nRow = nStartRow + pE->nRow;
@@ -281,22 +280,22 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNu
BYTE nScriptType = mpDoc->GetStringScriptType( aStr );
const BYTE nScripts[3] = { SCRIPTTYPE_LATIN,
SCRIPTTYPE_ASIAN, SCRIPTTYPE_COMPLEX };
- for ( BYTE i=0; i<3; ++i )
+ for ( BYTE j=0; j<3; ++j )
{
- if ( nScriptType & nScripts[i] )
+ if ( nScriptType & nScripts[j] )
{
if ( pFont )
rSet.Put( *pFont, ScGlobal::GetScriptedWhichID(
- nScripts[i], ATTR_FONT ));
+ nScripts[j], ATTR_FONT ));
if ( pHeight )
rSet.Put( *pHeight, ScGlobal::GetScriptedWhichID(
- nScripts[i], ATTR_FONT_HEIGHT ));
+ nScripts[j], ATTR_FONT_HEIGHT ));
if ( pWeight )
rSet.Put( *pWeight, ScGlobal::GetScriptedWhichID(
- nScripts[i], ATTR_FONT_WEIGHT ));
+ nScripts[j], ATTR_FONT_WEIGHT ));
if ( pPosture )
rSet.Put( *pPosture, ScGlobal::GetScriptedWhichID(
- nScripts[i], ATTR_FONT_POSTURE ));
+ nScripts[j], ATTR_FONT_POSTURE ));
}
}
}
@@ -453,9 +452,9 @@ void ScEEImport::WriteToDocument( BOOL bSizeColsRows, double nOutputFactor, SvNu
}
}
if ( bHasGraphics )
- { // Grafiken einfuegen
- size_t ListSize = mpParser->ListSize();
- for ( size_t i = 0; i < ListSize; ++i )
+ {
+ // Grafiken einfuegen
+ for ( size_t i = 0, nListSize = mpParser->ListSize(); i < nListSize; ++i )
{
pE = mpParser->ListEntry( i );
if ( !pE->maImageList.empty() )
diff --git a/sc/source/filter/rtf/rtfparse.cxx b/sc/source/filter/rtf/rtfparse.cxx
index f0cca62..e9d7cf1 100644
--- a/sc/source/filter/rtf/rtfparse.cxx
+++ b/sc/source/filter/rtf/rtfparse.cxx
@@ -163,8 +163,7 @@ void ScRTFParser::ColAdjust()
{
SCCOL nCol = 0;
ScEEParseEntry* pE;
- size_t ListSize = maList.size();
- for ( size_t i = nStartAdjust; i < ListSize; ++ i )
+ for ( size_t i = nStartAdjust, nListSize = maList.size(); i < nListSize; ++ i )
{
pE = maList[ i ];
if ( pE->nCol == 0 )
More information about the Libreoffice-commits
mailing list