Kaydet (Commit) 1fd31676 authored tarafından Miklos Vajna's avatar Miklos Vajna

fdo#63680 SwTxtCursor::GetCrsrOfst: don't pass reference to a temporary

This was a situation similar to
d0d295af. 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
üst d0d295af
...@@ -489,8 +489,8 @@ sal_Bool SwTxtCursor::GetEndCharRect( SwRect* pOrig, const xub_StrLen nOfst, ...@@ -489,8 +489,8 @@ sal_Bool SwTxtCursor::GetEndCharRect( SwRect* pOrig, const xub_StrLen nOfst,
void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst, void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
SwCrsrMoveState* pCMS ) SwCrsrMoveState* pCMS )
{ {
const XubString &rText = GetInfo().GetTxt(); const OUString aText = GetInfo().GetTxt();
SwTxtSizeInfo aInf( GetInfo(), rText, nStart ); SwTxtSizeInfo aInf( GetInfo(), aText, nStart );
if( GetPropFont() ) if( GetPropFont() )
aInf.GetFont()->SetProportion( GetPropFont() ); aInf.GetFont()->SetProportion( GetPropFont() );
KSHORT nTmpAscent, nTmpHeight; // Zeilenhoehe KSHORT nTmpAscent, nTmpHeight; // Zeilenhoehe
...@@ -1593,8 +1593,8 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint, ...@@ -1593,8 +1593,8 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
else else
nOldProp = 0; nOldProp = 0;
{ {
OUString rTextStr = rText; OUString aText = rText;
SwTxtSizeInfo aSizeInf( GetInfo(), rTextStr, nCurrStart ); SwTxtSizeInfo aSizeInf( GetInfo(), aText, nCurrStart );
((SwTxtCursor*)this)->SeekAndChg( aSizeInf ); ((SwTxtCursor*)this)->SeekAndChg( aSizeInf );
SwTxtSlot aDiffTxt( &aSizeInf, ((SwTxtPortion*)pPor), false, false ); SwTxtSlot aDiffTxt( &aSizeInf, ((SwTxtPortion*)pPor), false, false );
SwFontSave aSave( aSizeInf, pPor->IsDropPortion() ? SwFontSave aSave( aSizeInf, pPor->IsDropPortion() ?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment