[Libreoffice-commits] core.git: connectivity/source cui/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Nov 7 11:01:10 UTC 2016


 connectivity/source/commontools/AutoRetrievingBase.cxx |    3 -
 connectivity/source/commontools/DriversConfig.cxx      |    7 +---
 connectivity/source/commontools/predicateinput.cxx     |    7 +---
 connectivity/source/drivers/dbase/DTable.cxx           |    3 -
 connectivity/source/drivers/flat/ETable.cxx            |    3 -
 connectivity/source/drivers/hsqldb/HCatalog.cxx        |    6 +--
 connectivity/source/drivers/hsqldb/HTables.cxx         |   10 +-----
 connectivity/source/drivers/hsqldb/HUser.cxx           |   27 +++++------------
 connectivity/source/drivers/mysql/YCatalog.cxx         |    9 +----
 connectivity/source/drivers/mysql/YTables.cxx          |   13 ++------
 connectivity/source/drivers/mysql/YUser.cxx            |   27 +++++------------
 connectivity/source/parse/sqliterator.cxx              |    6 +--
 cui/source/customize/acccfg.cxx                        |   13 ++------
 cui/source/customize/cfg.cxx                           |    6 +--
 cui/source/customize/cfgutil.cxx                       |   17 +++-------
 cui/source/customize/macropg.cxx                       |    3 -
 cui/source/dialogs/hlinettp.cxx                        |    3 -
 cui/source/options/optupdt.cxx                         |    3 -
 cui/source/tabpages/autocdlg.cxx                       |   15 +++------
 cui/source/tabpages/numpages.cxx                       |   18 +++--------
 20 files changed, 66 insertions(+), 133 deletions(-)

New commits:
commit fae35e535d2757244eccf4b5f5555293a24180b3
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Nov 7 10:47:55 2016 +0200

    loplugin:oncevar in cui..connectivity
    
    Change-Id: Ibe9d04932b0a57040db4fee11886dc1701f6ea17
    Reviewed-on: https://gerrit.libreoffice.org/30653
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
    Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/connectivity/source/commontools/AutoRetrievingBase.cxx b/connectivity/source/commontools/AutoRetrievingBase.cxx
index ac573ac..f64d441 100644
--- a/connectivity/source/commontools/AutoRetrievingBase.cxx
+++ b/connectivity/source/commontools/AutoRetrievingBase.cxx
@@ -31,10 +31,9 @@ namespace connectivity
         if ( sStmt.startsWith("INSERT") )
         {
             sStatement = m_sGeneratedValueStatement;
-            static const char sColumn[] = "$column";
             static const char sTable[] = "$table";
             sal_Int32 nIndex = 0;
-            nIndex = sStatement.indexOf(sColumn,nIndex);
+            nIndex = sStatement.indexOf("$column",nIndex);
             if ( -1 != nIndex )
             { // we need a column
             }
diff --git a/connectivity/source/commontools/DriversConfig.cxx b/connectivity/source/commontools/DriversConfig.cxx
index f7b5441..c40ed47 100644
--- a/connectivity/source/commontools/DriversConfig.cxx
+++ b/connectivity/source/commontools/DriversConfig.cxx
@@ -45,13 +45,12 @@ namespace
         if ( aPropertiesNode.isValid() )
         {
             uno::Sequence< OUString > aStringSeq;
-            static const char s_sValue[] = "/Value";
             const uno::Sequence< OUString > aProperties = aPropertiesNode.getNodeNames();
             const OUString* pPropertiesIter = aProperties.getConstArray();
             const OUString* pPropertiesEnd  = pPropertiesIter + aProperties.getLength();
             for (;pPropertiesIter != pPropertiesEnd ; ++pPropertiesIter)
             {
-                uno::Any aValue = aPropertiesNode.getNodeValue(*pPropertiesIter + s_sValue);
+                uno::Any aValue = aPropertiesNode.getNodeValue(*pPropertiesIter + "/Value");
                 if ( aValue >>= aStringSeq )
                 {
                     lcl_convert(aStringSeq,aValue);
@@ -98,8 +97,8 @@ void DriversConfigImpl::Load(const uno::Reference< uno::XComponentContext >& _rx
     {
         if ( !m_aInstalled.isValid() )
         {
-            static const char s_sNodeName[] = "org.openoffice.Office.DataAccess.Drivers/Installed"; ///Installed
-            m_aInstalled = ::utl::OConfigurationTreeRoot::createWithComponentContext(_rxORB, s_sNodeName, -1, ::utl::OConfigurationTreeRoot::CM_READONLY);
+            m_aInstalled = ::utl::OConfigurationTreeRoot::createWithComponentContext(_rxORB,
+                             "org.openoffice.Office.DataAccess.Drivers/Installed", -1, ::utl::OConfigurationTreeRoot::CM_READONLY);
         }
 
         if ( m_aInstalled.isValid() )
diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx
index c32f225..c3c91fa 100644
--- a/connectivity/source/commontools/predicateinput.cxx
+++ b/connectivity/source/commontools/predicateinput.cxx
@@ -146,19 +146,16 @@ namespace dbtools
                     )
                 {
                     static const char sSingleQuote[] = "'";
-                    static const char sDoubleQuote[] =  "''";
 
                     sal_Int32 nIndex = -1;
                     sal_Int32 nTemp = 0;
                     while ( -1 != ( nIndex = sQuoted.indexOf( '\'',nTemp ) ) )
                     {
-                        sQuoted = sQuoted.replaceAt( nIndex, 1, sDoubleQuote );
+                        sQuoted = sQuoted.replaceAt( nIndex, 1, "''" );
                         nTemp = nIndex+2;
                     }
 
-                    OUString sTemp( sSingleQuote );
-                    ( sTemp += sQuoted ) += sSingleQuote;
-                    sQuoted = sTemp;
+                    sQuoted = sSingleQuote + sQuoted + sSingleQuote;
                 }
                 pReturn = const_cast< OSQLParser& >( m_aParser ).predicateTree( _rErrorMessage, sQuoted, m_xFormatter, _rxField );
             }
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 858de8e..11d35d1 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -628,13 +628,12 @@ OUString ODbaseTable::getEntry(OConnection* _pConnection,const OUString& _sName
         OUString sName;
         OUString sExt;
         INetURLObject aURL;
-        static const char s_sSeparator[] = "/";
         xDir->beforeFirst();
         while(xDir->next())
         {
             sName = xRow->getString(1);
             aURL.SetSmartProtocol(INetProtocol::File);
-            OUString sUrl = _pConnection->getURL() +  s_sSeparator + sName;
+            OUString sUrl = _pConnection->getURL() + "/" + sName;
             aURL.SetSmartURL( sUrl );
 
             // cut the extension
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index b40c7f9..034aa77 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -460,12 +460,11 @@ OUString OFlatTable::getEntry()
 
         INetURLObject aURL;
         xDir->beforeFirst();
-        static const char s_sSeparator[] = "/";
         while(xDir->next())
         {
             sName = xRow->getString(1);
             aURL.SetSmartProtocol(INetProtocol::File);
-            OUString sUrl = m_pConnection->getURL() +  s_sSeparator + sName;
+            OUString sUrl = m_pConnection->getURL() + "/" + sName;
             aURL.SetSmartURL( sUrl );
 
             // cut the extension
diff --git a/connectivity/source/drivers/hsqldb/HCatalog.cxx b/connectivity/source/drivers/hsqldb/HCatalog.cxx
index 13cc609..a3baf0f 100644
--- a/connectivity/source/drivers/hsqldb/HCatalog.cxx
+++ b/connectivity/source/drivers/hsqldb/HCatalog.cxx
@@ -52,12 +52,10 @@ void OHCatalog::refreshObjects(const Sequence< OUString >& _sKindOfObject,TStrin
 void OHCatalog::refreshTables()
 {
     TStringVector aVector;
-    static const char s_sTableTypeView[] = "VIEW";
-    static const char s_sTableTypeTable[] = "TABLE";
 
     Sequence< OUString > sTableTypes(2);
-    sTableTypes[0] = s_sTableTypeView;
-    sTableTypes[1] = s_sTableTypeTable;
+    sTableTypes[0] = "VIEW";
+    sTableTypes[1] = "TABLE";
 
     refreshObjects(sTableTypes,aVector);
 
diff --git a/connectivity/source/drivers/hsqldb/HTables.cxx b/connectivity/source/drivers/hsqldb/HTables.cxx
index 0175f67..30ff90c 100644
--- a/connectivity/source/drivers/hsqldb/HTables.cxx
+++ b/connectivity/source/drivers/hsqldb/HTables.cxx
@@ -51,14 +51,10 @@ sdbcx::ObjectType OTables::createObject(const OUString& _rName)
     OUString sCatalog,sSchema,sTable;
     ::dbtools::qualifiedNameComponents(m_xMetaData,_rName,sCatalog,sSchema,sTable,::dbtools::EComposeRule::InDataManipulation);
 
-    static const char s_sTableTypeView[] = "VIEW";
-    static const char s_sTableTypeTable[] = "TABLE";
-    static const char s_sAll[] = "%";
-
     Sequence< OUString > sTableTypes(3);
-    sTableTypes[0] = s_sTableTypeView;
-    sTableTypes[1] = s_sTableTypeTable;
-    sTableTypes[2] = s_sAll;    // just to be sure to include anything else ....
+    sTableTypes[0] = "VIEW";
+    sTableTypes[1] = "TABLE";
+    sTableTypes[2] = "%";    // just to be sure to include anything else ....
 
     Any aCatalog;
     if ( !sCatalog.isEmpty() )
diff --git a/connectivity/source/drivers/hsqldb/HUser.cxx b/connectivity/source/drivers/hsqldb/HUser.cxx
index dc7f200..e736830 100644
--- a/connectivity/source/drivers/hsqldb/HUser.cxx
+++ b/connectivity/source/drivers/hsqldb/HUser.cxx
@@ -119,15 +119,6 @@ void OHSQLUser::findPrivilegesAndGrantPrivileges(const OUString& objName, sal_In
 
     if ( xRes.is() )
     {
-        static const char sSELECT   [] = "SELECT";
-        static const char sINSERT   [] = "INSERT";
-        static const char sUPDATE   [] = "UPDATE";
-        static const char sDELETE   [] = "DELETE";
-        static const char sREAD     [] = "READ";
-        static const char sCREATE   [] = "CREATE";
-        static const char sALTER    [] = "ALTER";
-        static const char sREFERENCE[] = "REFERENCE";
-        static const char sDROP     [] = "DROP";
         static const char sYes      [] = "YES";
 
         nRightsWithGrant = nRights = 0;
@@ -142,55 +133,55 @@ void OHSQLUser::findPrivilegesAndGrantPrivileges(const OUString& objName, sal_In
             if (!m_Name.equalsIgnoreAsciiCase(sGrantee))
                 continue;
 
-            if (sPrivilege.equalsIgnoreAsciiCase(sSELECT))
+            if (sPrivilege.equalsIgnoreAsciiCase("SELECT"))
             {
                 nRights |= Privilege::SELECT;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::SELECT;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sINSERT))
+            else if (sPrivilege.equalsIgnoreAsciiCase("INSERT"))
             {
                 nRights |= Privilege::INSERT;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::INSERT;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sUPDATE))
+            else if (sPrivilege.equalsIgnoreAsciiCase("UPDATE"))
             {
                 nRights |= Privilege::UPDATE;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::UPDATE;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sDELETE))
+            else if (sPrivilege.equalsIgnoreAsciiCase("DELETE"))
             {
                 nRights |= Privilege::DELETE;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::DELETE;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sREAD))
+            else if (sPrivilege.equalsIgnoreAsciiCase("READ"))
             {
                 nRights |= Privilege::READ;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::READ;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sCREATE))
+            else if (sPrivilege.equalsIgnoreAsciiCase("CREATE"))
             {
                 nRights |= Privilege::CREATE;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::CREATE;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sALTER))
+            else if (sPrivilege.equalsIgnoreAsciiCase("ALTER"))
             {
                 nRights |= Privilege::ALTER;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::ALTER;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sREFERENCE))
+            else if (sPrivilege.equalsIgnoreAsciiCase("REFERENCE"))
             {
                 nRights |= Privilege::REFERENCE;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::REFERENCE;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sDROP))
+            else if (sPrivilege.equalsIgnoreAsciiCase("DROP"))
             {
                 nRights |= Privilege::DROP;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
diff --git a/connectivity/source/drivers/mysql/YCatalog.cxx b/connectivity/source/drivers/mysql/YCatalog.cxx
index 6c98d12..c98890c 100644
--- a/connectivity/source/drivers/mysql/YCatalog.cxx
+++ b/connectivity/source/drivers/mysql/YCatalog.cxx
@@ -53,14 +53,11 @@ void OMySQLCatalog::refreshObjects(const Sequence< OUString >& _sKindOfObject,TS
 void OMySQLCatalog::refreshTables()
 {
     TStringVector aVector;
-    static const char s_sTableTypeView[] = "VIEW";
-    static const char s_sTableTypeTable[] = "TABLE";
-    static const char s_sAll[] = "%";
 
     Sequence< OUString > sTableTypes(3);
-    sTableTypes[0] = s_sTableTypeView;
-    sTableTypes[1] = s_sTableTypeTable;
-    sTableTypes[2] = s_sAll;    // just to be sure to include anything else ....
+    sTableTypes[0] = "VIEW";
+    sTableTypes[1] = "TABLE";
+    sTableTypes[2] = "%";    // just to be sure to include anything else ....
 
     refreshObjects(sTableTypes,aVector);
 
diff --git a/connectivity/source/drivers/mysql/YTables.cxx b/connectivity/source/drivers/mysql/YTables.cxx
index 7d12bf8..3cad536 100644
--- a/connectivity/source/drivers/mysql/YTables.cxx
+++ b/connectivity/source/drivers/mysql/YTables.cxx
@@ -51,14 +51,10 @@ sdbcx::ObjectType OTables::createObject(const OUString& _rName)
     OUString sCatalog,sSchema,sTable;
     ::dbtools::qualifiedNameComponents(m_xMetaData,_rName,sCatalog,sSchema,sTable,::dbtools::EComposeRule::InDataManipulation);
 
-    static const char s_sTableTypeView[] = "VIEW";
-    static const char s_sTableTypeTable[] = "TABLE";
-    static const char s_sAll[] = "%";
-
     Sequence< OUString > sTableTypes(3);
-    sTableTypes[0] = s_sTableTypeView;
-    sTableTypes[1] = s_sTableTypeTable;
-    sTableTypes[2] = s_sAll;    // just to be sure to include anything else ....
+    sTableTypes[0] = "VIEW";
+    sTableTypes[1] = "TABLE";
+    sTableTypes[2] = "%";    // just to be sure to include anything else ....
 
     Any aCatalog;
     if ( !sCatalog.isEmpty() )
@@ -180,8 +176,7 @@ OUString OTables::adjustSQL(const OUString& _sSql)
 void OTables::createTable( const Reference< XPropertySet >& descriptor )
 {
     const Reference< XConnection > xConnection = static_cast<OMySQLCatalog&>(m_rParent).getConnection();
-    static const char s_sCreatePattern[] = "(M,D)";
-    const OUString aSql = adjustSQL(::dbtools::createSqlCreateTableStatement(descriptor,xConnection,this,s_sCreatePattern));
+    const OUString aSql = adjustSQL(::dbtools::createSqlCreateTableStatement(descriptor,xConnection, this, "(M,D)"));
     Reference< XStatement > xStmt = xConnection->createStatement(  );
     if ( xStmt.is() )
     {
diff --git a/connectivity/source/drivers/mysql/YUser.cxx b/connectivity/source/drivers/mysql/YUser.cxx
index 0cd8d5a..e386d9b 100644
--- a/connectivity/source/drivers/mysql/YUser.cxx
+++ b/connectivity/source/drivers/mysql/YUser.cxx
@@ -119,15 +119,6 @@ void OMySQLUser::findPrivilegesAndGrantPrivileges(const OUString& objName, sal_I
 
     if ( xRes.is() )
     {
-        static const char sSELECT   [] = "SELECT";
-        static const char sINSERT   [] = "INSERT";
-        static const char sUPDATE   [] = "UPDATE";
-        static const char sDELETE   [] = "DELETE";
-        static const char sREAD     [] = "READ";
-        static const char sCREATE   [] = "CREATE";
-        static const char sALTER    [] = "ALTER";
-        static const char sREFERENCE[] = "REFERENCES";
-        static const char sDROP     [] = "DROP";
         static const char sYes      [] = "YES";
 
         nRightsWithGrant = nRights = 0;
@@ -142,55 +133,55 @@ void OMySQLUser::findPrivilegesAndGrantPrivileges(const OUString& objName, sal_I
             if (!m_Name.equalsIgnoreAsciiCase(sGrantee))
                 continue;
 
-            if (sPrivilege.equalsIgnoreAsciiCase(sSELECT))
+            if (sPrivilege.equalsIgnoreAsciiCase("SELECT"))
             {
                 nRights |= Privilege::SELECT;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::SELECT;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sINSERT))
+            else if (sPrivilege.equalsIgnoreAsciiCase("INSERT"))
             {
                 nRights |= Privilege::INSERT;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::INSERT;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sUPDATE))
+            else if (sPrivilege.equalsIgnoreAsciiCase("UPDATE"))
             {
                 nRights |= Privilege::UPDATE;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::UPDATE;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sDELETE))
+            else if (sPrivilege.equalsIgnoreAsciiCase("DELETE"))
             {
                 nRights |= Privilege::DELETE;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::DELETE;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sREAD))
+            else if (sPrivilege.equalsIgnoreAsciiCase("READ"))
             {
                 nRights |= Privilege::READ;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::READ;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sCREATE))
+            else if (sPrivilege.equalsIgnoreAsciiCase("CREATE"))
             {
                 nRights |= Privilege::CREATE;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::CREATE;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sALTER))
+            else if (sPrivilege.equalsIgnoreAsciiCase("ALTER"))
             {
                 nRights |= Privilege::ALTER;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::ALTER;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sREFERENCE))
+            else if (sPrivilege.equalsIgnoreAsciiCase("REFERENCES"))
             {
                 nRights |= Privilege::REFERENCE;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
                     nRightsWithGrant |= Privilege::REFERENCE;
             }
-            else if (sPrivilege.equalsIgnoreAsciiCase(sDROP))
+            else if (sPrivilege.equalsIgnoreAsciiCase("DROP"))
             {
                 nRights |= Privilege::DROP;
                 if ( sGrantable.equalsIgnoreAsciiCase(sYes) )
diff --git a/connectivity/source/parse/sqliterator.cxx b/connectivity/source/parse/sqliterator.cxx
index 4ace9f0..0f0e0d3 100644
--- a/connectivity/source/parse/sqliterator.cxx
+++ b/connectivity/source/parse/sqliterator.cxx
@@ -261,14 +261,12 @@ namespace
     {
         OUString sComposedName;
 
-        static const char s_sTableTypeView[] = "VIEW";
-        static const char s_sTableTypeTable[] = "TABLE";
         static const char s_sWildcard[] = "%" ;
 
         // we want all catalogues, all schemas, all tables
         Sequence< OUString > sTableTypes(3);
-        sTableTypes[0] = s_sTableTypeView;
-        sTableTypes[1] = s_sTableTypeTable;
+        sTableTypes[0] = "VIEW";
+        sTableTypes[1] = "TABLE";
         sTableTypes[2] = s_sWildcard;   // just to be sure to include anything else ....
 
         if ( _rxDBMeta.is() )
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index ae7d1cc..6d36d9c 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -74,14 +74,9 @@
 
 using namespace css;
 
-static const char MODULEPROP_SHORTNAME  [] = "ooSetupFactoryShortName";
-static const char MODULEPROP_UINAME     [] = "ooSetupFactoryUIName";
-static const char CMDPROP_UINAME        [] = "Name";
-
 static const char FOLDERNAME_UICONFIG   [] = "Configurations2";
 
 static const char MEDIATYPE_PROPNAME    [] = "MediaType";
-static const char MEDIATYPE_UICONFIG    [] = "application/vnd.sun.xml.ui.configuration";
 
 static const sal_uInt16 KEYCODE_ARRAY[] =
 {
@@ -884,8 +879,8 @@ void SfxAcceleratorConfigPage::InitAccCfg()
                  frame::ModuleManager::create(m_xContext);
         m_sModuleLongName = xModuleManager->identify(m_xFrame);
         comphelper::SequenceAsHashMap lModuleProps(xModuleManager->getByName(m_sModuleLongName));
-        m_sModuleShortName = lModuleProps.getUnpackedValueOrDefault(MODULEPROP_SHORTNAME, OUString());
-        m_sModuleUIName    = lModuleProps.getUnpackedValueOrDefault(MODULEPROP_UINAME   , OUString());
+        m_sModuleShortName = lModuleProps.getUnpackedValueOrDefault("ooSetupFactoryShortName", OUString());
+        m_sModuleUIName    = lModuleProps.getUnpackedValueOrDefault("ooSetupFactoryUIName", OUString());
 
         // get global accelerator configuration
         m_xGlobal = css::ui::GlobalAcceleratorConfiguration::create(m_xContext);
@@ -1357,7 +1352,7 @@ IMPL_LINK_NOARG(SfxAcceleratorConfigPage, SaveHdl, sfx2::FileDialogHelper*, void
             OUString sMediaType;
             xUIConfigProps->getPropertyValue(MEDIATYPE_PROPNAME) >>= sMediaType;
             if (sMediaType.isEmpty())
-                xUIConfigProps->setPropertyValue(MEDIATYPE_PROPNAME, uno::makeAny(OUString(MEDIATYPE_UICONFIG)));
+                xUIConfigProps->setPropertyValue(MEDIATYPE_PROPNAME, uno::makeAny(OUString("application/vnd.sun.xml.ui.configuration")));
 
             uno::Reference<ui::XUIConfigurationManager2> xCfgMgr2 = ui::UIConfigurationManager::create(m_xContext);
             xCfgMgr2->setStorage(xUIConfig);
@@ -1522,7 +1517,7 @@ OUString SfxAcceleratorConfigPage::GetLabel4Command(const OUString& sCommand)
         if (xModuleConf.is())
         {
             ::comphelper::SequenceAsHashMap lProps(xModuleConf->getByName(sCommand));
-            OUString sLabel = lProps.getUnpackedValueOrDefault(CMDPROP_UINAME, OUString());
+            OUString sLabel = lProps.getUnpackedValueOrDefault("Name", OUString());
             if (!sLabel.isEmpty())
                 return sLabel;
         }
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 20dece2..cf734f7 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -114,9 +114,7 @@ static const char ITEM_MENUBAR_URL[] = "private:resource/menubar/menubar";
 static const char ITEM_TOOLBAR_URL[] = "private:resource/toolbar/";
 
 static const char CUSTOM_TOOLBAR_STR[] = "custom_toolbar_";
-static const char CUSTOM_MENU_STR[] = "vnd.openoffice.org:CustomMenu";
 
-static const char aSeparatorStr[] = "----------------------------------";
 static const char aMenuSeparatorStr[] = " | ";
 
 namespace uno = com::sun::star::uno;
@@ -337,7 +335,7 @@ generateCustomMenuURL(
     SvxEntries* entries,
     sal_Int32 suffix = 1 )
 {
-    OUString url = CUSTOM_MENU_STR + OUString::number( suffix );
+    OUString url = "vnd.openoffice.org:CustomMenu" + OUString::number( suffix );
     if (!entries)
         return url;
 
@@ -2321,7 +2319,7 @@ SvTreeListEntry* SvxConfigPage::InsertEntryIntoUI(
     if (pNewEntryData->IsSeparator())
     {
         pNewEntry = m_pContentsListBox->InsertEntry(
-            OUString(aSeparatorStr),
+            OUString("----------------------------------"),
             nullptr, false, nPos, pNewEntryData);
     }
     else
diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 1209658..99cc9fe 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -76,9 +76,6 @@ void SfxStylesInfo_Impl::setModel(const css::uno::Reference< css::frame::XModel
     m_xDoc = xModel;
 }
 
-static const char CMDURL_SPART [] = ".uno:StyleApply?Style:string=";
-static const char CMDURL_FPART2[] = "&FamilyName:string=";
-
 static const char CMDURL_STYLEPROT_ONLY[] = ".uno:StyleApply?";
 static const char CMDURL_SPART_ONLY    [] = "Style:string=";
 static const char CMDURL_FPART_ONLY    [] = "FamilyName:string=";
@@ -87,12 +84,10 @@ static const char STYLEPROP_UINAME[] = "DisplayName";
 
 OUString SfxStylesInfo_Impl::generateCommand(const OUString& sFamily, const OUString& sStyle)
 {
-    OUStringBuffer sCommand(1024);
-    sCommand.append(CMDURL_SPART );
-    sCommand.append(sStyle       );
-    sCommand.append(CMDURL_FPART2);
-    sCommand.append(sFamily      );
-    return sCommand.makeStringAndClear();
+    return ".uno:StyleApply?Style:string="
+           + sStyle
+           + "&FamilyName:string="
+           + sFamily;
 }
 
 bool SfxStylesInfo_Impl::parseStyleCommand(SfxStyleInfo_Impl& aStyle)
@@ -206,8 +201,6 @@ void SfxStylesInfo_Impl::getLabel4Style(SfxStyleInfo_Impl& aStyle)
 
 ::std::vector< SfxStyleInfo_Impl > SfxStylesInfo_Impl::getStyles(const OUString& sFamily)
 {
-    static const char PROP_UINAME[] = "DisplayName";
-
     css::uno::Sequence< OUString > lStyleNames;
     css::uno::Reference< css::style::XStyleFamiliesSupplier > xModel(m_xDoc, css::uno::UNO_QUERY_THROW);
     css::uno::Reference< css::container::XNameAccess > xFamilies = xModel->getStyleFamilies();
@@ -238,7 +231,7 @@ void SfxStylesInfo_Impl::getLabel4Style(SfxStyleInfo_Impl& aStyle)
             xStyleSet->getByName(aStyleInfo.sStyle) >>= xStyle;
             if (!xStyle.is())
                 continue;
-            xStyle->getPropertyValue(PROP_UINAME) >>= aStyleInfo.sLabel;
+            xStyle->getPropertyValue("DisplayName") >>= aStyleInfo.sLabel;
         }
         catch(const css::uno::RuntimeException&)
             { throw; }
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 4575e9f..70dbf42 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -51,7 +51,6 @@ using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
 
 static const char aVndSunStarUNO[] = "vnd.sun.star.UNO:";
-static const char aVndSunStarScript[] = "vnd.sun.star.script:";
 
 SvxMacroTabPage_Impl::SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet )
     : pAssignPB(nullptr)
@@ -470,7 +469,7 @@ void IconLBoxString::Paint(const Point& aPos, SvTreeListBox& /*aDevice*/, vcl::R
         }
         else
         {
-            aPureMethod = aURL.copy(strlen(aVndSunStarScript));
+            aPureMethod = aURL.copy(strlen("vnd.sun.star.script:"));
             aPureMethod = aPureMethod.copy( 0, aPureMethod.indexOf( '?' ) );
         }
 
diff --git a/cui/source/dialogs/hlinettp.cxx b/cui/source/dialogs/hlinettp.cxx
index 71cc15c..0f6d2c6 100644
--- a/cui/source/dialogs/hlinettp.cxx
+++ b/cui/source/dialogs/hlinettp.cxx
@@ -25,7 +25,6 @@
 #include "hlmarkwn_def.hxx"
 
 sal_Char const sAnonymous[]    = "anonymous";
-sal_Char const sHTTPScheme[]   = INET_HTTP_SCHEME;
 sal_Char const sFTPScheme[]    = INET_FTP_SCHEME;
 
 /*************************************************************************
@@ -276,7 +275,7 @@ void SvxHyperlinkInternetTp::SetScheme(const OUString& rScheme)
     m_pCbAnonymous->Show( bFTP );
 
     //update 'link target in document'-window and opening-button
-    if (rScheme.startsWith(sHTTPScheme) || rScheme.isEmpty())
+    if (rScheme.startsWith(INET_HTTP_SCHEME) || rScheme.isEmpty())
     {
         if ( mbMarkWndOpen )
             ShowMarkWnd ();
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index 58bd1aa..36e2b99 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -277,8 +277,7 @@ void SvxOnlineUpdateTabPage::Reset( const SfxItemSet* )
 {
     bool bValue = false;
     m_xUpdateAccess->getByName( "AutoCheckEnabled" ) >>= bValue;
-    OUStringLiteral sPath("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/AutoCheckEnabled");
-    beans::Property aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName(sPath);
+    beans::Property aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/AutoCheckEnabled");
     bool bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
 
     m_pAutoCheckCheckBox->Check(bValue);
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 67efba2..3ebc03a 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -2391,16 +2391,9 @@ void OfaAutoCompleteTabPage::CopyToClipboard() const
     if (m_pAutoCompleteList && nSelCnt)
     {
         TransferDataContainer* pCntnr = new TransferDataContainer;
-        css::uno::Reference<
-            css::datatransfer::XTransferable > xRef( pCntnr );
+        css::uno::Reference< css::datatransfer::XTransferable > xRef( pCntnr );
 
         OStringBuffer sData;
-        const sal_Char aLineEnd[] =
-#if defined(_WIN32)
-                "\015\012";
-#else
-                "\012";
-#endif
 
         rtl_TextEncoding nEncode = osl_getThreadTextEncoding();
 
@@ -2408,7 +2401,11 @@ void OfaAutoCompleteTabPage::CopyToClipboard() const
         {
             sData.append(OUStringToOString(m_pLBEntries->GetSelectEntry(n),
                 nEncode));
-            sData.append(aLineEnd);
+#if defined(_WIN32)
+            sData.append("\015\012");
+#else
+            sData.append("\012");
+#endif
         }
         pCntnr->CopyByteString( SotClipboardFormatId::STRING, sData.makeStringAndClear() );
         pCntnr->CopyToClipboard( static_cast<vcl::Window*>(const_cast<OfaAutoCompleteTabPage *>(this)) );
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 5846d9e..6aacd7e 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -101,12 +101,6 @@ using namespace css::style;
 #define SEARCHFILENAME_DELIMITER    ((sal_Unicode)'/')
 
 static bool bLastRelative =         false;
-static const sal_Char cNumberingType[] = "NumberingType";
-static const sal_Char cParentNumbering[] = "ParentNumbering";
-static const sal_Char cPrefix[] = "Prefix";
-static const sal_Char cSuffix[] = "Suffix";
-static const sal_Char cBulletChar[] = "BulletChar";
-static const sal_Char cBulletFontName[] = "BulletFontName";
 
 static SvxNumSettings_Impl* lcl_CreateNumSettingsPtr(const Sequence<PropertyValue>& rLevelProps)
 {
@@ -114,17 +108,17 @@ static SvxNumSettings_Impl* lcl_CreateNumSettingsPtr(const Sequence<PropertyValu
     SvxNumSettings_Impl* pNew = new SvxNumSettings_Impl;
     for(sal_Int32 j = 0; j < rLevelProps.getLength(); j++)
     {
-        if ( pValues[j].Name == cNumberingType )
+        if ( pValues[j].Name == "NumberingType" )
             pValues[j].Value >>= pNew->nNumberType;
-        else if ( pValues[j].Name == cPrefix )
+        else if ( pValues[j].Name == "Prefix" )
             pValues[j].Value >>= pNew->sPrefix;
-        else if ( pValues[j].Name == cSuffix )
+        else if ( pValues[j].Name == "Suffix" )
             pValues[j].Value >>= pNew->sSuffix;
-        else if ( pValues[j].Name == cParentNumbering )
+        else if ( pValues[j].Name == "ParentNumbering" )
             pValues[j].Value >>= pNew->nParentNumbering;
-        else if ( pValues[j].Name == cBulletChar )
+        else if ( pValues[j].Name == "BulletChar" )
             pValues[j].Value >>= pNew->sBulletChar;
-        else if ( pValues[j].Name == cBulletFontName )
+        else if ( pValues[j].Name == "BulletFontName" )
             pValues[j].Value >>= pNew->sBulletFont;
     }
     return pNew;


More information about the Libreoffice-commits mailing list