for testing allow disabling configmgr for time critical paths
Change-Id: I83396e7c90d3b182f353a77c9bdf06fd17af92a1
This commit is contained in:
parent
b274176238
commit
f0e90c712b
@ -409,7 +409,7 @@ class Desktop : private cppu::BaseMutex,
|
||||
css::uno::Reference< css::frame::XFrame > m_xLastFrame; /// last target of "loadComponentFromURL()"!
|
||||
css::uno::Any m_aInteractionRequest;
|
||||
bool m_bSuspendQuickstartVeto; /// don't ask quickstart for a veto
|
||||
SvtCommandOptions m_aCommandOptions; /// ref counted class to support disabling commands defined by configuration file
|
||||
std::unique_ptr<SvtCommandOptions> m_xCommandOptions; /// ref counted class to support disabling commands defined by configuration file
|
||||
OUString m_sName;
|
||||
OUString m_sTitle;
|
||||
css::uno::Reference< css::frame::XDispatchRecorderSupplier > m_xDispatchRecorderSupplier;
|
||||
|
@ -63,6 +63,7 @@
|
||||
#include <vcl/svapp.hxx>
|
||||
|
||||
#include <tools/errinf.hxx>
|
||||
#include <unotools/configmgr.hxx>
|
||||
#include <comphelper/extract.hxx>
|
||||
|
||||
namespace framework{
|
||||
@ -162,7 +163,6 @@ Desktop::Desktop( const css::uno::Reference< css::uno::XComponentContext >& xCon
|
||||
, m_xLastFrame ( )
|
||||
, m_aInteractionRequest ( )
|
||||
, m_bSuspendQuickstartVeto( false )
|
||||
, m_aCommandOptions ( )
|
||||
, m_sName ( )
|
||||
, m_sTitle ( )
|
||||
, m_xDispatchRecorderSupplier( )
|
||||
@ -646,8 +646,11 @@ css::uno::Reference< css::frame::XDispatch > SAL_CALL Desktop::queryDispatch( co
|
||||
if ( aURL.Protocol.equalsIgnoreAsciiCase(".uno:") )
|
||||
aCommand = aURL.Path;
|
||||
|
||||
if (!m_xCommandOptions && !utl::ConfigManager::IsAvoidConfig())
|
||||
m_xCommandOptions.reset(new SvtCommandOptions);
|
||||
|
||||
// Make std::unordered_map lookup if the current URL is in the disabled list
|
||||
if ( m_aCommandOptions.Lookup( SvtCommandOptions::CMDOPTION_DISABLED, aCommand ) )
|
||||
if (m_xCommandOptions && m_xCommandOptions->Lookup(SvtCommandOptions::CMDOPTION_DISABLED, aCommand))
|
||||
return css::uno::Reference< css::frame::XDispatch >();
|
||||
else
|
||||
{
|
||||
|
@ -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,6 +2711,7 @@ ImplAllSettingsData::ImplAllSettingsData()
|
||||
mpUILocaleDataWrapper = NULL;
|
||||
mpI18nHelper = NULL;
|
||||
mpUII18nHelper = NULL;
|
||||
if (!utl::ConfigManager::IsAvoidConfig())
|
||||
maMiscSettings.SetEnableLocalizedDecimalSep( maSysLocale.GetOptions().IsDecimalSeparatorAsLocale() );
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
@ -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();
|
||||
if (!utl::ConfigManager::IsAvoidConfig())
|
||||
{
|
||||
pSVData->maAppData.mpCfgListener = new LocaleConfigurationListener;
|
||||
pSVData->maAppData.mpSettings->GetSysLocale().GetOptions().AddListener( pSVData->maAppData.mpCfgListener );
|
||||
}
|
||||
}
|
||||
|
||||
void Application::NotifyAllWindows( DataChangedEvent& rDCEvt )
|
||||
|
@ -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,6 +1203,9 @@ PhysicalFontFamily* PhysicalFontCollection::ImplFindByFont( FontSelectPattern& r
|
||||
if( rFSD.IsSymbolFont() )
|
||||
{
|
||||
LanguageTag aDefaultLanguageTag( OUString( "en"));
|
||||
if (utl::ConfigManager::IsAvoidConfig())
|
||||
aSearchName = "OpenSymbol";
|
||||
else
|
||||
aSearchName = utl::DefaultFontConfiguration::get().getDefaultFont( aDefaultLanguageTag, DefaultFontType::SYMBOL );
|
||||
PhysicalFontFamily* pFoundData = ImplFindByTokenNames( aSearchName );
|
||||
if( pFoundData )
|
||||
|
@ -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,9 +780,12 @@ 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();
|
||||
|
||||
OUString aSearch;
|
||||
if (!utl::ConfigManager::IsAvoidConfig())
|
||||
{
|
||||
LanguageTag aLanguageTag(
|
||||
( eLang == LANGUAGE_NONE || eLang == LANGUAGE_SYSTEM || eLang == LANGUAGE_DONTKNOW ) ?
|
||||
Application::GetSettings().GetUILanguageTag() :
|
||||
@ -789,12 +793,14 @@ vcl::Font OutputDevice::GetDefaultFont( DefaultFontType nType, LanguageType eLan
|
||||
|
||||
utl::DefaultFontConfiguration& rDefaults = utl::DefaultFontConfiguration::get();
|
||||
OUString aDefault = rDefaults.getDefaultFont( aLanguageTag, nType );
|
||||
OUString aSearch;
|
||||
|
||||
if( !aDefault.isEmpty() )
|
||||
aSearch = aDefault;
|
||||
else
|
||||
aSearch = rDefaults.getUserInterfaceFont( aLanguageTag ); // use the UI font as a fallback
|
||||
}
|
||||
else
|
||||
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);
|
||||
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
|
||||
|
@ -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,6 +1142,7 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p
|
||||
mpWindowImpl->meAlwaysInputMode = pParent->mpWindowImpl->meAlwaysInputMode;
|
||||
}
|
||||
|
||||
if (!utl::ConfigManager::IsAvoidConfig())
|
||||
OutputDevice::SetSettings( pParent->GetSettings() );
|
||||
}
|
||||
|
||||
@ -1150,14 +1151,14 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p
|
||||
// setup the scale factor for Hi-DPI displays
|
||||
mnDPIScaleFactor = CountDPIScaleFactor(mpWindowImpl->mpFrameData->mnDPIY);
|
||||
|
||||
if (!utl::ConfigManager::IsAvoidConfig())
|
||||
{
|
||||
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 )
|
||||
{
|
||||
SetTextColor( rStyleSettings.GetButtonTextColor() );
|
||||
@ -1168,6 +1169,15 @@ void Window::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentData* p
|
||||
SetTextColor( rStyleSettings.GetWindowTextColor() );
|
||||
SetBackground( Wallpaper( rStyleSettings.GetWindowColor() ) );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mnDPIX = 96;
|
||||
mnDPIY = 96;
|
||||
maFont = GetDefaultFont( DefaultFontType::FIXED, LANGUAGE_ENGLISH_US, GetDefaultFontFlags::NONE );
|
||||
}
|
||||
|
||||
ImplPointToLogic(*this, maFont);
|
||||
|
||||
(void)ImplUpdatePos();
|
||||
|
||||
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user