From 4e631a099bf354fe306e2035878ecb90f50ca5d2 Mon Sep 17 00:00:00 2001 From: Arnaud Versini Date: Sun, 12 May 2013 17:01:01 +0200 Subject: Fixes fdo#64237 by modifying the underlyning string Change-Id: I7d387e40464b53a55524bf950b8d413cf8468376 Reviewed-on: https://gerrit.libreoffice.org/3870 Tested-by: Miklos Vajna Reviewed-by: Miklos Vajna --- sw/source/core/text/guess.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx index 637372fc35bb..03628da8dc90 100644 --- a/sw/source/core/text/guess.cxx +++ b/sw/source/core/text/guess.cxx @@ -275,7 +275,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf, aDebugString = rInf.GetTxt(); #endif - OUString rOldTxt = rInf.GetTxt(); + OUString& rOldTxt = const_cast (rInf.GetTxt()); rOldTxt = rOldTxt.replaceAt( rInf.GetIdx() - 1, 1, aTxt ); rInf.SetIdx( rInf.GetIdx() + nFieldDiff ); } @@ -487,9 +487,9 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf, "I've got field trouble, part2!" ); nCutPos = nCutPos - nFieldDiff; - XubString& rOldTxt = (XubString&)rInf.GetTxt(); - rOldTxt.Erase( nOldIdx - 1, nFieldDiff + 1 ); - rOldTxt.Insert( cFldChr, nOldIdx - 1 ); + OUString& rOldTxt = const_cast (rInf.GetTxt()); + OUString aReplacement( cFldChr ); + rOldTxt = rOldTxt.replaceAt( nOldIdx - 1, nFieldDiff + 1, aReplacement); rInf.SetIdx( nOldIdx ); #if OSL_DEBUG_LEVEL > 0 -- cgit v1.2.3