Kaydet (Commit) 58d3e624 authored tarafından Eike Rathke's avatar Eike Rathke

fixed some 7d1f4cde brokenness

7d1f4cde 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
üst 5f5d2cb6
...@@ -1072,11 +1072,11 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText ) ...@@ -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 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. */ Complex font). Now we draw every non-space portion separately. */
xub_StrLen nTokenCount = comphelper::string::getTokenCount(aPlainText, ' '); xub_StrLen nTokenCount = comphelper::string::getTokenCount(aPlainText, ' ');
sal_Int32 nCharIx = 0; sal_Int32 nCharIxInt = 0;
for( xub_StrLen nToken = 0; nToken < nTokenCount; ++nToken ) for( xub_StrLen nToken = 0; nToken < nTokenCount; ++nToken )
{ {
sal_Int32 nBeginIx = nCharIx; sal_Int32 nBeginIx = nCharIxInt;
String aToken = aPlainText.GetToken( 0, ' ', nCharIx ); String aToken = aPlainText.GetToken( 0, ' ', nCharIxInt );
if( aToken.Len() > 0 ) if( aToken.Len() > 0 )
{ {
sal_Int32 nX = rPos.X() + GetCharWidth() * nBeginIx; sal_Int32 nX = rPos.X() + GetCharWidth() * nBeginIx;
...@@ -1085,8 +1085,8 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText ) ...@@ -1085,8 +1085,8 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText )
} }
} }
nCharIx = 0; xub_StrLen nCharIx = 0;
while( (nCharIx = rText.Search( '\t', nCharIx )) != -1 ) while( (nCharIx = rText.Search( '\t', nCharIx )) != STRING_NOTFOUND )
{ {
sal_Int32 nX1 = rPos.X() + GetCharWidth() * nCharIx; sal_Int32 nX1 = rPos.X() + GetCharWidth() * nCharIx;
sal_Int32 nX2 = nX1 + GetCharWidth() - 2; sal_Int32 nX2 = nX1 + GetCharWidth() - 2;
...@@ -1099,7 +1099,7 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText ) ...@@ -1099,7 +1099,7 @@ void ScCsvGrid::ImplDrawCellText( const Point& rPos, const String& rText )
++nCharIx; ++nCharIx;
} }
nCharIx = 0; 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 nX1 = rPos.X() + GetCharWidth() * nCharIx;
sal_Int32 nX2 = nX1 + GetCharWidth() - 2; sal_Int32 nX2 = nX1 + GetCharWidth() - 2;
......
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