Kaydet (Commit) 9cea34ee authored tarafından Khaled Hosny's avatar Khaled Hosny

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
üst e3429c50
......@@ -201,6 +201,8 @@ public:
virtual std::shared_ptr<vcl::TextLayoutCache>
CreateTextLayoutCache(OUString const&) const;
static bool UseCommonLayout();
protected:
// used by layout engines
SalLayout();
......
......@@ -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);
......
......@@ -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()
{}
......
......@@ -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]);
}
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment