Date: prev next · Thread: first prev next last
2010 Archives by date, by thread · List index


Here goes a patch for the base repo.

It's my first patch, hoping it's fine :-)

(LGPLv3+ / MPL)

Santiago Alessandri
From ea85fc8fe1d340502be04ceb7b6759c252ba029d Mon Sep 17 00:00:00 2001
From: Santiago Alessandri <salessandri@cert.unlp.edu.ar>
Date: Thu, 11 Nov 2010 10:19:47 -0300
Subject: [PATCH] Replaced the use of createFromAscii for the macro RTL_CONSTASCII_USTRINGPARAM

---
 dbaccess/source/core/dataaccess/ContentHelper.cxx  |   33 +++++++++++--------
 dbaccess/source/core/dataaccess/ModelImpl.cxx      |    4 +-
 .../source/core/dataaccess/bookmarkcontainer.cxx   |    4 +-
 .../source/core/dataaccess/commanddefinition.cxx   |    2 +-
 dbaccess/source/core/dataaccess/connection.cxx     |    2 +-
 .../source/core/dataaccess/databasedocument.cxx    |    6 ++--
 .../core/dataaccess/databaseregistrations.cxx      |    6 ++--
 dbaccess/source/core/dataaccess/datasource.cxx     |    6 ++--
 dbaccess/source/core/dataaccess/intercept.cxx      |    6 ++--
 9 files changed, 37 insertions(+), 32 deletions(-)

diff --git a/dbaccess/source/core/dataaccess/ContentHelper.cxx 
b/dbaccess/source/core/dataaccess/ContentHelper.cxx
index dc5bee8..4f41cda 100644
--- a/dbaccess/source/core/dataaccess/ContentHelper.cxx
+++ b/dbaccess/source/core/dataaccess/ContentHelper.cxx
@@ -363,24 +363,27 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< 
PropertyValue
         {
             // Read-only property!
             aRet[ n ] <<= IllegalAccessException(
-                            rtl::OUString::createFromAscii(
-                                "Property is read-only!" ),
+                            ::rtl::OUString(
+                                RTL_CONSTASCII_USTRINGPARAM("Property is read-only!")
+                            ),
                             static_cast< cppu::OWeakObject * >( this ) );
         }
         else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsDocument" ) ) )
         {
             // Read-only property!
             aRet[ n ] <<= IllegalAccessException(
-                            rtl::OUString::createFromAscii(
-                                "Property is read-only!" ),
+                            ::rtl::OUString(
+                                RTL_CONSTASCII_USTRINGPARAM("Property is read-only!")
+                            ),
                             static_cast< cppu::OWeakObject * >( this ) );
         }
         else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "IsFolder" ) ) )
         {
             // Read-only property!
             aRet[ n ] <<= IllegalAccessException(
-                            rtl::OUString::createFromAscii(
-                                "Property is read-only!" ),
+                            ::rtl::OUString(
+                                RTL_CONSTASCII_USTRINGPARAM("Property is read-only!")
+                            ),
                             static_cast< cppu::OWeakObject * >( this ) );
         }
         else if ( rValue.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Title" ) ) )
@@ -415,8 +418,9 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue
             else
             {
                 aRet[ n ] <<= IllegalTypeException(
-                                rtl::OUString::createFromAscii(
-                                    "Property value has wrong type!" ),
+                                ::rtl::OUString(
+                                    RTL_CONSTASCII_USTRINGPARAM("Property value has wrong type!")
+                                ),
                                 static_cast< cppu::OWeakObject * >( this ) );
             }
         }
@@ -424,8 +428,9 @@ Sequence< Any > OContentHelper::setPropertyValues(const Sequence< PropertyValue
         else
         {
             aRet[ n ] <<= Exception(
-                            rtl::OUString::createFromAscii(
-                                "No property set for storing the value!" ),
+                            ::rtl::OUString(
+                                    RTL_CONSTASCII_USTRINGPARAM("No property set for storing the 
value!")
+                            ),
                             static_cast< cppu::OWeakObject * >( this ) );
         }
     }
@@ -486,27 +491,27 @@ Reference< XRow > OContentHelper::getPropertyValues( const Sequence< Property 
&
     {
         // Append all Core Properties.
         xRow->appendString (
-            Property( rtl::OUString::createFromAscii( "ContentType" ),
+            Property( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ContentType")),
                       -1,
                       getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
                       PropertyAttribute::BOUND
                         | PropertyAttribute::READONLY ),
             getContentType() );
         xRow->appendString (
-            Property( rtl::OUString::createFromAscii( "Title" ),
+            Property( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Title" )),
                       -1,
                       getCppuType( static_cast< const rtl::OUString * >( 0 ) ),
                       PropertyAttribute::BOUND ),
             m_pImpl->m_aProps.aTitle );
         xRow->appendBoolean(
-            Property( rtl::OUString::createFromAscii( "IsDocument" ),
+            Property( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsDocument")),
                       -1,
                       getCppuBooleanType(),
                       PropertyAttribute::BOUND
                         | PropertyAttribute::READONLY ),
             m_pImpl->m_aProps.bIsDocument );
         xRow->appendBoolean(
-            Property( rtl::OUString::createFromAscii( "IsFolder" ),
+            Property( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IsFolder")),
                       -1,
                       getCppuBooleanType(),
                       PropertyAttribute::BOUND
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx 
b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index d3de75a..d3f7c77 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -440,9 +440,9 @@ ODatabaseModelImpl::ODatabaseModelImpl( const Reference< XMultiServiceFactory >&
 {
     // some kind of default
     DBG_CTOR(ODatabaseModelImpl,NULL);
-    m_sConnectURL = ::rtl::OUString::createFromAscii("jdbc:");
+    m_sConnectURL = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("jdbc:"));
     m_aTableFilter.realloc(1);
-    m_aTableFilter[0] = ::rtl::OUString::createFromAscii("%");
+    m_aTableFilter[0] = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("%"));
     impl_construct_nothrow();
 }
 
diff --git a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx 
b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
index 2d05ab8..dba19b0 100644
--- a/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
+++ b/dbaccess/source/core/dataaccess/bookmarkcontainer.cxx
@@ -97,7 +97,7 @@ OBookmarkContainer::~OBookmarkContainer()
 // XServiceInfo
 ::rtl::OUString SAL_CALL OBookmarkContainer::getImplementationName(  ) throw(RuntimeException)
 {
-    return ::rtl::OUString::createFromAscii("com.sun.star.comp.dba.OBookmarkContainer");
+    return 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.OBookmarkContainer"));
 }
 
 sal_Bool SAL_CALL OBookmarkContainer::supportsService( const ::rtl::OUString& _rServiceName ) 
throw (RuntimeException)
@@ -110,7 +110,7 @@ sal_Bool SAL_CALL OBookmarkContainer::supportsService( const ::rtl::OUString& _r
 Sequence< ::rtl::OUString > SAL_CALL OBookmarkContainer::getSupportedServiceNames(  ) 
throw(RuntimeException)
 {
     Sequence< ::rtl::OUString > aReturn(1);
-    aReturn.getArray()[0] = 
::rtl::OUString::createFromAscii("com.sun.star.sdb.DefinitionContainer");
+    aReturn.getArray()[0] = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.sdb.DefinitionContainer"));
     return aReturn;
 }
 
diff --git a/dbaccess/source/core/dataaccess/commanddefinition.cxx 
b/dbaccess/source/core/dataaccess/commanddefinition.cxx
index 6cfd923..eda4a63 100644
--- a/dbaccess/source/core/dataaccess/commanddefinition.cxx
+++ b/dbaccess/source/core/dataaccess/commanddefinition.cxx
@@ -115,7 +115,7 @@ IMPLEMENT_PROPERTYCONTAINER_DEFAULTS2(OCommandDefinition,OCommandDefinition_PROP
 
 ::rtl::OUString OCommandDefinition::getImplementationName_static(  ) throw(RuntimeException)
 {
-    return ::rtl::OUString::createFromAscii("com.sun.star.comp.dba.OCommandDefinition");
+    return 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.OCommandDefinition"));
 }
 
 ::rtl::OUString SAL_CALL OCommandDefinition::getImplementationName(  ) throw(RuntimeException)
diff --git a/dbaccess/source/core/dataaccess/connection.cxx 
b/dbaccess/source/core/dataaccess/connection.cxx
index 490d0c4..b143027 100644
--- a/dbaccess/source/core/dataaccess/connection.cxx
+++ b/dbaccess/source/core/dataaccess/connection.cxx
@@ -88,7 +88,7 @@ namespace dbaccess
 rtl::OUString OConnection::getImplementationName(  ) throw(RuntimeException)
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", 
"OConnection::getImplementationName" );
-    return rtl::OUString::createFromAscii("com.sun.star.comp.dbaccess.Connection");
+    return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dbaccess.Connection"));
 }
 
 sal_Bool OConnection::supportsService( const ::rtl::OUString& _rServiceName ) throw 
(RuntimeException)
diff --git a/dbaccess/source/core/dataaccess/databasedocument.cxx 
b/dbaccess/source/core/dataaccess/databasedocument.cxx
index e04153c..f4daba6 100644
--- a/dbaccess/source/core/dataaccess/databasedocument.cxx
+++ b/dbaccess/source/core/dataaccess/databasedocument.cxx
@@ -1056,7 +1056,7 @@ void ODatabaseDocument::impl_storeAs_throw( const ::rtl::OUString& _rURL, 
const
 Reference< XStorage > ODatabaseDocument::impl_createStorageFor_throw( const ::rtl::OUString& _rURL 
) const
 {
     Reference < ::com::sun::star::ucb::XSimpleFileAccess > xTempAccess;
-    m_pImpl->m_aContext.createComponent( ::rtl::OUString::createFromAscii( 
"com.sun.star.ucb.SimpleFileAccess" ) ,xTempAccess);
+    m_pImpl->m_aContext.createComponent( 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess")) ,xTempAccess);
     Reference< io::XStream > xStream = xTempAccess->openFileReadWrite( _rURL );
     Reference< io::XTruncate > xTruncate(xStream,UNO_QUERY);
     if ( xTruncate.is() )
@@ -1760,7 +1760,7 @@ rtl::OUString ODatabaseDocument::getImplementationName(  ) 
throw(RuntimeExceptio
 
 rtl::OUString ODatabaseDocument::getImplementationName_static(  ) throw(RuntimeException)
 {
-    return rtl::OUString::createFromAscii("com.sun.star.comp.dba.ODatabaseDocument");
+    return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.ODatabaseDocument"));
 }
 
 Sequence< ::rtl::OUString > ODatabaseDocument::getSupportedServiceNames(  ) throw 
(RuntimeException)
@@ -2003,7 +2003,7 @@ uno::Reference< frame::XUntitledNumbers > 
ODatabaseDocument::impl_getUntitledHel
         xNumberedControllers.set(static_cast< ::cppu::OWeakObject* >(pHelper), 
uno::UNO_QUERY_THROW);
 
         pHelper->setOwner          (xThis);
-        //pHelper->setUntitledPrefix (::rtl::OUString::createFromAscii(" : "));
+        //pHelper->setUntitledPrefix (::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" : ")));
 
         
m_aNumberedControllers.insert(TNumberedController::value_type(sModuleId,xNumberedControllers));
     }
diff --git a/dbaccess/source/core/dataaccess/databaseregistrations.cxx 
b/dbaccess/source/core/dataaccess/databaseregistrations.cxx
index 83b6d48..1449c3c 100644
--- a/dbaccess/source/core/dataaccess/databaseregistrations.cxx
+++ b/dbaccess/source/core/dataaccess/databaseregistrations.cxx
@@ -67,19 +67,19 @@ namespace dbaccess
 
     static const ::rtl::OUString& getConfigurationRootPath()
     {
-        static ::rtl::OUString s_sNodeName = 
::rtl::OUString::createFromAscii("org.openoffice.Office.DataAccess/RegisteredNames");
+        static ::rtl::OUString s_sNodeName = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.DataAccess/RegisteredNames"));
         return s_sNodeName;
     }
 
     const ::rtl::OUString& getLocationNodeName()
     {
-        static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii( "Location" );
+        static ::rtl::OUString s_sNodeName = 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Location"));
         return s_sNodeName;
     }
 
     const ::rtl::OUString& getNameNodeName()
     {
-        static ::rtl::OUString s_sNodeName = ::rtl::OUString::createFromAscii( "Name" );
+        static ::rtl::OUString s_sNodeName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name"));
         return s_sNodeName;
     }
 
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx 
b/dbaccess/source/core/dataaccess/datasource.cxx
index 6849f81..c866902 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -602,7 +602,7 @@ rtl::OUString ODatabaseSource::getImplementationName(  ) throw(RuntimeException)
 rtl::OUString ODatabaseSource::getImplementationName_static(  ) throw(RuntimeException)
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dataaccess", "Ocke.Janssen@sun.com", 
"ODatabaseSource::getImplementationName_static" );
-    return rtl::OUString::createFromAscii("com.sun.star.comp.dba.ODatabaseSource");
+    return rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.dba.ODatabaseSource"));
 }
 
 Sequence< ::rtl::OUString > ODatabaseSource::getSupportedServiceNames(  ) throw (RuntimeException)
@@ -680,13 +680,13 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const 
::rtl::O
         sal_Int32 nArgPos = 0;
         if (sUser.getLength())
         {
-            aUserPwd[ nArgPos ].Name = ::rtl::OUString::createFromAscii("user");
+            aUserPwd[ nArgPos ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("user"));
             aUserPwd[ nArgPos ].Value <<= sUser;
             ++nArgPos;
         }
         if (sPwd.getLength())
         {
-            aUserPwd[ nArgPos ].Name = ::rtl::OUString::createFromAscii("password");
+            aUserPwd[ nArgPos ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("password"));
             aUserPwd[ nArgPos ].Value <<= sPwd;
         }
         Reference< XDriver > xDriver;
diff --git a/dbaccess/source/core/dataaccess/intercept.cxx 
b/dbaccess/source/core/dataaccess/intercept.cxx
index 1b950f2..5060200 100644
--- a/dbaccess/source/core/dataaccess/intercept.cxx
+++ b/dbaccess/source/core/dataaccess/intercept.cxx
@@ -171,12 +171,12 @@ void SAL_CALL OInterceptor::dispatch( const URL& _URL,const 
Sequence<PropertyVal
             if ( nInd == aNewArgs.getLength() )
             {
                 aNewArgs.realloc( nInd + 1 );
-                aNewArgs[nInd].Name = ::rtl::OUString::createFromAscii( "SaveTo" );
+                aNewArgs[nInd].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SaveTo"));
                 aNewArgs[nInd].Value <<= sal_True;
             }
 
             Reference< XDispatch > xDispatch = m_xSlaveDispatchProvider->queryDispatch(
-                _URL, ::rtl::OUString::createFromAscii( "_self" ), 0 );
+                _URL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_self")), 0 );
             if ( xDispatch.is() )
                 xDispatch->dispatch( _URL, aNewArgs );
         }
@@ -204,7 +204,7 @@ IMPL_LINK( OInterceptor, OnDispatch, void*, _pDispatcher )
         if ( m_pContentHolder && m_pContentHolder->prepareClose() && m_xSlaveDispatchProvider.is() 
)
         {
             Reference< XDispatch > xDispatch = m_xSlaveDispatchProvider->queryDispatch(
-                pHelper->aURL, ::rtl::OUString::createFromAscii( "_self" ), 0 );
+                pHelper->aURL, ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("_self")), 0 );
             if ( xDispatch.is() )
             {
                 Reference< ::com::sun::star::document::XEventBroadcaster> 
xEvtB(m_pContentHolder->getComponent(),UNO_QUERY);
-- 
1.7.0.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.