Kaydet (Commit) ba587924 authored tarafından Michael Stahl's avatar Michael Stahl

sw: let's try without a SwHyphPortion copy ctor

It looks like it can be easily avoided.

Change-Id: Ied8a047871c431b809569e1bbf232ce769d498ec
üst 92a2445f
...@@ -296,8 +296,8 @@ bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess ) ...@@ -296,8 +296,8 @@ bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess )
else else
{ {
// second case: no alternative spelling // second case: no alternative spelling
SwHyphPortion aHyphPor; pHyphPor = new SwHyphPortion;
aHyphPor.SetLen( 1 ); pHyphPor->SetLen( 1 );
static const void* pLastMagicNo = 0; static const void* pLastMagicNo = 0;
static sal_uInt16 aMiniCacheH = 0, aMiniCacheW = 0; static sal_uInt16 aMiniCacheH = 0, aMiniCacheW = 0;
...@@ -306,15 +306,14 @@ bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess ) ...@@ -306,15 +306,14 @@ bool SwTxtPortion::CreateHyphen( SwTxtFormatInfo &rInf, SwTxtGuess &rGuess )
rInf.GetFont()->GetMagic( pTmpMagic, nFntIdx, rInf.GetFont()->GetActual() ); rInf.GetFont()->GetMagic( pTmpMagic, nFntIdx, rInf.GetFont()->GetActual() );
if( !pLastMagicNo || pLastMagicNo != pTmpMagic ) { if( !pLastMagicNo || pLastMagicNo != pTmpMagic ) {
pLastMagicNo = pTmpMagic; pLastMagicNo = pTmpMagic;
(SwPosSize&)aHyphPor = aHyphPor.GetTxtSize( rInf ); (SwPosSize&)(*pHyphPor) = pHyphPor->GetTxtSize( rInf );
aMiniCacheH = aHyphPor.Height(), aMiniCacheW = aHyphPor.Width(); aMiniCacheH = pHyphPor->Height();
aMiniCacheW = pHyphPor->Width();
} else { } else {
aHyphPor.Height( aMiniCacheH ), aHyphPor.Width( aMiniCacheW ); pHyphPor->Height( aMiniCacheH );
pHyphPor->Width( aMiniCacheW );
} }
aHyphPor.SetLen( 0 ); pHyphPor->SetLen( 0 );
pHyphPor = new SwHyphPortion( aHyphPor );
pHyphPor->SetWhichPor( POR_HYPH );
// values required for this // values required for this
nPorEnd = xHyphWord->getHyphenPos() + 1 + rGuess.BreakStart() nPorEnd = xHyphWord->getHyphenPos() + 1 + rGuess.BreakStart()
......
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