summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-11-24 18:20:41 -0600
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-11-27 22:59:28 -0600
commit621cdc7a446e500a6c1b7fd417199be34cdaf3da (patch)
treecd75c013ac4a3ab30c4aebecd80b4f678282aaa1 /svl
parenta8fe23a16082deb749b0ad8bfef93ef90ef9ce07 (diff)
migrate user of InsertBlanks to OUString
Change-Id: Idc7379daf25a226622e5599124df2ab68b98902a
Diffstat (limited to 'svl')
-rw-r--r--svl/inc/svl/zformat.hxx11
-rw-r--r--svl/source/numbers/zformat.cxx21
2 files changed, 12 insertions, 20 deletions
diff --git a/svl/inc/svl/zformat.hxx b/svl/inc/svl/zformat.hxx
index 8e9dd9523190..8958663626fd 100644
--- a/svl/inc/svl/zformat.hxx
+++ b/svl/inc/svl/zformat.hxx
@@ -386,7 +386,16 @@ public:
/** Insert the number of blanks into the string that is needed to simulate
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
the width of character c for underscore formats */
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 0e916586aaf3..15d98d0e7f64 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -84,23 +84,6 @@ static sal_uInt8 cCharWidths[ 128-32 ] = {
};
// 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 )
{
if( c >= 32 )
@@ -3294,7 +3277,7 @@ sal_Int32 SvNumberformat::ImpUseMonthCase( int & io_nState, const ImpSvNumFor& r
const sal_uInt16 nCount = rNumFor.GetCount();
for (sal_uInt16 i = 0; i < nCount && io_nState == 0; ++i)
{
- xub_StrLen nLen;
+ sal_Int32 nLen;
switch (rInfo.nTypeArray[i])
{
case NF_KEY_D :
@@ -3858,7 +3841,7 @@ bool SvNumberformat::ImpGetDateTimeOutput(double fNumber,
else
{
bInputLine = false;
- nCntPost = xub_StrLen(rInfo.nCntPost);
+ nCntPost = rInfo.nCntPost;
}
double fTime = (fNumber - floor( fNumber )) * 86400.0;
fTime = ::rtl::math::round( fTime, int(nCntPost) );