Kaydet (Commit) 621cdc7a authored tarafından Norbert Thiebaud's avatar Norbert Thiebaud

migrate user of InsertBlanks to OUString

Change-Id: Idc7379daf25a226622e5599124df2ab68b98902a
üst a8fe23a1
...@@ -386,7 +386,16 @@ public: ...@@ -386,7 +386,16 @@ public:
/** Insert the number of blanks into the string that is needed to simulate /** Insert the number of blanks into the string that is needed to simulate
the width of character c for underscore formats */ the width of character c for underscore formats */
static xub_StrLen InsertBlanks( String& r, xub_StrLen nPos, sal_Unicode c ); static sal_Int32 InsertBlanks( OUString& r, sal_Int32 nPos, sal_Unicode c )
{
sal_Int32 result;
OUStringBuffer sBuff(r);
result = InsertBlanks(sBuff, nPos, c);
r = sBuff.makeStringAndClear();
return result;
}
/** Insert the number of blanks into the string that is needed to simulate /** Insert the number of blanks into the string that is needed to simulate
the width of character c for underscore formats */ the width of character c for underscore formats */
......
...@@ -84,23 +84,6 @@ static sal_uInt8 cCharWidths[ 128-32 ] = { ...@@ -84,23 +84,6 @@ static sal_uInt8 cCharWidths[ 128-32 ] = {
}; };
// static // static
xub_StrLen SvNumberformat::InsertBlanks( String& r, xub_StrLen nPos, sal_Unicode c )
{
if( c >= 32 )
{
sal_uInt16 n = 2; // Default fuer Zeichen > 128 (HACK!)
if( c <= 127 )
{
n = cCharWidths[ c - 32 ];
}
while( n-- )
{
r.Insert( ' ', nPos++ );
}
}
return nPos;
}
sal_Int32 SvNumberformat::InsertBlanks( OUStringBuffer& r, sal_Int32 nPos, sal_Unicode c ) sal_Int32 SvNumberformat::InsertBlanks( OUStringBuffer& r, sal_Int32 nPos, sal_Unicode c )
{ {
if( c >= 32 ) if( c >= 32 )
...@@ -3294,7 +3277,7 @@ sal_Int32 SvNumberformat::ImpUseMonthCase( int & io_nState, const ImpSvNumFor& r ...@@ -3294,7 +3277,7 @@ sal_Int32 SvNumberformat::ImpUseMonthCase( int & io_nState, const ImpSvNumFor& r
const sal_uInt16 nCount = rNumFor.GetCount(); const sal_uInt16 nCount = rNumFor.GetCount();
for (sal_uInt16 i = 0; i < nCount && io_nState == 0; ++i) for (sal_uInt16 i = 0; i < nCount && io_nState == 0; ++i)
{ {
xub_StrLen nLen; sal_Int32 nLen;
switch (rInfo.nTypeArray[i]) switch (rInfo.nTypeArray[i])
{ {
case NF_KEY_D : case NF_KEY_D :
...@@ -3858,7 +3841,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber, ...@@ -3858,7 +3841,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
else else
{ {
bInputLine = false; bInputLine = false;
nCntPost = xub_StrLen(rInfo.nCntPost); nCntPost = rInfo.nCntPost;
} }
double fTime = (fNumber - floor( fNumber )) * 86400.0; double fTime = (fNumber - floor( fNumber )) * 86400.0;
fTime = ::rtl::math::round( fTime, int(nCntPost) ); fTime = ::rtl::math::round( fTime, int(nCntPost) );
......
...@@ -1261,12 +1261,15 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt ...@@ -1261,12 +1261,15 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
{ {
// text (literal or underscore) within the integer part of a number:number element // text (literal or underscore) within the integer part of a number:number element
String aEmbeddedStr; OUString aEmbeddedStr;
if ( nElemType == NF_SYMBOLTYPE_STRING || nElemType == NF_SYMBOLTYPE_PERCENT ) if ( nElemType == NF_SYMBOLTYPE_STRING || nElemType == NF_SYMBOLTYPE_PERCENT )
{
aEmbeddedStr = *pElemStr; aEmbeddedStr = *pElemStr;
}
else else
{
SvNumberformat::InsertBlanks( aEmbeddedStr, 0, (*pElemStr)[1] ); SvNumberformat::InsertBlanks( aEmbeddedStr, 0, (*pElemStr)[1] );
}
sal_Int32 nEmbedPos = nIntegerSymbols - nDigitsPassed; sal_Int32 nEmbedPos = nIntegerSymbols - nDigitsPassed;
SvXMLEmbeddedTextEntry* pObj = new SvXMLEmbeddedTextEntry( nPos, nEmbedPos, aEmbeddedStr ); SvXMLEmbeddedTextEntry* pObj = new SvXMLEmbeddedTextEntry( nPos, nEmbedPos, aEmbeddedStr );
...@@ -1334,7 +1337,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt ...@@ -1334,7 +1337,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
// turn "_x" into the number of spaces used for x in InsertBlanks in the NumberFormat // turn "_x" into the number of spaces used for x in InsertBlanks in the NumberFormat
// (#i20396# the spaces may also be in embedded-text elements) // (#i20396# the spaces may also be in embedded-text elements)
String aBlanks; OUString aBlanks;
SvNumberformat::InsertBlanks( aBlanks, 0, (*pElemStr)[1] ); SvNumberformat::InsertBlanks( aBlanks, 0, (*pElemStr)[1] );
AddToTextElement_Impl( aBlanks ); AddToTextElement_Impl( aBlanks );
} }
......
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