[Libreoffice-commits] core.git: sw/source

Arnaud Versini arnaud.versini at gmail.com
Mon May 13 00:45:11 PDT 2013


 sw/source/core/text/guess.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 4e631a099bf354fe306e2035878ecb90f50ca5d2
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date:   Sun May 12 17:01:01 2013 +0200

    Fixes fdo#64237 by modifying the underlyning string
    
    Change-Id: I7d387e40464b53a55524bf950b8d413cf8468376
    Reviewed-on: https://gerrit.libreoffice.org/3870
    Tested-by: Miklos Vajna <vmiklos at suse.cz>
    Reviewed-by: Miklos Vajna <vmiklos at suse.cz>

diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 637372f..03628da 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<OUString&> (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<OUString&> (rInf.GetTxt());
+            OUString aReplacement( cFldChr );
+            rOldTxt = rOldTxt.replaceAt( nOldIdx - 1, nFieldDiff + 1, aReplacement);
             rInf.SetIdx( nOldIdx );
 
 #if OSL_DEBUG_LEVEL > 0


More information about the Libreoffice-commits mailing list