summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorSzabolcs Dezsi <dezsiszabi@hotmail.com>2012-04-06 19:49:53 +0200
committerJan Holesovsky <kendy@suse.cz>2012-04-06 20:03:42 +0200
commitd6bc02f8c4cd0f50f0a2631ac7634dab408efc1f (patch)
treeb5a12df1fcae025715633469b75ab4c9b6f6d279 /sfx2
parent0e1c0587617e0a6e4295a13599e97cdf6d1d2ea9 (diff)
Replaced equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(...)) with == operator
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/inc/sfx2/XmlIdRegistry.hxx4
-rw-r--r--sfx2/source/control/unoctitm.cxx5
-rw-r--r--sfx2/source/doc/DocumentMetadataAccess.cxx13
-rw-r--r--sfx2/source/doc/Metadatable.cxx4
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx16
-rw-r--r--sfx2/source/doc/doctemplates.cxx8
-rw-r--r--sfx2/source/doc/objstor.cxx11
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx4
-rw-r--r--sfx2/source/doc/sfxmodelfactory.cxx4
-rw-r--r--sfx2/source/view/ipclient.cxx2
-rw-r--r--sfx2/source/view/viewfrm.cxx2
-rw-r--r--sfx2/source/view/viewfrm2.cxx3
12 files changed, 30 insertions, 46 deletions
diff --git a/sfx2/inc/sfx2/XmlIdRegistry.hxx b/sfx2/inc/sfx2/XmlIdRegistry.hxx
index 00c5ae88063a..691bfaa44389 100644
--- a/sfx2/inc/sfx2/XmlIdRegistry.hxx
+++ b/sfx2/inc/sfx2/XmlIdRegistry.hxx
@@ -51,9 +51,7 @@ extern inline bool
isValidXmlId(::rtl::OUString const & i_rStreamName,
::rtl::OUString const & i_rIdref)
{
- return isValidNCName(i_rIdref) &&
- (i_rStreamName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("content.xml")) ||
- i_rStreamName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("styles.xml")));
+ return isValidNCName(i_rIdref) && ( i_rStreamName == "content.xml" || i_rStreamName == "styles.xml" );
}
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index f78dd308ec62..005db6e6b1a4 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -422,8 +422,7 @@ void SfxOfficeDispatch::SetMasterUnoCommand( sal_Bool bSet )
// Determine if URL contains a master/slave command which must be handled a little bit different
sal_Bool SfxOfficeDispatch::IsMasterUnoCommand( const ::com::sun::star::util::URL& aURL )
{
- if ( aURL.Protocol.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( ".uno:" ) ) &&
- ( aURL.Path.indexOf( '.' ) > 0 ))
+ if ( aURL.Protocol == ".uno:" && ( aURL.Path.indexOf( '.' ) > 0 ))
return sal_True;
return sal_False;
@@ -458,7 +457,7 @@ SfxDispatchController_Impl::SfxDispatchController_Impl(
, bVisible( sal_True )
, pUnoName( pSlot->pUnoName )
{
- if ( aDispatchURL.Protocol.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("slot:")) && pUnoName )
+ if ( aDispatchURL.Protocol == "slot:" && pUnoName )
{
rtl::OStringBuffer aTmp(RTL_CONSTASCII_STRINGPARAM(".uno:"));
aTmp.append(pUnoName);
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index c5ff48061fae..d27df1dece1d 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -108,20 +108,17 @@ static const char s_odfmime [] = "application/vnd.oasis.opendocument.";
static bool isContentFile(::rtl::OUString const & i_rPath)
{
- return i_rPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_content));
+ return i_rPath == s_content;
}
static bool isStylesFile (::rtl::OUString const & i_rPath)
{
- return i_rPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_styles));
+ return i_rPath == s_styles;
}
static bool isReservedFile(::rtl::OUString const & i_rPath)
{
- return isContentFile(i_rPath)
- || isStylesFile(i_rPath)
- || i_rPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_meta))
- || i_rPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_settings));
+ return isContentFile(i_rPath) || isStylesFile(i_rPath) || i_rPath == s_meta || i_rPath == s_settings;
}
@@ -244,8 +241,8 @@ static bool isFileNameValid(const ::rtl::OUString & i_rFileName)
const ::rtl::OUString segment(
i_rFileName.getToken(0, static_cast<sal_Unicode> ('/'), idx) );
if (segment.isEmpty() || // no empty segments
- segment.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".")) || // no . segments
- segment.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("..")) || // no .. segments
+ segment == "." || // no . segments
+ segment == ".." || // no .. segments
!::comphelper::OStorageHelper::IsValidZipEntryFileName(
segment, sal_False)) // no invalid characters
return false;
diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx
index f23e7823ff3f..73374214251b 100644
--- a/sfx2/source/doc/Metadatable.cxx
+++ b/sfx2/source/doc/Metadatable.cxx
@@ -126,12 +126,12 @@ static const char s_prefix [] = "id"; // prefix for generated xml:id
static bool isContentFile(::rtl::OUString const & i_rPath)
{
- return i_rPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_content));
+ return i_rPath == s_content;
}
static bool isStylesFile (::rtl::OUString const & i_rPath)
{
- return i_rPath.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(s_styles));
+ return i_rPath == s_styles;
}
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 77caad27b039..2e5ff08e5bea 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -528,10 +528,10 @@ getQualifier(const char* i_name) {
DBG_ASSERT(i_qname, "SfxDocumentMetaData: getNameSpace: argument is null");
const char * ns = "";
::rtl::OUString n = getQualifier(i_qname).first;
- if (n.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("xlink"))) ns = s_nsXLink;
- if (n.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("dc"))) ns = s_nsDC;
- if (n.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("office"))) ns = s_nsODF;
- if (n.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("meta"))) ns = s_nsODFMeta;
+ if ( n == "xlink" ) ns = s_nsXLink;
+ if ( n == "dc" ) ns = s_nsDC;
+ if ( n == "office" ) ns = s_nsODF;
+ if ( n == "meta" ) ns = s_nsODFMeta;
DBG_ASSERT(*ns, "SfxDocumentMetaData: unknown namespace prefix");
return ::rtl::OUString::createFromAscii(ns);
}
@@ -1110,8 +1110,7 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes()
static_cast<const char*>("office:target-frame-name"),
m_DefaultTarget));
// xlink:show: _blank -> new, any other value -> replace
- const sal_Char* show = m_DefaultTarget.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("_blank"))
- ? "new" : "replace";
+ const sal_Char* show = m_DefaultTarget == "_blank" ? "new" : "replace";
attributes.push_back(std::make_pair(
static_cast<const char*>("xlink:show"),
::rtl::OUString::createFromAscii(show)));
@@ -1209,8 +1208,7 @@ void SAL_CALL SfxDocumentMetaData::init(
while (xNode.is()) {
if (css::xml::dom::NodeType_ELEMENT_NODE ==xNode->getNodeType())
{
- if (xNode->getNamespaceURI().equalsAscii(s_nsODF) &&
- xNode->getLocalName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("document-meta")))
+ if ( xNode->getNamespaceURI().equalsAscii(s_nsODF) && xNode->getLocalName() == "document-meta" )
{
xRElem.set(xNode, css::uno::UNO_QUERY_THROW);
break;
@@ -1362,7 +1360,7 @@ void SAL_CALL SfxDocumentMetaData::init(
OUStringToOString(text, RTL_TEXTENCODING_UTF8).getStr());
continue;
}
- } else if (type.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("string")) || true) { // default
+ } else if ( type == "string" || true) { // default
any <<= text;
}
try {
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index ac66b5d96fd8..cdf6397e389d 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1156,10 +1156,7 @@ bool SfxURLRelocator_Impl::propertyCanContainOfficeDir(
// with a predefined semantic). Additional Core properties introduced
// be a client app must be handled by the client app itself, because
// the UCB does not know the semantics of those properties.
- return ( rPropName.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM( TARGET_DIR_URL ) ) ||
- rPropName.equalsAsciiL(
- RTL_CONSTASCII_STRINGPARAM( PROPERTY_DIRLIST ) ) );
+ return ( rPropName == TARGET_DIR_URL || rPropName == PROPERTY_DIRLIST );
}
//-----------------------------------------------------------------------------
@@ -2595,8 +2592,7 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList,
OUString aType;
OUString aHierURL;
- if ( aChildTitle.compareToAscii( "sfx.tlx" ) == 0
- || aChildTitle.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "groupuinames.xml" ) ) )
+ if ( aChildTitle.compareToAscii( "sfx.tlx" ) == 0 || aChildTitle == "groupuinames.xml" )
continue;
// only StarOffice templates are accepted
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 3276a0800430..b258ed83ea99 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2211,7 +2211,7 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert )
pNewValue[i] = pOldValue[i];
if ( pOldValue [i].Name == sInputStream )
bHasInputStream = sal_True;
- else if ( pOldValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "DocumentBaseURL" ) ) )
+ else if ( pOldValue[i].Name == "DocumentBaseURL" )
bHasBaseURL = sal_True;
}
@@ -2308,13 +2308,13 @@ sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
for ( i = 0; i < nEnd; i++ )
{
pNewValue[i] = pOldValue[i];
- if ( pOldValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "FileName" ) ) )
+ if ( pOldValue[i].Name == "FileName" )
pNewValue[i].Value <<= OUString ( rMedium.GetName() );
else if ( pOldValue[i].Name == sOutputStream )
bHasOutputStream = sal_True;
else if ( pOldValue[i].Name == sStream )
bHasStream = sal_True;
- else if ( pOldValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "DocumentBaseURL" ) ) )
+ else if ( pOldValue[i].Name == "DocumentBaseURL" )
bHasBaseURL = sal_True;
}
@@ -3418,9 +3418,8 @@ sal_Bool SfxObjectShell::CopyStoragesOfUnknownMediaType( const uno::Reference< e
default:
{
- OSL_ENSURE(
- aSubElements[nInd].equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Configurations2" ) ) || !xTarget->hasByName( aSubElements[nInd] ),
- "The target storage is an output storage, the element should not exist in the target!\n" );
+ OSL_ENSURE( aSubElements[nInd] == "Configurations2" || !xTarget->hasByName( aSubElements[nInd] ),
+ "The target storage is an output storage, the element should not exist in the target!\n" );
if ( !xTarget->hasByName( aSubElements[nInd] ) )
{
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 1e23fada1260..2a30dad35305 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -988,7 +988,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const ::rtl::OUString&
throw(::com::sun::star::uno::RuntimeException)
{
SfxModelGuard aGuard( *this, SfxModelGuard::E_INITIALIZING );
- if ( rURL.isEmpty() && rArgs.getLength() == 1 && rArgs[0].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SetEmbedded")) )
+ if ( rURL.isEmpty() && rArgs.getLength() == 1 && rArgs[0].Name == "SetEmbedded" )
{
// allows to set a windowless document to EMBEDDED state
// but _only_ before load() or initNew() methods
@@ -2029,7 +2029,7 @@ uno::Any SAL_CALL SfxBaseModel::getTransferData( const DATAFLAVOR& aFlavor )
if ( m_pData->m_pObjectShell.Is() )
{
- if ( aFlavor.MimeType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"")) )
+ if ( aFlavor.MimeType == "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"" )
{
if ( aFlavor.DataType == getCppuType( (const Sequence< sal_Int8 >*) 0 ) )
{
diff --git a/sfx2/source/doc/sfxmodelfactory.cxx b/sfx2/source/doc/sfxmodelfactory.cxx
index 7added399fff..7a2441bfe1e8 100644
--- a/sfx2/source/doc/sfxmodelfactory.cxx
+++ b/sfx2/source/doc/sfxmodelfactory.cxx
@@ -147,9 +147,7 @@ namespace sfx2
{
static bool isSpecialArgumentName( const ::rtl::OUString& _rValueName )
{
- return _rValueName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "EmbeddedObject" ) )
- || _rValueName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "EmbeddedScriptSupport" ) )
- || _rValueName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "DocumentRecoverySupport" ) );
+ return _rValueName == "EmbeddedObject" || _rValueName == "EmbeddedScriptSupport" || _rValueName == "DocumentRecoverySupport";
}
bool operator()( const Any& _rArgument ) const
diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx
index 0c22e263a76c..ec198973c59a 100644
--- a/sfx2/source/view/ipclient.cxx
+++ b/sfx2/source/view/ipclient.cxx
@@ -200,7 +200,7 @@ void SAL_CALL SfxInPlaceClient_Impl::notifyEvent( const document::EventObject& a
{
SolarMutexGuard aGuard;
- if ( m_pClient && aEvent.EventName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("OnVisAreaChanged")) && m_nAspect != embed::Aspects::MSOLE_ICON )
+ if ( m_pClient && aEvent.EventName == "OnVisAreaChanged" && m_nAspect != embed::Aspects::MSOLE_ICON )
{
m_pClient->FormatChanged(); // for Writer when format of the object is changed with the area
m_pClient->ViewChanged();
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index d939c7eb55fa..531f7d128c15 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -2382,7 +2382,7 @@ sal_Bool impl_maxOpenDocCountReached()
continue;
// a) do not count the help window
- if (xFrame->getName().equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("OFFICE_HELP_TASK")))
+ if ( xFrame->getName() == "OFFICE_HELP_TASK" )
continue;
// b) count all other frames
diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx
index 23641cbbe2fa..41937a3bca61 100644
--- a/sfx2/source/view/viewfrm2.cxx
+++ b/sfx2/source/view/viewfrm2.cxx
@@ -127,8 +127,7 @@ static String _getTabString()
Sequence< NamedValue > sMaterial;
if (xHolder->getMaterial() >>= sMaterial) {
for (int i=0; i < sMaterial.getLength(); i++) {
- if ((sMaterial[i].Name.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("title"))) &&
- (sMaterial[i].Value >>= aTabString))
+ if (( sMaterial[i].Name == "title" ) && ( sMaterial[i].Value >>= aTabString ))
{
result += ' ';
result += String(aTabString);