[Libreoffice-commits] core.git: framework/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Thu Jun 4 09:31:36 UTC 2020


 framework/source/accelerators/acceleratorconfiguration.cxx |    3 --
 framework/source/classes/taskcreator.cxx                   |    3 --
 framework/source/dispatch/oxt_handler.cxx                  |    3 --
 framework/source/services/pathsettings.cxx                 |   15 +++----------
 framework/source/uielement/macrosmenucontroller.cxx        |    3 --
 framework/source/uielement/toolbarsmenucontroller.cxx      |    3 --
 framework/source/uifactory/uicontrollerfactory.cxx         |    3 --
 7 files changed, 10 insertions(+), 23 deletions(-)

New commits:
commit 8331ecac51c5b090cb3cce7d20da5ba403a74b01
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed Jun 3 22:43:13 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Jun 4 11:31:03 2020 +0200

    Upcoming loplugin:elidestringvar: framework
    
    Change-Id: I5a786316e9fa6dab0166c435c6a1ac9e5d8014a6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95466
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

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;
 


More information about the Libreoffice-commits mailing list