From e27a0ec89f6d13be0ddf4d68b844a78f939f7bf9 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 20 Sep 2016 11:19:32 +0200 Subject: [PATCH] Related cid#1371289: Improve code to not depend on missing move assignment Change-Id: Id254fa76cafe33a36646d517d224ba6a05406c09 --- basic/source/runtime/runtime.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 1fba86622b5b..6082437db846 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -2019,18 +2019,19 @@ void SbiRuntime::StepLSET() sal_Int32 nVarStrLen = aRefVarString.getLength(); sal_Int32 nValStrLen = aRefValString.getLength(); - OUStringBuffer aNewStr; + OUString aNewStr; if( nVarStrLen > nValStrLen ) { - aNewStr.append(aRefValString); - comphelper::string::padToLength(aNewStr, nVarStrLen, ' '); + OUStringBuffer buf(aRefValString); + comphelper::string::padToLength(buf, nVarStrLen, ' '); + aNewStr = buf.makeStringAndClear(); } else { aNewStr = aRefValString.copy( 0, nVarStrLen ); } - refVar->PutString(aNewStr.makeStringAndClear()); + refVar->PutString(aNewStr); refVar->SetFlags( n ); } }