[Libreoffice-commits] .: desktop/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Dec 30 02:08:26 PST 2012


 desktop/source/deployment/dp_log.cxx                     |    9 
 desktop/source/deployment/dp_persmap.cxx                 |    4 
 desktop/source/deployment/inc/lockfile.hxx               |   14 -
 desktop/source/deployment/misc/dp_dependencies.cxx       |   52 +---
 desktop/source/deployment/misc/dp_descriptioninfoset.cxx |  195 +++++----------
 desktop/source/deployment/misc/dp_identifier.cxx         |    2 
 6 files changed, 94 insertions(+), 182 deletions(-)

New commits:
commit 0f3ee5e0d60e9e8b8c7e18393dda46532c72d658
Author: Chr. Rossmanith <ChrRossmanith at gmx.de>
Date:   Sun Dec 30 11:07:28 2012 +0100

    RTL_CONSTASCII_(U)STRINGPARAM removed in desktop/source/deployment
    
    removed OUSTR() as well and replaced equals() with ==
    
    Change-Id: Ica293711467cd93c8b4df3d52bb72bd0710ca05a

diff --git a/desktop/source/deployment/dp_log.cxx b/desktop/source/deployment/dp_log.cxx
index c9c070b..461f55f 100644
--- a/desktop/source/deployment/dp_log.cxx
+++ b/desktop/source/deployment/dp_log.cxx
@@ -106,8 +106,7 @@ ProgressLogImpl::ProgressLogImpl(
 
     // write log stamp
     OStringBuffer buf;
-    buf.append(
-        RTL_CONSTASCII_STRINGPARAM("###### Progress log entry ") );
+    buf.append( "###### Progress log entry " );
     TimeValue m_start_time, tLocal;
     oslDateTime date_time;
     if (osl_getSystemTime( &m_start_time ) &&
@@ -122,7 +121,7 @@ ProgressLogImpl::ProgressLogImpl(
             date_time.Hours, date_time.Minutes, date_time.Seconds );
         buf.append( ar );
     }
-    buf.append( RTL_CONSTASCII_STRINGPARAM("######\n") );
+    buf.append( "######\n" );
     log_write( buf.makeStringAndClear() );
 }
 
@@ -171,10 +170,10 @@ void ProgressLogImpl::update( Any const & Status )
         buf.append( msg );
     }
     else {
-        buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("ERROR: ") );
+        buf.appendAscii( "ERROR: " );
         buf.append( ::comphelper::anyToString(Status) );
     }
-    buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("\n") );
+    buf.appendAscii( "\n" );
     log_write( OUStringToOString(
                    buf.makeStringAndClear(), osl_getThreadTextEncoding() ) );
 }
diff --git a/desktop/source/deployment/dp_persmap.cxx b/desktop/source/deployment/dp_persmap.cxx
index d1d8592..05cd002 100644
--- a/desktop/source/deployment/dp_persmap.cxx
+++ b/desktop/source/deployment/dp_persmap.cxx
@@ -330,9 +330,9 @@ bool PersistentMap::importFromBDB()
 
     // get the name of its BDB counterpart
     rtl::OUString aDBName = m_MapFileName;
-    if( !aDBName.endsWithAsciiL( ".pmap", 5))
+    if( !aDBName.endsWith( ".pmap" ))
         return false;
-    aDBName = aDBName.replaceAt( aDBName.getLength()-5, 5, OUSTR(".db"));
+    aDBName = aDBName.replaceAt( aDBName.getLength()-5, 5, ".db");
 
     // open the corresponding BDB file for reading
     osl::File aDBFile( aDBName);
diff --git a/desktop/source/deployment/inc/lockfile.hxx b/desktop/source/deployment/inc/lockfile.hxx
index 3d9a365..647ba2f 100644
--- a/desktop/source/deployment/inc/lockfile.hxx
+++ b/desktop/source/deployment/inc/lockfile.hxx
@@ -38,13 +38,13 @@
 
 #include "dp_misc_api.hxx"
 
-#define LOCKFILE_SUFFIX   rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/.lock" ) )
-#define LOCKFILE_GROUP    rtl::OString(RTL_CONSTASCII_STRINGPARAM( "Lockdata" ) )
-#define LOCKFILE_USERKEY  rtl::OString(RTL_CONSTASCII_STRINGPARAM( "User" ) )
-#define LOCKFILE_HOSTKEY  rtl::OString(RTL_CONSTASCII_STRINGPARAM( "Host" ) )
-#define LOCKFILE_STAMPKEY rtl::OString(RTL_CONSTASCII_STRINGPARAM( "Stamp" ) )
-#define LOCKFILE_TIMEKEY  rtl::OString(RTL_CONSTASCII_STRINGPARAM( "Time" ) )
-#define LOCKFILE_IPCKEY   rtl::OString(RTL_CONSTASCII_STRINGPARAM( "IPCServer" ) )
+#define LOCKFILE_SUFFIX   rtl::OUString( "/.lock" )
+#define LOCKFILE_GROUP    rtl::OString( "Lockdata" )
+#define LOCKFILE_USERKEY  rtl::OString( "User" )
+#define LOCKFILE_HOSTKEY  rtl::OString( "Host" )
+#define LOCKFILE_STAMPKEY rtl::OString( "Stamp" )
+#define LOCKFILE_TIMEKEY  rtl::OString( "Time" )
+#define LOCKFILE_IPCKEY   rtl::OString( "IPCServer" )
 
 namespace desktop {
 
diff --git a/desktop/source/deployment/misc/dp_dependencies.cxx b/desktop/source/deployment/misc/dp_dependencies.cxx
index 84f72fd..23df4a2 100644
--- a/desktop/source/deployment/misc/dp_dependencies.cxx
+++ b/desktop/source/deployment/misc/dp_dependencies.cxx
@@ -60,9 +60,8 @@ rtl::OUString getLibreOfficeMajorMinorMicro() {
 
 rtl::OUString getReferenceOpenOfficeOrgMajorMinor() {
     rtl::OUString v(
-        RTL_CONSTASCII_USTRINGPARAM(
             "${$BRAND_BASE_DIR/program/" SAL_CONFIGFILE("version")
-            ":Version:ReferenceOOoMajorMinor}"));
+            ":Version:ReferenceOOoMajorMinor}");
     rtl::Bootstrap::expandMacros(v); //TODO: check for failure
     return v;
 }
@@ -110,35 +109,24 @@ check(dp_misc::DescriptionInfoset const & infoset) {
         {
             sat = satisfiesMinimalVersion(
                 getReferenceOpenOfficeOrgMajorMinor(),
-                e->getAttribute(
-                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"))));
+                e->getAttribute("value"));
         } else if ( e->getNamespaceURI() == namespaceOpenOfficeOrg && e->getTagName() == maximalVersionOpenOfficeOrg )
         {
             sat = satisfiesMaximalVersion(
                 getReferenceOpenOfficeOrgMajorMinor(),
-                e->getAttribute(
-                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"))));
+                e->getAttribute("value"));
         } else if (e->getNamespaceURI() == namespaceLibreOffice && e->getTagName() == minimalVersionLibreOffice )
         {
             sat = satisfiesMinimalVersion(
                 getLibreOfficeMajorMinorMicro(),
-                e->getAttribute(
-                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"))));
-        } else if (e->hasAttributeNS(
-                       rtl::OUString(
-                           RTL_CONSTASCII_USTRINGPARAM(namespaceOpenOfficeOrg)),
-                       rtl::OUString(
-                           RTL_CONSTASCII_USTRINGPARAM(
-                               minimalVersionOpenOfficeOrg))))
+                e->getAttribute("value"));
+        } else if (e->hasAttributeNS(namespaceOpenOfficeOrg,
+                       minimalVersionOpenOfficeOrg))
         {
             sat = satisfiesMinimalVersion(
                 getReferenceOpenOfficeOrgMajorMinor(),
-                e->getAttributeNS(
-                    rtl::OUString(
-                        RTL_CONSTASCII_USTRINGPARAM(namespaceOpenOfficeOrg)),
-                    rtl::OUString(
-                        RTL_CONSTASCII_USTRINGPARAM(
-                            minimalVersionOpenOfficeOrg))));
+                e->getAttributeNS(namespaceOpenOfficeOrg,
+                    minimalVersionOpenOfficeOrg));
         }
         if (!sat) {
             unsatisfied[unsat++] = e;
@@ -156,34 +144,24 @@ rtl::OUString getErrorText(
     {
         return produceErrorText(
                 dp_misc::getResId(RID_DEPLOYMENT_DEPENDENCIES_OOO_MIN).toString(),
-            dependency->getAttribute(
-                rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"))));
+            dependency->getAttribute("value"));
     } else if (dependency->getNamespaceURI() == namespaceOpenOfficeOrg && dependency->getTagName() == maximalVersionOpenOfficeOrg )
     {
         return produceErrorText(
                 dp_misc::getResId(RID_DEPLOYMENT_DEPENDENCIES_OOO_MAX).toString(),
-            dependency->getAttribute(
-                rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"))));
+            dependency->getAttribute("value"));
     } else if (dependency->getNamespaceURI() == namespaceLibreOffice && dependency->getTagName() == minimalVersionLibreOffice )
     {
         return produceErrorText(
                 dp_misc::getResId(RID_DEPLOYMENT_DEPENDENCIES_LO_MIN).toString(),
-            dependency->getAttribute(
-                rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("value"))));
-    } else if (dependency->hasAttributeNS(
-                   rtl::OUString(
-                       RTL_CONSTASCII_USTRINGPARAM(namespaceOpenOfficeOrg)),
-                   rtl::OUString(
-                       RTL_CONSTASCII_USTRINGPARAM(
-                           minimalVersionOpenOfficeOrg))))
+            dependency->getAttribute("value"));
+    } else if (dependency->hasAttributeNS(namespaceOpenOfficeOrg,
+                   minimalVersionOpenOfficeOrg))
     {
         return produceErrorText(
                 dp_misc::getResId(RID_DEPLOYMENT_DEPENDENCIES_OOO_MIN).toString(),
-            dependency->getAttributeNS(
-                rtl::OUString(
-                    RTL_CONSTASCII_USTRINGPARAM(namespaceOpenOfficeOrg)),
-                rtl::OUString(
-                    RTL_CONSTASCII_USTRINGPARAM(minimalVersionOpenOfficeOrg))));
+            dependency->getAttributeNS(namespaceOpenOfficeOrg,
+                minimalVersionOpenOfficeOrg));
     } else {
         return dp_misc::getResId(RID_DEPLOYMENT_DEPENDENCIES_UNKNOWN).toString();
     }
diff --git a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
index 81c0e85..75429e1 100644
--- a/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
+++ b/desktop/source/deployment/misc/dp_descriptioninfoset.cxx
@@ -87,10 +87,7 @@ EmptyNodeList::~EmptyNodeList() {}
 css::uno::Reference< css::xml::dom::XNode > EmptyNodeList::item(::sal_Int32)
     throw (css::uno::RuntimeException)
 {
-    throw css::uno::RuntimeException(
-        ::rtl::OUString(
-            RTL_CONSTASCII_USTRINGPARAM(
-                "bad EmptyNodeList com.sun.star.xml.dom.XNodeList.item call")),
+    throw css::uno::RuntimeException("bad EmptyNodeList com.sun.star.xml.dom.XNodeList.item call",
         static_cast< ::cppu::OWeakObject * >(this));
 }
 
@@ -102,10 +99,7 @@ css::uno::Reference< css::xml::dom::XNode > EmptyNodeList::item(::sal_Int32)
         return node->getNodeValue();
     } catch (const css::xml::dom::DOMException & e) {
         throw css::uno::RuntimeException(
-            (::rtl::OUString(
-                RTL_CONSTASCII_USTRINGPARAM(
-                    "com.sun.star.xml.dom.DOMException: ")) +
-             e.Message),
+            "com.sun.star.xml.dom.DOMException: " + e.Message,
             css::uno::Reference< css::uno::XInterface >());
     }
 }
@@ -191,7 +185,7 @@ ExtensionDescription::ExtensionDescription(
         //If there is no description.xml then ucb will start an interaction which
         //brings up a dialog.We want to prevent this. Therefore we wrap the xCmdEnv
         //and filter the respective exception out.
-        OUString sDescriptionUri(installDir + OUSTR("/description.xml"));
+        OUString sDescriptionUri(installDir + "/description.xml");
         Reference<css::ucb::XCommandEnvironment> xFilter =
             static_cast<css::ucb::XCommandEnvironment*>(
                 new FileDoesNotExistFilter(xCmdEnv));
@@ -212,7 +206,7 @@ ExtensionDescription::ExtensionDescription(
         if (!xIn.is())
         {
             throw css::uno::Exception(
-                OUSTR("Could not get XInputStream for description.xml of extension ") +
+                "Could not get XInputStream for description.xml of extension " +
                 sDescriptionUri, 0);
         }
 
@@ -223,13 +217,13 @@ ExtensionDescription::ExtensionDescription(
         if (xDocBuilder->isNamespaceAware() == sal_False)
         {
             throw css::uno::Exception(
-                OUSTR("Service com.sun.star.xml.dom.DocumentBuilder is not namespace aware."), 0);
+                "Service com.sun.star.xml.dom.DocumentBuilder is not namespace aware.", 0);
         }
 
         Reference<css::xml::dom::XDocument> xDoc = xDocBuilder->parse(xIn);
         if (!xDoc.is())
         {
-            throw css::uno::Exception(sDescriptionUri + OUSTR(" contains data which cannot be parsed. "), 0);
+            throw css::uno::Exception(sDescriptionUri + " contains data which cannot be parsed. ", 0);
         }
 
         //check for proper root element and namespace
@@ -237,13 +231,13 @@ ExtensionDescription::ExtensionDescription(
         if (!xRoot.is())
         {
             throw css::uno::Exception(
-                sDescriptionUri + OUSTR(" contains no root element."), 0);
+                sDescriptionUri + " contains no root element.", 0);
         }
 
-        if ( ! xRoot->getTagName().equals(OUSTR("description")))
+        if ( ! (xRoot->getTagName() == "description"))
         {
             throw css::uno::Exception(
-                sDescriptionUri + OUSTR(" does not contain the root element <description>."), 0);
+                sDescriptionUri + " does not contain the root element <description>.", 0);
         }
 
         m_xRoot = Reference<css::xml::dom::XNode>(
@@ -251,9 +245,9 @@ ExtensionDescription::ExtensionDescription(
         OUString nsDescription = xRoot->getNamespaceURI();
 
         //check if this namespace is supported
-        if ( ! nsDescription.equals(OUSTR("http://openoffice.org/extensions/description/2006")))
+        if ( ! (nsDescription == "http://openoffice.org/extensions/description/2006"))
         {
-            throw css::uno::Exception(sDescriptionUri + OUSTR(" contains a root element with an unsupported namespace. "), 0);
+            throw css::uno::Exception(sDescriptionUri + " contains a root element with an unsupported namespace. ", 0);
         }
     } catch (const css::uno::RuntimeException &) {
         throw;
@@ -344,10 +338,7 @@ DescriptionInfoset getDescriptionInfoset(OUString const & sExtensionFolderURL)
     } catch (const NoDescriptionException &) {
     } catch (const css::deployment::DeploymentException & e) {
         throw css::uno::RuntimeException(
-            (OUString(
-                RTL_CONSTASCII_USTRINGPARAM(
-                    "com.sun.star.deployment.DeploymentException: ")) +
-             e.Message), 0);
+             "com.sun.star.deployment.DeploymentException: " + e.Message, 0);
     }
     return DescriptionInfoset(context, root);
 }
@@ -363,26 +354,18 @@ DescriptionInfoset::DescriptionInfoset(
     if (m_element.is()) {
         m_xpath = css::uno::Reference< css::xml::xpath::XXPathAPI >(
             manager->createInstanceWithContext(
-                ::rtl::OUString(
-                    RTL_CONSTASCII_USTRINGPARAM(
-                        "com.sun.star.xml.xpath.XPathAPI")),
+                "com.sun.star.xml.xpath.XPathAPI",
                 context),
             css::uno::UNO_QUERY_THROW);
-        m_xpath->registerNS(
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("desc")),
-            element->getNamespaceURI());
-        m_xpath->registerNS(
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xlink")),
-            ::rtl::OUString(
-                RTL_CONSTASCII_USTRINGPARAM("http://www.w3.org/1999/xlink")));
+        m_xpath->registerNS("desc", element->getNamespaceURI());
+        m_xpath->registerNS("xlink", "http://www.w3.org/1999/xlink");
     }
 }
 
 DescriptionInfoset::~DescriptionInfoset() {}
 
 ::boost::optional< ::rtl::OUString > DescriptionInfoset::getIdentifier() const {
-    return getOptionalValue(
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("desc:identifier/@value")));
+    return getOptionalValue("desc:identifier/@value");
 }
 
 ::rtl::OUString DescriptionInfoset::getNodeValueFromExpression(::rtl::OUString const & expression) const
@@ -411,19 +394,17 @@ void DescriptionInfoset::checkBlacklist() const
         css::uno::Reference< css::lang::XMultiComponentFactory > manager(
             m_context->getServiceManager(), css::uno::UNO_QUERY_THROW);
         css::uno::Reference< css::lang::XMultiServiceFactory> provider(
-            manager->createInstanceWithContext(
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationProvider")), m_context),
+            manager->createInstanceWithContext("com.sun.star.configuration.ConfigurationProvider", m_context),
                 css::uno::UNO_QUERY_THROW);
 
         css::uno::Sequence< css::uno::Any > args = css::uno::Sequence< css::uno::Any >(1);
         css::beans::PropertyValue prop;
-        prop.Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("nodepath"));
-        prop.Value <<= ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.ExtensionDependencies/Extensions"));
+        prop.Name = ::rtl::OUString("nodepath");
+        prop.Value <<= ::rtl::OUString("/org.openoffice.Office.ExtensionDependencies/Extensions");
         args[0] <<= prop;
 
         css::uno::Reference< css::container::XNameAccess > blacklist(
-            provider->createInstanceWithArguments(
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.ConfigurationAccess")), args),
+            provider->createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", args),
                 css::uno::UNO_QUERY_THROW);
 
         // check first if a blacklist entry is available
@@ -431,16 +412,14 @@ void DescriptionInfoset::checkBlacklist() const
             css::uno::Reference< css::beans::XPropertySet > extProps(
                 blacklist->getByName(*id), css::uno::UNO_QUERY_THROW);
 
-            css::uno::Any anyValue = extProps->getPropertyValue(
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Versions")));
+            css::uno::Any anyValue = extProps->getPropertyValue("Versions");
 
             css::uno::Sequence< ::rtl::OUString > blversions;
             anyValue >>= blversions;
 
             // check if the current version requires further dependency checks from the blacklist
             if (checkBlacklistVersion(currentversion, blversions)) {
-                anyValue = extProps->getPropertyValue(
-                    ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Dependencies")));
+                anyValue = extProps->getPropertyValue("Dependencies");
                 ::rtl::OUString udeps;
                 anyValue >>= udeps;
 
@@ -450,8 +429,7 @@ void DescriptionInfoset::checkBlacklist() const
                 ::rtl::OString xmlDependencies = ::rtl::OUStringToOString(udeps, RTL_TEXTENCODING_UNICODE);
 
                 css::uno::Reference< css::xml::dom::XDocumentBuilder> docbuilder(
-                    manager->createInstanceWithContext(
-                        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.dom.DocumentBuilder")), m_context),
+                    manager->createInstanceWithContext("com.sun.star.xml.dom.DocumentBuilder", m_context),
                     css::uno::UNO_QUERY_THROW);
 
                 css::uno::Sequence< sal_Int8 > byteSeq((const sal_Int8*)xmlDependencies.getStr(), xmlDependencies.getLength());
@@ -469,18 +447,16 @@ void DescriptionInfoset::checkBlacklist() const
 
                 // get dependency node of current description info to merge the new dependencies from the blacklist
                 css::uno::Reference< css::xml::dom::XNode > xCurrentDeps(
-                    m_xpath->selectSingleNode(m_element, ::rtl::OUString(
-                                                  RTL_CONSTASCII_USTRINGPARAM("desc:dependencies"))));
+                    m_xpath->selectSingleNode(m_element, "desc:dependencies"));
 
                 // if no dependency node exists, create a new one in the current description info
                 if (!xCurrentDeps.is()) {
                     css::uno::Reference< css::xml::dom::XNode > xNewDepNode(
                         xCurrentDescInfo->createElementNS(
-                            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("http://openoffice.org/extensions/description/2006")),
-                            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("dependencies"))), css::uno::UNO_QUERY_THROW);
+                            "http://openoffice.org/extensions/description/2006",
+                            "dependencies"), css::uno::UNO_QUERY_THROW);
                     m_element->appendChild(xNewDepNode);
-                    xCurrentDeps = m_xpath->selectSingleNode(m_element, ::rtl::OUString(
-                                                  RTL_CONSTASCII_USTRINGPARAM("desc:dependencies")));
+                    xCurrentDeps = m_xpath->selectSingleNode(m_element, "desc:dependencies");
                 }
 
                 for (sal_Int32 i=0; i<nLen; i++) {
@@ -503,7 +479,7 @@ bool DescriptionInfoset::checkBlacklistVersion(
 {
     sal_Int32 nLen = versions.getLength();
     for (sal_Int32 i=0; i<nLen; i++) {
-        if (currentversion.equals(versions[i]))
+        if (currentversion == versions[i])
             return true;
     }
 
@@ -512,8 +488,7 @@ bool DescriptionInfoset::checkBlacklistVersion(
 
 ::rtl::OUString DescriptionInfoset::getVersion() const
 {
-    return getNodeValueFromExpression( ::rtl::OUString(
-            RTL_CONSTASCII_USTRINGPARAM("desc:version/@value")));
+    return getNodeValueFromExpression( "desc:version/@value" );
 }
 
 css::uno::Sequence< ::rtl::OUString > DescriptionInfoset::getSupportedPlaforms() const
@@ -521,23 +496,19 @@ css::uno::Sequence< ::rtl::OUString > DescriptionInfoset::getSupportedPlaforms()
     //When there is no description.xml then we assume that we support all platforms
     if (! m_element.is())
     {
-        return comphelper::makeSequence(
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("all")));
+        return comphelper::makeSequence( OUString("all") );
     }
 
     //Check if the <platform> element was provided. If not the default is "all" platforms
     css::uno::Reference< css::xml::dom::XNode > nodePlatform(
-        m_xpath->selectSingleNode(m_element, ::rtl::OUString(
-            RTL_CONSTASCII_USTRINGPARAM("desc:platform"))));
+        m_xpath->selectSingleNode(m_element, "desc:platform"));
     if (!nodePlatform.is())
     {
-        return comphelper::makeSequence(
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("all")));
+        return comphelper::makeSequence( OUString("all") );
     }
 
     //There is a platform element.
-    const ::rtl::OUString value = getNodeValueFromExpression(::rtl::OUString(
-            RTL_CONSTASCII_USTRINGPARAM("desc:platform/@value")));
+    const ::rtl::OUString value = getNodeValueFromExpression("desc:platform/@value");
     //parse the string, it can contained multiple strings separated by commas
     ::std::vector< ::rtl::OUString> vec;
     sal_Int32 nIndex = 0;
@@ -561,8 +532,7 @@ DescriptionInfoset::getDependencies() const {
             // check the extension blacklist first and expand the dependencies if applicable
             checkBlacklist();
 
-            return m_xpath->selectNodeList(m_element, ::rtl::OUString(
-                        RTL_CONSTASCII_USTRINGPARAM("desc:dependencies/*")));
+            return m_xpath->selectNodeList(m_element, "desc:dependencies/*");
         } catch (const css::xml::xpath::XPathException &) {
             // ignore
         }
@@ -572,27 +542,19 @@ DescriptionInfoset::getDependencies() const {
 
 css::uno::Sequence< ::rtl::OUString >
 DescriptionInfoset::getUpdateInformationUrls() const {
-    return getUrls(
-        ::rtl::OUString(
-            RTL_CONSTASCII_USTRINGPARAM(
-                "desc:update-information/desc:src/@xlink:href")));
+    return getUrls("desc:update-information/desc:src/@xlink:href");
 }
 
 css::uno::Sequence< ::rtl::OUString >
 DescriptionInfoset::getUpdateDownloadUrls() const
 {
-    return getUrls(
-        ::rtl::OUString(
-            RTL_CONSTASCII_USTRINGPARAM(
-                "desc:update-download/desc:src/@xlink:href")));
+    return getUrls("desc:update-download/desc:src/@xlink:href");
 }
 
 ::rtl::OUString DescriptionInfoset::getIconURL( sal_Bool bHighContrast ) const
 {
-    css::uno::Sequence< ::rtl::OUString > aStrList = getUrls( ::rtl::OUString(
-            RTL_CONSTASCII_USTRINGPARAM( "desc:icon/desc:default/@xlink:href")));
-    css::uno::Sequence< ::rtl::OUString > aStrListHC = getUrls( ::rtl::OUString(
-            RTL_CONSTASCII_USTRINGPARAM( "desc:icon/desc:high-contrast/@xlink:href")));
+    css::uno::Sequence< ::rtl::OUString > aStrList = getUrls( "desc:icon/desc:default/@xlink:href" );
+    css::uno::Sequence< ::rtl::OUString > aStrListHC = getUrls( "desc:icon/desc:high-contrast/@xlink:href" );
 
     if ( bHighContrast && aStrListHC.hasElements() && !aStrListHC[0].isEmpty() )
         return aStrListHC[0];
@@ -607,8 +569,7 @@ DescriptionInfoset::getUpdateDownloadUrls() const
     const
 {
     bool bParentExists = false;
-    const ::rtl::OUString sURL (getLocalizedHREFAttrFromChild(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-        "/desc:description/desc:update-website")), &bParentExists ));
+    const ::rtl::OUString sURL (getLocalizedHREFAttrFromChild("/desc:description/desc:update-website", &bParentExists ));
 
     if (!sURL.isEmpty())
         return ::boost::optional< ::rtl::OUString >(sURL);
@@ -654,13 +615,13 @@ css::uno::Sequence< ::rtl::OUString > DescriptionInfoset::getUrls(
 ::std::pair< ::rtl::OUString, ::rtl::OUString > DescriptionInfoset::getLocalizedPublisherNameAndURL() const
 {
     css::uno::Reference< css::xml::dom::XNode > node =
-        getLocalizedChild(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("desc:publisher")));
+        getLocalizedChild("desc:publisher");
 
     ::rtl::OUString sPublisherName;
     ::rtl::OUString sURL;
     if (node.is())
     {
-        const ::rtl::OUString exp1(RTL_CONSTASCII_USTRINGPARAM("text()"));
+        const ::rtl::OUString exp1("text()");
         css::uno::Reference< css::xml::dom::XNode > xPathName;
         try {
             xPathName = m_xpath->selectSingleNode(node, exp1);
@@ -671,7 +632,7 @@ css::uno::Sequence< ::rtl::OUString > DescriptionInfoset::getUrls(
         if (xPathName.is())
             sPublisherName = xPathName->getNodeValue();
 
-        const ::rtl::OUString exp2(RTL_CONSTASCII_USTRINGPARAM("@xlink:href"));
+        const ::rtl::OUString exp2("@xlink:href");
         css::uno::Reference< css::xml::dom::XNode > xURL;
         try {
             xURL = m_xpath->selectSingleNode(node, exp2);
@@ -687,17 +648,16 @@ css::uno::Sequence< ::rtl::OUString > DescriptionInfoset::getUrls(
 
 ::rtl::OUString DescriptionInfoset::getLocalizedReleaseNotesURL() const
 {
-    return getLocalizedHREFAttrFromChild(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-        "/desc:description/desc:release-notes")), NULL);
+    return getLocalizedHREFAttrFromChild("/desc:description/desc:release-notes", NULL);
 }
 
 ::rtl::OUString DescriptionInfoset::getLocalizedDisplayName() const
 {
     css::uno::Reference< css::xml::dom::XNode > node =
-        getLocalizedChild(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("desc:display-name")));
+        getLocalizedChild("desc:display-name");
     if (node.is())
     {
-        const ::rtl::OUString exp(RTL_CONSTASCII_USTRINGPARAM("text()"));
+        const ::rtl::OUString exp("text()");
         css::uno::Reference< css::xml::dom::XNode > xtext;
         try {
             xtext = m_xpath->selectSingleNode(node, exp);
@@ -712,8 +672,7 @@ css::uno::Sequence< ::rtl::OUString > DescriptionInfoset::getUrls(
 
 ::rtl::OUString DescriptionInfoset::getLocalizedLicenseURL() const
 {
-    return getLocalizedHREFAttrFromChild(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-        "/desc:description/desc:registration/desc:simple-license")), NULL);
+    return getLocalizedHREFAttrFromChild("/desc:description/desc:registration/desc:simple-license", NULL);
 
 }
 
@@ -724,9 +683,7 @@ DescriptionInfoset::getSimpleLicenseAttributes() const
     css::uno::Reference< css::xml::dom::XNode > n;
     if (m_element.is()) {
         try {
-            n = m_xpath->selectSingleNode(m_element,
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-                "/desc:description/desc:registration/desc:simple-license/@accept-by")));
+            n = m_xpath->selectSingleNode(m_element, "/desc:description/desc:registration/desc:simple-license/@accept-by");
         } catch (const css::xml::xpath::XPathException &) {
             // ignore
         }
@@ -734,24 +691,17 @@ DescriptionInfoset::getSimpleLicenseAttributes() const
         {
             SimpleLicenseAttributes attributes;
             attributes.acceptBy =
-                getNodeValueFromExpression(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-                "/desc:description/desc:registration/desc:simple-license/@accept-by")));
+                getNodeValueFromExpression("/desc:description/desc:registration/desc:simple-license/@accept-by");
 
-            ::boost::optional< ::rtl::OUString > suppressOnUpdate = getOptionalValue(
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-                "/desc:description/desc:registration/desc:simple-license/@suppress-on-update")));
+            ::boost::optional< ::rtl::OUString > suppressOnUpdate = getOptionalValue("/desc:description/desc:registration/desc:simple-license/@suppress-on-update");
             if (suppressOnUpdate)
-                attributes.suppressOnUpdate = (*suppressOnUpdate).trim().equalsIgnoreAsciiCase(
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true")));
+                attributes.suppressOnUpdate = (*suppressOnUpdate).trim().equalsIgnoreAsciiCase("true");
             else
                 attributes.suppressOnUpdate = false;
 
-            ::boost::optional< ::rtl::OUString > suppressIfRequired = getOptionalValue(
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-                "/desc:description/desc:registration/desc:simple-license/@suppress-if-required")));
+            ::boost::optional< ::rtl::OUString > suppressIfRequired = getOptionalValue("/desc:description/desc:registration/desc:simple-license/@suppress-if-required");
             if (suppressIfRequired)
-                attributes.suppressIfRequired = (*suppressIfRequired).trim().equalsIgnoreAsciiCase(
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("true")));
+                attributes.suppressIfRequired = (*suppressIfRequired).trim().equalsIgnoreAsciiCase("true");
             else
                 attributes.suppressIfRequired = false;
 
@@ -763,8 +713,7 @@ DescriptionInfoset::getSimpleLicenseAttributes() const
 
 ::rtl::OUString DescriptionInfoset::getLocalizedDescriptionURL() const
 {
-    return getLocalizedHREFAttrFromChild(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
-        "/desc:description/desc:extension-description")), NULL);
+    return getLocalizedHREFAttrFromChild("/desc:description/desc:extension-description", NULL);
 }
 
 css::uno::Reference< css::xml::dom::XNode >
@@ -807,10 +756,7 @@ DescriptionInfoset::matchFullLocale(css::uno::Reference< css::xml::dom::XNode >
                                     const & xParent, ::rtl::OUString const & sLocale) const
 {
     OSL_ASSERT(xParent.is());
-    const ::rtl::OUString exp1(
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*[@lang=\""))
-        + sLocale +
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"]")));
+    const ::rtl::OUString exp1("*[@lang=\"" + sLocale + "\"]");
     try {
         return m_xpath->selectSingleNode(xParent, exp1);
     } catch (const css::xml::xpath::XPathException &) {
@@ -829,13 +775,10 @@ DescriptionInfoset::matchCountryAndLanguage(
     if (!officeLocale.Country.isEmpty())
     {
         const ::rtl::OUString sLangCountry(officeLocale.Language +
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-")) +
-            officeLocale.Country);
+            "-" + officeLocale.Country);
         //first try exact match for lang-country
         const ::rtl::OUString exp1(
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*[@lang=\""))
-            + sLangCountry +
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"]")));
+            "*[@lang=\"" + sLangCountry +"\"]");
         try {
             nodeMatch = m_xpath->selectSingleNode(xParent, exp1);
         } catch (const css::xml::xpath::XPathException &) {
@@ -847,9 +790,7 @@ DescriptionInfoset::matchCountryAndLanguage(
         if (!nodeMatch.is())
         {
             const ::rtl::OUString exp2(
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*[starts-with(@lang,\""))
-                + sLangCountry +
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-\")]")));
+                "*[starts-with(@lang,\"" + sLangCountry + "-\")]");
             try {
                 nodeMatch = m_xpath->selectSingleNode(xParent, exp2);
             } catch (const css::xml::xpath::XPathException &) {
@@ -870,10 +811,8 @@ DescriptionInfoset::matchLanguage(
     css::uno::Reference<css::xml::dom::XNode> nodeMatch;
 
     //first try exact match for lang
-    const ::rtl::OUString exp1(
-        ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*[@lang=\""))
-        + officeLocale.Language
-        + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"]")));
+    const ::rtl::OUString exp1("*[@lang=\"" + officeLocale.Language
+        + "\"]");
     try {
         nodeMatch = m_xpath->selectSingleNode(xParent, exp1);
     } catch (const css::xml::xpath::XPathException &) {
@@ -885,9 +824,7 @@ DescriptionInfoset::matchLanguage(
     if (!nodeMatch.is())
     {
         const ::rtl::OUString exp2(
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("*[starts-with(@lang,\""))
-            + officeLocale.Language
-            + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-\")]")));
+            "*[starts-with(@lang,\"" + officeLocale.Language + "-\")]");
         try {
             nodeMatch = m_xpath->selectSingleNode(xParent, exp2);
         } catch (const css::xml::xpath::XPathException &) {
@@ -906,18 +843,16 @@ DescriptionInfoset::getChildWithDefaultLocale(css::uno::Reference< css::xml::dom
     {
         css::uno::Reference<css::xml::dom::XNode> nodeDefault;
         try {
-            nodeDefault = m_xpath->selectSingleNode(xParent, ::rtl::OUString(
-                RTL_CONSTASCII_USTRINGPARAM("@default-license-id")));
+            nodeDefault = m_xpath->selectSingleNode(xParent, "@default-license-id");
         } catch (const css::xml::xpath::XPathException &) {
             // ignore
         }
         if (nodeDefault.is())
         {
             //The old way
-            const ::rtl::OUString exp1(
-                ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("desc:license-text[@license-id = \""))
+            const ::rtl::OUString exp1("desc:license-text[@license-id = \""
                 + nodeDefault->getNodeValue()
-                + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("\"]")));
+                + "\"]");
             try {
                 return m_xpath->selectSingleNode(xParent, exp1);
             } catch (const css::xml::xpath::XPathException &) {
@@ -926,7 +861,7 @@ DescriptionInfoset::getChildWithDefaultLocale(css::uno::Reference< css::xml::dom
         }
     }
 
-    const ::rtl::OUString exp2(RTL_CONSTASCII_USTRINGPARAM("*[1]"));
+    const ::rtl::OUString exp2("*[1]");
     try {
         return m_xpath->selectSingleNode(xParent, exp2);
     } catch (const css::xml::xpath::XPathException &) {
@@ -947,7 +882,7 @@ DescriptionInfoset::getChildWithDefaultLocale(css::uno::Reference< css::xml::dom
     {
         if (out_bParentExists)
             *out_bParentExists = true;
-        const ::rtl::OUString exp(RTL_CONSTASCII_USTRINGPARAM("@xlink:href"));
+        const ::rtl::OUString exp("@xlink:href");
         css::uno::Reference< css::xml::dom::XNode > xURL;
         try {
             xURL = m_xpath->selectSingleNode(node, exp);
diff --git a/desktop/source/deployment/misc/dp_identifier.cxx b/desktop/source/deployment/misc/dp_identifier.cxx
index c1528f2..165a097 100644
--- a/desktop/source/deployment/misc/dp_identifier.cxx
+++ b/desktop/source/deployment/misc/dp_identifier.cxx
@@ -51,7 +51,7 @@ namespace dp_misc {
 
 ::rtl::OUString generateLegacyIdentifier(::rtl::OUString const & fileName) {
     rtl::OUStringBuffer b;
-    b.appendAscii(RTL_CONSTASCII_STRINGPARAM("org.openoffice.legacy."));
+    b.appendAscii("org.openoffice.legacy.");
     b.append(fileName);
     return b.makeStringAndClear();
 }


More information about the Libreoffice-commits mailing list