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

Miklos Vajna vmiklos at suse.cz
Sun Apr 28 07:25:53 PDT 2013


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

New commits:
commit 1fd3167695aaebb050df53acd91f2e1625e8305a
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Sun Apr 28 16:12:19 2013 +0200

    fdo#63680 SwTxtCursor::GetCrsrOfst: don't pass reference to a temporary
    
    This was a situation similar to
    d0d295af530e7dc1379a878ba5854e28eae250ad. Unfortunately just changing
    SwTxtSizeInfo's pTxt to an OUString copy doesn't work, as we still have
    code that relies on that being a pointer only.
    
    Change-Id: I202d7e6f5bd3005fc50551aa7195b419994ca3e8

diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index d567e76..bb1d08b 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -489,8 +489,8 @@ sal_Bool SwTxtCursor::GetEndCharRect( SwRect* pOrig, const xub_StrLen nOfst,
 void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
     SwCrsrMoveState* pCMS )
 {
-    const XubString &rText = GetInfo().GetTxt();
-    SwTxtSizeInfo aInf( GetInfo(), rText, nStart );
+    const OUString aText = GetInfo().GetTxt();
+    SwTxtSizeInfo aInf( GetInfo(), aText, nStart );
     if( GetPropFont() )
         aInf.GetFont()->SetProportion( GetPropFont() );
     KSHORT nTmpAscent, nTmpHeight;  // Zeilenhoehe
@@ -1593,8 +1593,8 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
             else
                 nOldProp = 0;
             {
-                OUString rTextStr = rText;
-                SwTxtSizeInfo aSizeInf( GetInfo(), rTextStr, nCurrStart );
+                OUString aText = rText;
+                SwTxtSizeInfo aSizeInf( GetInfo(), aText, nCurrStart );
                 ((SwTxtCursor*)this)->SeekAndChg( aSizeInf );
                 SwTxtSlot aDiffTxt( &aSizeInf, ((SwTxtPortion*)pPor), false, false );
                 SwFontSave aSave( aSizeInf, pPor->IsDropPortion() ?


More information about the Libreoffice-commits mailing list