summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSameer Deshmukh <sameer.deshmukh93@gmail.com>2013-04-20 23:35:23 +0530
committerFridrich Strba <fridrich@documentfoundation.org>2013-04-22 07:38:00 +0000
commitdd47994722eaead16099145e593fbf878072d52b (patch)
treeb2395abb94f6247513873cb822b51f1ee4ff6ed2
parentca54015d7ea10f5648bccb2adfb7a321747e70f9 (diff)
fdo#62096: Replaced some compareTo with ==
Change-Id: I1151dafcef91abdb2ce08abe3547a49fe3f4a67c Reviewed-on: https://gerrit.libreoffice.org/3509 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r--sal/inc/rtl/string.hxx8
-rw-r--r--sal/qa/rtl_strings/rtl_OString.cxx6
-rw-r--r--writerfilter/source/ooxml/OOXMLStreamImpl.cxx14
3 files changed, 14 insertions, 14 deletions
diff --git a/sal/inc/rtl/string.hxx b/sal/inc/rtl/string.hxx
index e3d5afbc895a..815126284aaa 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 1934f0625248..293381cd2a7c 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 96f37bdfbacd..3305e7c41d78 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;
}