[Libreoffice-commits] core.git: sw/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Fri Mar 22 14:03:32 UTC 2019
sw/source/core/txtnode/fntcache.cxx | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
New commits:
commit bb4fcc3d968367d682d6da057083378e9d171a22
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Fri Mar 22 13:51:39 2019 +0100
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Mar 22 15:03:07 2019 +0100
Related: tdf#124109 sw: save one vcl layout call in SwFntObj::DrawText()
Commit 436b829f5b904d76039db0818cff5dedf1ae89f1 (sw: save one vcl layout
call in SwFntObj::DrawText(), 2018-08-16) did this unconditionally,
which broke kashida justification. Re-introduce the same mechanism, but
this time opt out in the kashida case to keep that working.
This means that for Latin scripts we are back to 2 layout calls (instead
of 3) for each keypress in Writer.
Change-Id: I890f0ab04d1f5dce561f1536d7c8a6d67a639813
Reviewed-on: https://gerrit.libreoffice.org/69557
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
Tested-by: Jenkins
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 07889531a4ed..e749bc2bdac4 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1492,6 +1492,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
long nSpaceAdd = rInf.GetSpace() / SPACING_PRECISION_FACTOR;
bool bNoHalfSpace = false;
+ bool bCacheLayout = true;
if ( rInf.GetFont() && rInf.GetLen() )
{
@@ -1534,7 +1535,12 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( pSI && pSI->CountKashida() &&
pSI->KashidaJustify( pKernArray.get(), pScrArray.get(), rInf.GetIdx(),
rInf.GetLen(), nSpaceAdd ) != -1 )
+ {
nSpaceAdd = 0;
+ // Layout can't be reused in this case, it would lead to missing gaps in
+ // place of kashida.
+ bCacheLayout = false;
+ }
else
bNoHalfSpace = true;
}
@@ -1815,8 +1821,12 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
? (rInf.GetIdx() ? 1 : 0)
: sal_Int32(rInf.GetIdx());
aGlyphsKey = SwTextGlyphsKey{ &rInf.GetOut(), *pStr, nTmpIdx, nLen };
+ if (bCacheLayout)
+ pGlyphs = lcl_CreateLayout(aGlyphsKey, m_aTextGlyphs[aGlyphsKey]);
+ else
+ pGlyphs = nullptr;
rInf.GetOut().DrawTextArray( aTextOriginPos, *pStr, pKernArray.get(),
- nTmpIdx , nLen );
+ nTmpIdx , nLen, SalLayoutFlags::NONE, pGlyphs );
if (bBullet)
{
rInf.GetOut().Push();
More information about the Libreoffice-commits
mailing list