Kaydet (Commit) 34012133 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

use sal_Int32 instead of xub_StrLen

Change-Id: Id868448b5c981d744a066c738b344752bcd0faab
üst 93959db4
...@@ -625,7 +625,7 @@ static bool lcl_appendLineData( OUString& rField, const sal_Unicode* p1, const s ...@@ -625,7 +625,7 @@ static bool lcl_appendLineData( OUString& rField, const sal_Unicode* p1, const s
OSL_ENSURE( rField.getLength() + (p2 - p1) <= STRING_MAXLEN, "lcl_appendLineData: data overflow"); OSL_ENSURE( rField.getLength() + (p2 - p1) <= STRING_MAXLEN, "lcl_appendLineData: data overflow");
if (rField.getLength() + (p2 - p1) <= STRING_MAXLEN) if (rField.getLength() + (p2 - p1) <= STRING_MAXLEN)
{ {
rField += OUString( p1, sal::static_int_cast<xub_StrLen>( p2 - p1 ) ); rField += OUString( p1, sal::static_int_cast<sal_Int32>( p2 - p1 ) );
return true; return true;
} }
else else
...@@ -763,7 +763,7 @@ static const sal_Unicode* lcl_ScanSylkString( const sal_Unicode* p, ...@@ -763,7 +763,7 @@ static const sal_Unicode* lcl_ScanSylkString( const sal_Unicode* p,
} }
if (!pEndQuote) if (!pEndQuote)
pEndQuote = p; // Take all data as string. pEndQuote = p; // Take all data as string.
rString += OUString(pStartQuote + 1, sal::static_int_cast<xub_StrLen>( pEndQuote - pStartQuote - 1 ) ); rString += OUString(pStartQuote + 1, sal::static_int_cast<sal_Int32>( pEndQuote - pStartQuote - 1 ) );
lcl_UnescapeSylk( rString, eVersion); lcl_UnescapeSylk( rString, eVersion);
return p; return p;
} }
...@@ -785,7 +785,7 @@ static const sal_Unicode* lcl_ScanSylkFormula( const sal_Unicode* p, ...@@ -785,7 +785,7 @@ static const sal_Unicode* lcl_ScanSylkFormula( const sal_Unicode* p,
} }
++p; ++p;
} }
rString += OUString( pStart, sal::static_int_cast<xub_StrLen>( p - pStart)); rString += OUString( pStart, sal::static_int_cast<sal_Int32>( p - pStart));
lcl_UnescapeSylk( rString, eVersion); lcl_UnescapeSylk( rString, eVersion);
} }
else else
...@@ -826,7 +826,7 @@ static const sal_Unicode* lcl_ScanSylkFormula( const sal_Unicode* p, ...@@ -826,7 +826,7 @@ static const sal_Unicode* lcl_ScanSylkFormula( const sal_Unicode* p,
{ {
while (*p && *p != ';') while (*p && *p != ';')
++p; ++p;
rString += OUString( pStart, sal::static_int_cast<xub_StrLen>( p - pStart)); rString += OUString( pStart, sal::static_int_cast<sal_Int32>( p - pStart));
} }
} }
return p; return p;
...@@ -1011,9 +1011,9 @@ static bool lcl_PutString( ...@@ -1011,9 +1011,9 @@ static bool lcl_PutString(
else if ( nColFormat != SC_COL_STANDARD ) // Datumsformate else if ( nColFormat != SC_COL_STANDARD ) // Datumsformate
{ {
const sal_uInt16 nMaxNumberParts = 7; // Y-M-D h:m:s.t const sal_uInt16 nMaxNumberParts = 7; // Y-M-D h:m:s.t
xub_StrLen nLen = rStr.getLength(); sal_Int32 nLen = rStr.getLength();
xub_StrLen nStart[nMaxNumberParts]; sal_Int32 nStart[nMaxNumberParts];
xub_StrLen nEnd[nMaxNumberParts]; sal_Int32 nEnd[nMaxNumberParts];
sal_uInt16 nDP, nMP, nYP; sal_uInt16 nDP, nMP, nYP;
switch ( nColFormat ) switch ( nColFormat )
...@@ -1026,7 +1026,7 @@ static bool lcl_PutString( ...@@ -1026,7 +1026,7 @@ static bool lcl_PutString(
sal_uInt16 nFound = 0; sal_uInt16 nFound = 0;
bool bInNum = false; bool bInNum = false;
for ( xub_StrLen nPos=0; nPos<nLen && (bInNum || for ( sal_Int32 nPos=0; nPos<nLen && (bInNum ||
nFound<nMaxNumberParts); nPos++ ) nFound<nMaxNumberParts); nPos++ )
{ {
if (bInNum && nFound == 3 && nColFormat == SC_COL_YMD && if (bInNum && nFound == 3 && nColFormat == SC_COL_YMD &&
...@@ -1052,8 +1052,8 @@ static bool lcl_PutString( ...@@ -1052,8 +1052,8 @@ static bool lcl_PutString(
{ {
// try to break one number (without separators) into date fields // try to break one number (without separators) into date fields
xub_StrLen nDateStart = nStart[0]; sal_Int32 nDateStart = nStart[0];
xub_StrLen nDateLen = nEnd[0] + 1 - nDateStart; sal_Int32 nDateLen = nEnd[0] + 1 - nDateStart;
if ( nDateLen >= 5 && nDateLen <= 8 && if ( nDateLen >= 5 && nDateLen <= 8 &&
ScGlobal::pCharClass->isNumeric( rStr.copy( nDateStart, nDateLen ) ) ) ScGlobal::pCharClass->isNumeric( rStr.copy( nDateStart, nDateLen ) ) )
......
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