[Libreoffice-commits] .: sd/source

Olivier Hallot ohallot at kemper.freedesktop.org
Mon Apr 16 06:01:37 PDT 2012


 sd/source/filter/html/htmlex.cxx     |    3 -
 sd/source/filter/sdfilter.cxx        |    2 
 sd/source/filter/sdpptwrp.cxx        |   18 ++++----
 sd/source/filter/xml/sdtransform.cxx |    6 +-
 sd/source/filter/xml/sdxmlwrp.cxx    |   78 +++++++++++++++--------------------
 5 files changed, 48 insertions(+), 59 deletions(-)

New commits:
commit fe794eaa03c198320e525725ec1fe51210df9775
Author: Olivier Hallot <olivier.hallot at alta.org.br>
Date:   Mon Apr 16 09:59:48 2012 -0300

    More RTL_CONSTASCII_USTRINGPARAM removals
    
    sd/filter

diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx
index 57df9d4..cc4573a 100644
--- a/sd/source/filter/html/htmlex.cxx
+++ b/sd/source/filter/html/htmlex.cxx
@@ -3133,8 +3133,7 @@ bool HtmlExport::checkForExistingFiles()
     try
     {
         Reference< XMultiServiceFactory > xMsf( ::comphelper::getProcessServiceFactory() );
-        Reference< ::com::sun::star::ucb::XSimpleFileAccess > xFA( xMsf->createInstance(
-            OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.ucb.SimpleFileAccess"))), UNO_QUERY_THROW );
+        Reference< ::com::sun::star::ucb::XSimpleFileAccess > xFA( xMsf->createInstance( "com.sun.star.ucb.SimpleFileAccess" ), UNO_QUERY_THROW );
 
         sal_uInt16 nSdPage;
         for( nSdPage = 0; !bFound && (nSdPage < mnSdPageCount); nSdPage++)
diff --git a/sd/source/filter/sdfilter.cxx b/sd/source/filter/sdfilter.cxx
index 0016933..ec24592 100644
--- a/sd/source/filter/sdfilter.cxx
+++ b/sd/source/filter/sdfilter.cxx
@@ -76,7 +76,7 @@ SdFilter::~SdFilter()
 
 ::rtl::OUString SdFilter::ImplGetFullLibraryName( const ::rtl::OUString& rLibraryName ) const
 {
-    String aTemp(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(SVLIBRARY("?"))));
+    String aTemp(::rtl::OUString(SVLIBRARY("?")));
     xub_StrLen nIndex = aTemp.Search( (sal_Unicode)'?' );
     aTemp.Replace( nIndex, 1, rLibraryName );
     ::rtl::OUString aLibraryName( aTemp );
diff --git a/sd/source/filter/sdpptwrp.cxx b/sd/source/filter/sdpptwrp.cxx
index 2229c26..052cf61 100644
--- a/sd/source/filter/sdpptwrp.cxx
+++ b/sd/source/filter/sdpptwrp.cxx
@@ -92,25 +92,25 @@ sal_Bool SdPPTFilter::Import()
             xDualStorage = pStorage->OpenSotStorage( sDualStorage, STREAM_STD_READ );
             pStorage = xDualStorage;
         }
-        SvStream* pDocStream = pStorage->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM("PowerPoint Document") ), STREAM_STD_READ );
+        SvStream* pDocStream = pStorage->OpenSotStream( rtl::OUString("PowerPoint Document") , STREAM_STD_READ );
         if( pDocStream )
         {
             pDocStream->SetVersion( pStorage->GetVersion() );
             pDocStream->SetCryptMaskKey(pStorage->GetKey());
 
-            if ( pStorage->IsStream( String( RTL_CONSTASCII_USTRINGPARAM("EncryptedSummary") ) ) )
-                mrMedium.SetError( ERRCODE_SVX_READ_FILTER_PPOINT, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
+            if ( pStorage->IsStream( rtl::OUString("EncryptedSummary" ) ) )
+                mrMedium.SetError( ERRCODE_SVX_READ_FILTER_PPOINT, OSL_LOG_PREFIX );
             else
             {
                 ::osl::Module* pLibrary = OpenLibrary( mrMedium.GetFilter()->GetUserData() );
                 if ( pLibrary )
                 {
-                    ImportPPT PPTImport = reinterpret_cast< ImportPPT >( pLibrary->getFunctionSymbol( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ImportPPT" ) ) ) );
+                    ImportPPT PPTImport = reinterpret_cast< ImportPPT >( pLibrary->getFunctionSymbol( "ImportPPT" ) );
                     if ( PPTImport )
                         bRet = PPTImport( &mrDocument, *pDocStream, *pStorage, mrMedium );
 
                     if ( !bRet )
-                        mrMedium.SetError( SVSTREAM_WRONGVERSION, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
+                        mrMedium.SetError( SVSTREAM_WRONGVERSION, OSL_LOG_PREFIX );
                 }
             }
 
@@ -133,7 +133,7 @@ sal_Bool SdPPTFilter::Export()
         if( mxModel.is() )
         {
             SotStorageRef    xStorRef = new SotStorage( mrMedium.GetOutStream(), sal_False );
-            ExportPPT       PPTExport = reinterpret_cast<ExportPPT>(pLibrary->getFunctionSymbol( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ExportPPT")) ));
+            ExportPPT       PPTExport = reinterpret_cast<ExportPPT>(pLibrary->getFunctionSymbol( "ExportPPT" ));
 
             if( PPTExport && xStorRef.Is() )
             {
@@ -155,10 +155,10 @@ sal_Bool SdPPTFilter::Export()
                 if( mbShowProgress )
                     CreateStatusIndicator();
 
-                rtl::OUString sBaseURI( RTL_CONSTASCII_USTRINGPARAM("BaseURI") );
+                //rtl::OUString sBaseURI( "BaseURI");
                 std::vector< PropertyValue > aProperties;
                 PropertyValue aProperty;
-                aProperty.Name = sBaseURI;
+                aProperty.Name = "BaseURI";
                 aProperty.Value = makeAny( mrMedium.GetBaseURL( true ) );
                 aProperties.push_back( aProperty );
                 
@@ -179,7 +179,7 @@ void SdPPTFilter::PreSaveBasic()
         ::osl::Module* pLibrary = OpenLibrary( mrMedium.GetFilter()->GetUserData() );
         if( pLibrary )
         {
-            SaveVBA pSaveVBA= reinterpret_cast<SaveVBA>(pLibrary->getFunctionSymbol( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SaveVBA")) ));
+            SaveVBA pSaveVBA= reinterpret_cast<SaveVBA>(pLibrary->getFunctionSymbol( "SaveVBA" ));
             if( pSaveVBA )
             {
                 pSaveVBA( (SfxObjectShell&) mrDocShell, pBas );
diff --git a/sd/source/filter/xml/sdtransform.cxx b/sd/source/filter/xml/sdtransform.cxx
index eec1b49..6e52c55 100644
--- a/sd/source/filter/xml/sdtransform.cxx
+++ b/sd/source/filter/xml/sdtransform.cxx
@@ -95,9 +95,9 @@ void TransformOOo2xDocument( SdDrawDocument* pDocument )
 SdTransformOOo2xDocument::SdTransformOOo2xDocument( SdDrawDocument& rDocument )
 : mrDocument( rDocument )
 , mrOutliner( rDocument.GetDrawOutliner() )
-, msEnableNumbering( RTL_CONSTASCII_USTRINGPARAM( "enable-numbering" ) )
-, msTextNamespace( RTL_CONSTASCII_USTRINGPARAM( "urn:oasis:names:tc:opendocument:xmlns:text:1.0" ) )
-, msTrue( RTL_CONSTASCII_USTRINGPARAM( "true" ) )
+, msEnableNumbering( "enable-numbering" )
+, msTextNamespace( "urn:oasis:names:tc:opendocument:xmlns:text:1.0" )
+, msTrue( "true" )
 {
 }
 
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index dd9c0c9..eaf5285 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -229,8 +229,7 @@ sal_Int32 ReadThroughComponent(
 
     // get parser
     Reference< xml::sax::XParser > xParser(
-        rFactory->createInstance(
-            OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser")) ),
+        rFactory->createInstance("com.sun.star.xml.sax.Parser" ),
         UNO_QUERY );
     DBG_ASSERT( xParser.is(), "Can't create parser" );
     if( !xParser.is() )
@@ -426,7 +425,7 @@ sal_Int32 ReadThroughComponent(
     DBG_ASSERT( xInfoSet.is(), "missing property set" );
     if( xInfoSet.is() )
     {
-        OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("StreamName") );
+        OUString sPropName( "StreamName" );
         xInfoSet->setPropertyValue( sPropName, makeAny( sStreamName ) );
     }
 
@@ -439,8 +438,7 @@ sal_Int32 ReadThroughComponent(
         if ( !xStream.is() || ! xProps.is() )
             return SD_XML_READERROR;
 
-        Any aAny = xProps->getPropertyValue(
-                OUString( RTL_CONSTASCII_USTRINGPARAM("Encrypted") ) );
+        Any aAny = xProps->getPropertyValue( "Encrypted" );
 
         sal_Bool bEncrypted = aAny.getValueType() == ::getBooleanCppuType() &&
                 *(sal_Bool *)aAny.getValue();
@@ -534,7 +532,7 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError )
     };
 
     uno::Reference< beans::XPropertySet > xInfoSet( GenericPropertySet_CreateInstance( new PropertySetInfo( aImportInfoMap ) ) );
-    xInfoSet->setPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM( "Preview" )), uno::makeAny( mrDocShell.GetDoc()->IsStarDrawPreviewMode() ) );
+    xInfoSet->setPropertyValue( "Preview" , uno::makeAny( mrDocShell.GetDoc()->IsStarDrawPreviewMode() ) );
 
     // ---- get BuildId from parent container if available
 
@@ -545,7 +543,7 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError )
         if( xParentSet.is() )
         {
             uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xParentSet->getPropertySetInfo() );
-            OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BuildId" ) );
+            OUString sPropName( "BuildId" );
             if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(sPropName) )
             {
                 xInfoSet->setPropertyValue( sPropName, xParentSet->getPropertyValue(sPropName) );
@@ -590,12 +588,12 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError )
             // set ProgressRange
             uno::Any aProgRange;
             aProgRange <<= nProgressRange;
-            xInfoSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ProgressRange")), aProgRange);
+            xInfoSet->setPropertyValue( "ProgressRange" , aProgRange);
 
             // set ProgressCurrent
             uno::Any aProgCurrent;
             aProgCurrent <<= nProgressCurrent;
-            xInfoSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ProgressCurrent")), aProgCurrent);
+            xInfoSet->setPropertyValue( "ProgressCurrent" , aProgCurrent);
         }
     }
 
@@ -607,7 +605,7 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError )
     Reference<io::XInputStream> xInputStream;
     uno::Reference < embed::XStorage > xStorage = mrMedium.GetStorage();
 
-    OUString sSourceStorage( RTL_CONSTASCII_USTRINGPARAM("SourceStorage") );
+    OUString sSourceStorage( "SourceStorage");
     xInfoSet->setPropertyValue( sSourceStorage, Any( xStorage ) );
 
     if( !xStorage.is() )
@@ -627,8 +625,7 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError )
     }
 
     // Set base URI
-    const OUString sBaseURI( RTL_CONSTASCII_USTRINGPARAM("BaseURI") );
-    xInfoSet->setPropertyValue( sBaseURI, makeAny( mrMedium.GetBaseURL() ) );
+    xInfoSet->setPropertyValue( "BaseURI" , makeAny( mrMedium.GetBaseURL() ) );
 
     if( 0 == nRet && SFX_CREATE_MODE_EMBEDDED == mrDocShell.GetCreateMode() )
     {
@@ -641,21 +638,14 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError )
                 aName = pDocHierarchItem->GetValue();
         }
         else
-            aName = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "dummyObjectName" ));
+            aName = "dummyObjectName" ;
 
         if( !aName.isEmpty() )
-        {
-            const OUString sStreamRelPath(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath"));
-            xInfoSet->setPropertyValue( sStreamRelPath, Any( aName ) );
-        }
+            xInfoSet->setPropertyValue( "StreamRelPath", Any( aName ) );
     }
 
     if (SDXMLMODE_Organizer == meFilterMode)
-    {
-        ::rtl::OUString const sOrganizerMode(
-            RTL_CONSTASCII_USTRINGPARAM("OrganizerMode"));
-        xInfoSet->setPropertyValue(sOrganizerMode, uno::makeAny(sal_True));
-    }
+        xInfoSet->setPropertyValue("OrganizerMode", uno::makeAny(sal_True));
 
     // -------------------------------------
 
@@ -761,28 +751,28 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError )
     {
         try
         {
-            const OUString aName( RTL_CONSTASCII_USTRINGPARAM( "~clear~" ) );
-            uno::Reference< container::XNameContainer > xGradient( xModelFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.GradientTable") ) ), uno::UNO_QUERY );
+            const OUString aName("~clear~" );
+            uno::Reference< container::XNameContainer > xGradient( xModelFactory->createInstance( "com.sun.star.drawing.GradientTable" ), uno::UNO_QUERY );
             if( xGradient.is() )
                 xGradient->removeByName( aName );
 
-            uno::Reference< container::XNameContainer > xHatch( xModelFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.HatchTable") ) ), uno::UNO_QUERY );
+            uno::Reference< container::XNameContainer > xHatch( xModelFactory->createInstance( "com.sun.star.drawing.HatchTable" ), uno::UNO_QUERY );
             if( xHatch.is() )
                 xHatch->removeByName( aName );
 
-            uno::Reference< container::XNameContainer > xBitmap( xModelFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.BitmapTable") ) ), uno::UNO_QUERY );
+            uno::Reference< container::XNameContainer > xBitmap( xModelFactory->createInstance( "com.sun.star.drawing.BitmapTable" ), uno::UNO_QUERY );
             if( xBitmap.is() )
                 xBitmap->removeByName( aName );
 
-            uno::Reference< container::XNameContainer > xTransGradient( xModelFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.TransparencyGradientTable") ) ), uno::UNO_QUERY );
+            uno::Reference< container::XNameContainer > xTransGradient( xModelFactory->createInstance( "com.sun.star.drawing.TransparencyGradientTable" ), uno::UNO_QUERY );
             if( xTransGradient.is() )
                 xTransGradient->removeByName( aName );
 
-            uno::Reference< container::XNameContainer > xMarker( xModelFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.MarkerTable") ) ), uno::UNO_QUERY );
+            uno::Reference< container::XNameContainer > xMarker( xModelFactory->createInstance( "com.sun.star.drawing.MarkerTable" ), uno::UNO_QUERY );
             if( xMarker.is() )
                 xMarker->removeByName( aName );
 
-            uno::Reference< container::XNameContainer > xDashes( xModelFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DashTable") ) ), uno::UNO_QUERY );
+            uno::Reference< container::XNameContainer > xDashes( xModelFactory->createInstance( "com.sun.star.drawing.DashTable" ), uno::UNO_QUERY );
             if( xDashes.is() )
                 xDashes->removeByName( aName );
         }
@@ -799,7 +789,7 @@ sal_Bool SdXMLFilter::Import( ErrCode& nError )
         if( xModelSet.is() )
         {
             uno::Reference< beans::XPropertySetInfo > xModelSetInfo( xModelSet->getPropertySetInfo() );
-            const OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BuildId" ) );
+            const OUString sPropName( "BuildId" );
 
             OUString sBuildId;
             xInfoSet->getPropertyValue(sPropName) >>= sBuildId;
@@ -885,7 +875,7 @@ sal_Bool SdXMLFilter::Export()
 
         uno::Reference< lang::XServiceInfo > xServiceInfo( mxModel, uno::UNO_QUERY );
 
-        if( !xServiceInfo.is() || !xServiceInfo->supportsService( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.drawing.GenericDrawingDocument" ) ) ) )
+        if( !xServiceInfo.is() || !xServiceInfo->supportsService( "com.sun.star.drawing.GenericDrawingDocument" ) )
         {
             OSL_FAIL( "Model is no DrawingDocument in XMLExport" );
             return sal_False;
@@ -899,7 +889,7 @@ sal_Bool SdXMLFilter::Export()
             return sal_False;
         }
 
-        uno::Reference< uno::XInterface > xWriter( xServiceFactory->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.xml.sax.Writer" ) ) ) );
+        uno::Reference< uno::XInterface > xWriter( xServiceFactory->createInstance( "com.sun.star.xml.sax.Writer" ) );
 
         if( !xWriter.is() )
         {
@@ -942,17 +932,17 @@ sal_Bool SdXMLFilter::Export()
 
 
         SvtSaveOptions aSaveOpt;
-        OUString sUsePrettyPrinting(RTL_CONSTASCII_USTRINGPARAM("UsePrettyPrinting"));
+        OUString sUsePrettyPrinting("UsePrettyPrinting");
         sal_Bool bUsePrettyPrinting( aSaveOpt.IsPrettyPrinting() );
         xInfoSet->setPropertyValue( sUsePrettyPrinting, makeAny( bUsePrettyPrinting ) );
 
         const uno::Reference < embed::XStorage >& xStorage = mrMedium.GetOutputStorage();
 
         // Set base URI
-        OUString sPropName( RTL_CONSTASCII_USTRINGPARAM("BaseURI") );
+        OUString sPropName( "BaseURI" );
         xInfoSet->setPropertyValue( sPropName, makeAny( mrMedium.GetBaseURL( true ) ) );
 
-        OUString sTargetStorage( RTL_CONSTASCII_USTRINGPARAM("TargetStorage") );
+        OUString sTargetStorage( "TargetStorage" );
         xInfoSet->setPropertyValue( sTargetStorage, Any( xStorage ) );
 
         if( SFX_CREATE_MODE_EMBEDDED == mrDocShell.GetCreateMode() )
@@ -968,7 +958,7 @@ sal_Bool SdXMLFilter::Export()
 
             if( !aName.isEmpty() )
             {
-                sPropName = OUString(RTL_CONSTASCII_USTRINGPARAM("StreamRelPath"));
+                sPropName = OUString( "StreamRelPath" );
                 xInfoSet->setPropertyValue( sPropName, makeAny( aName ) );
             }
         }
@@ -977,7 +967,7 @@ sal_Bool SdXMLFilter::Export()
         uno::Sequence< beans::PropertyValue > aDescriptor( 1 );
         beans::PropertyValue* pProps = aDescriptor.getArray();
 
-        pProps[0].Name = OUString( RTL_CONSTASCII_USTRINGPARAM( "FileName" ) );
+        pProps[0].Name = "FileName";
         pProps[0].Value <<= OUString( mrMedium.GetName() );
 
         {
@@ -1007,12 +997,12 @@ sal_Bool SdXMLFilter::Export()
                     // set ProgressRange
                     uno::Any aProgRange;
                     aProgRange <<= nProgressRange;
-                    xInfoSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ProgressRange")), aProgRange);
+                    xInfoSet->setPropertyValue( "ProgressRange" , aProgRange);
 
                     // set ProgressCurrent
                     uno::Any aProgCurrent;
                     aProgCurrent <<= nProgressCurrent;
-                    xInfoSet->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ProgressCurrent")), aProgCurrent);
+                    xInfoSet->setPropertyValue( "ProgressCurrent" , aProgCurrent);
                 }
             }
 
@@ -1067,16 +1057,16 @@ sal_Bool SdXMLFilter::Export()
                     if( !xDocOut.is() || !xProps.is() )
                         return sal_False;
 
-                    uno::Any aAny; aAny <<= OUString( RTL_CONSTASCII_USTRINGPARAM("text/xml") );
-                    xProps->setPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), aAny);
+                    uno::Any aAny; aAny <<= OUString( "text/xml");
+                    xProps->setPropertyValue( "MediaType" , aAny);
 
-                    OUString aUseCommonPassPropName( RTL_CONSTASCII_USTRINGPARAM("UseCommonStoragePasswordEncryption") );
+                    OUString aUseCommonPassPropName( "UseCommonStoragePasswordEncryption");
                     if( pServices->mbPlain )
-                        xProps->setPropertyValue( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Compressed") ), uno::makeAny( (sal_Bool) sal_False ) );
+                        xProps->setPropertyValue( "Compressed" , uno::makeAny( (sal_Bool) sal_False ) );
                     // if the document is encrypted even the plain streams should be encrypted
                     xProps->setPropertyValue( aUseCommonPassPropName, uno::makeAny( (sal_Bool)sal_True ) );
 
-                    const OUString sStreamName( RTL_CONSTASCII_USTRINGPARAM("StreamName") );
+                    const OUString sStreamName( "StreamName");
                     xInfoSet->setPropertyValue( sStreamName, Any( sDocName ) );
                 }
 


More information about the Libreoffice-commits mailing list