vcl/source/outdev/text.cxx | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
New commits: commit e73abe51aef8c0f1ff4fdbc370c714c20cf15db6 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Dec 17 12:54:56 2019 +0200 Commit: Thorsten Behrens <thorsten.behr...@cib.de> CommitDate: Wed Dec 18 01:03:24 2019 +0100 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.gran...@collabora.co.uk> (cherry picked from commit 11c0effe3def917ec2002a30dbbcca1c5758ffa9) Reviewed-on: https://gerrit.libreoffice.org/85302 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> (cherry picked from commit 580f2b93a9c754743341e5e2f40084bceb8a1680) diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index fb3092739ffc..69919d2cac5f 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) @@ -1189,7 +1190,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? @@ -1198,11 +1199,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 _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits