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


Hello,

Here's a patch for libs-core/scripting + 1 patch for filter_msfilter (I thought i did it before but i must have deleted it by mistake). It seems, by reading the result of grep, it's the last SAL_N_ELEMENTS macro to put in place. So it would be a task to put in "Completed_easy_hacks". Someone to confirm (or to tell where the last ones are) ?

Julien.

(LGPLv3+ / MPL)
diff --git a/framework/source/jobs/jobdata.cxx b/framework/source/jobs/jobdata.cxx
index 55cda74..09b2165 100644
--- a/framework/source/jobs/jobdata.cxx
+++ b/framework/source/jobs/jobdata.cxx
@@ -182,7 +182,7 @@ void JobData::setAlias( const ::rtl::OUString& sAlias )
     // try to open the configuration set of this job directly and get a property access to it
     // We open it readonly here
     ::rtl::OUString sKey;
-    sKey  = ::rtl::OUString::createFromAscii(JOBCFG_ROOT);
+    sKey  = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(JOBCFG_ROOT));
     sKey += ::utl::wrapConfigurationElementName(m_sAlias);
 
     ConfigAccess aConfig(m_xSMGR, sKey);
@@ -199,11 +199,11 @@ void JobData::setAlias( const ::rtl::OUString& sAlias )
         css::uno::Any aValue;
 
         // read uno implementation name
-        aValue   = 
xJobProperties->getPropertyValue(::rtl::OUString::createFromAscii(JOBCFG_PROP_SERVICE));
+        aValue   = 
xJobProperties->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(JOBCFG_PROP_SERVICE)));
         aValue >>= m_sService;
 
         // read whole argument list
-        aValue = 
xJobProperties->getPropertyValue(::rtl::OUString::createFromAscii(JOBCFG_PROP_ARGUMENTS));
+        aValue = 
xJobProperties->getPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(JOBCFG_PROP_ARGUMENTS)));
         css::uno::Reference< css::container::XNameAccess > xArgumentList;
         if (
             (aValue >>= xArgumentList)  &&
@@ -313,7 +313,7 @@ void JobData::setJobConfig( const css::uno::Sequence< css::beans::NamedValue >&
         // It doesn nothing here then ... or it change the mode automaticly, if
         // it was opened using another one before.
         ::rtl::OUString sKey;
-        sKey  = ::rtl::OUString::createFromAscii(JOBCFG_ROOT);
+        sKey  = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(JOBCFG_ROOT));
         sKey += ::utl::wrapConfigurationElementName(m_sAlias);
 
         ConfigAccess aConfig(m_xSMGR, sKey);
@@ -481,11 +481,11 @@ css::uno::Sequence< css::beans::NamedValue > JobData::getConfig() const
         lConfig.realloc(2);
         sal_Int32 i = 0;
 
-        lConfig[i].Name = ::rtl::OUString::createFromAscii(PROP_ALIAS);
+        lConfig[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(PROP_ALIAS));
         lConfig[i].Value <<= m_sAlias;
         ++i;
 
-        lConfig[i].Name = ::rtl::OUString::createFromAscii(PROP_SERVICE);
+        lConfig[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(PROP_SERVICE));
         lConfig[i].Value <<= m_sService;
         ++i;
     }
@@ -556,7 +556,7 @@ void JobData::disableJob()
         // Convert and write the user timestamp to the configuration.
         css::uno::Any aValue;
         aValue <<= Converter::convert_DateTime2ISO8601(DateTime());
-        xPropSet->setPropertyValue(::rtl::OUString::createFromAscii(EVENTCFG_PROP_USERTIME), 
aValue);
+        
xPropSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(EVENTCFG_PROP_USERTIME)), 
aValue);
     }
 
     aConfig.close();
diff --git a/scripting/source/storage/ScriptSecurityManager.cxx 
b/scripting/source/storage/ScriptSecurityManager.cxx
index 6585c96..824ef61 100644
--- a/scripting/source/storage/ScriptSecurityManager.cxx
+++ b/scripting/source/storage/ScriptSecurityManager.cxx
@@ -137,7 +137,7 @@ throw ( RuntimeException )
 
         Reference< XInterface > xInterface;
         Any a = m_xContext->getValueByName(
-                OUString::createFromAscii( SCRIPTSTORAGEMANAGER_SERVICE ) );
+                OUString(RTL_CONSTASCII_USTRINGPARAM( SCRIPTSTORAGEMANAGER_SERVICE )) );
         if ( sal_False == ( a >>= xInterface ) )
         {
             throw RuntimeException( 
diff --git a/scripting/source/storage/ScriptStorage.cxx b/scripting/source/storage/ScriptStorage.cxx
index 0d6109d..ad31efd 100644
--- a/scripting/source/storage/ScriptStorage.cxx
+++ b/scripting/source/storage/ScriptStorage.cxx
@@ -290,8 +290,8 @@ throw ( RuntimeException, Exception )
 
         validateXRef( xSMI, "ScriptStorage::create: failed to obtain valid 
XExtendedDocumentHandler" );
 
-        xStringUri = xStringUri.concat( ::rtl::OUString::createFromAscii( 
-            SCRIPT_DIR ) );
+        xStringUri = xStringUri.concat( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( 
+            SCRIPT_DIR )) );
 
        // No Scripts directory - just return
        if ( ! m_xSimpleFileAccess->isFolder( xStringUri ) )
@@ -329,7 +329,7 @@ throw ( RuntimeException, Exception )
                     RTL_TEXTENCODING_ASCII_US ).pData->buffer );
 
                 OUString parcelFile = parcelDirs[ j ].concat(
-                    ::rtl::OUString::createFromAscii( SCRIPT_PARCEL ) );
+                    ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( SCRIPT_PARCEL )) );
 
                 // Do not have a valid parcel.xml
                 if ( !m_xSimpleFileAccess->exists( parcelFile ) ||
@@ -559,8 +559,8 @@ throw ( RuntimeException )
     // xScriptInvocation = Reference<XScriptInvocation>(xx, UNO_QUERY_THROW);
     Reference< xml::sax::XExtendedDocumentHandler > xHandler;
 
-    OUString parcel_suffix = OUString::createFromAscii( SCRIPT_PARCEL );
-    OUString ou_parcel = OUString( 
+    OUString parcel_suffix(RTL_CONSTASCII_USTRINGPARAM( SCRIPT_PARCEL ));
+    OUString ou_parcel( 
         RTL_CONSTASCII_USTRINGPARAM( SCRIPT_PARCEL_NAME_ONLY ) );
 
     try
diff --git a/filter/source/msfilter/msocximex.cxx b/filter/source/msfilter/msocximex.cxx
index d78dc81..308bc44 100644
--- a/filter/source/msfilter/msocximex.cxx
+++ b/filter/source/msfilter/msocximex.cxx
@@ -78,6 +78,7 @@
 #include <com/sun/star/io/XInputStream.hpp>
 #include <comphelper/componentcontext.hxx>
 #include <unotools/streamwrap.hxx>
+#include <sal/macros.h>
 
 #include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/table/XCellRange.hpp>
@@ -938,7 +939,7 @@ public:
         if ( bDefaultProg )
             pS->Read( pDefaultProg, sizeof( pDefaultProg ) );
 
-        sal_Int32 nNumIds =  sizeof( ClsidList ) / sizeof( ClsidList[0] );
+        sal_Int32 nNumIds =  SAL_N_ELEMENTS( ClsidList );
 
         if ( bClsID )
         {

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.