[Libreoffice-commits] .: sdext/source

Thomas Arnhold tarnhold at kemper.freedesktop.org
Thu Jan 20 02:30:34 PST 2011


 sdext/source/pdfimport/filterdet.cxx           |   22 +++++++++++-----------
 sdext/source/pdfimport/pdfiadaptor.cxx         |   16 ++++++++--------
 sdext/source/pdfimport/pdfparse/pdfentries.cxx |    2 +-
 sdext/source/pdfimport/tree/style.cxx          |    2 +-
 sdext/source/presenter/PresenterScreen.cxx     |    4 ++--
 sdext/source/presenter/PresenterToolBar.cxx    |   14 +++++++-------
 6 files changed, 30 insertions(+), 30 deletions(-)

New commits:
commit d1bb1b8d60fdf0c57d11001079bb714d4da4bf80
Author: Thomas Arnhold <thomas at arnhold.org>
Date:   Thu Jan 20 11:30:00 2011 +0100

    Replace suitable equalsAscii calls with equalsAsciiL.
    
    Done with sed -i 's%\(\.equalsAscii\)(\(\s\?"[^"]\+"\)\(\s\?\))%\1L(\3RTL_CONSTASCII_STRINGPARAM(\2\3)\3)%g'.

diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx
index 265ccbc..62863f4 100644
--- a/sdext/source/pdfimport/filterdet.cxx
+++ b/sdext/source/pdfimport/filterdet.cxx
@@ -355,13 +355,13 @@ rtl::OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue
                    rtl::OUStringToOString( pAttribs[i].Name, RTL_TEXTENCODING_UTF8 ).getStr(),
                    rtl::OUStringToOString( aVal, RTL_TEXTENCODING_UTF8 ).getStr() );
 #endif
-        if( pAttribs[i].Name.equalsAscii( "InputStream" ) )
+        if( pAttribs[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "InputStream" ) ) )
             pAttribs[i].Value >>= xInput;
-        else if( pAttribs[i].Name.equalsAscii( "URL" ) )
+        else if( pAttribs[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "URL" ) ) )
             pAttribs[i].Value >>= aURL;
-        else if( pAttribs[i].Name.equalsAscii( "FilterName" ) )
+        else if( pAttribs[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "FilterName" ) ) )
             nFilterNamePos = i;
-        else if( pAttribs[i].Name.equalsAscii( "Password" ) )
+        else if( pAttribs[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Password" ) ) )
         {
             nPwdPos = i;
             pAttribs[i].Value >>= aPwd;
@@ -443,15 +443,15 @@ rtl::OUString SAL_CALL PDFDetector::detect( uno::Sequence< beans::PropertyValue
             osl_removeFile( aURL.pData );
         if( aEmbedMimetype.getLength() )
         {
-            if( aEmbedMimetype.equalsAscii( "application/vnd.oasis.opendocument.text" )
-                || aEmbedMimetype.equalsAscii( "application/vnd.oasis.opendocument.text-master" ) )
+            if( aEmbedMimetype.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "application/vnd.oasis.opendocument.text" ) )
+                || aEmbedMimetype.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "application/vnd.oasis.opendocument.text-master" ) ) )
                 aOutFilterName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "writer_pdf_addstream_import" ) );
-            else if( aEmbedMimetype.equalsAscii( "application/vnd.oasis.opendocument.presentation" ) )
+            else if( aEmbedMimetype.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "application/vnd.oasis.opendocument.presentation" ) ) )
                 aOutFilterName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "impress_pdf_addstream_import" ) );
-            else if( aEmbedMimetype.equalsAscii( "application/vnd.oasis.opendocument.graphics" )
-                     || aEmbedMimetype.equalsAscii( "application/vnd.oasis.opendocument.drawing" ) )
+            else if( aEmbedMimetype.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "application/vnd.oasis.opendocument.graphics" ) )
+                     || aEmbedMimetype.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "application/vnd.oasis.opendocument.drawing" ) ) )
                 aOutFilterName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "draw_pdf_addstream_import" ) );
-            else if( aEmbedMimetype.equalsAscii( "application/vnd.oasis.opendocument.spreadsheet" ) )
+            else if( aEmbedMimetype.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "application/vnd.oasis.opendocument.spreadsheet" ) ) )
                 aOutFilterName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "calc_pdf_addstream_import" ) );
         }
     }
@@ -701,7 +701,7 @@ uno::Reference< io::XStream > getAdditionalStream( const rtl::OUString&
                                     uno::Reference< task::XInteractionHandler > xIntHdl;
                                     for( sal_Int32 i = 0; i < nAttribs; i++ )
                                     {
-                                        if( pAttribs[i].Name.equalsAscii( "InteractionHandler" ) )
+                                        if( pAttribs[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "InteractionHandler" ) ) )
                                             pAttribs[i].Value >>= xIntHdl;
                                     }
                                     if( ! bMayUseUI || ! xIntHdl.is() )
diff --git a/sdext/source/pdfimport/pdfiadaptor.cxx b/sdext/source/pdfimport/pdfiadaptor.cxx
index f40e354..ec753b6 100644
--- a/sdext/source/pdfimport/pdfiadaptor.cxx
+++ b/sdext/source/pdfimport/pdfiadaptor.cxx
@@ -85,9 +85,9 @@ sal_Bool SAL_CALL PDFIHybridAdaptor::filter( const uno::Sequence< beans::Propert
                        rtl::OUStringToOString( pAttribs[i].Name, RTL_TEXTENCODING_UTF8 ).getStr(),
                        rtl::OUStringToOString( aVal, RTL_TEXTENCODING_UTF8 ).getStr() );
             #endif
-            if( pAttribs[i].Name.equalsAscii( "EmbeddedSubstream" ) )
+            if( pAttribs[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "EmbeddedSubstream" ) ) )
                 pAttribs[i].Value >>= xSubStream;
-            else if( pAttribs[i].Name.equalsAscii( "Password" ) )
+            else if( pAttribs[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Password" ) ) )
             {
                 nPwPos = i;
                 pAttribs[i].Value >>= aPwd;
@@ -99,7 +99,7 @@ sal_Bool SAL_CALL PDFIHybridAdaptor::filter( const uno::Sequence< beans::Propert
             uno::Reference< io::XInputStream > xInput;
             for( sal_Int32 i = 0; i < nAttribs; i++ )
             {
-                if( pAttribs[i].Name.equalsAscii( "InputStream" ) )
+                if( pAttribs[i].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "InputStream" ) ) )
                 {
                     pAttribs[i].Value >>= xInput;
                     break;
@@ -294,15 +294,15 @@ sal_Bool SAL_CALL PDFIRawAdaptor::importer( const uno::Sequence< beans::Property
     for( sal_Int32 i = 0; i < nAttribs; i++, pAttribs++ )
     {
         OSL_TRACE("importer Attrib: %s\n", OUStringToOString( pAttribs->Name, RTL_TEXTENCODING_UTF8 ).getStr() );
-        if( pAttribs->Name.equalsAscii( "InputStream" ) )
+        if( pAttribs->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "InputStream" ) ) )
             pAttribs->Value >>= xInput;
-        else if( pAttribs->Name.equalsAscii( "URL" ) )
+        else if( pAttribs->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "URL" ) ) )
             pAttribs->Value >>= aURL;
-        else if( pAttribs->Name.equalsAscii( "StatusIndicator" ) )
+        else if( pAttribs->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "StatusIndicator" ) ) )
             pAttribs->Value >>= xStatus;
-        else if( pAttribs->Name.equalsAscii( "InteractionHandler" ) )
+        else if( pAttribs->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "InteractionHandler" ) ) )
             pAttribs->Value >>= xInteractionHandler;
-        else if( pAttribs->Name.equalsAscii( "Password" ) )
+        else if( pAttribs->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Password" ) ) )
             pAttribs->Value >>= aPwd;
     }
     if( !xInput.is() )
diff --git a/sdext/source/pdfimport/pdfparse/pdfentries.cxx b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
index 51bf6a1..c45bd7c 100644
--- a/sdext/source/pdfimport/pdfparse/pdfentries.cxx
+++ b/sdext/source/pdfimport/pdfparse/pdfentries.cxx
@@ -1253,7 +1253,7 @@ PDFFileImplData* PDFFile::impl_getData() const
                                 m_pData->m_nKeyLength = static_cast<sal_uInt32>(pNum->m_fValue) / 8;
                         }
                         PDFName* pFilter = dynamic_cast<PDFName*>(filter->second);
-                        if( pFilter && pFilter->getFilteredName().equalsAscii( "Standard" ) )
+                        if( pFilter && pFilter->getFilteredName().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Standard" ) ) )
                             m_pData->m_bStandardHandler = true;
                         if( o_ent != pDict->m_aMap.end() )
                         {
diff --git a/sdext/source/pdfimport/tree/style.cxx b/sdext/source/pdfimport/tree/style.cxx
index 1a2f43c..1d7bed7 100644
--- a/sdext/source/pdfimport/tree/style.cxx
+++ b/sdext/source/pdfimport/tree/style.cxx
@@ -228,7 +228,7 @@ void StyleContainer::emit( EmitContext&        rContext,
         {
             if( it->second.Name.equals( "style:master-page" ) )
                 aMasterPageSection.push_back( it->first );
-            else if( getStyleName( it->first ).equalsAscii( "standard" ) )
+            else if( getStyleName( it->first ).equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "standard" ) ) )
                 aOfficeStyleSection.push_back( it->first );
             else
                 aAutomaticStyleSection.push_back( it->first );
diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx
index 69e949c..8f9e9c5 100644
--- a/sdext/source/presenter/PresenterScreen.cxx
+++ b/sdext/source/presenter/PresenterScreen.cxx
@@ -173,7 +173,7 @@ Any SAL_CALL PresenterScreenJob::execute(
     const beans::NamedValue* p = Arguments.getConstArray();
     for (i=0; i<c; ++i)
     {
-        if (p[i].Name.equalsAscii("Environment"))
+        if (p[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Environment")))
         {
             p[i].Value >>= lEnv;
             break;
@@ -185,7 +185,7 @@ Any SAL_CALL PresenterScreenJob::execute(
     p = lEnv.getConstArray();
     for (i=0; i<c; ++i)
     {
-        if (p[i].Name.equalsAscii("Model"))
+        if (p[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Model")))
         {
             p[i].Value >>= xModel;
             break;
diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx
index 21e4121..cf51005 100644
--- a/sdext/source/presenter/PresenterToolBar.cxx
+++ b/sdext/source/presenter/PresenterToolBar.cxx
@@ -840,19 +840,19 @@ void PresenterToolBar::ProcessEntry (
 
     // Create new element.
     ::rtl::Reference<Element> pElement;
-    if (sType.equalsAscii("Button"))
+    if (sType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Button")))
         pElement = Button::Create(this);
-    else if (sType.equalsAscii("CurrentTimeLabel"))
+    else if (sType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CurrentTimeLabel")))
         pElement = CurrentTimeLabel::Create(this);
-    else if (sType.equalsAscii("PresentationTimeLabel"))
+    else if (sType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PresentationTimeLabel")))
         pElement = PresentationTimeLabel::Create(this);
-    else if (sType.equalsAscii("VerticalSeparator"))
+    else if (sType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("VerticalSeparator")))
         pElement = ::rtl::Reference<Element>(new VerticalSeparator(this));
-    else if (sType.equalsAscii("HorizontalSeparator"))
+    else if (sType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HorizontalSeparator")))
         pElement = ::rtl::Reference<Element>(new HorizontalSeparator(this));
-    else if (sType.equalsAscii("Label"))
+    else if (sType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Label")))
         pElement = ::rtl::Reference<Element>(new Label(this));
-    else if (sType.equalsAscii("ChangeOrientation"))
+    else if (sType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ChangeOrientation")))
     {
         mpCurrentContainerPart.reset(new ElementContainerPart());
         maElementContainer.push_back(mpCurrentContainerPart);


More information about the Libreoffice-commits mailing list