diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-12-15 12:42:04 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-12-17 09:35:23 +0000 |
commit | 7b028f4aaefe626edfa5283363e21146ceca4acf (patch) | |
tree | b9e1af5ed117c1108f9f3c0e3d550000d89a8cd5 /connectivity/source | |
parent | 243630f394d5a332a7b214970b1f9924650f0255 (diff) |
String::AllocBuffer -> OUStringBuffer
Change-Id: I66489516df4b363fd7ed61e90471efaeb1235333
Diffstat (limited to 'connectivity/source')
-rw-r--r-- | connectivity/source/drivers/flat/ETable.cxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 87e2d6679581..7982417f7be5 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -674,23 +674,20 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal case DataType::NUMERIC: { - String aStrConverted; + OUString aStrConverted; if ( DataType::INTEGER != nType ) { - sal_Unicode* pData = aStrConverted.AllocBuffer(aStr.Len()); - const sal_Unicode* pStart = pData; - OSL_ENSURE((cDecimalDelimiter && nType != DataType::INTEGER) || (!cDecimalDelimiter && nType == DataType::INTEGER), "FalscherTyp"); + OUStringBuffer aBuf(aStr.Len()); // convert to Standard-Notation (DecimalPOINT without thousands-comma): for (xub_StrLen j = 0; j < aStr.Len(); ++j) { const sal_Unicode cChar = aStr.GetChar(j); if (cDecimalDelimiter && cChar == cDecimalDelimiter) - *pData++ = '.'; - //aStrConverted.Append( '.' ); + aBuf.append('.'); else if ( cChar == '.' ) // special case, if decimal seperator isn't '.' we have to put the string after it continue; else if (cThousandDelimiter && cChar == cThousandDelimiter) @@ -698,10 +695,9 @@ sal_Bool OFlatTable::fetchRow(OValueRefRow& _rRow,const OSQLColumns & _rCols,sal // leave out } else - *pData++ = cChar; - //aStrConverted.Append(cChar); + aBuf.append(cChar); } // for (xub_StrLen j = 0; j < aStr.Len(); ++j) - aStrConverted.ReleaseBufferAccess(xub_StrLen(pData - pStart)); + aStrConverted = aBuf.makeStringAndClear(); } // if ( DataType::INTEGER != nType ) else { |