include/vcl/outdev.hxx     |    4 +++-
 vcl/source/outdev/text.cxx |   12 ++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

New commits:
commit 9aee1dd5c7a4799fa02f0f64e6f733029c47a21a
Author:     Miklos Vajna <vmik...@collabora.co.uk>
AuthorDate: Wed Aug 15 14:41:28 2018 +0200
Commit:     Miklos Vajna <vmik...@collabora.co.uk>
CommitDate: Wed Aug 15 18:59:14 2018 +0200

    vcl: allow using pre-calculated layout in OutputDevice::DrawTextArray()
    
    I plan to use this in SwFntObj::DrawText().
    
    Change-Id: Ic5e167d90a7e72452d8efa9fad06b8067675a225
    Reviewed-on: https://gerrit.libreoffice.org/59108
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk>

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 );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to