diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-10-07 10:09:56 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-10-07 13:24:01 +0000 |
commit | ae625675a88db46d378cc29f6513bbb4fa6e62a7 (patch) | |
tree | 0c91981c8e7726a79b3f911b86e30ca7475e1974 /vcl/inc | |
parent | 9bb6863fcf0784c70a95510b488f0162fe6deb37 (diff) |
afl-eventtesting: creating OUString from super long sal_Unicode* is slow
the mpStr and mnLength arguments are always created from an OUString
and the OUString aRun(rArgs.mpStr); creates a duplicate of the original
string. Its way faster to pass the original OUString around instead.
Change-Id: I3de0cc31654eb215362548b6aee435f9c0c3c9db
Reviewed-on: https://gerrit.libreoffice.org/19221
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/graphite_serverfont.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/sallayout.hxx | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/vcl/inc/graphite_serverfont.hxx b/vcl/inc/graphite_serverfont.hxx index ec002a55b771..63dc900d1024 100644 --- a/vcl/inc/graphite_serverfont.hxx +++ b/vcl/inc/graphite_serverfont.hxx @@ -53,13 +53,11 @@ private: // mutable so that the DrawOffset/DrawBase can be set mutable GraphiteLayoutImpl maImpl; grutils::GrFeatureParser * mpFeatures; - const sal_Unicode * mpStr; public: GraphiteServerFontLayout(ServerFont& pServerFont) throw(); virtual bool LayoutText( ImplLayoutArgs& rArgs) SAL_OVERRIDE { - mpStr = rArgs.mpStr; SalLayout::AdjustLayout(rArgs); return maImpl.LayoutText(rArgs); }; // first step of layout diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index 9a33c12430b2..46a3a9e521ad 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -75,10 +75,9 @@ public: // string related inputs LanguageTag maLanguageTag; SalLayoutFlags mnFlags; - int mnLength; + const OUString& mrStr; int mnMinCharPos; int mnEndCharPos; - const sal_Unicode* mpStr; // performance hack vcl::TextLayoutCache const* m_pTextLayoutCache; @@ -93,7 +92,7 @@ public: ImplLayoutRuns maFallbackRuns; public: - ImplLayoutArgs( const sal_Unicode* pStr, int nLength, + ImplLayoutArgs( const OUString& rStr, int nMinCharPos, int nEndCharPos, SalLayoutFlags nFlags, const LanguageTag& rLanguageTag, vcl::TextLayoutCache const* pLayoutCache); @@ -339,7 +338,7 @@ public: void ApplyDXArray( ImplLayoutArgs& ); void Justify( DeviceCoordinate nNewWidth ); void KashidaJustify( long nIndex, int nWidth ); - void ApplyAsianKerning( const sal_Unicode*, int nLength ); + void ApplyAsianKerning(const OUString& rStr); void SortGlyphItems(); // used by upper layers |