Kaydet (Commit) 7b028f4a authored tarafından Caolán McNamara's avatar Caolán McNamara

String::AllocBuffer -> OUStringBuffer

Change-Id: I66489516df4b363fd7ed61e90471efaeb1235333
üst 243630f3
...@@ -674,23 +674,20 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal ...@@ -674,23 +674,20 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
case DataType::NUMERIC: case DataType::NUMERIC:
{ {
String aStrConverted; OUString aStrConverted;
if ( DataType::INTEGER != nType ) if ( DataType::INTEGER != nType )
{ {
sal_Unicode* pData = aStrConverted.AllocBuffer(aStr.Len());
const sal_Unicode* pStart = pData;
OSL_ENSURE((cDecimalDelimiter && nType != DataType::INTEGER) || OSL_ENSURE((cDecimalDelimiter && nType != DataType::INTEGER) ||
(!cDecimalDelimiter && nType == DataType::INTEGER), (!cDecimalDelimiter && nType == DataType::INTEGER),
"FalscherTyp"); "FalscherTyp");
OUStringBuffer aBuf(aStr.Len());
// convert to Standard-Notation (DecimalPOINT without thousands-comma): // convert to Standard-Notation (DecimalPOINT without thousands-comma):
for (xub_StrLen j = 0; j < aStr.Len(); ++j) for (xub_StrLen j = 0; j < aStr.Len(); ++j)
{ {
const sal_Unicode cChar = aStr.GetChar(j); const sal_Unicode cChar = aStr.GetChar(j);
if (cDecimalDelimiter && cChar == cDecimalDelimiter) if (cDecimalDelimiter && cChar == cDecimalDelimiter)
*pData++ = '.'; aBuf.append('.');
//aStrConverted.Append( '.' );
else if ( cChar == '.' ) // special case, if decimal seperator isn't '.' we have to put the string after it else if ( cChar == '.' ) // special case, if decimal seperator isn't '.' we have to put the string after it
continue; continue;
else if (cThousandDelimiter && cChar == cThousandDelimiter) else if (cThousandDelimiter && cChar == cThousandDelimiter)
...@@ -698,10 +695,9 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal ...@@ -698,10 +695,9 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal
// leave out // leave out
} }
else else
*pData++ = cChar; aBuf.append(cChar);
//aStrConverted.Append(cChar);
} // for (xub_StrLen j = 0; j < aStr.Len(); ++j) } // for (xub_StrLen j = 0; j < aStr.Len(); ++j)
aStrConverted.ReleaseBufferAccess(xub_StrLen(pData - pStart)); aStrConverted = aBuf.makeStringAndClear();
} // if ( DataType::INTEGER != nType ) } // if ( DataType::INTEGER != nType )
else else
{ {
......
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