diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-06-03 22:43:13 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-06-04 11:31:03 +0200 |
commit | 8331ecac51c5b090cb3cce7d20da5ba403a74b01 (patch) | |
tree | 05befa8896b312eba4baa96cb1b4e1219d6c34d7 /framework/source | |
parent | e848e95faa5cea1f258c9f97d99ffc91614e5a3b (diff) |
Upcoming loplugin:elidestringvar: framework
Change-Id: I5a786316e9fa6dab0166c435c6a1ac9e5d8014a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95466
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'framework/source')
-rw-r--r-- | framework/source/accelerators/acceleratorconfiguration.cxx | 3 | ||||
-rw-r--r-- | framework/source/classes/taskcreator.cxx | 3 | ||||
-rw-r--r-- | framework/source/dispatch/oxt_handler.cxx | 3 | ||||
-rw-r--r-- | framework/source/services/pathsettings.cxx | 15 | ||||
-rw-r--r-- | framework/source/uielement/macrosmenucontroller.cxx | 3 | ||||
-rw-r--r-- | framework/source/uielement/toolbarsmenucontroller.cxx | 3 | ||||
-rw-r--r-- | framework/source/uifactory/uicontrollerfactory.cxx | 3 |
7 files changed, 10 insertions, 23 deletions
diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index 6daa18b33a6c..2c01e90a47e2 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -479,9 +479,8 @@ OUString XMLBasedAcceleratorConfiguration::impl_ts_getLocale() const XCUBasedAcceleratorConfiguration::XCUBasedAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& xContext) : m_xContext (xContext ) { - const OUString CFG_ENTRY_ACCELERATORS("org.openoffice.Office.Accelerators"); m_xCfg.set( - ::comphelper::ConfigurationHelper::openConfig( m_xContext, CFG_ENTRY_ACCELERATORS, ::comphelper::EConfigurationModes::AllLocales ), + ::comphelper::ConfigurationHelper::openConfig( m_xContext, "org.openoffice.Office.Accelerators", ::comphelper::EConfigurationModes::AllLocales ), css::uno::UNO_QUERY ); } diff --git a/framework/source/classes/taskcreator.cxx b/framework/source/classes/taskcreator.cxx index 65755aa8d674..aae5849b89a8 100644 --- a/framework/source/classes/taskcreator.cxx +++ b/framework/source/classes/taskcreator.cxx @@ -56,11 +56,10 @@ TaskCreator::~TaskCreator() css::uno::Reference< css::frame::XFrame > TaskCreator::createTask( const OUString& sName, const utl::MediaDescriptor& rDescriptor ) { css::uno::Reference< css::lang::XSingleServiceFactory > xCreator; - OUString sCreator = IMPLEMENTATIONNAME_FWK_TASKCREATOR; try { - xCreator.set( m_xContext->getServiceManager()->createInstanceWithContext(sCreator, m_xContext), css::uno::UNO_QUERY_THROW); + xCreator.set( m_xContext->getServiceManager()->createInstanceWithContext(IMPLEMENTATIONNAME_FWK_TASKCREATOR, m_xContext), css::uno::UNO_QUERY_THROW); } catch(const css::uno::Exception&) {} diff --git a/framework/source/dispatch/oxt_handler.cxx b/framework/source/dispatch/oxt_handler.cxx index 8bc67abf9105..5d6540e01a28 100644 --- a/framework/source/dispatch/oxt_handler.cxx +++ b/framework/source/dispatch/oxt_handler.cxx @@ -87,11 +87,10 @@ void SAL_CALL Oxt_Handler::dispatchWithNotification( const css::util::URL& aURL, { osl::MutexGuard g(m_mutex); - OUString sServiceName = "com.sun.star.deployment.ui.PackageManagerDialog"; css::uno::Sequence< css::uno::Any > lParams(1); lParams[0] <<= aURL.Main; - css::uno::Reference< css::uno::XInterface > xService = m_xFactory->createInstanceWithArguments( sServiceName, lParams ); + css::uno::Reference< css::uno::XInterface > xService = m_xFactory->createInstanceWithArguments( "com.sun.star.deployment.ui.PackageManagerDialog", lParams ); css::uno::Reference< css::task::XJobExecutor > xExecuteable( xService, css::uno::UNO_QUERY ); if ( xExecuteable.is() ) xExecuteable->trigger( OUString() ); diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx index 74a9810ee402..6f288ce96da4 100644 --- a/framework/source/services/pathsettings.cxx +++ b/framework/source/services/pathsettings.cxx @@ -576,9 +576,6 @@ std::vector<OUString> PathSettings::impl_readOldFormat(const OUString& sPath) // NO substitution here ! It's done outside ... PathSettings::PathInfo PathSettings::impl_readNewFormat(const OUString& sPath) { - const OUString CFGPROP_INTERNALPATHS("InternalPaths"); - const OUString CFGPROP_ISSINGLEPATH("IsSinglePath"); - css::uno::Reference< css::container::XNameAccess > xCfg = fa_getCfgNew(); // get access to the "queried" path @@ -589,7 +586,7 @@ PathSettings::PathInfo PathSettings::impl_readNewFormat(const OUString& sPath) // read internal path list css::uno::Reference< css::container::XNameAccess > xIPath; - xPath->getByName(CFGPROP_INTERNALPATHS) >>= xIPath; + xPath->getByName("InternalPaths") >>= xIPath; aPathVal.lInternalPaths = comphelper::sequenceToContainer<std::vector<OUString>>(xIPath->getElementNames()); // read user defined path list @@ -607,7 +604,7 @@ PathSettings::PathInfo PathSettings::impl_readNewFormat(const OUString& sPath) aPathVal.lUserPaths.erase(aI); // read state props - xPath->getByName(CFGPROP_ISSINGLEPATH) >>= aPathVal.bIsSinglePath; + xPath->getByName("IsSinglePath") >>= aPathVal.bIsSinglePath; // analyze finalized/mandatory states aPathVal.bIsReadonly = false; @@ -1360,8 +1357,6 @@ css::uno::Reference< css::util::XStringSubstitution > PathSettings::fa_getSubsti css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgOld() { - const OUString CFG_NODE_OLD("org.openoffice.Office.Common/Path/Current"); - css::uno::Reference< css::container::XNameAccess > xCfg; { // SAFE -> osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex); @@ -1372,7 +1367,7 @@ css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgOld() { xCfg.set( ::comphelper::ConfigurationHelper::openConfig( m_xContext, - CFG_NODE_OLD, + "org.openoffice.Office.Common/Path/Current", ::comphelper::EConfigurationModes::Standard), // not readonly! Sometimes we need write access there !!! css::uno::UNO_QUERY_THROW); @@ -1387,8 +1382,6 @@ css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgOld() css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgNew() { - const OUString CFG_NODE_NEW("org.openoffice.Office.Paths/Paths"); - css::uno::Reference< css::container::XNameAccess > xCfg; { // SAFE -> osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex); @@ -1399,7 +1392,7 @@ css::uno::Reference< css::container::XNameAccess > PathSettings::fa_getCfgNew() { xCfg.set( ::comphelper::ConfigurationHelper::openConfig( m_xContext, - CFG_NODE_NEW, + "org.openoffice.Office.Paths/Paths", ::comphelper::EConfigurationModes::Standard), css::uno::UNO_QUERY_THROW); diff --git a/framework/source/uielement/macrosmenucontroller.cxx b/framework/source/uielement/macrosmenucontroller.cxx index e6700d0ebf31..f776a0b06bb0 100644 --- a/framework/source/uielement/macrosmenucontroller.cxx +++ b/framework/source/uielement/macrosmenucontroller.cxx @@ -118,10 +118,9 @@ void MacrosMenuController::addScriptItems( PopupMenu* pPopupMenu, sal_uInt16 sta const OUString aCmdBase(".uno:ScriptOrganizer?ScriptOrganizer.Language:string="); const OUString ellipsis( "..." ); const OUString providerKey("com.sun.star.script.provider.ScriptProviderFor"); - const OUString languageProviderName("com.sun.star.script.provider.LanguageScriptProvider"); sal_uInt16 itemId = startItemId; Reference< XContentEnumerationAccess > xEnumAccess( m_xContext->getServiceManager(), UNO_QUERY_THROW ); - Reference< XEnumeration > xEnum = xEnumAccess->createContentEnumeration ( languageProviderName ); + Reference< XEnumeration > xEnum = xEnumAccess->createContentEnumeration ( "com.sun.star.script.provider.LanguageScriptProvider" ); while ( xEnum->hasMoreElements() ) { diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index be2f42c57712..c6c9ab409a70 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -450,8 +450,7 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > co } OUString aLabelStr(FwkResId(STR_RESTORE_TOOLBARS)); - OUString aRestoreCmd( CMD_RESTOREVISIBILITY ); - addCommand( m_xPopupMenu, aRestoreCmd, aLabelStr ); + addCommand( m_xPopupMenu, CMD_RESTOREVISIBILITY, aLabelStr ); } // XEventListener diff --git a/framework/source/uifactory/uicontrollerfactory.cxx b/framework/source/uifactory/uicontrollerfactory.cxx index 35d883a4c9f0..73959546a0ce 100644 --- a/framework/source/uifactory/uicontrollerfactory.cxx +++ b/framework/source/uifactory/uicontrollerfactory.cxx @@ -118,7 +118,6 @@ Reference< XInterface > SAL_CALL UIControllerFactory::createInstanceWithArgument const Reference< XComponentContext >& ) { const OUString aPropModuleName( "ModuleIdentifier" ); - const OUString aPropValueName( "Value" ); OUString aPropName; PropertyValue aPropValue; @@ -149,7 +148,7 @@ Reference< XInterface > SAL_CALL UIControllerFactory::createInstanceWithArgument // Append the optional value argument. It's an empty string if no additional info // is provided to the controller. OUString aValue = m_pConfigAccess->getValueFromCommandModule( ServiceSpecifier, aPropName ); - aPropValue.Name = aPropValueName; + aPropValue.Name = "Value"; aPropValue.Value <<= aValue; aNewArgs[nAppendIndex+1] <<= aPropValue; |