summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTamas Bunth <tamas.bunth@collabora.co.uk>2017-06-08 19:56:28 +0200
committerTamás Bunth <btomi96@gmail.com>2017-06-09 16:29:40 +0200
commitf0821f9a347c7752a3c741c3451a2f1630173720 (patch)
treecbc76e9d40d1490af1595556b2c6f877a90f3eb8 /include
parentGSoC: import VML shape adjustments (diff)
downloadcore-f0821f9a347c7752a3c741c3451a2f1630173720.tar.gz
core-f0821f9a347c7752a3c741c3451a2f1630173720.zip
Cache text layout of statusbar items
Extend lifecycle of SalLayout created by the output device. A layout is stored for each status bar item and used as a cache. The layout may be updated through output device method parameters. This way it's no longer necessary to calculate the layout again and again when painting the status bar item multiple times, provided that its text does not change. Change-Id: I6494c2d6b676e8f4fdda2cde6165ff0755fd4fa2 Reviewed-on: https://gerrit.libreoffice.org/38578 Reviewed-by: Tamás Bunth <btomi96@gmail.com> Tested-by: Tamás Bunth <btomi96@gmail.com>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/outdev.hxx9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index d6a7032f20dd..cf44ac9c3811 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -971,7 +971,8 @@ public:
void DrawText( const Point& rStartPt, const OUString& rStr,
sal_Int32 nIndex = 0, sal_Int32 nLen = -1,
- MetricVector* pVector = nullptr, OUString* pDisplayText = nullptr );
+ MetricVector* pVector = nullptr, OUString* pDisplayText = nullptr,
+ SalLayout** pLayoutCache = nullptr );
void DrawText( const tools::Rectangle& rRect,
const OUString& rStr, DrawTextFlags nStyle = DrawTextFlags::NONE,
@@ -1132,7 +1133,8 @@ public:
See also GetTextBoundRect() for more explanation + code examples.
*/
long GetTextWidth( const OUString& rStr, sal_Int32 nIndex = 0, sal_Int32 nLen = -1,
- vcl::TextLayoutCache const* = nullptr) const;
+ vcl::TextLayoutCache const* = nullptr,
+ SalLayout** pLayoutCache = nullptr) const;
/** Height where any character of the current font fits; in logic coordinates.
@@ -1148,7 +1150,8 @@ public:
SalLayoutFlags flags = SalLayoutFlags::NONE);
long GetTextArray( const OUString& rStr, long* pDXAry,
sal_Int32 nIndex = 0, sal_Int32 nLen = -1,
- vcl::TextLayoutCache const* = nullptr) const;
+ vcl::TextLayoutCache const* = nullptr,
+ SalLayout** pLayoutCache = nullptr) const;
bool GetCaretPositions( const OUString&, long* pCaretXArray,
sal_Int32 nIndex, sal_Int32 nLen ) const;