From 70bfdd828b01e9db0713b87645ffe39f3dc21c7e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 28 Jul 2018 18:01:57 +0200 Subject: loplugin:stringloop in sfx2..svx Change-Id: Ie4ca2421f00259f974b6d94f883adfa11600b1fe Reviewed-on: https://gerrit.libreoffice.org/58251 Tested-by: Jenkins Reviewed-by: Noel Grandin --- starmath/source/mathtype.cxx | 18 +++++++++--------- starmath/source/mathtype.hxx | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'starmath') diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index 611ea68d3019..af59301b8f80 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -2759,28 +2759,28 @@ void MathType::HandleEmblishments() case 0x05: if (!nPostSup) { - sPost += " sup {}"; + sPost.append(" sup {}"); nPostSup = sPost.getLength(); } - sPost = sPost.replaceAt(nPostSup-1,0," ' "); + sPost.insert(nPostSup-1," ' "); nPostSup += 3; break; case 0x06: if (!nPostSup) { - sPost += " sup {}"; + sPost.append(" sup {}"); nPostSup = sPost.getLength(); } - sPost = sPost.replaceAt(nPostSup-1,0," '' "); + sPost.insert(nPostSup-1," '' "); nPostSup += 4; break; case 0x07: if (!nPostlSup) { - sPost += " lsup {}"; + sPost.append(" lsup {}"); nPostlSup = sPost.getLength(); } - sPost = sPost.replaceAt(nPostlSup-1,0," ' "); + sPost.insert(nPostlSup-1," ' "); nPostlSup += 3; break; case 0x08: @@ -2801,10 +2801,10 @@ void MathType::HandleEmblishments() case 0x12: if (!nPostSup) { - sPost += " sup {}"; + sPost.append(" sup {}"); nPostSup = sPost.getLength(); } - sPost = sPost.replaceAt(nPostSup-1,0," ''' "); + sPost.insert(nPostSup-1," ''' "); nPostSup += 5; break; case 0x14: @@ -2882,7 +2882,7 @@ bool MathType::HandleChar(sal_Int32 &rTextStart, int &rSetSize, int nLevel, //follows the char and nPostSup and nPostlSup are the //indexes at which this class of emblishment is //collated together - sPost.clear(); + sPost = ""; nPostSup = nPostlSup = 0; int nOriglen=rRet.getLength()-rTextStart; rRet.append(" {"); // #i24340# make what would be "vec {A}_n" become "{vec {A}}_n" diff --git a/starmath/source/mathtype.hxx b/starmath/source/mathtype.hxx index f69ebccf7b19..1e3a744d7789 100644 --- a/starmath/source/mathtype.hxx +++ b/starmath/source/mathtype.hxx @@ -165,7 +165,7 @@ private: sal_Int16 nLastSize; sal_uInt8 nSpec; bool bIsReInterpBrace; - OUString sPost; + OUStringBuffer sPost; sal_Int32 nPostSup; sal_Int32 nPostlSup; sal_uInt8 nTypeFace; -- cgit v1.2.3