diff options
author | Eike Rathke <erack@redhat.com> | 2013-03-26 20:42:24 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-03-26 20:48:16 +0100 |
commit | 58d3e62455416f4bfa71719f09dd8c3938cd8053 (patch) | |
tree | 18d0879978e1f9f695f57cab2131860f6e7a4d18 /sc | |
parent | Make the conditional formatting code free of ScBaseCell. (diff) | |
download | core-58d3e62455416f4bfa71719f09dd8c3938cd8053.tar.gz core-58d3e62455416f4bfa71719f09dd8c3938cd8053.zip |
fixed some 7d1f4cdec307bb1e761bb5dd3d8231bba5833e10 brokenness
7d1f4cdec307bb1e761bb5dd3d8231bba5833e10 changed String::GetToken() to
expect and return a sal_Int32 and return -1 instead of STRING_NOTFOUND.
So far so good though not consistent, but unfortunately it also replaced
STRING_NOTFOUND with -1 in a few other places like where
String::Search() is called but that still returns STRING_NOTFOUND ...
Change-Id: I1ef1891cef220c1f1f9032af173d80f3f0e29e71
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/dbgui/csvgrid.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx index 74eaac258739..428aa75f5a4d 100644 --- a/sc/source/ui/dbgui/csvgrid.cxx +++ b/sc/source/ui/dbgui/csvgrid.cxx @@ -1072,11 +1072,11 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText ) U+0020 may be drawn with a wrong width (from non-fixed-width Asian or Complex font). Now we draw every non-space portion separately. */ xub_StrLen nTokenCount = comphelper::string::getTokenCount(aPlainText, ' '); - sal_Int32 nCharIx = 0; + sal_Int32 nCharIxInt = 0; for( xub_StrLen nToken = 0; nToken < nTokenCount; ++nToken ) { - sal_Int32 nBeginIx = nCharIx; - String aToken = aPlainText.GetToken( 0, ' ', nCharIx ); + sal_Int32 nBeginIx = nCharIxInt; + String aToken = aPlainText.GetToken( 0, ' ', nCharIxInt ); if( aToken.Len() > 0 ) { sal_Int32 nX = rPos.X() + GetCharWidth() * nBeginIx; @@ -1085,8 +1085,8 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText ) } } - nCharIx = 0; - while( (nCharIx = rText.Search( '\t', nCharIx )) != -1 ) + xub_StrLen nCharIx = 0; + while( (nCharIx = rText.Search( '\t', nCharIx )) != STRING_NOTFOUND ) { sal_Int32 nX1 = rPos.X() + GetCharWidth() * nCharIx; sal_Int32 nX2 = nX1 + GetCharWidth() - 2; @@ -1099,7 +1099,7 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText ) ++nCharIx; } nCharIx = 0; - while( (nCharIx = rText.Search( '\n', nCharIx )) != -1 ) + while( (nCharIx = rText.Search( '\n', nCharIx )) != STRING_NOTFOUND ) { sal_Int32 nX1 = rPos.X() + GetCharWidth() * nCharIx; sal_Int32 nX2 = nX1 + GetCharWidth() - 2; |