From 6702bc37d4bc28ec45c6c25f6a953997f6999270 Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Fri, 26 Oct 2012 09:25:34 +0200 Subject: basic: convert StepPAD to OUString Change-Id: I19d05f455767c973a47d0233b3af20af1ac3a20a --- basic/source/runtime/step1.cxx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'basic') 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(); } } -- cgit