[Libreoffice-commits] .: 2 commits - svtools/source tools/source

Caolán McNamara caolan at kemper.freedesktop.org
Sun Jan 16 13:20:56 PST 2011


 svtools/source/config/extcolorcfg.cxx                      |    6 +++---
 svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx |    4 ++--
 svtools/source/filter.vcl/filter/filter.cxx                |    8 ++++----
 svtools/source/graphic/provider.cxx                        |    8 ++++----
 svtools/source/misc/embedhlp.cxx                           |    2 +-
 svtools/source/productregistration/productregistration.cxx |    2 +-
 svtools/source/uno/contextmenuhelper.cxx                   |    2 +-
 svtools/source/uno/popupmenucontrollerbase.cxx             |    4 ++--
 svtools/source/uno/statusbarcontroller.cxx                 |   10 +++++-----
 tools/source/fsys/urlobj.cxx                               |    4 ++--
 10 files changed, 25 insertions(+), 25 deletions(-)

New commits:
commit fc6db21fbd38755caebea525f295b9404ea10954
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 16 21:20:49 2011 +0000

    equalsAsciiL faster than equalsAscii

diff --git a/svtools/source/config/extcolorcfg.cxx b/svtools/source/config/extcolorcfg.cxx
index 369085a..b0a5521 100644
--- a/svtools/source/config/extcolorcfg.cxx
+++ b/svtools/source/config/extcolorcfg.cxx
@@ -327,12 +327,12 @@ void ExtendedColorConfig_Impl::Load(const rtl::OUString& rScheme)
     {
         aComponentNames = GetPropertyNames(sBase);
         FillComponentColors(aComponentNames,aDisplayNameMap);
-    } // if ( bFound )
+    }
 
     if ( !m_sLoadedScheme.getLength() )
         m_sLoadedScheme = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("default"));
     
-    if ( !sScheme.equalsAscii("default") )
+    if ( !sScheme.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("default")) )
     {
         ::rtl::OUString sDefault(RTL_CONSTASCII_USTRINGPARAM("default"));
         if ( ExistsScheme(sDefault) )
@@ -341,7 +341,7 @@ void ExtendedColorConfig_Impl::Load(const rtl::OUString& rScheme)
             aComponentNames = GetPropertyNames(sBaseDefault);
             FillComponentColors(aComponentNames,aDisplayNameMap);
         }
-    } // if ( !sScheme.equalsAscii("default") )
+    }
     if ( !bFound && sScheme.getLength() )
     {
         AddScheme(sScheme);
diff --git a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
index 09cc71e..649efae 100644
--- a/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
+++ b/svtools/source/filter.vcl/filter/SvFilterOptionsDialog.cxx
@@ -151,7 +151,7 @@ uno::Sequence< beans::PropertyValue > SvFilterOptionsDialog::getPropertyValues()
     sal_Int32 i, nCount;
     for ( i = 0, nCount = aMediaDescriptor.getLength(); i < nCount; i++ )
     {
-        if ( aMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) ) 
+        if ( aMediaDescriptor[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FilterData")) )
             break;
     }
     if ( i == nCount )
@@ -173,7 +173,7 @@ void SvFilterOptionsDialog::setPropertyValues( const uno::Sequence< beans::Prope
     sal_Int32 i, nCount;
     for ( i = 0, nCount = aMediaDescriptor.getLength(); i < nCount; i++ )
     {
-        if ( aMediaDescriptor[ i ].Name.equalsAscii( "FilterData" ) ) 
+        if ( aMediaDescriptor[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FilterData")) )
         {
             aMediaDescriptor[ i ].Value >>= aFilterDataSequence;
             break;
diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx
index 7f7e9ac..dbedfb0 100644
--- a/svtools/source/filter.vcl/filter/filter.cxx
+++ b/svtools/source/filter.vcl/filter/filter.cxx
@@ -1310,7 +1310,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
         sal_Int32 i;
         for ( i = 0; i < pFilterData->getLength(); i++ )
         {
-            if ( (*pFilterData)[ i ].Name.equalsAscii( "PreviewSizeHint" ) )
+            if ( (*pFilterData)[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("PreviewSizeHint")) )
             {
                 awt::Size aSize;
                 if ( (*pFilterData)[ i ].Value >>= aSize )
@@ -1322,7 +1322,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
                         nImportFlags &=~GRFILTER_I_FLAGS_FOR_PREVIEW;
                 }
             }
-            else if ( (*pFilterData)[ i ].Name.equalsAscii( "AllowPartialStreamRead" ) )
+            else if ( (*pFilterData)[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("AllowPartialStreamRead")) )
             {
                 (*pFilterData)[ i ].Value >>= bAllowPartialStreamRead;
                 if ( bAllowPartialStreamRead )
@@ -1330,7 +1330,7 @@ USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvS
                 else
                     nImportFlags &=~GRFILTER_I_FLAGS_ALLOW_PARTIAL_STREAMREAD;
             }
-            else if ( (*pFilterData)[ i ].Name.equalsAscii( "CreateNativeLink" ) )
+            else if ( (*pFilterData)[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CreateNativeLink")) )
             {
                 (*pFilterData)[ i ].Value >>= bCreateNativeLink;
             }
@@ -1867,7 +1867,7 @@ USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPat
                     sal_Int32 k, j, i = 0;
                     for ( i = 0; i < pFilterData->getLength(); i++ )
                     {
-                        if ( (*pFilterData)[ i ].Name.equalsAscii( "AdditionalChunks" ) )
+                        if ( (*pFilterData)[ i ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("AdditionalChunks")) )
                         {
                             com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aAdditionalChunkSequence;
                             if ( (*pFilterData)[ i ].Value >>= aAdditionalChunkSequence )
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index 789b864..dbb6b83 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -232,19 +232,19 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadStandardImage( co
     if( ( 0 == rResourceURL.getToken( 0, '/', nIndex ).compareToAscii( "private:standardimage" ) ) )
     {
         rtl::OUString sImageName( rResourceURL.copy( nIndex ) );
-        if ( sImageName.equalsAscii( "info" ) )
+        if ( sImageName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("info")) )
         {
             xRet = InfoBox::GetStandardImage().GetXGraphic();
         }
-        else if ( sImageName.equalsAscii( "warning" ) )
+        else if ( sImageName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("warning")) )
         {
             xRet = WarningBox::GetStandardImage().GetXGraphic();
         }
-        else if ( sImageName.equalsAscii( "error" ) )
+        else if ( sImageName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("error")) )
         {
             xRet = ErrorBox::GetStandardImage().GetXGraphic();
         }
-        else if ( sImageName.equalsAscii( "query" ) )
+        else if ( sImageName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("query")) )
         {
             xRet = QueryBox::GetStandardImage().GetXGraphic();
         }
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index 9ca8175..5a6959c 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -194,7 +194,7 @@ void SAL_CALL EmbedEventListener_Impl::notifyEvent( const document::EventObject&
 {
     SolarMutexGuard aGuard;
 
-    if ( pObject && aEvent.EventName.equalsAscii("OnVisAreaChanged") && pObject->GetViewAspect() != embed::Aspects::MSOLE_ICON && !pObject->IsChart() )
+    if ( pObject && aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("OnVisAreaChanged")) && pObject->GetViewAspect() != embed::Aspects::MSOLE_ICON && !pObject->IsChart() )
     {
         pObject->UpdateReplacement();
     }
diff --git a/svtools/source/productregistration/productregistration.cxx b/svtools/source/productregistration/productregistration.cxx
index cf0ba6a..df2e6b9 100644
--- a/svtools/source/productregistration/productregistration.cxx
+++ b/svtools/source/productregistration/productregistration.cxx
@@ -441,7 +441,7 @@ namespace svt
     OProductRegistration::EventType OProductRegistration::classify( const OUString& _rEventDesc )
     {
         EventType eReturn = etUnknown;
-        if ( _rEventDesc.equalsAscii( "RegistrationRequired" ) )
+        if ( _rEventDesc.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("RegistrationRequired")) )
         {
             eReturn = etRegistrationRequired;
         }
diff --git a/svtools/source/uno/contextmenuhelper.cxx b/svtools/source/uno/contextmenuhelper.cxx
index 4d163f6..16a1bcc 100644
--- a/svtools/source/uno/contextmenuhelper.cxx
+++ b/svtools/source/uno/contextmenuhelper.cxx
@@ -576,7 +576,7 @@ ContextMenuHelper::getLabelFromCommandURL(
                 {
                     for ( sal_Int32 i = 0; i < aPropSeq.getLength(); i++ )
                     {
-                        if ( aPropSeq[i].Name.equalsAscii( "Label" ))
+                        if ( aPropSeq[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Label")) )
                         {
                             aPropSeq[i].Value >>= aStr;
                             break;
diff --git a/svtools/source/uno/popupmenucontrollerbase.cxx b/svtools/source/uno/popupmenucontrollerbase.cxx
index 3ec62db..df89113 100644
--- a/svtools/source/uno/popupmenucontrollerbase.cxx
+++ b/svtools/source/uno/popupmenucontrollerbase.cxx
@@ -371,9 +371,9 @@ void SAL_CALL PopupMenuControllerBase::initialize( const Sequence< Any >& aArgum
         {
             if ( aArguments[i] >>= aPropValue )
             {
-                if ( aPropValue.Name.equalsAscii( "Frame" ))
+                if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Frame")) )
                     aPropValue.Value >>= xFrame;
-                else if ( aPropValue.Name.equalsAscii( "CommandURL" ))
+                else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CommandURL")) )
                     aPropValue.Value >>= aCommandURL;
             }
         }
diff --git a/svtools/source/uno/statusbarcontroller.cxx b/svtools/source/uno/statusbarcontroller.cxx
index 0a47c29..49c7bf7 100644
--- a/svtools/source/uno/statusbarcontroller.cxx
+++ b/svtools/source/uno/statusbarcontroller.cxx
@@ -189,15 +189,15 @@ throw ( Exception, RuntimeException )
         {
             if ( aArguments[i] >>= aPropValue )
             {
-                if ( aPropValue.Name.equalsAscii( "Frame" ))
+                if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Frame")) )
                     aPropValue.Value >>= m_xFrame;
-                else if ( aPropValue.Name.equalsAscii( "CommandURL" ))
+                else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("CommandURL")) )
                     aPropValue.Value >>= m_aCommandURL;
-                else if ( aPropValue.Name.equalsAscii( "ServiceManager" ))
+                else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ServiceManager")) )
                     aPropValue.Value >>= m_xServiceManager;
-                else if ( aPropValue.Name.equalsAscii( "ParentWindow" ))
+                else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ParentWindow")) )
                     aPropValue.Value >>= m_xParentWindow;
-                else if ( aPropValue.Name.equalsAscii( "Identifier" ))
+                else if ( aPropValue.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Identifier")) )
                     aPropValue.Value >>= m_nID;
             }
         }
commit 648f73a13999ecc85090435ce458bc87632fe4a3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 16 21:14:53 2011 +0000

    microopt, equalsAsciiL faster than equalsAscii

diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 90d6933..b6e2697 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -3286,9 +3286,9 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
             }
             bool bInbox;
             rtl::OUString sCompare(aTheSynPath);
-            if (sCompare.equalsAscii("/inbox"))
+            if (sCompare.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("/inbox")))
                 bInbox = true;
-            else if (sCompare.equalsAscii("/newsgroups"))
+            else if (sCompare.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("/newsgroups")))
                 bInbox = false;
             else
                 return false;


More information about the Libreoffice-commits mailing list