summaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-05 11:06:18 +0200
committerNoel Grandin <noel@peralex.com>2013-11-11 12:58:12 +0200
commit0a9ef5a18e148c7a5c9a088e153a7873d1564841 (patch)
tree3c3bc21e7ee4f836a1d056695175e0b1a91eda26 /io
parent7944301424aac0943e4ecc0410f495b210ad3b79 (diff)
convert OUString 0==compareToAscii to equalsAscii
Convert code like: 0 == aStr.compareToAscii("XXX") to aStr.equalsAscii("XXX") which is both clearer and faster. Change-Id: I2e906d7d38494db38eb292702fadb781b1251e07
Diffstat (limited to 'io')
-rw-r--r--io/test/stm/datatest.cxx36
1 files changed, 18 insertions, 18 deletions
diff --git a/io/test/stm/datatest.cxx b/io/test/stm/datatest.cxx
index 3e80f09e382e..b556aab6192c 100644
--- a/io/test/stm/datatest.cxx
+++ b/io/test/stm/datatest.cxx
@@ -462,28 +462,28 @@ void MyPersistObject::setPropertyValue(
WrappedTargetException,
RuntimeException)
{
- if( 0 == aPropertyName.compareToAscii("long") ) {
+ if( aPropertyName.equalsAscii("long") ) {
aValue >>= m_l;
}
- else if ( 0 == aPropertyName.compareToAscii("float") ) {
+ else if ( aPropertyName.equalsAscii("float") ) {
aValue >>= m_f;
}
- else if( 0 == aPropertyName.compareToAscii("double") ) {
+ else if( aPropertyName.equalsAscii("double") ) {
aValue >>= m_d;
}
- else if( 0 == aPropertyName.compareToAscii("bool") ) {
+ else if( aPropertyName.equalsAscii("bool") ) {
aValue >>= m_b;
}
- else if( 0 == aPropertyName.compareToAscii("byte" ) ) {
+ else if( aPropertyName.equalsAscii("byte" ) ) {
aValue >>= m_byte;
}
- else if( 0 == aPropertyName.compareToAscii("char") ) {
+ else if( aPropertyName.equalsAscii("char") ) {
aValue >>= m_c;
}
- else if( 0 == aPropertyName.compareToAscii("string") ) {
+ else if( aPropertyName.equalsAscii("string") ) {
aValue >>= m_s;
}
- else if( 0 == aPropertyName.compareToAscii("object") ) {
+ else if( aPropertyName.equalsAscii("object") ) {
if( aValue.getValueType() == getCppuType( (Reference< XPersistObject> *)0 ) )
{
aValue >>= m_ref;
@@ -502,28 +502,28 @@ Any MyPersistObject::getPropertyValue(const OUString& aPropertyName)
RuntimeException)
{
Any aValue;
- if( 0 == aPropertyName.compareToAscii("long" ) ) {
+ if( aPropertyName.equalsAscii("long" ) ) {
aValue <<= m_l;
}
- else if ( 0 == aPropertyName.compareToAscii("float") ) {
+ else if ( aPropertyName.equalsAscii("float") ) {
aValue <<= m_f;
}
- else if( 0 == aPropertyName.compareToAscii("double") ) {
+ else if( aPropertyName.equalsAscii("double") ) {
aValue <<= m_d;
}
- else if( 0 == aPropertyName.compareToAscii("bool") ) {
+ else if( aPropertyName.equalsAscii("bool") ) {
aValue <<= m_b;
}
- else if( 0 == aPropertyName.compareToAscii("byte") ) {
+ else if( aPropertyName.equalsAscii("byte") ) {
aValue <<= m_byte;
}
- else if( 0 == aPropertyName.compareToAscii("char" ) ) {
+ else if( aPropertyName.equalsAscii("char" ) ) {
aValue <<= m_c;
}
- else if( 0 == aPropertyName.compareToAscii("string") ) {
+ else if( aPropertyName.equalsAscii("string") ) {
aValue <<= m_s;
}
- else if( 0 == aPropertyName.compareToAscii("object" ) )
+ else if( aPropertyName.equalsAscii("object" ) )
{
aValue <<= m_ref;
}
@@ -699,8 +699,8 @@ sal_Int32 OObjectStreamTest::test( const OUString& TestName,
throw ( IllegalArgumentException,
RuntimeException)
{
- if( 0 == TestName.compareToAscii("com.sun.star.io.ObjectInputStream") ||
- 0 == TestName.compareToAscii("com.sun.star.io.ObjectOutputStream" ) ) {
+ if( TestName.equalsAscii("com.sun.star.io.ObjectInputStream") ||
+ TestName.equalsAscii("com.sun.star.io.ObjectOutputStream") ) {
try
{