[Libreoffice-commits] .: scripting/source sfx2/source

Michael Meeks mmeeks at kemper.freedesktop.org
Mon Nov 22 04:22:22 PST 2010


 scripting/source/storage/ScriptSecurityManager.cxx |    2 +-
 scripting/source/storage/ScriptStorage.cxx         |   10 +++++-----
 sfx2/source/doc/DocumentMetadataAccess.cxx         |    6 +++---
 sfx2/source/doc/SfxDocumentMetaData.cxx            |    2 --
 4 files changed, 9 insertions(+), 11 deletions(-)

New commits:
commit 31a29ec9333c6851d02e556a19c8c475cf0c57ef
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Mon Nov 22 12:22:41 2010 +0000

    cleanup createFromAscii calls

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..4837ffa 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/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index 76f53d0..b477a32 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -516,8 +516,8 @@ collectFilesFromStorage(uno::Reference<embed::XStorage> const& i_xStorage,
     ::rtl::OUString i_Path,
     std::set< ::rtl::OUString > & o_rFiles)
 {
-    static ::rtl::OUString content(::rtl::OUString::createFromAscii(s_content));
-    static ::rtl::OUString styles (::rtl::OUString::createFromAscii(s_styles ));
+    static ::rtl::OUString content(RTL_CONSTASCII_USTRINGPARAM(s_content));
+    static ::rtl::OUString styles(RTL_CONSTASCII_USTRINGPARAM(s_styles ));
     try {
         if (i_xStorage->hasByName(content) &&
             i_xStorage->isStreamElement(content))
@@ -643,7 +643,7 @@ exportStream(struct DocumentMetadataAccess_Impl & i_rImpl,
     if (xStreamProps.is()) { // this is NOT supported in FileSystemStorage
         xStreamProps->setPropertyValue(
             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")),
-            uno::makeAny(::rtl::OUString::createFromAscii(s_rdfxml)));
+            uno::makeAny(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(s_rdfxml))));
     }
     const uno::Reference<io::XOutputStream> xOutStream(
         xStream->getOutputStream(), uno::UNO_SET_THROW );
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 7589ad6..2379dd7 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -1232,8 +1232,6 @@ void SAL_CALL SfxDocumentMetaData::init(
                 css::uno::UNO_QUERY_THROW);
             // NB: the following is a _bad_idea_ with our DOM implementation
             //     do _not_ create attributes with xmlns prefix!
-//        xRElem->setAttribute(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("xmlns:office")),
-//                    ::rtl::OUString::createFromAscii(s_nsODF));
             xRElem->setAttributeNS(::rtl::OUString::createFromAscii(s_nsODF),
                         ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("office:version")),
                         ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("1.0")));


More information about the Libreoffice-commits mailing list