summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vcl/inc/sallayout.hxx2
-rw-r--r--vcl/quartz/ctlayout.cxx2
-rw-r--r--vcl/source/gdi/sallayout.cxx6
-rw-r--r--vcl/unx/generic/gdi/cairotextrender.cxx2
-rw-r--r--vcl/win/gdi/winlayout.cxx2
5 files changed, 11 insertions, 3 deletions
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index 1050943c2e77..364bd488a97f 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -201,6 +201,8 @@ public:
virtual std::shared_ptr<vcl::TextLayoutCache>
CreateTextLayoutCache(OUString const&) const;
+ static bool UseCommonLayout();
+
protected:
// used by layout engines
SalLayout();
diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 4c841d43d545..c327991c58fb 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -782,7 +782,7 @@ void CTLayout::Simplify( bool /*bIsBase*/ ) {}
SalLayout* CoreTextStyle::GetTextLayout() const
{
- if (getenv("SAL_USE_COMMON_LAYOUT"))
+ if (SalLayout::UseCommonLayout())
return new CommonSalLayout(*this);
else
return new CTLayout( this);
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 8aaefbfdb4ee..b865ff917a6e 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -768,6 +768,12 @@ bool SalLayout::IsSpacingGlyph( sal_GlyphId nGlyph )
return bRet;
}
+bool SalLayout::UseCommonLayout()
+{
+ static bool bUse = getenv("SAL_USE_COMMON_LAYOUT") != nullptr;
+ return bUse;
+}
+
GenericSalLayout::GenericSalLayout()
{}
diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx
index 46b9326df858..35d086d20292 100644
--- a/vcl/unx/generic/gdi/cairotextrender.cxx
+++ b/vcl/unx/generic/gdi/cairotextrender.cxx
@@ -532,7 +532,7 @@ SalLayout* CairoTextRender::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackL
if( mpServerFont[ nFallbackLevel ]
&& !(rArgs.mnFlags & SalLayoutFlags::DisableGlyphProcessing) )
{
- if (getenv("SAL_USE_COMMON_LAYOUT"))
+ if (SalLayout::UseCommonLayout())
{
pLayout = new CommonSalLayout(*mpServerFont[nFallbackLevel]);
}
diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx
index b036307b8a5a..9b78a72601b6 100644
--- a/vcl/win/gdi/winlayout.cxx
+++ b/vcl/win/gdi/winlayout.cxx
@@ -3826,7 +3826,7 @@ SalLayout* WinSalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe
const WinFontFace& rFontFace = *mpWinFontData[ nFallbackLevel ];
WinFontInstance& rFontInstance = *mpWinFontEntry[ nFallbackLevel ];
- if (getenv("SAL_USE_COMMON_LAYOUT"))
+ if (SalLayout::UseCommonLayout())
{
return new CommonSalLayout(this, rFontInstance, rFontFace);
}