Kaydet (Commit) 950e84e4 authored tarafından Miklos Vajna's avatar Miklos Vajna

sw: nOffs is always 0 in SwFntObj::DrawText()

Since commit 95cb8d2c (Remove
FONT_TEST_DEBUG, COMING_SOON and some more dead code., 2011-01-24).

Change-Id: Iff4ad45f8e1550254ab237ea097b17ec3122766a
Reviewed-on: https://gerrit.libreoffice.org/59109Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins
üst 76532719
...@@ -1725,10 +1725,9 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) ...@@ -1725,10 +1725,9 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
} }
} }
sal_Int32 nOffs = 0;
sal_Int32 nLen = sal_Int32(rInf.GetLen()); sal_Int32 nLen = sal_Int32(rInf.GetLen());
if( nOffs < nLen ) if( nLen > 0 )
{ {
if ( bSwitchL2R ) if ( bSwitchL2R )
...@@ -1744,8 +1743,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) ...@@ -1744,8 +1743,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
sal_Int32 nTmpIdx = bBullet sal_Int32 nTmpIdx = bBullet
? (rInf.GetIdx() ? 1 : 0) ? (rInf.GetIdx() ? 1 : 0)
: sal_Int32(rInf.GetIdx()); : sal_Int32(rInf.GetIdx());
rInf.GetOut().DrawTextArray( aTextOriginPos, *pStr, pKernArray.get() + nOffs, rInf.GetOut().DrawTextArray( aTextOriginPos, *pStr, pKernArray.get(),
nTmpIdx + nOffs , nLen - nOffs ); nTmpIdx , nLen );
if (bBullet) if (bBullet)
{ {
rInf.GetOut().Push(); rInf.GetOut().Push();
...@@ -1782,8 +1781,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) ...@@ -1782,8 +1781,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
pKernArray [ i - 1 ] -= nAdd; pKernArray [ i - 1 ] -= nAdd;
} }
} }
rInf.GetOut().DrawTextArray( aTextOriginPos, aBulletOverlay, pKernArray.get() + nOffs, rInf.GetOut().DrawTextArray( aTextOriginPos, aBulletOverlay, pKernArray.get(),
nTmpIdx + nOffs , nLen - nOffs ); nTmpIdx , nLen );
pTmpFont->SetColor( aPreviousColor ); pTmpFont->SetColor( aPreviousColor );
pTmpFont->SetUnderline(aPreviousUnderline); pTmpFont->SetUnderline(aPreviousUnderline);
......
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