summaryrefslogtreecommitdiff
path: root/vcl/source/outdev
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-08-19 15:27:07 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-08-19 20:28:35 +0100
commitf0e90c712b701b2d3b4f4725dfbed8c5ea924b0f (patch)
treef6de2296f69e8ea7ef9f2d51b79bd254b8dc042a /vcl/source/outdev
parentb27417623835b1c82475783979a1fb9656b5155e (diff)
for testing allow disabling configmgr for time critical paths
Change-Id: I83396e7c90d3b182f353a77c9bdf06fd17af92a1
Diffstat (limited to 'vcl/source/outdev')
-rw-r--r--vcl/source/outdev/font.cxx37
1 files changed, 23 insertions, 14 deletions
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index a28ff0668530..5c1d00dcea30 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -19,6 +19,7 @@
#include "i18nlangtag/mslangid.hxx"
+#include <unotools/configmgr.hxx>
#include <vcl/virdev.hxx>
#include <vcl/print.hxx>
#include <vcl/outdev.hxx>
@@ -779,22 +780,27 @@ void ImplFontSubstitute( OUString& rFontName )
vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLang,
GetDefaultFontFlags nFlags, const OutputDevice* pOutDev )
{
- if (!pOutDev) // default is NULL
+ if (!pOutDev && !utl::ConfigManager::IsAvoidConfig()) // default is NULL
pOutDev = Application::GetDefaultDevice();
- LanguageTag aLanguageTag(
- ( eLang == LANGUAGE_NONE || eLang == LANGUAGE_SYSTEM || eLang == LANGUAGE_DONTKNOW ) ?
- Application::GetSettings().GetUILanguageTag() :
- LanguageTag( eLang ));
-
- utl::DefaultFontConfiguration& rDefaults = utl::DefaultFontConfiguration::get();
- OUString aDefault = rDefaults.getDefaultFont( aLanguageTag, nType );
OUString aSearch;
+ if (!utl::ConfigManager::IsAvoidConfig())
+ {
+ LanguageTag aLanguageTag(
+ ( eLang == LANGUAGE_NONE || eLang == LANGUAGE_SYSTEM || eLang == LANGUAGE_DONTKNOW ) ?
+ Application::GetSettings().GetUILanguageTag() :
+ LanguageTag( eLang ));
- if( !aDefault.isEmpty() )
- aSearch = aDefault;
+ utl::DefaultFontConfiguration& rDefaults = utl::DefaultFontConfiguration::get();
+ OUString aDefault = rDefaults.getDefaultFont( aLanguageTag, nType );
+
+ if( !aDefault.isEmpty() )
+ aSearch = aDefault;
+ else
+ aSearch = rDefaults.getUserInterfaceFont( aLanguageTag ); // use the UI font as a fallback
+ }
else
- aSearch = rDefaults.getUserInterfaceFont( aLanguageTag ); // use the UI font as a fallback
+ aSearch = "Liberation Serif";
vcl::Font aFont;
aFont.SetPitch( PITCH_VARIABLE );
@@ -1498,9 +1504,12 @@ void OutputDevice::InitFont() const
{
// decide if antialiasing is appropriate
bool bNonAntialiased(GetAntialiasing() & AntialiasingFlags::DisableText);
- const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
- bNonAntialiased |= bool(rStyleSettings.GetDisplayOptions() & DisplayOptions::AADisable);
- bNonAntialiased |= (int(rStyleSettings.GetAntialiasingMinPixelHeight()) > mpFontEntry->maFontSelData.mnHeight);
+ if (!utl::ConfigManager::IsAvoidConfig())
+ {
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ bNonAntialiased |= bool(rStyleSettings.GetDisplayOptions() & DisplayOptions::AADisable);
+ bNonAntialiased |= (int(rStyleSettings.GetAntialiasingMinPixelHeight()) > mpFontEntry->maFontSelData.mnHeight);
+ }
mpFontEntry->maFontSelData.mbNonAntialiased = bNonAntialiased;
// select font in the device layers