diff options
49 files changed, 152 insertions, 232 deletions
diff --git a/comphelper/source/misc/configuration.cxx b/comphelper/source/misc/configuration.cxx index 67009cd9f864..46ac8ab6c407 100644 --- a/comphelper/source/misc/configuration.cxx +++ b/comphelper/source/misc/configuration.cxx @@ -38,9 +38,9 @@ namespace com::sun::star::uno { class XComponentContext; } namespace { -comphelper::detail::ConfigurationWrapper& GetTheConfigurationWrapper(const css::uno::Reference< css::uno::XComponentContext >& xContext) +comphelper::detail::ConfigurationWrapper& GetTheConfigurationWrapper() { - static comphelper::detail::ConfigurationWrapper WRAPPER(xContext); + static comphelper::detail::ConfigurationWrapper WRAPPER(comphelper::getProcessComponentContext()); return WRAPPER; } @@ -67,10 +67,9 @@ OUString extendLocalizedPath(std::u16string_view path, OUString const & locale) } std::shared_ptr< comphelper::ConfigurationChanges > -comphelper::ConfigurationChanges::create( - css::uno::Reference< css::uno::XComponentContext > const & context) +comphelper::ConfigurationChanges::create() { - return GetTheConfigurationWrapper(context).createChanges(); + return GetTheConfigurationWrapper().createChanges(); } comphelper::ConfigurationChanges::~ConfigurationChanges() {} @@ -107,10 +106,9 @@ comphelper::ConfigurationChanges::getSet(OUString const & path) const } comphelper::detail::ConfigurationWrapper const & -comphelper::detail::ConfigurationWrapper::get( - css::uno::Reference< css::uno::XComponentContext > const & context) +comphelper::detail::ConfigurationWrapper::get() { - return GetTheConfigurationWrapper(context); + return GetTheConfigurationWrapper(); } comphelper::detail::ConfigurationWrapper::ConfigurationWrapper( diff --git a/cui/source/dialogs/cuicharmap.cxx b/cui/source/dialogs/cuicharmap.cxx index 78d6fad653ee..bda30b764f26 100644 --- a/cui/source/dialogs/cuicharmap.cxx +++ b/cui/source/dialogs/cuicharmap.cxx @@ -352,7 +352,7 @@ void SvxCharacterMap::updateRecentCharacterList(const OUString& sTitle, const OU aRecentCharFontListRange[i] = maRecentCharFontList[i]; } - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(mxContext)); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); officecfg::Office::Common::RecentCharacters::RecentCharacterList::set(aRecentCharList, batch); officecfg::Office::Common::RecentCharacters::RecentCharacterFontList::set(aRecentCharFontList, batch); batch->commit(); @@ -391,7 +391,7 @@ void SvxCharacterMap::updateFavCharacterList(const OUString& sTitle, const OUStr aFavCharFontListRange[i] = maFavCharFontList[i]; } - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(mxContext)); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::set(aFavCharList, batch); officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterFontList::set(aFavCharFontList, batch); batch->commit(); @@ -444,7 +444,7 @@ void SvxCharacterMap::deleteFavCharacterFromList(std::u16string_view sTitle, std aFavCharFontListRange[i] = maFavCharFontList[i]; } - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(mxContext)); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::set(aFavCharList, batch); officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterFontList::set(aFavCharFontList, batch); batch->commit(); @@ -799,7 +799,7 @@ IMPL_LINK(SvxCharacterMap, RecentClearClickHdl, SvxCharView*, rView, void) aRecentCharFontListRange[i] = maRecentCharFontList[i]; } - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(mxContext)); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); officecfg::Office::Common::RecentCharacters::RecentCharacterList::set(aRecentCharList, batch); officecfg::Office::Common::RecentCharacters::RecentCharacterFontList::set(aRecentCharFontList, batch); batch->commit(); @@ -812,7 +812,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, RecentClearAllClickHdl, SvxCharView*, void) maRecentCharList.clear(); maRecentCharFontList.clear(); - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(mxContext)); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); officecfg::Office::Common::RecentCharacters::RecentCharacterList::set({ }, batch); officecfg::Office::Common::RecentCharacters::RecentCharacterFontList::set({ }, batch); batch->commit(); @@ -831,7 +831,7 @@ IMPL_LINK_NOARG(SvxCharacterMap, FavClearAllClickHdl, SvxCharView*, void) maFavCharList.clear(); maFavCharFontList.clear(); - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(mxContext)); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::set({ }, batch); officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterFontList::set({ }, batch); batch->commit(); diff --git a/cui/source/dialogs/toolbarmodedlg.cxx b/cui/source/dialogs/toolbarmodedlg.cxx index a99903338f06..c4c4d347b58a 100644 --- a/cui/source/dialogs/toolbarmodedlg.cxx +++ b/cui/source/dialogs/toolbarmodedlg.cxx @@ -181,7 +181,7 @@ IMPL_LINK(ToolbarmodeDialog, OnApplyClick, weld::Button&, rButton, void) if (&rButton == m_pApplyAll.get()) { std::shared_ptr<comphelper::ConfigurationChanges> aBatch( - comphelper::ConfigurationChanges::create(::comphelper::getProcessComponentContext())); + comphelper::ConfigurationChanges::create()); officecfg::Office::UI::ToolbarMode::ActiveWriter::set(sCmd, aBatch); officecfg::Office::UI::ToolbarMode::ActiveCalc::set(sCmd, aBatch); officecfg::Office::UI::ToolbarMode::ActiveImpress::set(sCmd, aBatch); diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx index 02c064d1b2e7..9697237d5dc4 100644 --- a/cui/source/options/personalization.cxx +++ b/cui/source/options/personalization.cxx @@ -63,11 +63,8 @@ bool SvxPersonalizationTabPage::FillItemSet(SfxItemSet*) aPersona = "no"; bool bModified = false; - uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); - if (xContext.is() - && (aPersona != officecfg::Office::Common::Misc::Persona::get(xContext) - || m_aPersonaSettings - != officecfg::Office::Common::Misc::PersonaSettings::get(xContext))) + if (aPersona != officecfg::Office::Common::Misc::Persona::get() + || m_aPersonaSettings != officecfg::Office::Common::Misc::PersonaSettings::get()) { bModified = true; } @@ -94,15 +91,9 @@ bool SvxPersonalizationTabPage::FillItemSet(SfxItemSet*) void SvxPersonalizationTabPage::Reset(const SfxItemSet*) { - uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); - // persona - OUString aPersona("default"); - if (xContext.is()) - { - aPersona = officecfg::Office::Common::Misc::Persona::get(xContext); - m_aPersonaSettings = officecfg::Office::Common::Misc::PersonaSettings::get(xContext); - } + OUString aPersona = officecfg::Office::Common::Misc::Persona::get(); + m_aPersonaSettings = officecfg::Office::Common::Misc::PersonaSettings::get(); if (aPersona == "no") m_xNoPersona->set_active(true); diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index e0e19ff86537..2fc4b1f2f3db 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -359,7 +359,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, weld::Button&, void) { m_xSelectPalette->set_active(0); SelectPaletteLBHdl(*m_xSelectPalette); - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context)); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); css::uno::Sequence< sal_Int32 > aCustomColorList(officecfg::Office::Common::UserColors::CustomColor::get()); css::uno::Sequence< OUString > aCustomColorNameList(officecfg::Office::Common::UserColors::CustomColorName::get()); sal_Int32 nSize = aCustomColorList.getLength(); @@ -409,7 +409,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickDeleteHdl_Impl, weld::Button&, void) if (m_xSelectPalette->get_active() != 0 || nPos == VALUESET_ITEM_NOTFOUND) return; - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context)); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); css::uno::Sequence< sal_Int32 > aCustomColorList(officecfg::Office::Common::UserColors::CustomColor::get()); auto aCustomColorListRange = asNonConstRange(aCustomColorList); css::uno::Sequence< OUString > aCustomColorNameList(officecfg::Office::Common::UserColors::CustomColorName::get()); diff --git a/desktop/inc/app.hxx b/desktop/inc/app.hxx index e2ecf5920aa0..3372e751dbf1 100644 --- a/desktop/inc/app.hxx +++ b/desktop/inc/app.hxx @@ -123,8 +123,7 @@ class Desktop final : public Application // throws an exception upon failure private: - void RegisterServices( - css::uno::Reference< css::uno::XComponentContext > const & context); + void RegisterServices(); static void DeregisterServices(); public: diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 9c272314dadf..caf9358683cf 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -1305,7 +1305,7 @@ int Desktop::Main() Reference< XDesktop2 > xDesktop; - RegisterServices(xContext); + RegisterServices(); SetSplashScreenProgress(25); diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx index 98a1fa61ca2f..a70004e23b3f 100644 --- a/desktop/source/app/appinit.cxx +++ b/desktop/source/app/appinit.cxx @@ -84,7 +84,7 @@ void Desktop::InitApplicationServiceManager() comphelper::setProcessServiceFactory(sm); } -void Desktop::RegisterServices(Reference< XComponentContext > const & context) +void Desktop::RegisterServices() { if( m_bServicesRegistered ) return; @@ -100,7 +100,7 @@ void Desktop::RegisterServices(Reference< XComponentContext > const & context) // read accept string from configuration OUString conDcpCfg( - officecfg::Setup::Office::ooSetupConnectionURL::get(context)); + officecfg::Setup::Office::ooSetupConnectionURL::get()); if (!conDcpCfg.isEmpty()) { createAcceptor(conDcpCfg); } diff --git a/embeddedobj/source/general/xcreator.cxx b/embeddedobj/source/general/xcreator.cxx index d057aeba4a1a..c4a8635e465d 100644 --- a/embeddedobj/source/general/xcreator.cxx +++ b/embeddedobj/source/general/xcreator.cxx @@ -188,13 +188,11 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta * Decides if rFilter should be used to load data into a doc model or real OLE embedding should * happen. Empty return value means the later. */ -static OUString HandleFilter(const uno::Reference<uno::XComponentContext>& xComponentContext, - const OUString& rFilter) +static OUString HandleFilter(const OUString& rFilter) { OUString aRet = rFilter; - if (!officecfg::Office::Common::Filter::Microsoft::Import::WinWordToWriter::get( - xComponentContext)) + if (!officecfg::Office::Common::Filter::Microsoft::Import::WinWordToWriter::get()) { if (rFilter == "MS Word 97" || rFilter == "MS Word 2007 XML") { @@ -202,29 +200,28 @@ static OUString HandleFilter(const uno::Reference<uno::XComponentContext>& xComp } } - if (!officecfg::Office::Common::Filter::Microsoft::Import::ExcelToCalc::get(xComponentContext)) + if (!officecfg::Office::Common::Filter::Microsoft::Import::ExcelToCalc::get()) { if (rFilter == "MS Excel 97" || rFilter == "Calc MS Excel 2007 XML") { aRet.clear(); } } - if (!officecfg::Office::Common::Filter::Microsoft::Import::PowerPointToImpress::get( - xComponentContext)) + if (!officecfg::Office::Common::Filter::Microsoft::Import::PowerPointToImpress::get()) { if (rFilter == "MS PowerPoint 97" || rFilter == "Impress MS PowerPoint 2007 XML") { aRet.clear(); } } - if (!officecfg::Office::Common::Filter::Microsoft::Import::VisioToDraw::get(xComponentContext)) + if (!officecfg::Office::Common::Filter::Microsoft::Import::VisioToDraw::get()) { if (rFilter == "Visio Document") { aRet.clear(); } } - if (!officecfg::Office::Common::Filter::Adobe::Import::PDFToDraw::get(xComponentContext)) + if (!officecfg::Office::Common::Filter::Adobe::Import::PDFToDraw::get()) { if (rFilter == "draw_pdf_import") { @@ -259,7 +256,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta // check if there is FilterName OUString aFilterName = m_aConfigHelper.UpdateMediaDescriptorWithFilterName( aTempMedDescr, false ); - aFilterName = HandleFilter(m_xContext, aFilterName); + aFilterName = HandleFilter(aFilterName); if ( !aFilterName.isEmpty() ) { diff --git a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx index e62068f17b04..2e97ab5581ac 100644 --- a/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx +++ b/extensions/source/config/WinUserInfo/WinUserInfoBe.cxx @@ -84,7 +84,7 @@ constexpr OUStringLiteral mail(u"mail"); class ADsUserAccess : public extensions::config::WinUserInfo::WinUserInfoBe_Impl { public: - ADsUserAccess(const css::uno::Reference<css::uno::XComponentContext>& xContext) + ADsUserAccess() { try { @@ -121,12 +121,12 @@ public: m_aMap[facsimiletelephonenumber] = Str(pUser, L"facsimileTelephoneNumber"); m_aMap[mail] = Str(pUser, &IADsUser::get_EmailAddress); - CacheData(xContext); + CacheData(); } catch (sal::systools::ComError&) { // Maybe we temporarily lost connection to AD; try to get cached data - GetCachedData(xContext); + GetCachedData(); } } @@ -186,7 +186,7 @@ private: return ""; } - void CacheData(const css::uno::Reference<css::uno::XComponentContext>& xContext) + void CacheData() { try { @@ -212,7 +212,7 @@ private: comphelper::Base64::encode(sOutBuf, seqCachedData); std::shared_ptr<comphelper::ConfigurationChanges> batch( - comphelper::ConfigurationChanges::create(xContext)); + comphelper::ConfigurationChanges::create()); officecfg::UserProfile::WinUserInfo::Cache::set(sOutBuf.makeStringAndClear(), batch); batch->commit(); } @@ -223,12 +223,12 @@ private: } } - void GetCachedData(const css::uno::Reference<css::uno::XComponentContext>& xContext) + void GetCachedData() { if (m_sUserDN.isEmpty()) throw css::uno::RuntimeException(); - OUString sCache = officecfg::UserProfile::WinUserInfo::Cache::get(xContext); + OUString sCache = officecfg::UserProfile::WinUserInfo::Cache::get(); if (sCache.isEmpty()) throw css::uno::RuntimeException(); @@ -308,13 +308,13 @@ namespace config { namespace WinUserInfo { -WinUserInfoBe::WinUserInfoBe(const css::uno::Reference<css::uno::XComponentContext>& xContext) +WinUserInfoBe::WinUserInfoBe() : WinUserInfoMutexHolder() , BackendBase(mMutex) { try { - m_pImpl.reset(new ADsUserAccess(xContext)); + m_pImpl.reset(new ADsUserAccess()); } catch (css::uno::RuntimeException&) { @@ -429,10 +429,10 @@ css::uno::Sequence<OUString> SAL_CALL WinUserInfoBe::getSupportedServiceNames() } extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface* -extensions_WinUserInfoBe_get_implementation(css::uno::XComponentContext* context, +extensions_WinUserInfoBe_get_implementation(css::uno::XComponentContext*, css::uno::Sequence<css::uno::Any> const&) { - return cppu::acquire(new extensions::config::WinUserInfo::WinUserInfoBe(context)); + return cppu::acquire(new extensions::config::WinUserInfo::WinUserInfoBe()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/config/WinUserInfo/WinUserInfoBe.hxx b/extensions/source/config/WinUserInfo/WinUserInfoBe.hxx index 7914121469c7..30ca088c3aca 100644 --- a/extensions/source/config/WinUserInfo/WinUserInfoBe.hxx +++ b/extensions/source/config/WinUserInfo/WinUserInfoBe.hxx @@ -51,7 +51,7 @@ struct WinUserInfoMutexHolder class WinUserInfoBe : private WinUserInfoMutexHolder, public BackendBase { public: - explicit WinUserInfoBe(const css::uno::Reference<css::uno::XComponentContext>& xContext); + explicit WinUserInfoBe(); virtual ~WinUserInfoBe() override; // XServiceInfo diff --git a/filter/source/config/cache/filterfactory.cxx b/filter/source/config/cache/filterfactory.cxx index 6bcb0cc4e326..c22e3bb03830 100644 --- a/filter/source/config/cache/filterfactory.cxx +++ b/filter/source/config/cache/filterfactory.cxx @@ -406,15 +406,9 @@ std::vector<OUString> FilterFactory::impl_getSortedFilterList(const QueryTokeniz } -std::vector<OUString> FilterFactory::impl_getListOfInstalledModules() const +std::vector<OUString> FilterFactory::impl_getListOfInstalledModules() { - // SAFE -> ---------------------- - osl::ClearableMutexGuard aLock(m_aMutex); - css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; - aLock.clear(); - // <- SAFE ---------------------- - - css::uno::Reference< css::container::XNameAccess > xModuleConfig = officecfg::Setup::Office::Factories::get(xContext); + css::uno::Reference< css::container::XNameAccess > xModuleConfig = officecfg::Setup::Office::Factories::get(); std::vector<OUString> lModules(comphelper::sequenceToContainer< std::vector<OUString> >(xModuleConfig->getElementNames())); return lModules; } @@ -469,17 +463,11 @@ std::vector<OUString> FilterFactory::impl_getSortedFilterListForModule(const OUS } -std::vector<OUString> FilterFactory::impl_readSortedFilterListFromConfig(const OUString& sModule) const +std::vector<OUString> FilterFactory::impl_readSortedFilterListFromConfig(const OUString& sModule) { - // SAFE -> ---------------------- - osl::ClearableMutexGuard aLock(m_aMutex); - css::uno::Reference< css::uno::XComponentContext > xContext = m_xContext; - aLock.clear(); - // <- SAFE ---------------------- - try { - css::uno::Reference< css::container::XNameAccess > xUISortConfig = officecfg::TypeDetection::UISort::ModuleDependendFilterOrder::get(xContext); + css::uno::Reference< css::container::XNameAccess > xUISortConfig = officecfg::TypeDetection::UISort::ModuleDependendFilterOrder::get(); // don't check the module name here. If it does not exists, an exception is thrown and caught below. // We return an empty list as result then. css::uno::Reference< css::container::XNameAccess > xModule; diff --git a/filter/source/config/cache/filterfactory.hxx b/filter/source/config/cache/filterfactory.hxx index 19abea5d6db0..f4c161df2914 100644 --- a/filter/source/config/cache/filterfactory.hxx +++ b/filter/source/config/cache/filterfactory.hxx @@ -95,7 +95,7 @@ class FilterFactory : public ::cppu::ImplInheritanceHelper< BaseContainer /** TODO document me */ - std::vector<OUString> impl_getListOfInstalledModules() const; + static std::vector<OUString> impl_getListOfInstalledModules(); /** @short implement the container string query: @@ -126,7 +126,7 @@ class FilterFactory : public ::cppu::ImplInheritanceHelper< BaseContainer @return A string list of internal filter names. Can be empty. */ - std::vector<OUString> impl_readSortedFilterListFromConfig(const OUString& sModule) const; + static std::vector<OUString> impl_readSortedFilterListFromConfig(const OUString& sModule); }; diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index 64dccd911941..c36d55deb81b 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -137,7 +137,7 @@ RemoteFilesDialog::~RemoteFilesDialog() } // save services - std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create( m_xContext ) ); + std::shared_ptr< comphelper::ConfigurationChanges > batch( comphelper::ConfigurationChanges::create() ); officecfg::Office::Common::Misc::FilePickerLastService::set( m_sLastServiceUrl, batch ); @@ -258,13 +258,13 @@ void RemoteFilesDialog::FillServicesListbox() m_aServices.clear(); // Load from user settings - Sequence< OUString > placesUrlsList( officecfg::Office::Common::Misc::FilePickerPlacesUrls::get( m_xContext ) ); - Sequence< OUString > placesNamesList( officecfg::Office::Common::Misc::FilePickerPlacesNames::get( m_xContext ) ); + Sequence< OUString > placesUrlsList( officecfg::Office::Common::Misc::FilePickerPlacesUrls::get() ); + Sequence< OUString > placesNamesList( officecfg::Office::Common::Misc::FilePickerPlacesNames::get() ); unsigned int nPos = 0; unsigned int i = 0; - m_sLastServiceUrl = officecfg::Office::Common::Misc::FilePickerLastService::get( m_xContext ); + m_sLastServiceUrl = officecfg::Office::Common::Misc::FilePickerLastService::get(); for( sal_Int32 nPlace = 0; nPlace < placesUrlsList.getLength() && nPlace < placesNamesList.getLength(); ++nPlace ) { diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 33f42647e308..c358636ca071 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -288,7 +288,6 @@ SvtFileDialog::SvtFileDialog(weld::Window* pParent, PickerFlags nStyle) , m_bIsInExecute(false) , m_bInExecuteAsync(false) , m_bHasFilename(false) - , m_xContext(comphelper::getProcessComponentContext()) { m_xImpl->m_xCbOptions = m_xBuilder->weld_check_button("options"); m_xImpl->m_xFtFileName = m_xBuilder->weld_label("file_name_label"); @@ -494,7 +493,7 @@ SvtFileDialog::~SvtFileDialog() } } - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_xContext)); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); officecfg::Office::Common::Misc::FilePickerPlacesUrls::set(placesUrlsList, batch); officecfg::Office::Common::Misc::FilePickerPlacesNames::set(placesNamesList, batch); batch->commit(); @@ -2284,8 +2283,8 @@ void SvtFileDialog::initDefaultPlaces( ) m_xImpl->m_xPlaces->AppendPlace( pRootPlace ); // Load from user settings - Sequence< OUString > placesUrlsList(officecfg::Office::Common::Misc::FilePickerPlacesUrls::get(m_xContext)); - Sequence< OUString > placesNamesList(officecfg::Office::Common::Misc::FilePickerPlacesNames::get(m_xContext)); + Sequence< OUString > placesUrlsList(officecfg::Office::Common::Misc::FilePickerPlacesUrls::get()); + Sequence< OUString > placesNamesList(officecfg::Office::Common::Misc::FilePickerPlacesNames::get()); for(sal_Int32 nPlace = 0; nPlace < placesUrlsList.getLength() && nPlace < placesNamesList.getLength(); ++nPlace) { diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx index 3578ae883de6..86b707e3aedf 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -77,8 +77,6 @@ private: m_pCurrentAsyncAction; bool m_bInExecuteAsync; bool m_bHasFilename; - css::uno::Reference < css::uno::XComponentContext > - m_xContext; DECL_LINK( FilterSelectHdl_Impl, weld::ComboBox&, void ); DECL_LINK( FilterSelectTimerHdl_Impl, Timer*, void ); diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx index 6aacbd040d3b..9d51bab8434e 100644 --- a/framework/source/helper/statusindicatorfactory.cxx +++ b/framework/source/helper/statusindicatorfactory.cxx @@ -375,7 +375,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed() VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow(xParentWindow); if ( pWindow ) { - bool bForceFrontAndFocus(officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(xContext)); + bool bForceFrontAndFocus(officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get()); pWindow->Show(true, bForceFrontAndFocus ? ShowFlags::ForegroundTask : ShowFlags::NONE ); } diff --git a/framework/source/jobs/helponstartup.cxx b/framework/source/jobs/helponstartup.cxx index 968a3aa10577..de7f787223c0 100644 --- a/framework/source/jobs/helponstartup.cxx +++ b/framework/source/jobs/helponstartup.cxx @@ -65,10 +65,10 @@ HelpOnStartup::HelpOnStartup(const css::uno::Reference< css::uno::XComponentCont m_xDesktop = css::frame::Desktop::create(m_xContext); // ask for office locale - m_sLocale = officecfg::Setup::L10N::ooLocale::get(m_xContext); + m_sLocale = officecfg::Setup::L10N::ooLocale::get(); // detect system - m_sSystem = officecfg::Office::Common::Help::System::get(m_xContext); + m_sSystem = officecfg::Office::Common::Help::System::get(); // Start listening for disposing events of these services, // so we can react e.g. for an office shutdown diff --git a/framework/source/loadenv/loadenv.cxx b/framework/source/loadenv/loadenv.cxx index 12cc84b7dab4..cb63ed31d232 100644 --- a/framework/source/loadenv/loadenv.cxx +++ b/framework/source/loadenv/loadenv.cxx @@ -681,8 +681,7 @@ bool queryOrcusTypeAndFilter(const uno::Sequence<beans::PropertyValue>& rDescrip // hack. // depending on the experimental mode - uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); - if (!xContext.is() || !officecfg::Office::Common::Misc::ExperimentalMode::get(xContext)) + if (!officecfg::Office::Common::Misc::ExperimentalMode::get()) { return false; } @@ -914,7 +913,7 @@ bool LoadEnv::impl_furtherDocsAllowed() try { - std::optional<sal_Int32> x(officecfg::Office::Common::Misc::MaxOpenDocuments::get(xContext)); + std::optional<sal_Int32> x(officecfg::Office::Common::Misc::MaxOpenDocuments::get()); // NIL means: count of allowed documents = infinite ! // => return true @@ -1704,7 +1703,7 @@ void LoadEnv::impl_makeFrameWindowVisible(const css::uno::Reference< css::awt::X bool bForceFrontAndFocus(false); if ( !preview ) { - bForceFrontAndFocus = officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(xContext); + bForceFrontAndFocus = officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(); } if( pWindow->IsVisible() && (bForceFrontAndFocus || bForceToFront) ) @@ -1774,7 +1773,7 @@ void LoadEnv::impl_applyPersistentWindowState(const css::uno::Reference< css::aw OUString sModule = lProps.getUnpackedValueOrDefault(FILTER_PROPNAME_ASCII_DOCUMENTSERVICE, OUString()); // get access to the configuration of this office module - css::uno::Reference< css::container::XNameAccess > xModuleCfg(officecfg::Setup::Office::Factories::get(xContext)); + css::uno::Reference< css::container::XNameAccess > xModuleCfg(officecfg::Setup::Office::Factories::get()); // read window state from the configuration // and apply it on the window. diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index bede4be05682..ae2188466898 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -1724,8 +1724,8 @@ void AutoRecovery::implts_openConfig() try { - nMinSpaceDocSave = officecfg::Office::Recovery::AutoSave::MinSpaceDocSave::get(m_xContext); - nMinSpaceConfigSave = officecfg::Office::Recovery::AutoSave::MinSpaceConfigSave::get(m_xContext); + nMinSpaceDocSave = officecfg::Office::Recovery::AutoSave::MinSpaceDocSave::get(); + nMinSpaceConfigSave = officecfg::Office::Recovery::AutoSave::MinSpaceConfigSave::get(); } catch(const css::uno::Exception&) { @@ -1748,13 +1748,13 @@ void AutoRecovery::implts_readAutoSaveConfig() implts_openConfig(); // AutoSave [bool] - bool bEnabled(officecfg::Office::Recovery::AutoSave::Enabled::get(m_xContext)); + bool bEnabled(officecfg::Office::Recovery::AutoSave::Enabled::get()); /* SAFE */ { osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex); if (bEnabled) { - bool bUserEnabled(officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::get(m_xContext)); + bool bUserEnabled(officecfg::Office::Recovery::AutoSave::UserAutoSaveEnabled::get()); m_eJob |= Job::AutoSave; m_eTimerType = AutoRecovery::E_NORMAL_AUTOSAVE_INTERVALL; @@ -1776,7 +1776,7 @@ void AutoRecovery::implts_readAutoSaveConfig() } /* SAFE */ // AutoSaveTimeIntervall [int] in min - sal_Int32 nTimeIntervall(officecfg::Office::Recovery::AutoSave::TimeIntervall::get(m_xContext)); + sal_Int32 nTimeIntervall(officecfg::Office::Recovery::AutoSave::TimeIntervall::get()); /* SAFE */ { osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex); @@ -1802,7 +1802,7 @@ void AutoRecovery::implts_readConfig() // <- REENTRANT -------------------------------- css::uno::Reference<css::container::XNameAccess> xRecoveryList( - officecfg::Office::Recovery::RecoveryList::get(m_xContext)); + officecfg::Office::Recovery::RecoveryList::get()); const OUString sRECOVERY_ITEM_BASE_IDENTIFIER(RECOVERY_ITEM_BASE_IDENTIFIER); const css::uno::Sequence< OUString > lItems = xRecoveryList->getElementNames(); const OUString* pItems = lItems.getConstArray(); @@ -1884,7 +1884,7 @@ void AutoRecovery::implts_specifyDefaultFilterAndExtension(AutoRecovery::TDocume { implts_openConfig(); // open module config on demand and cache the update access - xCFG.set(officecfg::Setup::Office::Factories::get(m_xContext), + xCFG.set(officecfg::Setup::Office::Factories::get(), css::uno::UNO_SET_THROW); /* SAFE */ { @@ -1985,14 +1985,14 @@ void AutoRecovery::implts_persistAllActiveViewNames() void AutoRecovery::implts_flushConfigItem(const AutoRecovery::TDocumentInfo& rInfo, bool bRemoveIt) { std::shared_ptr<comphelper::ConfigurationChanges> batch( - comphelper::ConfigurationChanges::create(m_xContext)); + comphelper::ConfigurationChanges::create()); try { implts_openConfig(); css::uno::Reference<css::container::XNameAccess> xCheck( - officecfg::Office::Recovery::RecoveryList::get(batch)); + officecfg::Office::Recovery::RecoveryList::get()); css::uno::Reference< css::container::XNameContainer > xModify(xCheck, css::uno::UNO_QUERY_THROW); css::uno::Reference< css::lang::XSingleServiceFactory > xCreate(xCheck, css::uno::UNO_QUERY_THROW); @@ -3629,7 +3629,7 @@ void AutoRecovery::implts_doEmergencySave(const DispatchParams& aParams) // documents exists and was saved. std::shared_ptr<comphelper::ConfigurationChanges> batch( - comphelper::ConfigurationChanges::create(m_xContext)); + comphelper::ConfigurationChanges::create()); officecfg::Office::Recovery::RecoveryInfo::Crashed::set(true, batch); batch->commit(); @@ -3686,7 +3686,7 @@ void AutoRecovery::implts_doRecovery(const DispatchParams& aParams) // Reset the configuration hint "we were crashed"! std::shared_ptr<comphelper::ConfigurationChanges> batch( - comphelper::ConfigurationChanges::create(m_xContext)); + comphelper::ConfigurationChanges::create()); officecfg::Office::Recovery::RecoveryInfo::Crashed::set(false, batch); batch->commit(); } @@ -3748,7 +3748,7 @@ void AutoRecovery::implts_doSessionQuietQuit() // Write a hint for "stored session data" into the configuration, so // the on next startup we know what's happen last time std::shared_ptr<comphelper::ConfigurationChanges> batch( - comphelper::ConfigurationChanges::create(m_xContext)); + comphelper::ConfigurationChanges::create()); officecfg::Office::Recovery::RecoveryInfo::SessionData::set(true, batch); batch->commit(); @@ -3780,7 +3780,7 @@ void AutoRecovery::implts_doSessionRestore(const DispatchParams& aParams) // Reset the configuration hint for "session save"! SAL_INFO("fwk.autorecovery", "... reset config key 'SessionData'"); std::shared_ptr<comphelper::ConfigurationChanges> batch( - comphelper::ConfigurationChanges::create(m_xContext)); + comphelper::ConfigurationChanges::create()); officecfg::Office::Recovery::RecoveryInfo::SessionData::set(false, batch); batch->commit(); @@ -3897,7 +3897,7 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue , { case AUTORECOVERY_PROPHANDLE_EXISTS_RECOVERYDATA : { - bool bSessionData = officecfg::Office::Recovery::RecoveryInfo::SessionData::get(m_xContext); + bool bSessionData = officecfg::Office::Recovery::RecoveryInfo::SessionData::get(); bool bRecoveryData = !m_lDocCache.empty(); // exists session data ... => then we can't say, that these @@ -3910,11 +3910,11 @@ void SAL_CALL AutoRecovery::getFastPropertyValue(css::uno::Any& aValue , break; case AUTORECOVERY_PROPHANDLE_CRASHED : - aValue <<= officecfg::Office::Recovery::RecoveryInfo::Crashed::get(m_xContext); + aValue <<= officecfg::Office::Recovery::RecoveryInfo::Crashed::get(); break; case AUTORECOVERY_PROPHANDLE_EXISTS_SESSIONDATA : - aValue <<= officecfg::Office::Recovery::RecoveryInfo::SessionData::get(m_xContext); + aValue <<= officecfg::Office::Recovery::RecoveryInfo::SessionData::get(); break; } } diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index bf50f889a9e4..b575233065f8 100644 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -135,7 +135,7 @@ typedef comphelper::WeakComponentImplHelper< class SubstitutePathVariables : public SubstitutePathVariables_BASE { public: - explicit SubstitutePathVariables(const css::uno::Reference< css::uno::XComponentContext >& xContext); + explicit SubstitutePathVariables(); virtual OUString SAL_CALL getImplementationName() override { @@ -185,11 +185,9 @@ private: VarNameToIndexMap m_aPreDefVarMap; // Mapping from pre-def variable names to enum for array access PredefinedPathVariables m_aPreDefVars; // All predefined variables std::vector<ReSubstFixedVarOrder> m_aReSubstFixedVarOrder; // To speed up resubstitution fixed variables (order for lookup) - css::uno::Reference< css::uno::XComponentContext > m_xContext; }; -SubstitutePathVariables::SubstitutePathVariables( const Reference< XComponentContext >& xContext ) : - m_xContext( xContext ) +SubstitutePathVariables::SubstitutePathVariables() { SetPredefinedPathVariables(); @@ -243,7 +241,7 @@ OUString SAL_CALL SubstitutePathVariables::getSubstituteVariableValue( const OUS OUString SubstitutePathVariables::GetWorkPath() const { OUString aWorkPath; - css::uno::Reference< css::container::XHierarchicalNameAccess > xPaths(officecfg::Office::Paths::Paths::get(m_xContext), css::uno::UNO_QUERY_THROW); + css::uno::Reference< css::container::XHierarchicalNameAccess > xPaths(officecfg::Office::Paths::Paths::get(), css::uno::UNO_QUERY_THROW); if (!(xPaths->getByHierarchicalName("['Work']/WritePath") >>= aWorkPath)) // fallback in case config layer does not return a usable work dir value. aWorkPath = GetWorkVariableValue(); @@ -254,7 +252,7 @@ OUString SubstitutePathVariables::GetWorkPath() const OUString SubstitutePathVariables::GetWorkVariableValue() const { OUString aWorkPath; - std::optional<OUString> x(officecfg::Office::Paths::Variables::Work::get(m_xContext)); + std::optional<OUString> x(officecfg::Office::Paths::Variables::Work::get()); if (!x) { // fallback to $HOME in case platform dependent config layer does not return @@ -688,10 +686,10 @@ void SubstitutePathVariables::SetPredefinedPathVariables() extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_framework_PathSubstitution_get_implementation( - css::uno::XComponentContext *context, + css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(new SubstitutePathVariables(context)); + return cppu::acquire(new SubstitutePathVariables()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/comphelper/configuration.hxx b/include/comphelper/configuration.hxx index 1ed37dcd45c3..8525b816a3c5 100644 --- a/include/comphelper/configuration.hxx +++ b/include/comphelper/configuration.hxx @@ -46,9 +46,7 @@ namespace detail { class ConfigurationWrapper; } /// directly. class COMPHELPER_DLLPUBLIC ConfigurationChanges { public: - static std::shared_ptr<ConfigurationChanges> create( - css::uno::Reference< css::uno::XComponentContext > - const & context = comphelper::getProcessComponentContext()); + static std::shared_ptr<ConfigurationChanges> create(); ~ConfigurationChanges(); @@ -85,9 +83,7 @@ namespace detail { /// @internal class COMPHELPER_DLLPUBLIC ConfigurationWrapper { public: - static ConfigurationWrapper const & get( - css::uno::Reference< css::uno::XComponentContext > - const & context); + static ConfigurationWrapper const & get(); SAL_DLLPRIVATE explicit ConfigurationWrapper( css::uno::Reference< css::uno::XComponentContext > @@ -193,24 +189,20 @@ template< typename T, typename U > struct ConfigurationProperty { /// Get the read-only status of the given (non-localized) configuration /// property. - static bool isReadOnly( - css::uno::Reference<css::uno::XComponentContext> const & context - = comphelper::getProcessComponentContext()) + static bool isReadOnly() { - return detail::ConfigurationWrapper::get(context).isReadOnly(T::path()); + return detail::ConfigurationWrapper::get().isReadOnly(T::path()); } /// Get the value of the given (non-localized) configuration property. /// /// For nillable properties, U is of type std::optional<U'>. - static U get( - css::uno::Reference< css::uno::XComponentContext > - const & context = comphelper::getProcessComponentContext()) + static U get() { // Folding this into one statement causes a bogus error at least with // Red Hat GCC 4.6.2-1: css::uno::Any a( - detail::ConfigurationWrapper::get(context).getPropertyValue( + detail::ConfigurationWrapper::get().getPropertyValue( T::path())); return detail::Convert< U >::fromAny(a); } @@ -247,12 +239,12 @@ template< typename T, typename U > struct ConfigurationLocalizedProperty /// com.sun.star.configuration.theDefaultProvider. /// /// For nillable properties, U is of type std::optional<U'>. - static U get(css::uno::Reference< css::uno::XComponentContext > const & context) + static U get() { // Folding this into one statement causes a bogus error at least with // Red Hat GCC 4.6.2-1: css::uno::Any a( - detail::ConfigurationWrapper::get(context). + detail::ConfigurationWrapper::get(). getLocalizedPropertyValue(T::path())); return detail::Convert< U >::fromAny(a); } @@ -288,10 +280,9 @@ template< typename T > struct ConfigurationGroup { /// Get read-only access to the given configuration group. static css::uno::Reference< css::container::XHierarchicalNameAccess > - get(css::uno::Reference< css::uno::XComponentContext > - const & context = comphelper::getProcessComponentContext()) + get() { - return detail::ConfigurationWrapper::get(context).getGroupReadOnly( + return detail::ConfigurationWrapper::get().getGroupReadOnly( T::path()); } @@ -322,10 +313,9 @@ template< typename T > struct ConfigurationSet { /// Get read-only access to the given configuration set. static css::uno::Reference< css::container::XNameAccess > - get(css::uno::Reference< css::uno::XComponentContext > - const & context = comphelper::getProcessComponentContext()) + get() { - return detail::ConfigurationWrapper::get(context).getSetReadOnly( + return detail::ConfigurationWrapper::get().getSetReadOnly( T::path()); } diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx index d67623555157..4e45df0012e6 100644 --- a/include/svx/PaletteManager.hxx +++ b/include/svx/PaletteManager.hxx @@ -47,7 +47,6 @@ class SVXCORE_DLLPUBLIC PaletteManager std::vector<std::unique_ptr<Palette>> m_Palettes; ColorSelectFunction maColorSelectFunction; - css::uno::Reference < css::uno::XComponentContext > m_context; std::unique_ptr<SvColorDialog> m_pColorDlg; public: diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx index 512b561ee997..faf5aea9b7e1 100644 --- a/include/svx/charmap.hxx +++ b/include/svx/charmap.hxx @@ -128,7 +128,6 @@ protected: std::deque<OUString> maFavCharFontList; rtl::Reference<svx::SvxShowCharSetAcc> m_xAccessible; - uno::Reference< uno::XComponentContext > mxContext; tools::Long nX; tools::Long nY; tools::Long m_nXGap; diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx index f21ac93117ad..4a99b423066a 100644 --- a/sc/source/filter/oox/workbookfragment.cxx +++ b/sc/source/filter/oox/workbookfragment.cxx @@ -544,9 +544,8 @@ void WorkbookFragment::recalcFormulaCells() // Recalculate formula cells. ScDocument& rDoc = getScDocument(); ScDocShell& rDocSh = getDocShell(rDoc); - Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); ScRecalcOptions nRecalcMode = - static_cast<ScRecalcOptions>(officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::get(xContext)); + static_cast<ScRecalcOptions>(officecfg::Office::Calc::Formula::Load::OOXMLRecalcMode::get()); bool bHardRecalc = false; if (nRecalcMode == RECALC_ASK) { diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index a0159d0c6628..4179a0ba5acf 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -497,9 +497,8 @@ bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const css::uno::Reference< css uno::Reference<document::XDocumentPropertiesSupplier> xDPS(GetModel(), uno::UNO_QUERY_THROW); uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties(); - Reference<uno::XComponentContext> xContext = comphelper::getProcessComponentContext(); ScRecalcOptions nRecalcMode = - static_cast<ScRecalcOptions>(officecfg::Office::Calc::Formula::Load::ODFRecalcMode::get(xContext)); + static_cast<ScRecalcOptions>(officecfg::Office::Calc::Formula::Load::ODFRecalcMode::get()); bool bHardRecalc = false; if (nRecalcMode == RECALC_ASK) diff --git a/sd/source/core/drawdoc.cxx b/sd/source/core/drawdoc.cxx index d765e3639288..f1a9a55cedcd 100644 --- a/sd/source/core/drawdoc.cxx +++ b/sd/source/core/drawdoc.cxx @@ -1111,7 +1111,7 @@ void SdDrawDocument::InitLayoutVector() // get file list from configuration const Sequence< OUString > aFiles( - officecfg::Office::Impress::Misc::LayoutListFiles::get(xContext) ); + officecfg::Office::Impress::Misc::LayoutListFiles::get() ); OUString sFilename; for( const auto& rFile : aFiles ) @@ -1150,7 +1150,7 @@ void SdDrawDocument::InitObjectVector() // get file list from configuration const Sequence< OUString > aFiles( - officecfg::Office::Impress::Misc::PresObjListFiles::get(xContext) ); + officecfg::Office::Impress::Misc::PresObjListFiles::get() ); OUString sFilename; for( const auto& rFile : aFiles ) diff --git a/sd/source/ui/remotecontrol/Server.cxx b/sd/source/ui/remotecontrol/Server.cxx index d1942df124c8..ab583c471982 100644 --- a/sd/source/ui/remotecontrol/Server.cxx +++ b/sd/source/ui/remotecontrol/Server.cxx @@ -348,8 +348,7 @@ void SdDLL::RegisterRemotes() if ( Application::IsHeadlessModeEnabled() ) return; - uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); - if ( xContext.is() && !officecfg::Office::Impress::Misc::Start::EnableSdremote::get( xContext ) ) + if ( !officecfg::Office::Impress::Misc::Start::EnableSdremote::get() ) return; sd::RemoteServer::setup(); diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index cf0eb92c3828..4f375dc6a05c 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1007,11 +1007,8 @@ void DrawViewShell::GetMenuState( SfxItemSet &rSet ) #ifndef ENABLE_SDREMOTE bDisableSdremoteForGood = true; #endif - uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); - if ( xContext.is() ) - bDisableSdremoteForGood |= ! ( /*officecfg::Office::Common::Misc::ExperimentalMode::get( xContext ) &&*/ - - officecfg::Office::Impress::Misc::Start::EnableSdremote::get( xContext ) ); + bDisableSdremoteForGood |= ! ( /*officecfg::Office::Common::Misc::ExperimentalMode::get() &&*/ + officecfg::Office::Impress::Misc::Start::EnableSdremote::get() ); // This dialog is only useful for TCP/IP remote control // which is unusual, under-tested and a security issue. diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 73d86cba8266..c8ea5cf45cd3 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -124,7 +124,7 @@ OUString const & getHelpRootURL() { static OUString const s_instURL = []() { - OUString tmp = officecfg::Office::Common::Path::Current::Help::get(comphelper::getProcessComponentContext()); + OUString tmp = officecfg::Office::Common::Path::Current::Help::get(); if (tmp.isEmpty()) { // try to determine path from default diff --git a/sfx2/source/control/emojicontrol.cxx b/sfx2/source/control/emojicontrol.cxx index 86c820dd230a..8b3c20607fd9 100644 --- a/sfx2/source/control/emojicontrol.cxx +++ b/sfx2/source/control/emojicontrol.cxx @@ -142,8 +142,7 @@ IMPL_STATIC_LINK(SfxEmojiControl, InsertHdl, ThumbnailViewItem*, pItem, void) const OUString& sHexText = pItem->getTitle(); sal_uInt32 cEmojiChar = sHexText.toUInt32(16); - uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); - OUString sFontName(officecfg::Office::Common::Misc::EmojiFont::get(xContext)); + OUString sFontName(officecfg::Office::Common::Misc::EmojiFont::get()); uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({ { "Symbols", uno::Any(OUString(&cEmojiChar, 1)) }, diff --git a/sfx2/source/control/emojiview.cxx b/sfx2/source/control/emojiview.cxx index a257ac85bf2c..02ee330e2c2a 100644 --- a/sfx2/source/control/emojiview.cxx +++ b/sfx2/source/control/emojiview.cxx @@ -85,8 +85,7 @@ void EmojiView::SetDrawingArea(weld::DrawingArea* pDrawingArea) { ThumbnailView::SetDrawingArea(pDrawingArea); - uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); - OUString sFontName(officecfg::Office::Common::Misc::EmojiFont::get(xContext)); + OUString sFontName(officecfg::Office::Common::Misc::EmojiFont::get()); vcl::Font aFont = pDrawingArea->get_font(); aFont.SetFamilyName(sFontName); OutputDevice& rDevice = pDrawingArea->get_ref_device(); diff --git a/sfx2/source/notebookbar/SfxNotebookBar.cxx b/sfx2/source/notebookbar/SfxNotebookBar.cxx index e70c7a88bd55..3f7bb9863314 100644 --- a/sfx2/source/notebookbar/SfxNotebookBar.cxx +++ b/sfx2/source/notebookbar/SfxNotebookBar.cxx @@ -114,7 +114,7 @@ static OUString lcl_getAppName( vcl::EnumContext::Application eApp ) static void lcl_setNotebookbarFileName( vcl::EnumContext::Application eApp, const OUString& sFileName ) { std::shared_ptr<comphelper::ConfigurationChanges> aBatch( - comphelper::ConfigurationChanges::create( ::comphelper::getProcessComponentContext() ) ); + comphelper::ConfigurationChanges::create() ); switch ( eApp ) { case vcl::EnumContext::Application::Writer: diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 7de17349ccfb..82404ce79246 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -2502,7 +2502,7 @@ void SfxViewFrame::ExecView_Impl static bool impl_maxOpenDocCountReached() { css::uno::Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - std::optional<sal_Int32> x(officecfg::Office::Common::Misc::MaxOpenDocuments::get(xContext)); + std::optional<sal_Int32> x(officecfg::Office::Common::Misc::MaxOpenDocuments::get()); // NIL means: count of allowed documents = infinite ! if (!x) return false; diff --git a/svl/source/config/asiancfg.cxx b/svl/source/config/asiancfg.cxx index 5f179447839d..3ff5797fccaf 100644 --- a/svl/source/config/asiancfg.cxx +++ b/svl/source/config/asiancfg.cxx @@ -54,15 +54,12 @@ OUString toString(css::lang::Locale const & locale) { struct SvxAsianConfig::Impl { Impl(): - context(comphelper::getProcessComponentContext()), - batch(comphelper::ConfigurationChanges::create(context)) + batch(comphelper::ConfigurationChanges::create()) {} Impl(const Impl&) = delete; Impl& operator=(const Impl&) = delete; - css::uno::Reference< css::uno::XComponentContext > context; - std::shared_ptr< comphelper::ConfigurationChanges > batch; }; @@ -76,8 +73,7 @@ void SvxAsianConfig::Commit() { bool SvxAsianConfig::IsKerningWesternTextOnly() const { return - officecfg::Office::Common::AsianLayout::IsKerningWesternTextOnly::get( - impl_->context); + officecfg::Office::Common::AsianLayout::IsKerningWesternTextOnly::get(); } void SvxAsianConfig::SetKerningWesternTextOnly(bool value) { @@ -86,8 +82,7 @@ void SvxAsianConfig::SetKerningWesternTextOnly(bool value) { } CharCompressType SvxAsianConfig::GetCharDistanceCompression() const { - return static_cast<CharCompressType>(officecfg::Office::Common::AsianLayout::CompressCharacterDistance::get( - impl_->context)); + return static_cast<CharCompressType>(officecfg::Office::Common::AsianLayout::CompressCharacterDistance::get()); } void SvxAsianConfig::SetCharDistanceCompression(CharCompressType value) { @@ -99,8 +94,7 @@ css::uno::Sequence< css::lang::Locale > SvxAsianConfig::GetStartEndCharLocales() const { const css::uno::Sequence< OUString > ns( - officecfg::Office::Common::AsianLayout::StartEndCharacters::get( - impl_->context)-> + officecfg::Office::Common::AsianLayout::StartEndCharacters::get()-> getElementNames()); css::uno::Sequence< css::lang::Locale > ls(ns.getLength()); std::transform(ns.begin(), ns.end(), ls.getArray(), @@ -114,8 +108,7 @@ bool SvxAsianConfig::GetStartEndChars( OUString & endChars) const { css::uno::Reference< css::container::XNameAccess > set( - officecfg::Office::Common::AsianLayout::StartEndCharacters::get( - impl_->context)); + officecfg::Office::Common::AsianLayout::StartEndCharacters::get()); css::uno::Any v; try { v = set->getByName(toString(locale)); diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx index d0c8b67d5de7..b61abd58e9ad 100644 --- a/svtools/source/dialogs/PlaceEditDialog.cxx +++ b/svtools/source/dialogs/PlaceEditDialog.cxx @@ -177,8 +177,6 @@ void PlaceEditDialog::InitDetails( ) { // Create CMIS controls for each server type - Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - // Load the ServerType entries bool bSkipGDrive = OUString( GDRIVE_CLIENT_ID ).isEmpty() || OUString( GDRIVE_CLIENT_SECRET ).isEmpty(); @@ -187,8 +185,8 @@ void PlaceEditDialog::InitDetails( ) bool bSkipOneDrive= OUString( ONEDRIVE_CLIENT_ID ).isEmpty() || OUString( ONEDRIVE_CLIENT_SECRET ).isEmpty(); - Sequence< OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get( xContext ) ); - Sequence< OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get( xContext ) ); + Sequence< OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get() ); + Sequence< OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get() ); int nPos = 0; auto nSize = std::min(aTypesUrlsList.getLength(), aTypesNamesList.getLength()); diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index 3617e48a82c8..23b6cda06ec7 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -64,7 +64,6 @@ FactoryFunction SvxShowCharSet::GetUITestFactory() const SvxShowCharSet::SvxShowCharSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow, const VclPtr<VirtualDevice>& rVirDev) : mxVirDev(rVirDev) , mxScrollArea(std::move(pScrolledWindow)) - , mxContext(comphelper::getProcessComponentContext()) , nX(0) , nY(0) , maFontSize(0, 0) @@ -302,7 +301,7 @@ void SvxShowCharSet::updateFavCharacterList(const OUString& sTitle, const OUStri aFavCharFontListRange[i] = maFavCharFontList[i]; } - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(mxContext)); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::set(aFavCharList, batch); officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterFontList::set(aFavCharFontList, batch); batch->commit(); @@ -339,7 +338,7 @@ void SvxShowCharSet::updateFavCharacterList(const OUString& sTitle, const OUStri aFavCharFontListRange[i] = maFavCharFontList[i]; } - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(mxContext)); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterList::set(aFavCharList, batch); officecfg::Office::Common::FavoriteCharacters::FavoriteCharacterFontList::set(aFavCharFontList, batch); batch->commit(); diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index cfc7eedeeeaf..55b2fdbd8a2d 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -61,8 +61,7 @@ PaletteManager::PaletteManager() : mnCurrentPalette(0), mnColorCount(0), mpBtnUpdater(nullptr), - maColorSelectFunction(PaletteManager::DispatchColorCommand), - m_context(comphelper::getProcessComponentContext()) + maColorSelectFunction(PaletteManager::DispatchColorCommand) { SfxObjectShell* pDocSh = SfxObjectShell::Current(); if(pDocSh) @@ -294,7 +293,7 @@ void PaletteManager::SetPalette( sal_Int32 nPos ) OUString aPaletteName(officecfg::Office::Common::UserColors::PaletteName::get()); if (aPaletteName != GetPaletteName()) { - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context)); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); officecfg::Office::Common::UserColors::PaletteName::set(GetPaletteName(), batch); batch->commit(); } @@ -363,7 +362,7 @@ void PaletteManager::AddRecentColor(const Color& rRecentColor, const OUString& r aColorListRange[i] = static_cast<sal_Int32>(maRecentColors[i].first); aColorNameListRange[i] = maRecentColors[i].second; } - std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create(m_context)); + std::shared_ptr<comphelper::ConfigurationChanges> batch(comphelper::ConfigurationChanges::create()); officecfg::Office::Common::UserColors::RecentColor::set(aColorList, batch); officecfg::Office::Common::UserColors::RecentColorName::set(aColorNameList, batch); batch->commit(); diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 90e9d9f9902b..0fe486ee2232 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -3350,10 +3350,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest, testTdf90362) { SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf90362.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - uno::Reference<uno::XComponentContext> xComponentContext(comphelper::getProcessComponentContext()); // Ensure correct initial setting std::shared_ptr<comphelper::ConfigurationChanges> batch( - comphelper::ConfigurationChanges::create(xComponentContext)); + comphelper::ConfigurationChanges::create()); officecfg::Office::Writer::Cursor::Option::IgnoreProtectedArea::set(false, batch); batch->commit(); // First check if the end of the second paragraph is indeed protected. diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx b/sw/qa/extras/uiwriter/uiwriter4.cxx index de93fd2e8125..c18216eed770 100644 --- a/sw/qa/extras/uiwriter/uiwriter4.cxx +++ b/sw/qa/extras/uiwriter/uiwriter4.cxx @@ -1747,11 +1747,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf105625) { SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf105625.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - uno::Reference<uno::XComponentContext> xComponentContext( - comphelper::getProcessComponentContext()); // Ensure correct initial setting std::shared_ptr<comphelper::ConfigurationChanges> batch( - comphelper::ConfigurationChanges::create(xComponentContext)); + comphelper::ConfigurationChanges::create()); officecfg::Office::Writer::Cursor::Option::IgnoreProtectedArea::set(false, batch); batch->commit(); // We should be able to edit at positions adjacent to fields. @@ -1783,11 +1781,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf125151_protected) // so read-only is already true when fieldmarks are considered. SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf125151_protected.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - uno::Reference<uno::XComponentContext> xComponentContext( - comphelper::getProcessComponentContext()); // Ensure correct initial setting std::shared_ptr<comphelper::ConfigurationChanges> batch( - comphelper::ConfigurationChanges::create(xComponentContext)); + comphelper::ConfigurationChanges::create()); officecfg::Office::Writer::Cursor::Option::IgnoreProtectedArea::set(false, batch); batch->commit(); pWrtShell->Down(/*bSelect=*/false); @@ -1803,11 +1799,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testTdf125151_protectedB) // Similar to testTdf105625 except this is protected with the Protect_Form compat setting SwDoc* pDoc = createSwDoc(DATA_DIRECTORY, "tdf125151_protectedB.fodt"); SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); - uno::Reference<uno::XComponentContext> xComponentContext( - comphelper::getProcessComponentContext()); // Ensure correct initial setting std::shared_ptr<comphelper::ConfigurationChanges> batch( - comphelper::ConfigurationChanges::create(xComponentContext)); + comphelper::ConfigurationChanges::create()); officecfg::Office::Writer::Cursor::Option::IgnoreProtectedArea::set(false, batch); batch->commit(); // The cursor starts inside of the FieldMark textbox. diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx index 4add6f1ee201..896d7108c0b1 100644 --- a/sw/source/core/crsr/pam.cxx +++ b/sw/source/core/crsr/pam.cxx @@ -731,7 +731,7 @@ bool SwPaM::HasReadonlySel( bool bFormView ) const const bool bAtStartA = (pA != nullptr) && (pA->GetMarkStart() == *GetPoint()); const bool bAtStartB = (pB != nullptr) && (pB->GetMarkStart() == *GetMark()); - if (officecfg::Office::Common::Filter::Microsoft::Import::ForceImportWWFieldsAsGenericFields::get(comphelper::getProcessComponentContext())) + if (officecfg::Office::Common::Filter::Microsoft::Import::ForceImportWWFieldsAsGenericFields::get()) { ; // allow editing all fields in generic mode } diff --git a/ucb/source/ucp/webdav-curl/CurlSession.cxx b/ucb/source/ucp/webdav-curl/CurlSession.cxx index 90ce91c3cddc..3e48874c3108 100644 --- a/ucb/source/ucp/webdav-curl/CurlSession.cxx +++ b/ucb/source/ucp/webdav-curl/CurlSession.cxx @@ -650,7 +650,7 @@ CurlSession::CurlSession(uno::Reference<uno::XComponentContext> const& xContext, throw DAVException(DAVException::DAV_SESSION_CREATE, ConnectionEndPointString(m_URI.GetHost(), m_URI.GetPort())); } - auto const connectTimeout(officecfg::Inet::Settings::ConnectTimeout::get(m_xContext)); + auto const connectTimeout(officecfg::Inet::Settings::ConnectTimeout::get()); // default is 300s rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_CONNECTTIMEOUT, ::std::max<long>(2L, ::std::min<long>(connectTimeout, 180L))); @@ -660,7 +660,7 @@ CurlSession::CurlSession(uno::Reference<uno::XComponentContext> const& xContext, throw DAVException(DAVException::DAV_SESSION_CREATE, ConnectionEndPointString(m_URI.GetHost(), m_URI.GetPort())); } - auto const readTimeout(officecfg::Inet::Settings::ReadTimeout::get(m_xContext)); + auto const readTimeout(officecfg::Inet::Settings::ReadTimeout::get()); m_nReadTimeout = ::std::max<int>(20, ::std::min<long>(readTimeout, 180)) * 1000; // default is infinite rc = curl_easy_setopt(m_pCurl.get(), CURLOPT_TIMEOUT, 300L); diff --git a/ucb/source/ucp/webdav-curl/webdavcontent.cxx b/ucb/source/ucp/webdav-curl/webdavcontent.cxx index 30f141368e3a..8528f31fa263 100644 --- a/ucb/source/ucp/webdav-curl/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-curl/webdavcontent.cxx @@ -3971,23 +3971,23 @@ void Content::initOptsCacheLifeTime() // officecfg/registry/schema/org/openoffice/Inet.xcs // for use of these field values. sal_uInt32 nAtime; - nAtime = officecfg::Inet::Settings::OptsCacheLifeImplWeb::get( m_xContext ); + nAtime = officecfg::Inet::Settings::OptsCacheLifeImplWeb::get(); m_nOptsCacheLifeImplWeb = std::max( sal_uInt32( 0 ), std::min( nAtime, sal_uInt32( 3600 ) ) ); - nAtime = officecfg::Inet::Settings::OptsCacheLifeDAV::get( m_xContext ); + nAtime = officecfg::Inet::Settings::OptsCacheLifeDAV::get(); m_nOptsCacheLifeDAV = std::max( sal_uInt32( 0 ), std::min( nAtime, sal_uInt32( 3600 ) ) ); - nAtime = officecfg::Inet::Settings::OptsCacheLifeDAVLocked::get( m_xContext ); + nAtime = officecfg::Inet::Settings::OptsCacheLifeDAVLocked::get(); m_nOptsCacheLifeDAVLocked = std::max( sal_uInt32( 0 ), std::min( nAtime, sal_uInt32( 3600 ) ) ); - nAtime = officecfg::Inet::Settings::OptsCacheLifeNotImpl::get( m_xContext ); + nAtime = officecfg::Inet::Settings::OptsCacheLifeNotImpl::get(); m_nOptsCacheLifeNotImpl = std::max( sal_uInt32( 0 ), std::min( nAtime, sal_uInt32( 43200 ) ) ); - nAtime = officecfg::Inet::Settings::OptsCacheLifeNotFound::get( m_xContext ); + nAtime = officecfg::Inet::Settings::OptsCacheLifeNotFound::get(); m_nOptsCacheLifeNotFound = std::max( sal_uInt32( 0 ), std::min( nAtime, sal_uInt32( 30 ) ) ); } diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index 0e64a4269e35..9660efc09c53 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -2262,17 +2262,13 @@ enum WhichPersona { PERSONA_HEADER, PERSONA_FOOTER }; /** Update the setting of the Persona header / footer in ImplStyleData */ static void setupPersonaHeaderFooter( WhichPersona eWhich, OUString& rHeaderFooter, BitmapEx& rHeaderFooterBitmap, std::optional<Color>& rMenuBarTextColor ) { - uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); - if ( !xContext.is() ) - return; - // don't burn time loading images we don't need. if ( Application::IsHeadlessModeEnabled() ) return; // read from the configuration - OUString aPersona( officecfg::Office::Common::Misc::Persona::get( xContext ) ); - OUString aPersonaSettings( officecfg::Office::Common::Misc::PersonaSettings::get( xContext ) ); + OUString aPersona( officecfg::Office::Common::Misc::Persona::get() ); + OUString aPersonaSettings( officecfg::Office::Common::Misc::PersonaSettings::get() ); // have the settings changed? marks if header /footer prepared before //should maybe extended to a flag that marks if header /footer /both are loaded @@ -3098,14 +3094,10 @@ StyleSettings::DetermineIconTheme() const else { // read from the configuration, or fallback to what the desktop wants - uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext()); - if (xContext.is()) - { - sTheme = officecfg::Office::Common::Misc::SymbolStyle::get(xContext); + sTheme = officecfg::Office::Common::Misc::SymbolStyle::get(); - if (sTheme.isEmpty() || sTheme == "auto") - sTheme = GetAutomaticallyChosenIconTheme(); - } + if (sTheme.isEmpty() || sTheme == "auto") + sTheme = GetAutomaticallyChosenIconTheme(); } } diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 96cd04008148..b1f18dc50041 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -997,7 +997,7 @@ bool Dialog::ImplStartExecute() css::uno::Reference< css::uno::XComponentContext > xContext( comphelper::getProcessComponentContext()); - bool bForceFocusAndToFront(officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(xContext)); + bool bForceFocusAndToFront(officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get()); ShowFlags showFlags = bForceFocusAndToFront ? ShowFlags::ForegroundTask : ShowFlags::NONE; Show(true, showFlags); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 2475da8baa5b..882bd28086a6 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -318,7 +318,7 @@ DomainMapper_Impl::DomainMapper_Impl( m_xTextDocument( xModel, uno::UNO_QUERY ), m_xTextFactory( xModel, uno::UNO_QUERY ), m_xComponentContext( xContext ), - m_bForceGenericFields(!utl::ConfigManager::IsFuzzing() && officecfg::Office::Common::Filter::Microsoft::Import::ForceImportWWFieldsAsGenericFields::get(m_xComponentContext)), + m_bForceGenericFields(!utl::ConfigManager::IsFuzzing() && officecfg::Office::Common::Filter::Microsoft::Import::ForceImportWWFieldsAsGenericFields::get()), m_bSetUserFieldContent( false ), m_bSetCitation( false ), m_bSetDateValue( false ), @@ -418,7 +418,7 @@ DomainMapper_Impl::DomainMapper_Impl( getTableManager( ).setHandler(m_pTableHandler); getTableManager( ).startLevel(); - m_bUsingEnhancedFields = !utl::ConfigManager::IsFuzzing() && officecfg::Office::Common::Filter::Microsoft::Import::ImportWWFieldsAsEnhancedFields::get(m_xComponentContext); + m_bUsingEnhancedFields = !utl::ConfigManager::IsFuzzing() && officecfg::Office::Common::Filter::Microsoft::Import::ImportWWFieldsAsEnhancedFields::get(); m_pSdtHelper = new SdtHelper(*this, m_xComponentContext); @@ -2615,7 +2615,7 @@ void DomainMapper_Impl::appendOLE( const OUString& rStreamName, const std::share uno::Reference< text::XTextContent > xOLE( m_xTextFactory->createInstance("com.sun.star.text.TextEmbeddedObject"), uno::UNO_QUERY_THROW ); uno::Reference< beans::XPropertySet > xOLEProperties(xOLE, uno::UNO_QUERY_THROW); - OUString aCLSID = pOLEHandler->getCLSID(m_xComponentContext); + OUString aCLSID = pOLEHandler->getCLSID(); if (aCLSID.isEmpty()) xOLEProperties->setPropertyValue(getPropertyName( PROP_STREAM_NAME ), uno::makeAny( rStreamName )); diff --git a/writerfilter/source/dmapper/OLEHandler.cxx b/writerfilter/source/dmapper/OLEHandler.cxx index f7cc322d808a..6cdde201e9f6 100644 --- a/writerfilter/source/dmapper/OLEHandler.cxx +++ b/writerfilter/source/dmapper/OLEHandler.cxx @@ -236,24 +236,24 @@ void OLEHandler::importStream(const uno::Reference<uno::XComponentContext>& xCom m_sProgId); } -OUString OLEHandler::getCLSID(const uno::Reference<uno::XComponentContext>& xComponentContext) const +OUString OLEHandler::getCLSID() const { OUString aRet; // See officecfg/registry/data/org/openoffice/Office/Embedding.xcu. if (m_sProgId == "Word.Document.12") { - if (officecfg::Office::Common::Filter::Microsoft::Import::WinWordToWriter::get(xComponentContext)) + if (officecfg::Office::Common::Filter::Microsoft::Import::WinWordToWriter::get()) aRet = "8BC6B165-B1B2-4EDD-aa47-dae2ee689dd6"; } else if (m_sProgId == "Excel.Sheet.12") { - if (officecfg::Office::Common::Filter::Microsoft::Import::ExcelToCalc::get(xComponentContext)) + if (officecfg::Office::Common::Filter::Microsoft::Import::ExcelToCalc::get()) aRet = "47BBB4CB-CE4C-4E80-A591-42D9AE74950F"; } else if (m_sProgId == "Equation.3") { - if (officecfg::Office::Common::Filter::Microsoft::Import::MathTypeToMath::get(xComponentContext)) + if (officecfg::Office::Common::Filter::Microsoft::Import::MathTypeToMath::get()) aRet = "078B7ABA-54FC-457F-8551-6147E776A997"; } else diff --git a/writerfilter/source/dmapper/OLEHandler.hxx b/writerfilter/source/dmapper/OLEHandler.hxx index f0279d1dc854..67fed0128186 100644 --- a/writerfilter/source/dmapper/OLEHandler.hxx +++ b/writerfilter/source/dmapper/OLEHandler.hxx @@ -77,7 +77,7 @@ public: const css::uno::Reference<css::text::XTextContent>& xOLE); /// Get the CLSID of the OLE object, in case we can find one based on m_sProgId. - OUString getCLSID(const css::uno::Reference<css::uno::XComponentContext>& xComponentContext) const; + OUString getCLSID() const; OUString const & GetDrawAspect() const; OUString const & GetVisAreaWidth() const; diff --git a/xmlhelp/source/cxxhelp/provider/provider.cxx b/xmlhelp/source/cxxhelp/provider/provider.cxx index ff31b25ee9aa..c98d3704ceb1 100644 --- a/xmlhelp/source/cxxhelp/provider/provider.cxx +++ b/xmlhelp/source/cxxhelp/provider/provider.cxx @@ -198,7 +198,7 @@ void ContentProvider::init() isInitialized = true; OUString instPath( - officecfg::Office::Common::Path::Current::Help::get(m_xContext)); + officecfg::Office::Common::Path::Current::Help::get()); if( instPath.isEmpty() ) // try to determine path from default instPath = "$(instpath)/" LIBO_SHARE_HELP_FOLDER; @@ -206,22 +206,21 @@ void ContentProvider::init() subst( instPath ); OUString stylesheet( - officecfg::Office::Common::Help::HelpStyleSheet::get(m_xContext)); + officecfg::Office::Common::Help::HelpStyleSheet::get()); // now adding as configuration change listener for the stylesheet m_xContainer.set( - officecfg::Office::Common::Help::get(m_xContext), + officecfg::Office::Common::Help::get(), css::uno::UNO_QUERY_THROW); m_xContainer->addContainerListener( this ); OUString setupversion( - officecfg::Setup::Product::ooSetupVersion::get(m_xContext)); + officecfg::Setup::Product::ooSetupVersion::get()); OUString setupextension( - officecfg::Setup::Product::ooSetupExtension::get(m_xContext)); + officecfg::Setup::Product::ooSetupExtension::get()); OUString productversion( setupversion + " " + setupextension ); - bool showBasic = officecfg::Office::Common::Help::ShowBasic::get( - m_xContext); + bool showBasic = officecfg::Office::Common::Help::ShowBasic::get(); m_pDatabases.reset( new Databases( showBasic, instPath, utl::ConfigManager::getProductName(), |