diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-17 12:54:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-12-17 13:50:59 +0100 |
commit | 11c0effe3def917ec2002a30dbbcca1c5758ffa9 (patch) | |
tree | 8fa595f66e0b77b228166b271b220bcd8151b342 /vcl/source/outdev | |
parent | 7b9e75da2e057fe5b551bf7294814d1744fe653f (diff) |
tdf#112989 reduce export to PDF time
reduces the time from 33s to 24s for me
Change-Id: Ia70e1c4220ebedf0b686ed76c5704efa551591fe
Reviewed-on: https://gerrit.libreoffice.org/85281
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/outdev')
-rw-r--r-- | vcl/source/outdev/text.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index 26d7e38f318c..8de7cece1bbb 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -48,6 +48,7 @@ #include <textlayout.hxx> #include <textlineinfo.hxx> #include <impglyphitem.hxx> +#include <boost/optional.hpp> #define TEXT_DRAW_ELLIPSIS (DrawTextFlags::EndEllipsis | DrawTextFlags::PathEllipsis | DrawTextFlags::NewsEllipsis) @@ -1190,7 +1191,7 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr, const sal_Unicode* pBase = rStr.getStr(); const sal_Unicode* pStr = pBase + nMinIndex; const sal_Unicode* pEnd = pBase + nEndIndex; - OUStringBuffer sTmpStr(rStr); + boost::optional<OUStringBuffer> xTmpStr; for( ; pStr < pEnd; ++pStr ) { // TODO: are there non-digit localizations? @@ -1199,11 +1200,16 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr, // translate characters to local preference sal_UCS4 cChar = GetLocalizedChar( *pStr, meTextLanguage ); if( cChar != *pStr ) + { + if (!xTmpStr) + xTmpStr = OUStringBuffer(rStr); // TODO: are the localized digit surrogates? - sTmpStr[pStr - pBase] = cChar; + (*xTmpStr)[pStr - pBase] = cChar; + } } } - rStr = sTmpStr.makeStringAndClear(); + if (xTmpStr) + rStr = (*xTmpStr).makeStringAndClear(); } // right align for RTL text, DRAWPOS_REVERSED, RTL window style |