diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-08-19 15:27:07 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-08-19 20:28:35 +0100 |
commit | f0e90c712b701b2d3b4f4725dfbed8c5ea924b0f (patch) | |
tree | f6de2296f69e8ea7ef9f2d51b79bd254b8dc042a /vcl/source | |
parent | b27417623835b1c82475783979a1fb9656b5155e (diff) |
for testing allow disabling configmgr for time critical paths
Change-Id: I83396e7c90d3b182f353a77c9bdf06fd17af92a1
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/app/settings.cxx | 25 | ||||
-rw-r--r-- | vcl/source/app/svapp.cxx | 10 | ||||
-rw-r--r-- | vcl/source/font/PhysicalFontCollection.cxx | 11 | ||||
-rw-r--r-- | vcl/source/outdev/font.cxx | 37 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 52 |
5 files changed, 97 insertions, 38 deletions
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 33674f8371a3..a8fb56a9633d 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -50,6 +50,7 @@ #include "unotools/localedatawrapper.hxx" #include "unotools/collatorwrapper.hxx" #include "unotools/confignode.hxx" +#include "unotools/configmgr.hxx" #include "unotools/syslocaleoptions.hxx" using namespace ::com::sun::star; @@ -687,7 +688,10 @@ void ImplStyleData::SetStandardStyles() vcl::Font aStdFont( FAMILY_SWISS, Size( 0, 8 ) ); aStdFont.SetCharSet( osl_getThreadTextEncoding() ); aStdFont.SetWeight( WEIGHT_NORMAL ); - aStdFont.SetName( utl::DefaultFontConfiguration::get().getUserInterfaceFont( LanguageTag("en")) ); + if (!utl::ConfigManager::IsAvoidConfig()) + aStdFont.SetName(utl::DefaultFontConfiguration::get().getUserInterfaceFont(LanguageTag("en"))); + else + aStdFont.SetName("Liberation Serif"); maAppFont = aStdFont; maHelpFont = aStdFont; maMenuFont = aStdFont; @@ -2707,7 +2711,8 @@ ImplAllSettingsData::ImplAllSettingsData() mpUILocaleDataWrapper = NULL; mpI18nHelper = NULL; mpUII18nHelper = NULL; - maMiscSettings.SetEnableLocalizedDecimalSep( maSysLocale.GetOptions().IsDecimalSeparatorAsLocale() ); + if (!utl::ConfigManager::IsAvoidConfig()) + maMiscSettings.SetEnableLocalizedDecimalSep( maSysLocale.GetOptions().IsDecimalSeparatorAsLocale() ); } ImplAllSettingsData::ImplAllSettingsData( const ImplAllSettingsData& rData ) : @@ -2913,16 +2918,26 @@ namespace bool AllSettings::GetLayoutRTL() { + if (utl::ConfigManager::IsAvoidConfig()) + return false; return GetConfigLayoutRTL(false); } bool AllSettings::GetMathLayoutRTL() { + if (utl::ConfigManager::IsAvoidConfig()) + return false; return GetConfigLayoutRTL(true); } const LanguageTag& AllSettings::GetLanguageTag() const { + if (utl::ConfigManager::IsAvoidConfig()) + { + static LanguageTag aRet("en-US"); + return aRet; + } + // SYSTEM locale means: use settings from SvtSysLocale that is resolved if ( mxData->maLocale.isSystemLocale() ) mxData->maLocale = mxData->maSysLocale.GetLanguageTag(); @@ -2932,6 +2947,12 @@ const LanguageTag& AllSettings::GetLanguageTag() const const LanguageTag& AllSettings::GetUILanguageTag() const { + if (utl::ConfigManager::IsAvoidConfig()) + { + static LanguageTag aRet("en-US"); + return aRet; + } + // the UILocale is never changed if ( mxData->maUILocale.isSystemLocale() ) mxData->maUILocale = mxData->maSysLocale.GetUILanguageTag(); diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx index 265d0b219c7b..2c8f41d8cdd1 100644 --- a/vcl/source/app/svapp.cxx +++ b/vcl/source/app/svapp.cxx @@ -33,7 +33,8 @@ #include "i18nlangtag/mslangid.hxx" -#include "unotools/syslocaleoptions.hxx" +#include <unotools/configmgr.hxx> +#include <unotools/syslocaleoptions.hxx> #include "vcl/settings.hxx" #include "vcl/keycod.hxx" @@ -629,9 +630,12 @@ void Application::InitSettings(ImplSVData* pSVData) { assert(!pSVData->maAppData.mpSettings && "initialization should not happen twice!"); - pSVData->maAppData.mpCfgListener = new LocaleConfigurationListener; pSVData->maAppData.mpSettings = new AllSettings(); - pSVData->maAppData.mpSettings->GetSysLocale().GetOptions().AddListener( pSVData->maAppData.mpCfgListener ); + if (!utl::ConfigManager::IsAvoidConfig()) + { + pSVData->maAppData.mpCfgListener = new LocaleConfigurationListener; + pSVData->maAppData.mpSettings->GetSysLocale().GetOptions().AddListener( pSVData->maAppData.mpCfgListener ); + } } void Application::NotifyAllWindows( DataChangedEvent& rDCEvt ) diff --git a/vcl/source/font/PhysicalFontCollection.cxx b/vcl/source/font/PhysicalFontCollection.cxx index dc4c18517816..8ff985b8b1d0 100644 --- a/vcl/source/font/PhysicalFontCollection.cxx +++ b/vcl/source/font/PhysicalFontCollection.cxx @@ -23,6 +23,7 @@ #include <vector> #include <i18nlangtag/mslangid.hxx> +#include <unotools/configmgr.hxx> #include <tools/debug.hxx> #include <config_graphite.h> @@ -459,6 +460,9 @@ void PhysicalFontCollection::InitMatchData() const return; mbMatchData = true; + if (utl::ConfigManager::IsAvoidConfig()) + return; + // calculate MatchData for all entries const utl::FontSubstConfiguration& rFontSubst = utl::FontSubstConfiguration::get(); @@ -1175,7 +1179,7 @@ PhysicalFontFamily* PhysicalFontCollection::ImplFindByFont( FontSelectPattern& r // use font fallback const utl::FontNameAttr* pFontAttr = NULL; - if( !aSearchName.isEmpty() ) + if (!aSearchName.isEmpty() && !utl::ConfigManager::IsAvoidConfig()) { // get fallback info using FontSubstConfiguration and // the target name, it's shortened name and family name in that order @@ -1199,7 +1203,10 @@ PhysicalFontFamily* PhysicalFontCollection::ImplFindByFont( FontSelectPattern& r if( rFSD.IsSymbolFont() ) { LanguageTag aDefaultLanguageTag( OUString( "en")); - aSearchName = utl::DefaultFontConfiguration::get().getDefaultFont( aDefaultLanguageTag, DefaultFontType::SYMBOL ); + if (utl::ConfigManager::IsAvoidConfig()) + aSearchName = "OpenSymbol"; + else + aSearchName = utl::DefaultFontConfiguration::get().getDefaultFont( aDefaultLanguageTag, DefaultFontType::SYMBOL ); PhysicalFontFamily* pFoundData = ImplFindByTokenNames( aSearchName ); if( pFoundData ) return pFoundData; 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 diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 8a0d521976c4..e112a3638b73 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -22,7 +22,6 @@ #include <tools/rc.h> #include <sal/types.h> - #include <vcl/salgtype.hxx> #include <vcl/event.hxx> #include <vcl/help.hxx> @@ -65,6 +64,7 @@ #include <com/sun/star/rendering/CanvasFactory.hpp> #include <com/sun/star/rendering/XSpriteCanvas.hpp> #include <comphelper/processfactory.hxx> +#include <unotools/configmgr.hxx> #include <cassert> #include <set> @@ -1142,7 +1142,8 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p mpWindowImpl->meAlwaysInputMode = pParent->mpWindowImpl->meAlwaysInputMode; } - OutputDevice::SetSettings( pParent->GetSettings() ); + if (!utl::ConfigManager::IsAvoidConfig()) + OutputDevice::SetSettings( pParent->GetSettings() ); } } @@ -1150,25 +1151,34 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p // setup the scale factor for Hi-DPI displays mnDPIScaleFactor = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY); - const StyleSettings& rStyleSettings = mxSettings->GetStyleSettings(); - sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom(); - mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100; - mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100; - maFont = rStyleSettings.GetAppFont(); - - ImplPointToLogic(*this, maFont); - - if ( nStyle & WB_3DLOOK ) + if (!utl::ConfigManager::IsAvoidConfig()) { - SetTextColor( rStyleSettings.GetButtonTextColor() ); - SetBackground( Wallpaper( rStyleSettings.GetFaceColor() ) ); + const StyleSettings& rStyleSettings = mxSettings->GetStyleSettings(); + sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom(); + mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100; + mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100; + maFont = rStyleSettings.GetAppFont(); + + if ( nStyle & WB_3DLOOK ) + { + SetTextColor( rStyleSettings.GetButtonTextColor() ); + SetBackground( Wallpaper( rStyleSettings.GetFaceColor() ) ); + } + else + { + SetTextColor( rStyleSettings.GetWindowTextColor() ); + SetBackground( Wallpaper( rStyleSettings.GetWindowColor() ) ); + } } else { - SetTextColor( rStyleSettings.GetWindowTextColor() ); - SetBackground( Wallpaper( rStyleSettings.GetWindowColor() ) ); + mnDPIX = 96; + mnDPIY = 96; + maFont = GetDefaultFont( DefaultFontType::FIXED, LANGUAGE_ENGLISH_US, GetDefaultFontFlags::NONE ); } + ImplPointToLogic(*this, maFont); + (void)ImplUpdatePos(); // calculate app font res (except for the Intro Window or the default window) @@ -1458,7 +1468,11 @@ void Window::ImplInitResolutionSettings() void Window::ImplPointToLogic(vcl::RenderContext& rRenderContext, vcl::Font& rFont) const { Size aSize = rFont.GetSize(); - sal_uInt16 nScreenFontZoom = rRenderContext.GetSettings().GetStyleSettings().GetScreenFontZoom(); + sal_uInt16 nScreenFontZoom; + if (!utl::ConfigManager::IsAvoidConfig()) + nScreenFontZoom = rRenderContext.GetSettings().GetStyleSettings().GetScreenFontZoom(); + else + nScreenFontZoom = 100; if (aSize.Width()) { @@ -1483,7 +1497,11 @@ void Window::ImplPointToLogic(vcl::RenderContext& rRenderContext, vcl::Font& rFo void Window::ImplLogicToPoint(vcl::RenderContext& rRenderContext, vcl::Font& rFont) const { Size aSize = rFont.GetSize(); - sal_uInt16 nScreenFontZoom = rRenderContext.GetSettings().GetStyleSettings().GetScreenFontZoom(); + sal_uInt16 nScreenFontZoom; + if (!utl::ConfigManager::IsAvoidConfig()) + nScreenFontZoom = rRenderContext.GetSettings().GetStyleSettings().GetScreenFontZoom(); + else + nScreenFontZoom = 100; if (rRenderContext.IsMapModeEnabled()) aSize = rRenderContext.LogicToPixel(aSize); |