summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-01-16 14:12:57 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-01-16 14:12:57 +0000
commitee34a7e85cfd4fcc407c938db4e584762e0c6a3f (patch)
treeeb22268c1810503f64d1d52db18746da2fcb6f55 /sfx2
parentb8dc42c46239452cd199c697e50c283a77e21f0f (diff)
equalsAsciiL faster than equalsAscii & comparetoAscii(const sal_Char*)
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/sfxhelp.cxx34
-rw-r--r--sfx2/source/bastyp/fltfnc.cxx24
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx38
-rw-r--r--sfx2/source/notify/eventsupplier.cxx50
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx8
5 files changed, 77 insertions, 77 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 781413ec39..23f2ac49da 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -518,7 +518,7 @@ String SfxHelp::GetHelpModuleName_Impl()
xCont->getByName( aModuleIdentifier ) >>= lProps;
for ( sal_Int32 i = 0; i < lProps.getLength(); ++i )
{
- if ( lProps[i].Name.equalsAscii("ooSetupFactoryShortName") )
+ if ( lProps[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ooSetupFactoryShortName")) )
{
lProps[i].Value >>= aFactoryShortName;
break;
@@ -535,26 +535,26 @@ String SfxHelp::GetHelpModuleName_Impl()
if ( aFactoryShortName.getLength() > 0 )
{
// Map some module identifiers to their "real" help module string.
- if ( aFactoryShortName.equalsAscii( "chart2" ) )
+ if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("chart2")) )
aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "schart" ) );
- else if ( aFactoryShortName.equalsAscii( "BasicIDE" ) )
+ else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("BasicIDE")) )
aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "sbasic" ) );
- else if ( aFactoryShortName.equalsAscii( "sweb" )
- || aFactoryShortName.equalsAscii( "sglobal" )
- || aFactoryShortName.equalsAscii( "swxform" ) )
+ else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sweb"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sglobal"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("swxform")) )
aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "swriter" ) );
- else if ( aFactoryShortName.equalsAscii( "dbquery" )
- || aFactoryShortName.equalsAscii( "dbbrowser" )
- || aFactoryShortName.equalsAscii( "dbrelation" )
- || aFactoryShortName.equalsAscii( "dbtable" )
- || aFactoryShortName.equalsAscii( "dbapp" )
- || aFactoryShortName.equalsAscii( "dbreport" )
- || aFactoryShortName.equalsAscii( "swreport" )
- || aFactoryShortName.equalsAscii( "dbbrowser" )
- || aFactoryShortName.equalsAscii( "swform" ) )
+ else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbquery"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbbrowser"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbrelation"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbtable"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbapp"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbreport"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("swreport"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dbbrowser"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("swform")) )
aFactoryShortName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "sdatabase" ) );
- else if ( aFactoryShortName.equalsAscii( "sbibliography" )
- || aFactoryShortName.equalsAscii( "StartModule" ) )
+ else if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("sbibliography"))
+ || aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("StartModule")) )
aFactoryShortName = sDefaultModule;
}
else
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index b083ef6072..ba03a4798c 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -940,33 +940,33 @@ void SfxFilterContainer::ReadSingleFilter_Impl(
sal_Int32 nFilterProperty = 0 ;
for( nFilterProperty=0; nFilterProperty<nFilterPropertyCount; ++nFilterProperty )
{
- if( lFilterProperties[nFilterProperty].Name.compareToAscii( "FileFormatVersion" ) == 0 )
+ if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("FileFormatVersion")) )
{
lFilterProperties[nFilterProperty].Value >>= nFormatVersion;
}
- else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "TemplateName" ) == 0 )
+ else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("TemplateName")) )
{
lFilterProperties[nFilterProperty].Value >>= sDefaultTemplate;
}
- else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "Flags" ) == 0 )
+ else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Flags")) )
{
lFilterProperties[nFilterProperty].Value >>= nFlags;
}
- else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "UIName" ) == 0 )
+ else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UIName")) )
{
lFilterProperties[nFilterProperty].Value >>= sUIName;
}
- else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "UserData" ) == 0 )
+ else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("UserData")) )
{
::com::sun::star::uno::Sequence< ::rtl::OUString > lUserData;
lFilterProperties[nFilterProperty].Value >>= lUserData;
sUserData = implc_convertStringlistToString( lUserData, ',', ::rtl::OUString() );
}
- else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "DocumentService" ) == 0 )
+ else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DocumentService")) )
{
lFilterProperties[nFilterProperty].Value >>= sServiceName;
}
- else if( lFilterProperties[nFilterProperty].Name.compareToAscii( "Type" ) == 0 )
+ else if( lFilterProperties[nFilterProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Type")) )
{
lFilterProperties[nFilterProperty].Value >>= sType;
// Try to get filter .. but look for any exceptions!
@@ -988,25 +988,25 @@ void SfxFilterContainer::ReadSingleFilter_Impl(
sal_Int32 nTypeProperty = 0 ;
for( nTypeProperty=0; nTypeProperty<nTypePropertyCount; ++nTypeProperty )
{
- if( lTypeProperties[nTypeProperty].Name.compareToAscii( "ClipboardFormat" ) == 0 )
+ if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("ClipboardFormat")) )
{
lTypeProperties[nTypeProperty].Value >>= sHumanName;
}
- else if( lTypeProperties[nTypeProperty].Name.compareToAscii( "DocumentIconID" ) == 0 )
+ else if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("DocumentIconID")) )
{
lTypeProperties[nTypeProperty].Value >>= nDocumentIconId;
}
- else if( lTypeProperties[nTypeProperty].Name.compareToAscii( "MediaType" ) == 0 )
+ else if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaType")) )
{
lTypeProperties[nTypeProperty].Value >>= sMimeType;
}
- else if( lTypeProperties[nTypeProperty].Name.compareToAscii( "Extensions" ) == 0 )
+ else if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Extensions")) )
{
::com::sun::star::uno::Sequence< ::rtl::OUString > lExtensions;
lTypeProperties[nTypeProperty].Value >>= lExtensions;
sExtension = implc_convertStringlistToString( lExtensions, ';', DEFINE_CONST_UNICODE("*.") );
}
- else if( lTypeProperties[nTypeProperty].Name.compareToAscii( "URLPattern" ) == 0 )
+ else if( lTypeProperties[nTypeProperty].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("URLPattern")) )
{
::com::sun::star::uno::Sequence< ::rtl::OUString > lPattern;
lTypeProperties[nTypeProperty].Value >>= lPattern;
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 7410226a92..68f3f61553 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -943,7 +943,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString&
throw(::com::sun::star::uno::RuntimeException)
{
SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
- if ( rURL.getLength() == 0 && rArgs.getLength() == 1 && rArgs[0].Name.equalsAscii( "SetEmbedded" ) )
+ if ( rURL.getLength() == 0 && rArgs.getLength() == 1 && rArgs[0].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SetEmbedded")) )
{
// allows to set a windowless document to EMBEDDED state
// but _only_ before load() or initNew() methods
@@ -1916,7 +1916,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor )
if ( m_pData->m_pObjectShell.Is() )
{
- if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" ) )
+ if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
{
@@ -1945,7 +1945,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor )
else
throw datatransfer::UnsupportedFlavorException();
}
- else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-embed-source;windows_formatname=\"Star EMBS\"" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-embed-source;windows_formatname=\"Star EMBS\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
{
@@ -1970,7 +1970,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor )
else
throw datatransfer::UnsupportedFlavorException();
}
- else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
{
@@ -1991,7 +1991,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor )
else
throw datatransfer::UnsupportedFlavorException();
}
- else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
{
@@ -2011,7 +2011,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor )
else
throw datatransfer::UnsupportedFlavorException();
}
- else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-emf;windows_formatname=\"Image EMF\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
{
@@ -2046,7 +2046,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor )
else
throw datatransfer::UnsupportedFlavorException();
}
- else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-wmf;windows_formatname=\"Image WMF\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
{
@@ -2086,7 +2086,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor )
else
throw datatransfer::UnsupportedFlavorException();
}
- else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
{
@@ -2110,7 +2110,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor )
else
throw datatransfer::UnsupportedFlavorException();
}
- else if ( aFlavor.MimeType.equalsAscii( "image/png" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("image/png")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
{
@@ -2220,17 +2220,17 @@ sal_Bool SAL_CALL SfxBaseModel::isDataFlavorSupported( const DATAFLAVOR& aFlavor
{
SfxModelGuard aGuard( *this );
- if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) )
+ if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
return sal_True;
}
- else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
return sal_True;
}
- else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-emf;windows_formatname=\"Image EMF\"" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-emf;windows_formatname=\"Image EMF\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
return sal_True;
@@ -2238,7 +2238,7 @@ sal_Bool SAL_CALL SfxBaseModel::isDataFlavorSupported( const DATAFLAVOR& aFlavor
&& aFlavor.DataType == getCppuType( (const sal_uInt64*) 0 ) )
return sal_True;
}
- else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-wmf;windows_formatname=\"Image WMF\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
return sal_True;
@@ -2246,22 +2246,22 @@ sal_Bool SAL_CALL SfxBaseModel::isDataFlavorSupported( const DATAFLAVOR& aFlavor
&& aFlavor.DataType == getCppuType( (const sal_uInt64*) 0 ) )
return sal_True;
}
- else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
return sal_True;
}
- else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-embed-source;windows_formatname=\"Star EMBS\"" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-embed-source;windows_formatname=\"Star EMBS\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
return sal_True;
}
- else if ( aFlavor.MimeType.equalsAscii( "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
return sal_True;
}
- else if ( aFlavor.MimeType.equalsAscii( "image/png" ) )
+ else if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("image/png")) )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
return sal_True;
@@ -2390,7 +2390,7 @@ void addTitle_Impl( Sequence < ::com::sun::star::beans::PropertyValue >& rSeq, c
for ( nArg = 0; nArg < nCount; nArg++ )
{
::com::sun::star::beans::PropertyValue& rProp = rSeq[nArg];
- if ( rProp.Name.equalsAscii("Title") )
+ if ( rProp.Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Title")) )
{
rProp.Value <<= rTitle;
break;
@@ -3183,7 +3183,7 @@ static void GetCommandFromSequence( rtl::OUString& rCommand, sal_Int32& nIndex,
for ( sal_Int32 i = 0; i < rSeqPropValue.getLength(); i++ )
{
- if ( rSeqPropValue[i].Name.equalsAsciiL( "Command", 7 ))
+ if ( rSeqPropValue[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Command")) )
{
rSeqPropValue[i].Value >>= rCommand;
nIndex = i;
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index 07bfbfb851..174ec094f5 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -104,7 +104,7 @@ void SAL_CALL SfxEvents_Impl::replaceByName( const OUSTRING & aName, const ANY &
::rtl::OUString sType;
if ( ( aProperties.getLength() == 1 )
- && ( aProperties[0].Name.compareToAscii( PROP_EVENT_TYPE ) == 0 )
+ && ( aProperties[0].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_EVENT_TYPE)) )
&& ( aProperties[0].Value >>= sType )
&& ( sType.getLength() == 0 )
)
@@ -217,13 +217,13 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg
sal_Int32 nIndex = 0;
while ( nIndex < nCount )
{
- if ( aProperties[ nIndex ].Name.compareToAscii( PROP_EVENT_TYPE ) == 0 )
+ if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_EVENT_TYPE)))
aProperties[ nIndex ].Value >>= aType;
- else if ( aProperties[ nIndex ].Name.compareToAscii( PROP_SCRIPT ) == 0 )
+ else if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_SCRIPT)))
aProperties[ nIndex ].Value >>= aScript;
- else if ( aProperties[ nIndex ].Name.compareToAscii( PROP_LIBRARY ) == 0 )
+ else if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_LIBRARY)))
aProperties[ nIndex ].Value >>= aLibrary;
- else if ( aProperties[ nIndex ].Name.compareToAscii( PROP_MACRO_NAME ) == 0 )
+ else if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_MACRO_NAME)))
aProperties[ nIndex ].Value >>= aMacroName;
else {
DBG_ERROR("Unknown property value!");
@@ -231,13 +231,13 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg
nIndex += 1;
}
- if ( aType.compareToAscii( STAR_BASIC ) == 0 && aScript.getLength() )
+ if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STAR_BASIC)) && aScript.getLength())
{
com::sun::star::uno::Any aAny;
SfxMacroLoader::loadMacro( aScript, aAny, pDoc );
}
- else if ( aType.compareToAscii( "Service" ) == 0 ||
- aType.compareToAscii( "Script" ) == 0 )
+ else if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Service")) ||
+ aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Script")))
{
if ( aScript.getLength() )
{
@@ -400,13 +400,13 @@ SvxMacro* SfxEvents_Impl::ConvertToMacro( const ANY& rElement, SfxObjectShell* p
while ( nIndex < nCount )
{
- if ( aProperties[ nIndex ].Name.compareToAscii( PROP_EVENT_TYPE ) == 0 )
+ if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_EVENT_TYPE)))
aProperties[ nIndex ].Value >>= aType;
- else if ( aProperties[ nIndex ].Name.compareToAscii( PROP_SCRIPT ) == 0 )
+ else if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_SCRIPT)))
aProperties[ nIndex ].Value >>= aScriptURL;
- else if ( aProperties[ nIndex ].Name.compareToAscii( PROP_LIBRARY ) == 0 )
+ else if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_LIBRARY)))
aProperties[ nIndex ].Value >>= aLibrary;
- else if ( aProperties[ nIndex ].Name.compareToAscii( PROP_MACRO_NAME ) == 0 )
+ else if (aProperties[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_MACRO_NAME)))
aProperties[ nIndex ].Value >>= aMacroName;
else {
DBG_ERROR("Unknown propery value!");
@@ -416,11 +416,11 @@ SvxMacro* SfxEvents_Impl::ConvertToMacro( const ANY& rElement, SfxObjectShell* p
// Get the type
ScriptType eType( STARBASIC );
- if ( aType.compareToAscii( STAR_BASIC ) == COMPARE_EQUAL )
+ if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STAR_BASIC)))
eType = STARBASIC;
- else if ( aType.compareToAscii( "Script" ) == COMPARE_EQUAL && aScriptURL.getLength() )
+ else if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Script")) && aScriptURL.getLength())
eType = EXTENDED_STYPE;
- else if ( aType.compareToAscii( SVX_MACRO_LANGUAGE_JAVASCRIPT ) == COMPARE_EQUAL )
+ else if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SVX_MACRO_LANGUAGE_JAVASCRIPT)))
eType = JAVASCRIPT;
else {
DBG_ERRORFILE( "ConvertToMacro: Unknown macro type" );
@@ -428,7 +428,7 @@ SvxMacro* SfxEvents_Impl::ConvertToMacro( const ANY& rElement, SfxObjectShell* p
if ( aMacroName.getLength() )
{
- if ( aLibrary.compareToAscii("application") == 0 )
+ if (aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application")))
aLibrary = SFX_APP()->GetName();
else
aLibrary = ::rtl::OUString();
@@ -466,28 +466,28 @@ void SfxEvents_Impl::BlowUpMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell*
while ( nIndex < nCount )
{
- if ( aInProps[ nIndex ].Name.compareToAscii( PROP_EVENT_TYPE ) == 0 )
+ if (aInProps[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_EVENT_TYPE)))
{
aInProps[nIndex].Value >>= aType;
aOutProps[0] = aInProps[nIndex];
}
- else if ( aInProps[ nIndex ].Name.compareToAscii( PROP_SCRIPT ) == 0 )
+ else if (aInProps[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_SCRIPT)))
{
aInProps[nIndex].Value >>= aScript;
aOutProps[1] = aInProps[nIndex];
}
- else if ( aInProps[ nIndex ].Name.compareToAscii( PROP_LIBRARY ) == 0 )
+ else if (aInProps[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_LIBRARY)))
{
aInProps[ nIndex ].Value >>= aLibrary;
}
- else if ( aInProps[ nIndex ].Name.compareToAscii( PROP_MACRO_NAME ) == 0 )
+ else if (aInProps[ nIndex ].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(PROP_MACRO_NAME)))
{
aInProps[ nIndex ].Value >>= aMacroName;
}
nIndex += 1;
}
- if ( aType.compareToAscii( STAR_BASIC ) == 0 )
+ if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STAR_BASIC)))
{
aOutProps.realloc(4);
if ( aScript.getLength() )
@@ -499,7 +499,7 @@ void SfxEvents_Impl::BlowUpMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell*
if ( ( nHashPos != STRING_NOTFOUND ) && ( nHashPos < nArgsPos ) )
{
OUSTRING aBasMgrName( INetURLObject::decode( aScript.copy( 8, nHashPos-8 ), INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET ) );
- if ( aBasMgrName.compareToAscii(".") == 0 )
+ if (aBasMgrName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".")))
aLibrary = pDoc->GetTitle();
/*
else if ( aBasMgrName.getLength() )
@@ -520,7 +520,7 @@ void SfxEvents_Impl::BlowUpMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell*
else if ( aMacroName.getLength() )
{
aScript = OUSTRING( RTL_CONSTASCII_USTRINGPARAM( MACRO_PRFIX ) );
- if ( aLibrary.compareTo( SFX_APP()->GetName() ) != 0 && aLibrary.compareToAscii("StarDesktop") != 0 && aLibrary.compareToAscii("application") != 0 )
+ if ( aLibrary.compareTo( SFX_APP()->GetName() ) != 0 && !aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("StarDesktop")) && !aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application")) )
aScript += String('.');
aScript += String('/');
@@ -531,7 +531,7 @@ void SfxEvents_Impl::BlowUpMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell*
// wrong properties
return;
- if ( aLibrary.compareToAscii("document") != 0 )
+ if (!aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("document")))
{
if ( !aLibrary.getLength() || (pDoc && ( String(aLibrary) == pDoc->GetTitle( SFX_TITLE_APINAME ) || String(aLibrary) == pDoc->GetTitle() )) )
aLibrary = String::CreateFromAscii("document");
@@ -547,7 +547,7 @@ void SfxEvents_Impl::BlowUpMacro( const ANY& rEvent, ANY& rRet, SfxObjectShell*
aOutProps[3].Value <<= aMacroName;
rRet <<= aOutProps;
}
- else if ( aType.compareToAscii( SVX_MACRO_LANGUAGE_JAVASCRIPT ) == 0 )
+ else if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SVX_MACRO_LANGUAGE_JAVASCRIPT)))
{
aOutProps[1] = aInProps[1];
rRet <<= aOutProps;
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 8f8d6c6c04..f641a4a1b4 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -792,7 +792,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL&
SfxViewFrame* pAct = m_pData->m_pViewShell->GetViewFrame() ;
if ( !m_pData->m_bDisposing )
{
- if ( sTargetFrameName.compareToAscii( "_beamer" ) == COMPARE_EQUAL )
+ if ( sTargetFrameName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("_beamer")) )
{
SfxViewFrame *pFrame = m_pData->m_pViewShell->GetViewFrame();
if ( eSearchFlags & ( ::com::sun::star::frame::FrameSearchFlag::CREATE ))
@@ -809,7 +809,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL&
return xProv->queryDispatch( aURL, sTargetFrameName, ::com::sun::star::frame::FrameSearchFlag::SELF );
}
- if ( aURL.Protocol.compareToAscii( ".uno:" ) == COMPARE_EQUAL )
+ if ( aURL.Protocol.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:")) )
{
rtl::OUString aMasterCommand = SfxOfficeDispatch::GetMasterUnoCommand( aURL );
sal_Bool bMasterCommand( aMasterCommand.getLength() > 0 );
@@ -865,7 +865,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL&
}
}
}
- else if ( aURL.Protocol.compareToAscii( "slot:" ) == COMPARE_EQUAL )
+ else if ( aURL.Protocol.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("slot:")) )
{
USHORT nId = (USHORT) aURL.Path.toInt32();
@@ -917,7 +917,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOURL&
}
}
}
- else if( sTargetFrameName.compareToAscii( "_self" )==COMPARE_EQUAL || sTargetFrameName.getLength()==0 )
+ else if( sTargetFrameName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("_self")) || sTargetFrameName.getLength()==0 )
{
// check for already loaded URL ... but with additional jumpmark!
REFERENCE< XMODEL > xModel = getModel();