summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-03-16 15:04:08 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-03-17 22:49:33 +0100
commit7439cabc643de2f07c18adc35056f802997f484a (patch)
tree1fb8f6bd207a81936617263091dca32d3536f1d6 /svtools
parent9d02d86e8a9111b7a689062eb9a856146a9e80b1 (diff)
make SalLayoutGlyphs work with MultiSalLayout
Code that needs to lay out texts repeatedly can cache the result of SalLayout::GetGlyphs() can reuse it. But GetGlyphs() returns nullptr for MultiSalLayout, so caching for it doesn't work. Worse still, it actually increases the number of layout calls, because there's the initial layout for caching and then each call will need to do the layout again because of the nullptr that's not cached. This commit changes SalLayoutGlyphs to possibly include multiple SalLayoutGlyphsImpl objects, one for each SalLayout handled by MultiSalLayout. Changes include making GenericSalLayout work directly with the Impl class, which avoids an indirection and simplifies code. Change-Id: Ic4b19934a8a06d4955b51527fe3777c5e91107b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112590 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/control/ruler.cxx6
1 files changed, 1 insertions, 5 deletions
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
index 1f4a5d4eafac..2551dc39581d 100644
--- a/svtools/source/control/ruler.cxx
+++ b/svtools/source/control/ruler.cxx
@@ -84,12 +84,8 @@ SalLayoutGlyphs* lcl_GetRulerTextGlyphs(const vcl::RenderContext& rRenderContext
if (!pLayout)
return nullptr;
- const SalLayoutGlyphs* pGlyphs = pLayout->GetGlyphs();
- if (!pGlyphs)
- return nullptr;
-
// Remember the calculation result.
- rTextGlyphs = *pGlyphs;
+ rTextGlyphs = pLayout->GetGlyphs();
return &rTextGlyphs;
}