summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-11-05 14:39:55 +0200
committerNoel Grandin <noel@peralex.com>2013-11-11 12:58:13 +0200
commitfcd1637d5101b9142e6808edfb77b01122857901 (patch)
tree5fd09f97de80cf2a9481bd55a798015db35f1d0c /sdext
parentef90021abe3735fba57145598fd7c3d359d2718e (diff)
convert OUString compareToAscii == 0 to equalsAscii
Convert code like aStr.compareToAscii("XXX") == 0 to aStr.equalsAscii("XXX") which is both easier to read and faster. Change-Id: I448abf58f2fa0e7715dba53f8e8825ca0587c83f
Diffstat (limited to 'sdext')
-rw-r--r--sdext/source/minimizer/pppoptimizer.cxx8
-rw-r--r--sdext/source/minimizer/pppoptimizerdialog.cxx8
-rw-r--r--sdext/source/pdfimport/filterdet.cxx3
-rw-r--r--sdext/source/pdfimport/test/tests.cxx34
-rw-r--r--sdext/source/presenter/PresenterPaneFactory.cxx2
5 files changed, 27 insertions, 28 deletions
diff --git a/sdext/source/minimizer/pppoptimizer.cxx b/sdext/source/minimizer/pppoptimizer.cxx
index 3329e4854e09..b6679e82ad46 100644
--- a/sdext/source/minimizer/pppoptimizer.cxx
+++ b/sdext/source/minimizer/pppoptimizer.cxx
@@ -55,9 +55,9 @@ Reference< com::sun::star::frame::XDispatch > SAL_CALL PPPOptimizer::queryDispat
const URL& aURL, const OUString& /* aTargetFrameName */, sal_Int32 /* nSearchFlags */ ) throw( RuntimeException )
{
Reference < XDispatch > xRet;
- if ( aURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) == 0 )
+ if ( aURL.Protocol.equalsAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) )
{
-// if ( aURL.Path.compareToAscii( "Function1" ) == 0 )
+// if ( aURL.Path.equalsAscii( "Function1" ) )
xRet = this;
}
return xRet;
@@ -85,9 +85,9 @@ Sequence< Reference< com::sun::star::frame::XDispatch > > SAL_CALL PPPOptimizer:
void SAL_CALL PPPOptimizer::dispatch( const URL& rURL, const Sequence< PropertyValue >& lArguments )
throw( RuntimeException )
{
- if ( mxController.is() && ( rURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) == 0 ) )
+ if ( mxController.is() && rURL.Protocol.equalsAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) )
{
- if ( rURL.Path.compareToAscii( "optimize" ) == 0 )
+ if ( rURL.Path.equalsAscii( "optimize" ) )
{
Reference< XModel > xModel( mxController->getModel() );
if ( xModel.is() )
diff --git a/sdext/source/minimizer/pppoptimizerdialog.cxx b/sdext/source/minimizer/pppoptimizerdialog.cxx
index 0ff0ed30aaa5..1cfc874a88fa 100644
--- a/sdext/source/minimizer/pppoptimizerdialog.cxx
+++ b/sdext/source/minimizer/pppoptimizerdialog.cxx
@@ -92,7 +92,7 @@ Reference< com::sun::star::frame::XDispatch > SAL_CALL PPPOptimizerDialog::query
const URL& aURL, const OUString& /* aTargetFrameName */, sal_Int32 /* nSearchFlags */ ) throw( RuntimeException )
{
Reference < XDispatch > xRet;
- if ( aURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.PresentationMinimizer:" ) == 0 )
+ if ( aURL.Protocol.equalsAscii( "vnd.com.sun.star.comp.PresentationMinimizer:" ) )
xRet = this;
return xRet;
@@ -122,9 +122,9 @@ void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL,
throw( RuntimeException )
{
- if ( mxController.is() && ( rURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.PresentationMinimizer:" ) == 0 ) )
+ if ( mxController.is() && rURL.Protocol.equalsAscii( "vnd.com.sun.star.comp.PresentationMinimizer:" ) )
{
- if ( rURL.Path.compareToAscii( "execute" ) == 0 )
+ if ( rURL.Path.equalsAscii( "execute" ) )
{
try
{
@@ -157,7 +157,7 @@ void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL,
}
}
- else if ( rURL.Path.compareToAscii( "statusupdate" ) == 0 )
+ else if ( rURL.Path.equalsAscii( "statusupdate" ) )
{
if ( mpOptimizerDialog )
mpOptimizerDialog->UpdateStatus( rArguments );
diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx
index d11d8f43adc6..7665be4d1e7d 100644
--- a/sdext/source/pdfimport/filterdet.cxx
+++ b/sdext/source/pdfimport/filterdet.cxx
@@ -158,8 +158,7 @@ namespace {
const OUString& MethodName ) throw (lang::WrappedTargetException, uno::RuntimeException)
{
(void)MethodName;
- OSL_ENSURE( MethodName.compareToAscii("SelectionChanged") == 0,
- "Invalid event name" );
+ OSL_ENSURE( MethodName.equalsAscii("SelectionChanged"), "Invalid event name" );
selectionChanged(getSelectedItem());
return sal_True;
}
diff --git a/sdext/source/pdfimport/test/tests.cxx b/sdext/source/pdfimport/test/tests.cxx
index 4dc70a015489..a1cb3176507e 100644
--- a/sdext/source/pdfimport/test/tests.cxx
+++ b/sdext/source/pdfimport/test/tests.cxx
@@ -236,7 +236,7 @@ namespace
const char* sExportString = "m53570 7650-35430 24100";
CPPUNIT_ASSERT_MESSAGE( "Stroke is m535.7 518.5-354.3-241",
- basegfx::tools::exportToSvgD( aPath, true, true, false ).compareToAscii(sExportString) == 0 );
+ basegfx::tools::exportToSvgD( aPath, true, true, false ).equalsAscii(sExportString) );
m_bGreenStrokeSeen = true;
}
@@ -259,7 +259,7 @@ namespace
const char* sExportString = "m49890 5670.00000000001-35430 24090";
CPPUNIT_ASSERT_MESSAGE( "Stroke is m49890 5670.00000000001-35430 24090",
- basegfx::tools::exportToSvgD( aPath, true, true, false ).compareToAscii(sExportString) == 0 );
+ basegfx::tools::exportToSvgD( aPath, true, true, false ).equalsAscii(sExportString) );
m_bDashedLineSeen = true;
}
@@ -317,7 +317,7 @@ namespace
const char* sExportString = "m12050 49610c-4310 0-7800-3490-7800-7800 0-4300 "
"3490-7790 7800-7790 4300 0 7790 3490 7790 7790 0 4310-3490 7800-7790 7800z";
CPPUNIT_ASSERT_MESSAGE( "Stroke is a 4-bezier circle",
- basegfx::tools::exportToSvgD( aPath, true, true, false ).compareToAscii(sExportString) == 0 );
+ basegfx::tools::exportToSvgD( aPath, true, true, false ).equalsAscii(sExportString) );
m_bRedCircleSeen = true;
}
@@ -362,9 +362,9 @@ namespace
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMask received two properties",
xBitmap.getLength(), (sal_Int32) 3 );
CPPUNIT_ASSERT_MESSAGE( "drawMask got URL param",
- xBitmap[0].Name.compareToAscii( "URL" ) == 0 );
+ xBitmap[0].Name.equalsAscii( "URL" ) );
CPPUNIT_ASSERT_MESSAGE( "drawMask got InputStream param",
- xBitmap[1].Name.compareToAscii( "InputStream" ) == 0 );
+ xBitmap[1].Name.equalsAscii( "InputStream" ) );
}
virtual void drawImage(const uno::Sequence<beans::PropertyValue>& xBitmap )
@@ -372,9 +372,9 @@ namespace
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawImage received two properties",
xBitmap.getLength(), (sal_Int32) 3 );
CPPUNIT_ASSERT_MESSAGE( "drawImage got URL param",
- xBitmap[0].Name.compareToAscii( "URL" ) == 0 );
+ xBitmap[0].Name.equalsAscii( "URL" ) );
CPPUNIT_ASSERT_MESSAGE( "drawImage got InputStream param",
- xBitmap[1].Name.compareToAscii( "InputStream" ) == 0 );
+ xBitmap[1].Name.equalsAscii( "InputStream" ) );
m_bImageSeen = true;
}
@@ -384,9 +384,9 @@ namespace
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawColorMaskedImage received two properties",
xBitmap.getLength(), (sal_Int32) 3 );
CPPUNIT_ASSERT_MESSAGE( "drawColorMaskedImage got URL param",
- xBitmap[0].Name.compareToAscii( "URL" ) == 0 );
+ xBitmap[0].Name.equalsAscii( "URL" ) );
CPPUNIT_ASSERT_MESSAGE( "drawColorMaskedImage got InputStream param",
- xBitmap[1].Name.compareToAscii( "InputStream" ) == 0 );
+ xBitmap[1].Name.equalsAscii( "InputStream" ) );
}
virtual void drawMaskedImage(const uno::Sequence<beans::PropertyValue>& xBitmap,
@@ -396,16 +396,16 @@ namespace
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMaskedImage received two properties #1",
xBitmap.getLength(), (sal_Int32) 3 );
CPPUNIT_ASSERT_MESSAGE( "drawMaskedImage got URL param #1",
- xBitmap[0].Name.compareToAscii( "URL" ) == 0 );
+ xBitmap[0].Name.equalsAscii( "URL" ) );
CPPUNIT_ASSERT_MESSAGE( "drawMaskedImage got InputStream param #1",
- xBitmap[1].Name.compareToAscii( "InputStream" ) == 0 );
+ xBitmap[1].Name.equalsAscii( "InputStream" ) );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawMaskedImage received two properties #2",
xMask.getLength(), (sal_Int32) 3 );
CPPUNIT_ASSERT_MESSAGE( "drawMaskedImage got URL param #2",
- xMask[0].Name.compareToAscii( "URL" ) == 0 );
+ xMask[0].Name.equalsAscii( "URL" ) );
CPPUNIT_ASSERT_MESSAGE( "drawMaskedImage got InputStream param #2",
- xMask[1].Name.compareToAscii( "InputStream" ) == 0 );
+ xMask[1].Name.equalsAscii( "InputStream" ) );
}
virtual void drawAlphaMaskedImage(const uno::Sequence<beans::PropertyValue>& xBitmap,
@@ -414,16 +414,16 @@ namespace
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawAlphaMaskedImage received two properties #1",
xBitmap.getLength(), (sal_Int32) 3 );
CPPUNIT_ASSERT_MESSAGE( "drawAlphaMaskedImage got URL param #1",
- xBitmap[0].Name.compareToAscii( "URL" ) == 0 );
+ xBitmap[0].Name.equalsAscii( "URL" ) );
CPPUNIT_ASSERT_MESSAGE( "drawAlphaMaskedImage got InputStream param #1",
- xBitmap[1].Name.compareToAscii( "InputStream" ) == 0 );
+ xBitmap[1].Name.equalsAscii( "InputStream" ) );
CPPUNIT_ASSERT_EQUAL_MESSAGE( "drawAlphaMaskedImage received two properties #2",
xMask.getLength(), (sal_Int32) 3 );
CPPUNIT_ASSERT_MESSAGE( "drawAlphaMaskedImage got URL param #2",
- xMask[0].Name.compareToAscii( "URL" ) == 0 );
+ xMask[0].Name.equalsAscii( "URL" ) );
CPPUNIT_ASSERT_MESSAGE( "drawAlphaMaskedImage got InputStream param #2",
- xMask[1].Name.compareToAscii( "InputStream" ) == 0 );
+ xMask[1].Name.equalsAscii( "InputStream" ) );
}
virtual void setTextRenderMode( sal_Int32 )
diff --git a/sdext/source/presenter/PresenterPaneFactory.cxx b/sdext/source/presenter/PresenterPaneFactory.cxx
index 958bc363e1ab..99615eb55d4c 100644
--- a/sdext/source/presenter/PresenterPaneFactory.cxx
+++ b/sdext/source/presenter/PresenterPaneFactory.cxx
@@ -243,7 +243,7 @@ Reference<XResource> PresenterPaneFactory::CreatePane (
rxPaneId,
rsTitle,
xParentPane,
- rxPaneId->getFullResourceURL().Arguments.compareToAscii("Sprite=1") == 0);
+ rxPaneId->getFullResourceURL().Arguments.equalsAscii("Sprite=1") );
}
catch (Exception&)
{