diff options
-rw-r--r-- | include/vcl/outdev.hxx | 4 | ||||
-rw-r--r-- | vcl/source/outdev/text.cxx | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index e414121d4dcd..471d9a39fa0e 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1149,7 +1149,9 @@ public: const long* pDXAry, sal_Int32 nIndex = 0, sal_Int32 nLen = -1, - SalLayoutFlags flags = SalLayoutFlags::NONE); + SalLayoutFlags flags = SalLayoutFlags::NONE, + vcl::TextLayoutCache const* = nullptr, + SalLayout* pLayoutCache = nullptr); long GetTextArray( const OUString& rStr, long* pDXAry, sal_Int32 nIndex = 0, sal_Int32 nLen = -1, vcl::TextLayoutCache const* = nullptr, diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx index fdcca1565731..659a9b6a82da 100644 --- a/vcl/source/outdev/text.cxx +++ b/vcl/source/outdev/text.cxx @@ -944,7 +944,9 @@ float OutputDevice::approximate_digit_width() const void OutputDevice::DrawTextArray( const Point& rStartPt, const OUString& rStr, const long* pDXAry, - sal_Int32 nIndex, sal_Int32 nLen, SalLayoutFlags flags ) + sal_Int32 nIndex, sal_Int32 nLen, SalLayoutFlags flags, + vcl::TextLayoutCache const*const pLayoutCache, + SalLayout* pSalLayoutCache ) { assert(!is_double_buffered_window()); @@ -964,7 +966,13 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const OUString& rStr, if( mbOutputClipped ) return; - std::unique_ptr<SalLayout> pSalLayout = ImplLayout(rStr, nIndex, nLen, rStartPt, 0, pDXAry, flags); + SalLayout* pSalLayout = pSalLayoutCache; + std::unique_ptr<SalLayout> pLayout; + if (!pSalLayout) + { + pLayout = ImplLayout(rStr, nIndex, nLen, rStartPt, 0, pDXAry, flags, pLayoutCache); + pSalLayout = pLayout.get(); + } if( pSalLayout ) { ImplDrawText( *pSalLayout ); |