summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-07-10 11:04:50 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-08-20 07:40:21 +0000
commitaf6daec72b71b1d72a2555efdc5b2fb2e0ba2b90 (patch)
tree1f16be1fd99edcdc3237ee3fa038ca0f1b88b4fd /sfx2
parent00754461516416f8ee59ec97632bff84f4d9b155 (diff)
more config skipping stuff and a tester tool
Change-Id: I5e93a4c84b3a0940239213766eb24d21fb5fd649 Reviewed-on: https://gerrit.libreoffice.org/17863 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/app.cxx11
-rw-r--r--sfx2/source/appl/appbas.cxx11
-rw-r--r--sfx2/source/appl/appinit.cxx20
-rw-r--r--sfx2/source/doc/objstor.cxx26
-rw-r--r--sfx2/source/doc/objxtor.cxx26
5 files changed, 64 insertions, 30 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 98958e9faab0..f77141fd1e8f 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -42,6 +42,7 @@
#include <svtools/ehdl.hxx>
#include <svl/svdde.hxx>
+#include <unotools/configmgr.hxx>
#include <unotools/tempfile.hxx>
#include <osl/file.hxx>
#include <com/sun/star/uno/Sequence.hxx>
@@ -165,11 +166,11 @@ SfxApplication* SfxApplication::GetOrCreate()
::framework::SetActivateToolPanel( &SfxViewFrame::ActivateToolPanel );
#if HAVE_FEATURE_DESKTOP
Application::SetHelp( pSfxHelp );
- if ( SvtHelpOptions().IsHelpTips() )
+ if (!utl::ConfigManager::IsAvoidConfig() && SvtHelpOptions().IsHelpTips())
Help::EnableQuickHelp();
else
Help::DisableQuickHelp();
- if ( SvtHelpOptions().IsHelpTips() && SvtHelpOptions().IsExtendedHelp() )
+ if (!utl::ConfigManager::IsAvoidConfig() && SvtHelpOptions().IsHelpTips() && SvtHelpOptions().IsExtendedHelp())
Help::EnableBalloonHelp();
else
Help::DisableBalloonHelp();
@@ -182,7 +183,8 @@ SfxApplication::SfxApplication()
: pAppData_Impl( 0 )
{
SetName( OUString("StarOffice") );
- SvtViewOptions::AcquireOptions();
+ if (!utl::ConfigManager::IsAvoidConfig())
+ SvtViewOptions::AcquireOptions();
pAppData_Impl = new SfxAppData_Impl( this );
pAppData_Impl->m_xImeStatusWindow->init();
@@ -230,7 +232,8 @@ SfxApplication::~SfxApplication()
#endif
// delete global options
- SvtViewOptions::ReleaseOptions();
+ if (!utl::ConfigManager::IsAvoidConfig())
+ SvtViewOptions::ReleaseOptions();
if ( !pAppData_Impl->bDowning )
Deinitialize();
diff --git a/sfx2/source/appl/appbas.cxx b/sfx2/source/appl/appbas.cxx
index becd677efcaf..df23fcd9b4a6 100644
--- a/sfx2/source/appl/appbas.cxx
+++ b/sfx2/source/appl/appbas.cxx
@@ -69,6 +69,7 @@
#include <sfx2/sfxhelp.hxx>
#include <basic/basmgr.hxx>
#include <svtools/svtools.hrc>
+#include <unotools/configmgr.hxx>
#include "sorgitm.hxx"
#include "appbaslib.hxx"
#include <basic/basicmanagerrepository.hxx>
@@ -99,17 +100,19 @@ BasicManager* SfxApplication::GetBasicManager()
#if !HAVE_FEATURE_SCRIPTING
return 0;
#else
+ if (utl::ConfigManager::IsAvoidConfig())
+ return 0;
return BasicManagerRepository::getApplicationBasicManager( true );
#endif
}
-
-
XLibraryContainer * SfxApplication::GetDialogContainer()
{
#if !HAVE_FEATURE_SCRIPTING
return NULL;
#else
+ if (utl::ConfigManager::IsAvoidConfig())
+ return NULL;
if ( !pAppData_Impl->pBasicManager->isValid() )
GetBasicManager();
return pAppData_Impl->pBasicManager->getLibraryContainer( SfxBasicManagerHolder::DIALOGS );
@@ -123,6 +126,8 @@ XLibraryContainer * SfxApplication::GetBasicContainer()
#if !HAVE_FEATURE_SCRIPTING
return NULL;
#else
+ if (utl::ConfigManager::IsAvoidConfig())
+ return NULL;
if ( !pAppData_Impl->pBasicManager->isValid() )
GetBasicManager();
return pAppData_Impl->pBasicManager->getLibraryContainer( SfxBasicManagerHolder::SCRIPTS );
@@ -134,6 +139,8 @@ StarBASIC* SfxApplication::GetBasic()
#if !HAVE_FEATURE_SCRIPTING
return 0;
#else
+ if (utl::ConfigManager::IsAvoidConfig())
+ return 0;
return GetBasicManager()->GetLib(0);
#endif
}
diff --git a/sfx2/source/appl/appinit.cxx b/sfx2/source/appl/appinit.cxx
index 89e11a37bc81..0c1b6d752929 100644
--- a/sfx2/source/appl/appinit.cxx
+++ b/sfx2/source/appl/appinit.cxx
@@ -28,6 +28,7 @@
#include <svtools/soerr.hxx>
#include <svtools/svtools.hrc>
+#include <unotools/configmgr.hxx>
#include <unotools/saveopt.hxx>
#include <unotools/localisationoptions.hxx>
#include <svl/intitem.hxx>
@@ -219,9 +220,12 @@ bool SfxApplication::Initialize_Impl()
Help::EnableContextHelp();
Help::EnableExtHelp();
- SvtLocalisationOptions aLocalisation;
- Application::EnableAutoMnemonic ( aLocalisation.IsAutoMnemonic() );
- Application::SetDialogScaleX ( (short)(aLocalisation.GetDialogScale()) );
+ if (!utl::ConfigManager::IsAvoidConfig())
+ {
+ SvtLocalisationOptions aLocalisation;
+ Application::EnableAutoMnemonic ( aLocalisation.IsAutoMnemonic() );
+ Application::SetDialogScaleX ( (short)(aLocalisation.GetDialogScale()) );
+ }
pAppData_Impl->m_pToolsErrorHdl = new SfxErrorHandler(
RID_ERRHDL, ERRCODE_AREA_TOOLS, ERRCODE_AREA_LIB1);
@@ -237,9 +241,13 @@ bool SfxApplication::Initialize_Impl()
pAppData_Impl->m_pSbxErrorHdl = new SfxErrorHandler(
RID_BASIC_START, ERRCODE_AREA_SBX, ERRCODE_AREA_SBX_END, pAppData_Impl->pBasicResMgr );
#endif
- //ensure instantiation of listener that manages the internal recently-used
- //list
- SfxPickList::ensure();
+
+ if (!utl::ConfigManager::IsAvoidConfig())
+ {
+ //ensure instantiation of listener that manages the internal recently-used
+ //list
+ SfxPickList::ensure();
+ }
DBG_ASSERT( !pAppData_Impl->pAppDispat, "AppDispatcher already exists" );
pAppData_Impl->pAppDispat = new SfxDispatcher(static_cast<SfxDispatcher*>(nullptr));
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 73ab864526f8..d5bc6d00611e 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -73,6 +73,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/interaction.hxx>
#include <svtools/sfxecode.hxx>
+#include <unotools/configmgr.hxx>
#include <unotools/securityoptions.hxx>
#include <cppuhelper/weak.hxx>
#include <unotools/streamwrap.hxx>
@@ -368,8 +369,17 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto
const_cast<SfxObjectShell*>( this )->SetError( ERRCODE_IO_GENERAL, OUString( OSL_LOG_PREFIX ) );
}
- SvtSaveOptions aSaveOpt;
- SvtSaveOptions::ODFDefaultVersion nDefVersion = aSaveOpt.GetODFDefaultVersion();
+ SvtSaveOptions::ODFDefaultVersion nDefVersion = SvtSaveOptions::ODFVER_012;
+ bool bUseSHA1InODF12 = false;
+ bool bUseBlowfishInODF12 = false;
+
+ if (!utl::ConfigManager::IsAvoidConfig())
+ {
+ SvtSaveOptions aSaveOpt;
+ nDefVersion = aSaveOpt.GetODFDefaultVersion();
+ bUseSHA1InODF12 = aSaveOpt.IsUseSHA1InODF12();
+ bUseBlowfishInODF12 = aSaveOpt.IsUseBlowfishInODF12();
+ }
uno::Sequence< beans::NamedValue > aEncryptionAlgs( 3 );
aEncryptionAlgs[0].Name = "StartKeyGenerationAlgorithm";
@@ -391,12 +401,12 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto
{
}
- if ( !aSaveOpt.IsUseSHA1InODF12() && nDefVersion != SvtSaveOptions::ODFVER_012_EXT_COMPAT )
+ if ( !bUseSHA1InODF12 && nDefVersion != SvtSaveOptions::ODFVER_012_EXT_COMPAT )
{
aEncryptionAlgs[0].Value <<= xml::crypto::DigestID::SHA256;
aEncryptionAlgs[2].Value <<= xml::crypto::DigestID::SHA256_1K;
}
- if ( !aSaveOpt.IsUseBlowfishInODF12() && nDefVersion != SvtSaveOptions::ODFVER_012_EXT_COMPAT )
+ if ( !bUseBlowfishInODF12 && nDefVersion != SvtSaveOptions::ODFVER_012_EXT_COMPAT )
aEncryptionAlgs[1].Value <<= xml::crypto::CipherID::AES_CBC_W3C_PADDING;
}
@@ -533,7 +543,8 @@ bool SfxObjectShell::DoInitNew( SfxMedium* pMed )
aArgs[nLength].Name = "Title";
aArgs[nLength].Value <<= OUString( GetTitle( SFX_TITLE_DETECT ) );
xModel->attachResource( OUString(), aArgs );
- impl_addToModelCollection(xModel);
+ if (!utl::ConfigManager::IsAvoidConfig())
+ impl_addToModelCollection(xModel);
}
SetInitialized_Impl( true );
@@ -543,8 +554,6 @@ bool SfxObjectShell::DoInitNew( SfxMedium* pMed )
return false;
}
-
-
bool SfxObjectShell::ImportFromGeneratedStream_Impl(
const uno::Reference< io::XStream >& xStream,
const uno::Sequence< beans::PropertyValue >& rMediaDescr )
@@ -3115,7 +3124,8 @@ uno::Reference< embed::XStorage > SfxObjectShell::GetStorage()
SetupStorage( pImp->m_xDocStorage, SOFFICE_FILEFORMAT_CURRENT, false );
pImp->m_bCreateTempStor = false;
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(GlobalEventId::STORAGECHANGED), this ) );
+ if (!utl::ConfigManager::IsAvoidConfig())
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(GlobalEventId::STORAGECHANGED), this ) );
}
catch( uno::Exception& )
{
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 0a198b61c271..335b6f8e8f46 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -45,6 +45,7 @@
#include <basic/sbstar.hxx>
#include <svl/stritem.hxx>
#include <basic/sbx.hxx>
+#include <unotools/configmgr.hxx>
#include <unotools/eventcfg.hxx>
#include <sfx2/objsh.hxx>
@@ -798,18 +799,21 @@ Reference< XLibraryContainer > SfxObjectShell::GetDialogContainer()
Reference< XLibraryContainer > SfxObjectShell::GetBasicContainer()
{
#if HAVE_FEATURE_SCRIPTING
- try
+ if (!utl::ConfigManager::IsAvoidConfig())
{
- if ( !pImp->m_bNoBasicCapabilities )
- return lcl_getOrCreateLibraryContainer( true, pImp->xBasicLibraries, GetModel() );
+ try
+ {
+ if ( !pImp->m_bNoBasicCapabilities )
+ return lcl_getOrCreateLibraryContainer( true, pImp->xBasicLibraries, GetModel() );
- BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this );
- if ( pBasMgr )
- return pBasMgr->GetScriptLibraryContainer().get();
- }
- catch (const css::ucb::ContentCreationException& e)
- {
- SAL_WARN("sfx.doc", "caught exception " << e.Message);
+ BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this );
+ if ( pBasMgr )
+ return pBasMgr->GetScriptLibraryContainer().get();
+ }
+ catch (const css::ucb::ContentCreationException& e)
+ {
+ SAL_WARN("sfx.doc", "caught exception " << e.Message);
+ }
}
SAL_WARN("sfx.doc", "SfxObjectShell::GetBasicContainer: falling back to the application - is this really expected here?");
#endif
@@ -1152,6 +1156,8 @@ SfxObjectShell* SfxObjectShell::GetShellFromComponent( const Reference<lang::XCo
void SfxObjectShell::SetInitialized_Impl( const bool i_fromInitNew )
{
pImp->bInitialized = true;
+ if (utl::ConfigManager::IsAvoidConfig())
+ return;
if ( i_fromInitNew )
{
SetActivateEvent_Impl( SFX_EVENT_CREATEDOC );