diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-03-14 16:03:03 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2022-03-15 14:36:14 +0100 |
commit | 47fe67de351dd4adbfe69247e0506d0766991813 (patch) | |
tree | 5044917ec38ac2d87b870ff6a135969e5203113e | |
parent | b2f0da51e36ae65d304881967605700ecee59575 (diff) |
use CreateTextLayoutCache() in PDF export (tdf#116400)
This seems to have a pretty good hit rate, avoiding most of the cost.
Change-Id: Iccaf310acb796d4bc2056fabc24fa27a3631ab18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131557
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 6477163c1b78..fc15be2be7bb 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -6499,7 +6499,9 @@ void PDFWriterImpl::drawText( const Point& rPos, const OUString& rText, sal_Int3 // get a layout from the OutputDevice's SalGraphics // this also enforces font substitution and sets the font on SalGraphics - std::unique_ptr<SalLayout> pLayout = ImplLayout( rText, nIndex, nLen, rPos ); + std::shared_ptr<const vcl::text::TextLayoutCache> layoutCache = CreateTextLayoutCache(rText); + std::unique_ptr<SalLayout> pLayout = ImplLayout( rText, nIndex, nLen, rPos, + 0, {}, SalLayoutFlags::NONE, layoutCache.get() ); if( pLayout ) { drawLayout( *pLayout, rText, bTextLines ); @@ -6514,7 +6516,9 @@ void PDFWriterImpl::drawTextArray( const Point& rPos, const OUString& rText, o3t // get a layout from the OutputDevice's SalGraphics // this also enforces font substitution and sets the font on SalGraphics - std::unique_ptr<SalLayout> pLayout = ImplLayout( rText, nIndex, nLen, rPos, 0, pDXArray ); + std::shared_ptr<const vcl::text::TextLayoutCache> layoutCache = CreateTextLayoutCache(rText); + std::unique_ptr<SalLayout> pLayout = ImplLayout( rText, nIndex, nLen, rPos, 0, pDXArray, + SalLayoutFlags::NONE, layoutCache.get() ); if( pLayout ) { drawLayout( *pLayout, rText, true ); @@ -6529,7 +6533,9 @@ void PDFWriterImpl::drawStretchText( const Point& rPos, sal_uLong nWidth, const // get a layout from the OutputDevice's SalGraphics // this also enforces font substitution and sets the font on SalGraphics - std::unique_ptr<SalLayout> pLayout = ImplLayout( rText, nIndex, nLen, rPos, nWidth ); + std::shared_ptr<const vcl::text::TextLayoutCache> layoutCache = CreateTextLayoutCache(rText); + std::unique_ptr<SalLayout> pLayout = ImplLayout( rText, nIndex, nLen, rPos, nWidth, + {}, SalLayoutFlags::NONE, layoutCache.get() ); if( pLayout ) { drawLayout( *pLayout, rText, true ); |