summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-09-07 10:43:10 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-09-07 16:02:49 +0200
commit2a73c9e04ba9379c0561a7e8d531b5633c46ec52 (patch)
treef20c1d7e42bd1117c86c17b620cc90ff7f2f0f7f /sw
parent2aaf5a73dac9f1dc137fba1e5f8536ef9f67ed89 (diff)
sw: less vcl text layout calls in SwFont::GetTextBreak()
Number of GenericSalLayout::LayoutText() calls during "dt<F3>" in Writer: 105 -> 89. Change-Id: I0f2bb241536209cfccc1d78bed6f54bf5c31e627 Reviewed-on: https://gerrit.libreoffice.org/60133 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/inc/fntcache.hxx1
-rw-r--r--sw/source/core/txtnode/fntcache.cxx9
2 files changed, 9 insertions, 1 deletions
diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx
index ee8a1d2971f7..a7400f03d0d1 100644
--- a/sw/source/core/inc/fntcache.hxx
+++ b/sw/source/core/inc/fntcache.hxx
@@ -122,6 +122,7 @@ public:
sal_uInt16 GetZoom() const { return m_nZoom; }
sal_uInt16 GetPropWidth() const { return m_nPropWidth; }
bool IsSymbol() const { return m_bSymbol; }
+ std::map<SwTextGlyphsKey, SalLayoutGlyphs>& GetTextGlyphs() { return m_aTextGlyphs; }
void DrawText( SwDrawTextInfo &rInf );
/// determine the TextSize (of the printer)
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index e893e43d1f8e..5f294fe6c7ca 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2483,10 +2483,17 @@ TextFrameIndex SwFont::GetTextBreak(SwDrawTextInfo const & rInf, long nTextWidth
*rInf.GetHyphPos() = TextFrameIndex((nHyphPos == -1) ? COMPLETE_STRING : nHyphPos);
}
else
+ {
+ SwFntAccess aFntAccess(m_aSub[m_nActual].m_nFontCacheId, m_aSub[m_nActual].m_nFontIndex,
+ &m_aSub[m_nActual], rInf.GetShell());
+ SwTextGlyphsKey aGlyphsKey{ &rInf.GetOut(), *pTmpText, nTmpIdx, nTmpLen };
+ SalLayoutGlyphs* pGlyphs
+ = lcl_CreateLayout(aGlyphsKey, aFntAccess.Get()->GetTextGlyphs()[aGlyphsKey]);
nTextBreak = TextFrameIndex(rInf.GetOut().GetTextBreak(
*pTmpText, nTextWidth,
sal_Int32(nTmpIdx), sal_Int32(nTmpLen),
- nKern, rInf.GetVclCache()));
+ nKern, rInf.GetVclCache(), pGlyphs));
+ }
if (bTextReplaced && sal_Int32(nTextBreak) != -1)
{