From 67d01fb5d4010a2486e47cdd9f55f38a2da162f2 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 26 Feb 2012 14:58:33 +0100 Subject: Avoid temporary rtl::OUString --- sal/test/unloading/unloadTest.cxx | 2 +- sax/source/expatwrap/sax_expat.cxx | 3 +-- .../accessibility/AccessibleDocumentViewBase.cxx | 3 +-- sdext/source/presenter/PresenterClock.cxx | 6 +++--- starmath/source/smdetect.cxx | 22 +++++++++++----------- stoc/source/inspect/introspection.cxx | 10 +++++----- sw/source/ui/uno/swdetect.cxx | 22 +++++++++++----------- 7 files changed, 33 insertions(+), 35 deletions(-) diff --git a/sal/test/unloading/unloadTest.cxx b/sal/test/unloading/unloadTest.cxx index 866a649ec588..355fa47079e0 100644 --- a/sal/test/unloading/unloadTest.cxx +++ b/sal/test/unloading/unloadTest.cxx @@ -560,7 +560,7 @@ sal_Bool test8() for( sal_Int32 i=0; igetSupportedServiceNames()[0]; - if (sFirstService == OUString ( - RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.DrawingDocumentDrawView"))) + if (sFirstService.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.drawing.DrawingDocumentDrawView"))) { sDescription = OUString (RTL_CONSTASCII_USTRINGPARAM("Draw Document")); } diff --git a/sdext/source/presenter/PresenterClock.cxx b/sdext/source/presenter/PresenterClock.cxx index f176b8bc3085..e52f2e0cd86f 100644 --- a/sdext/source/presenter/PresenterClock.cxx +++ b/sdext/source/presenter/PresenterClock.cxx @@ -1038,11 +1038,11 @@ void AnalogBitmapPainter::LoadBitmap ( if (rValues.size() == 3) { BitmapDescriptor* pDescriptor = NULL; - if (rsKey == OUString(RTL_CONSTASCII_USTRINGPARAM("Face"))) + if (rsKey.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Face"))) pDescriptor = &maFace; - else if (rsKey == OUString(RTL_CONSTASCII_USTRINGPARAM("HourHand"))) + else if (rsKey.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HourHand"))) pDescriptor = &maHourHand; - else if (rsKey == OUString(RTL_CONSTASCII_USTRINGPARAM("MinuteHand"))) + else if (rsKey.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MinuteHand"))) pDescriptor = &maMinuteHand; if (pDescriptor == NULL) diff --git a/starmath/source/smdetect.cxx b/starmath/source/smdetect.cxx index 63b0314309cd..617d8a0784e7 100644 --- a/starmath/source/smdetect.cxx +++ b/starmath/source/smdetect.cxx @@ -119,42 +119,42 @@ SmFilterDetect::~SmFilterDetect() for( sal_Int32 nProperty=0; nProperty>= sTemp; aURL = sTemp; } - else if( !aURL.Len() && lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("FileName")) ) + else if( !aURL.Len() && lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("FileName")) ) { lDescriptor[nProperty].Value >>= sTemp; aURL = sTemp; } - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("TypeName")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("TypeName")) ) { lDescriptor[nProperty].Value >>= sTemp; aTypeName = sTemp; } - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("FilterName")) ) { lDescriptor[nProperty].Value >>= sTemp; aPreselectedFilterName = sTemp; } - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("InputStream")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("InputStream")) ) nIndexOfInputStream = nProperty; - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ReadOnly")) ) nIndexOfReadOnlyFlag = nProperty; - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("UCBContent")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("UCBContent")) ) nIndexOfContent = nProperty; - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("AsTemplate")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("AsTemplate")) ) { lDescriptor[nProperty].Value >>= bOpenAsTemplate; nIndexOfTemplateFlag = nProperty; } - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("InteractionHandler")) ) lDescriptor[nProperty].Value >>= xInteraction; - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("RepairPackage")) ) lDescriptor[nProperty].Value >>= bRepairPackage; - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("DocumentTitle")) ) nIndexOfDocumentTitle = nProperty; } diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index aad88991bfaf..2d4d13bbdf31 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -2355,7 +2355,7 @@ rtl::Reference< IntrospectionAccessStatic_Impl > ImplIntrospection::implInspect( } else if( rxMethod_i->getDeclaringClass()->equals( mxAggregationClass ) ) { - if( aMethName == OUString( RTL_CONSTASCII_USTRINGPARAM("setDelegator")) ) + if( aMethName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("setDelegator")) ) { rMethodConcept_i |= MethodConcept::DANGEROUS; continue; @@ -2388,7 +2388,7 @@ rtl::Reference< IntrospectionAccessStatic_Impl > ImplIntrospection::implInspect( // Ist es eine get-Methode? aStartStr = aMethName.copy( 0, 3 ); - if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("get")) ) + if( aStartStr.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("get")) ) { // Namen der potentiellen Property aPropName = aMethName.copy( 3 ); @@ -2461,7 +2461,7 @@ rtl::Reference< IntrospectionAccessStatic_Impl > ImplIntrospection::implInspect( OUString aMethName2 = rxMethod_k->getName(); OUString aStartStr2 = aMethName2.copy( 0, 3 ); // ACHTUNG: Wegen SDL-Bug NICHT != bei OUString verwenden !!! - if( !( aStartStr2 == OUString( RTL_CONSTASCII_USTRINGPARAM("set")) ) ) + if( !( aStartStr2.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("set")) ) ) continue; // Ist es denn der gleiche Name? @@ -2509,7 +2509,7 @@ rtl::Reference< IntrospectionAccessStatic_Impl > ImplIntrospection::implInspect( } // Ist es eine addListener-Methode? - else if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("add")) ) + else if( aStartStr.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("add")) ) { OUString aListenerStr( RTL_CONSTASCII_USTRINGPARAM("Listener" ) ); @@ -2598,7 +2598,7 @@ rtl::Reference< IntrospectionAccessStatic_Impl > ImplIntrospection::implInspect( // Ist es eine set-Methode ohne zugehoerige get-Methode? aStartStr = aMethName.copy( 0, 3 ); - if( aStartStr == OUString( RTL_CONSTASCII_USTRINGPARAM("set")) ) + if( aStartStr.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("set")) ) { // Namen der potentiellen Property aPropName = aMethName.copy( 3 ); diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx index bcba59fe8340..0dda7601a289 100644 --- a/sw/source/ui/uno/swdetect.cxx +++ b/sw/source/ui/uno/swdetect.cxx @@ -121,45 +121,45 @@ SwFilterDetect::~SwFilterDetect() for( sal_Int32 nProperty=0; nProperty>= sTemp; aURL = sTemp; } - else if( !aURL.Len() && lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("FileName")) ) + else if( !aURL.Len() && lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("FileName")) ) { lDescriptor[nProperty].Value >>= sTemp; aURL = sTemp; } - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("TypeName")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("TypeName")) ) { lDescriptor[nProperty].Value >>= sTemp; aTypeName = sTemp; } - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("FilterName")) ) { lDescriptor[nProperty].Value >>= sTemp; aPreselectedFilterName = sTemp; } - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("InputStream")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("InputStream")) ) nIndexOfInputStream = nProperty; - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("ReadOnly")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("ReadOnly")) ) nIndexOfReadOnlyFlag = nProperty; - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("UCBContent")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("UCBContent")) ) nIndexOfContent = nProperty; - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("AsTemplate")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("AsTemplate")) ) { lDescriptor[nProperty].Value >>= bOpenAsTemplate; nIndexOfTemplateFlag = nProperty; } - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("InteractionHandler")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("InteractionHandler")) ) { lDescriptor[nProperty].Value >>= xInteraction; nIndexOfInteractionHandler = nProperty; } - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("RepairPackage")) ) lDescriptor[nProperty].Value >>= bRepairPackage; - else if( lDescriptor[nProperty].Name == OUString(RTL_CONSTASCII_USTRINGPARAM("DocumentTitle")) ) + else if( lDescriptor[nProperty].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("DocumentTitle")) ) nIndexOfDocumentTitle = nProperty; } -- cgit