summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-10-26 09:25:34 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-11-03 20:24:27 -0500
commit6702bc37d4bc28ec45c6c25f6a953997f6999270 (patch)
treef0f1ed58a15a494ae7c0e9706fcbfcb94024e6a0 /basic
parent8ce4050497566182a0d9620e85cb28b5b13df67d (diff)
basic: convert StepPAD to OUString
Change-Id: I19d05f455767c973a47d0233b3af20af1ac3a20a
Diffstat (limited to 'basic')
-rw-r--r--basic/source/runtime/step1.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx
index b5dbc3310084..483d912107be 100644
--- a/basic/source/runtime/step1.cxx
+++ b/basic/source/runtime/step1.cxx
@@ -144,15 +144,19 @@ void SbiRuntime::StepARGTYP( sal_uInt32 nOp1 )
void SbiRuntime::StepPAD( sal_uInt32 nOp1 )
{
SbxVariable* p = GetTOS();
- String& s = (String&)(const String&) *p;
- if (s.Len() != nOp1)
+ OUString s = p->GetOUString();
+ sal_Int32 nLen(nOp1);
+ if( s.getLength() != nLen )
{
rtl::OUStringBuffer aBuf(s);
- sal_Int32 nLen(nOp1);
if (aBuf.getLength() > nLen)
+ {
comphelper::string::truncateToLength(aBuf, nLen);
+ }
else
+ {
comphelper::string::padToLength(aBuf, nLen, ' ');
+ }
s = aBuf.makeStringAndClear();
}
}