diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2016-10-13 22:46:28 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2016-10-18 20:41:33 +0200 |
commit | 9cea34ee8334f145ca4fffdd76d6d819c427383d (patch) | |
tree | b68eb3bfd5ad20102864143811dcadc6ff343c24 /vcl | |
parent | e3429c5068e6ea8221ca6316bdaba3de9bce7e6d (diff) |
Check SAL_USE_COMMON_LAYOUT envar in one place
Makes it easier to flip the switch in the future (or even do something
more fancy other than checking envvar).
Change-Id: Ie42ca012c167b2108f0fca1ce9ff7beee95f1be7
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/sallayout.hxx | 2 | ||||
-rw-r--r-- | vcl/quartz/ctlayout.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/cairotextrender.cxx | 2 | ||||
-rw-r--r-- | vcl/win/gdi/winlayout.cxx | 2 |
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); } |