[Libreoffice-commits] core.git: sal/inc sal/qa writerfilter/source

Sameer Deshmukh sameer.deshmukh93 at gmail.com
Mon Apr 22 00:38:19 PDT 2013


 sal/inc/rtl/string.hxx                        |    8 ++++----
 sal/qa/rtl_strings/rtl_OString.cxx            |    6 +++---
 writerfilter/source/ooxml/OOXMLStreamImpl.cxx |   14 +++++++-------
 3 files changed, 14 insertions(+), 14 deletions(-)

New commits:
commit dd47994722eaead16099145e593fbf878072d52b
Author: Sameer Deshmukh <sameer.deshmukh93 at gmail.com>
Date:   Sat Apr 20 23:35:23 2013 +0530

    fdo#62096: Replaced some compareTo with ==
    
    Change-Id: I1151dafcef91abdb2ce08abe3547a49fe3f4a67c
    Reviewed-on: https://gerrit.libreoffice.org/3509
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index e3d5afb..8151262 100644
--- a/sal/inc/rtl/string.hxx
+++ b/sal/inc/rtl/string.hxx
@@ -782,25 +782,25 @@ public:
     template< typename T >
     friend typename internal::CharPtrDetector< T, bool >::Type operator==( const OString& rStr1, const T& value ) SAL_THROW(())
     {
-        return rStr1.compareTo( value ) == 0;
+        return (rStr1 == value);
     }
 
     template< typename T >
     friend typename internal::NonConstCharArrayDetector< T, bool >::Type operator==( const OString& rStr1, T& value ) SAL_THROW(())
     {
-        return rStr1.compareTo( value ) == 0;
+        return (rStr1 == value);
     }
 
     template< typename T >
     friend typename internal::CharPtrDetector< T, bool >::Type operator==( const T& value, const OString& rStr2 ) SAL_THROW(())
     {
-        return rStr2.compareTo( value ) == 0;
+        return (rStr2 == value);
     }
 
     template< typename T >
     friend typename internal::NonConstCharArrayDetector< T, bool >::Type operator==( T& value, const OString& rStr2 ) SAL_THROW(())
     {
-        return rStr2.compareTo( value ) == 0;
+        return (rStr2 == value);
     }
 
     /**
diff --git a/sal/qa/rtl_strings/rtl_OString.cxx b/sal/qa/rtl_strings/rtl_OString.cxx
index 1934f06..293381c 100644
--- a/sal/qa/rtl_strings/rtl_OString.cxx
+++ b/sal/qa/rtl_strings/rtl_OString.cxx
@@ -1929,7 +1929,7 @@ sal_Bool test_valueOf( const char** resArray, int n, sal_Int16 radix,
         bRes &= c_rtl_tres_state
                 (
                     hRtlTestResult,
-                    aStr2.compareTo(aStr1) == 0,
+                    aStr2 == aStr1,
                     (sal_Char*)resArray[i],
                     createName( pMeth, "valueOf", i )
                 );
@@ -2163,7 +2163,7 @@ sal_Bool SAL_CALL test_rtl_OString_valueOf_Int32_WrongRadix(
     bRes = c_rtl_tres_state
             (
                 hRtlTestResult,
-                aStr2.compareTo( aStr1 ) == 0,
+                aStr2 ==  aStr1,
                 "if radix not valid then radix must be 10",
                 "valueOf(sal_Int32, sal_Int32 radix): radix = -5"
             );
@@ -2411,7 +2411,7 @@ sal_Bool SAL_CALL test_rtl_OString_valueOf_Int64_WrongRadix(
     bRes = c_rtl_tres_state
             (
                 hRtlTestResult,
-                aStr2.compareTo(aStr1) == 0,
+                aStr2 == aStr1,
                 "if radix not valid then radix must be 10",
                 "valueOf(sal_Int64, sal_Int32 radix): radix = -5"
             );
diff --git a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
index 96f37bd..3305e7c 100644
--- a/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
+++ b/writerfilter/source/ooxml/OOXMLStreamImpl.cxx
@@ -169,16 +169,16 @@ bool OOXMLStreamImpl::lcl_getTarget(uno::Reference<embed::XRelationshipAccess>
             {
                 beans::StringPair aPair = aSeq[i];
 
-                if (aPair.First.compareTo(sType) == 0 &&
-                    aPair.Second.compareTo(sStreamType) == 0)
+                if (aPair.First == sType &&
+                    aPair.Second == sStreamType)
                     bFound = true;
-                else if (aPair.First.compareTo(sId) == 0 &&
-                         aPair.Second.compareTo(rId) == 0)
+                else if (aPair.First == sId &&
+                         aPair.Second == rId)
                     bFound = true;
-                else if (aPair.First.compareTo(sTarget) == 0)
+                else if (aPair.First == sTarget)
                     sMyTarget = aPair.Second;
-                else if (aPair.First.compareTo(sTargetMode) == 0 &&
-                         aPair.Second.compareTo(sExternal) == 0)
+                else if (aPair.First == sTargetMode &&
+                         aPair.Second == sExternal)
                     bExternalTarget = true;
 
             }


More information about the Libreoffice-commits mailing list