summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2011-01-28 15:59:35 +0100
committerThomas Arnhold <thomas@arnhold.org>2011-01-28 15:59:35 +0100
commit332c4b91ae2f3e0b1a78a3abff12252ad4933574 (patch)
tree38c50f00f79a01b3c25d6f0435341b99fabea1c9 /sfx2
parentcd7d5fa675bb42e9f06289f2320c5461c66deb9e (diff)
Replace empty equalsAscii() with getLength().
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/bastyp/frmhtmlw.cxx2
-rw-r--r--sfx2/source/doc/DocumentMetadataAccess.cxx8
-rw-r--r--sfx2/source/doc/Metadatable.cxx26
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx14
-rw-r--r--sfx2/source/doc/objuno.cxx2
5 files changed, 26 insertions, 26 deletions
diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx
index 4897b4f8a87b..fcc0c1985017 100644
--- a/sfx2/source/bastyp/frmhtmlw.cxx
+++ b/sfx2/source/bastyp/frmhtmlw.cxx
@@ -164,7 +164,7 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const String& rBaseURL,
{
// Reload
if( (i_xDocProps->getAutoloadSecs() != 0) ||
- !i_xDocProps->getAutoloadURL().equalsAscii("") )
+ i_xDocProps->getAutoloadURL().getLength() )
{
String sContent = String::CreateFromInt32(
i_xDocProps->getAutoloadSecs() );
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index 7989140b8e4c..3d0ffe7f183b 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -545,7 +545,7 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl,
::rtl::OUString rest;
try {
if (!splitPath(i_rPath, dir, rest)) throw uno::RuntimeException();
- if (dir.equalsAscii("")) {
+ if (dir.getLength() == 0) {
if (i_xStorage->isStreamElement(i_rPath)) {
const uno::Reference<io::XStream> xStream(
i_xStorage->openStreamElement(i_rPath,
@@ -665,7 +665,7 @@ writeStream(struct DocumentMetadataAccess_Impl & i_rImpl,
::rtl::OUString rest;
if (!splitPath(i_rPath, dir, rest)) throw uno::RuntimeException();
try {
- if (dir.equalsAscii("")) {
+ if (dir.getLength() == 0) {
exportStream(i_rImpl, i_xStorage, i_xGraphName, i_rPath,
i_rBaseURI);
} else {
@@ -1307,7 +1307,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
if (md.addInputStream()) {
md[ ::comphelper::MediaDescriptor::PROP_INPUTSTREAM() ] >>= xIn;
}
- if (!xIn.is() && URL.equalsAscii("")) {
+ if (!xIn.is() && (URL.getLength() == 0)) {
throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"DocumentMetadataAccess::loadMetadataFromMedium: "
"inalid medium: no URL, no input stream")), *this, 0);
@@ -1363,7 +1363,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
::comphelper::MediaDescriptor md(i_rMedium);
::rtl::OUString URL;
md[ ::comphelper::MediaDescriptor::PROP_URL() ] >>= URL;
- if (URL.equalsAscii("")) {
+ if (URL.getLength() == 0) {
throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"DocumentMetadataAccess::storeMetadataToMedium: "
"invalid medium: no URL")), *this, 0);
diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx
index 0a107eb99450..344c79914366 100644
--- a/sfx2/source/doc/Metadatable.cxx
+++ b/sfx2/source/doc/Metadatable.cxx
@@ -555,9 +555,9 @@ XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupXmlId(
m_XmlIdReverseMap.find(&i_rObject) );
if (iter != m_XmlIdReverseMap.end())
{
- OSL_ENSURE(!iter->second.first.equalsAscii(""),
+ OSL_ENSURE(iter->second.first.getLength(),
"null stream in m_XmlIdReverseMap");
- OSL_ENSURE(!iter->second.second.equalsAscii(""),
+ OSL_ENSURE(iter->second.second.getLength(),
"null id in m_XmlIdReverseMap");
o_rStream = iter->second.first;
o_rIdref = iter->second.second;
@@ -710,7 +710,7 @@ XmlIdRegistryDocument::TryRegisterMetadatable(Metadatable & i_rObject,
return (m_pImpl->LookupElement(old_path, old_idref) == &i_rObject);
}
XmlIdMap_t::iterator old_id( m_pImpl->m_XmlIdMap.end() );
- if (!old_idref.equalsAscii(""))
+ if (old_idref.getLength())
{
old_id = m_pImpl->m_XmlIdMap.find(old_idref);
OSL_ENSURE(old_id != m_pImpl->m_XmlIdMap.end(), "old id not found");
@@ -747,7 +747,7 @@ XmlIdRegistryDocument::RegisterMetadatableAndCreateID(Metadatable & i_rObject)
m_pImpl->LookupXmlId(i_rObject, old_path, old_idref);
XmlIdMap_t::iterator old_id( m_pImpl->m_XmlIdMap.end() );
- if (!old_idref.equalsAscii(""))
+ if (old_idref.getLength())
{
old_id = m_pImpl->m_XmlIdMap.find(old_idref);
OSL_ENSURE(old_id != m_pImpl->m_XmlIdMap.end(), "old id not found");
@@ -798,7 +798,7 @@ void XmlIdRegistryDocument::RemoveXmlIdForElement(const Metadatable& i_rObject)
m_pImpl->m_XmlIdReverseMap.find(&i_rObject) );
if (iter != m_pImpl->m_XmlIdReverseMap.end())
{
- OSL_ENSURE(!iter->second.second.equalsAscii(""),
+ OSL_ENSURE(iter->second.second.getLength(),
"null id in m_XmlIdReverseMap");
m_pImpl->m_XmlIdReverseMap.erase(iter);
}
@@ -1032,9 +1032,9 @@ XmlIdRegistryClipboard::XmlIdRegistry_Impl::LookupXmlId(
m_XmlIdReverseMap.find(&i_rObject) );
if (iter != m_XmlIdReverseMap.end())
{
- OSL_ENSURE(!iter->second.m_Stream.equalsAscii(""),
+ OSL_ENSURE(iter->second.m_Stream.getLength(),
"null stream in m_XmlIdReverseMap");
- OSL_ENSURE(!iter->second.m_XmlId.equalsAscii(""),
+ OSL_ENSURE(iter->second.m_XmlId.getLength(),
"null id in m_XmlIdReverseMap");
o_rStream = iter->second.m_Stream;
o_rIdref = iter->second.m_XmlId;
@@ -1145,7 +1145,7 @@ XmlIdRegistryClipboard::TryRegisterMetadatable(Metadatable & i_rObject,
return (m_pImpl->LookupElement(old_path, old_idref) == &i_rObject);
}
ClipboardXmlIdMap_t::iterator old_id( m_pImpl->m_XmlIdMap.end() );
- if (!old_idref.equalsAscii(""))
+ if (old_idref.getLength())
{
old_id = m_pImpl->m_XmlIdMap.find(old_idref);
OSL_ENSURE(old_id != m_pImpl->m_XmlIdMap.end(), "old id not found");
@@ -1180,7 +1180,7 @@ XmlIdRegistryClipboard::RegisterMetadatableAndCreateID(Metadatable & i_rObject)
::rtl::OUString old_path;
::rtl::OUString old_idref;
LookupXmlId(i_rObject, old_path, old_idref);
- if (!old_idref.equalsAscii("") &&
+ if (old_idref.getLength() &&
(m_pImpl->LookupElement(old_path, old_idref) == &i_rObject))
{
return;
@@ -1226,7 +1226,7 @@ void XmlIdRegistryClipboard::RemoveXmlIdForElement(const Metadatable& i_rObject)
m_pImpl->m_XmlIdReverseMap.find(&i_rObject) );
if (iter != m_pImpl->m_XmlIdReverseMap.end())
{
- OSL_ENSURE(!iter->second.m_XmlId.equalsAscii(""),
+ OSL_ENSURE(iter->second.m_XmlId.getLength(),
"null id in m_XmlIdReverseMap");
m_pImpl->m_XmlIdReverseMap.erase(iter);
}
@@ -1333,14 +1333,14 @@ void
Metadatable::SetMetadataReference(
const ::com::sun::star::beans::StringPair & i_rReference)
{
- if (i_rReference.Second.equalsAscii(""))
+ if (i_rReference.Second.getLength() == 0)
{
RemoveMetadataReference();
}
else
{
::rtl::OUString streamName( i_rReference.First );
- if (streamName.equalsAscii(""))
+ if (streamName.getLength() == 0)
{
// handle empty stream name as auto-detect.
// necessary for importing flat file format.
@@ -1421,7 +1421,7 @@ Metadatable::RegisterAsCopyOf(Metadatable const & i_rSource,
{
beans::StringPair SourceRef(
i_rSource.m_pReg->GetXmlIdForElement(i_rSource) );
- bool isLatent( SourceRef.Second.equalsAscii("") );
+ bool isLatent( SourceRef.Second.getLength() == 0 );
XmlIdRegistryDocument * pSourceRegDoc(
dynamic_cast<XmlIdRegistryDocument*>(i_rSource.m_pReg) );
OSL_ENSURE(pSourceRegDoc, "RegisterAsCopyOf: 2 clipboards?");
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index b64c37f3a7b0..71cbd7b9c32d 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -750,7 +750,7 @@ SfxDocumentMetaData::setMetaText(const char* i_name,
css::uno::Reference<css::xml::dom::XNode> xNode = m_meta.find(name)->second;
try {
- if (i_rValue.equalsAscii("")) {
+ if (i_rValue.getLength() == 0) {
if (xNode.is()) { // delete
m_xParent->removeChild(xNode);
xNode.clear();
@@ -1086,7 +1086,7 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes()
// update elements with attributes
std::vector<std::pair<const char *, ::rtl::OUString> > attributes;
- if (!m_TemplateName.equalsAscii("") || !m_TemplateURL.equalsAscii("")
+ if (m_TemplateName.getLength() || m_TemplateURL.getLength()
|| isValidDateTime(m_TemplateDate)) {
attributes.push_back(std::make_pair(
static_cast<const char*>("xlink:type"),
@@ -1109,7 +1109,7 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes()
}
attributes.clear();
- if (!m_AutoloadURL.equalsAscii("") || (0 != m_AutoloadSecs)) {
+ if (m_AutoloadURL.getLength() || (0 != m_AutoloadSecs)) {
attributes.push_back(std::make_pair(
static_cast<const char*>("xlink:href" ), m_AutoloadURL ));
attributes.push_back(std::make_pair(
@@ -1121,7 +1121,7 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes()
}
attributes.clear();
- if (!m_DefaultTarget.equalsAscii("")) {
+ if (m_DefaultTarget.getLength()) {
attributes.push_back(std::make_pair(
static_cast<const char*>("office:target-frame-name"),
m_DefaultTarget));
@@ -1772,7 +1772,7 @@ SfxDocumentMetaData::getDocumentStatistics() throw (css::uno::RuntimeException)
for (size_t i = 0; s_stdStats[i] != 0; ++i) {
const char * aName = s_stdStatAttrs[i];
::rtl::OUString text = getMetaAttr("meta:document-statistic", aName);
- if (text.equalsAscii("")) continue;
+ if (text.getLength() == 0) continue;
css::beans::NamedValue stat;
stat.Name = ::rtl::OUString::createFromAscii(s_stdStats[i]);
sal_Int32 val;
@@ -2077,7 +2077,7 @@ SfxDocumentMetaData::loadFromMedium(const ::rtl::OUString & URL,
css::uno::Reference<css::io::XInputStream> xIn;
::comphelper::MediaDescriptor md(Medium);
// if we have an URL parameter, it replaces the one in the media descriptor
- if (!URL.equalsAscii("")) {
+ if (URL.getLength()) {
md[ ::comphelper::MediaDescriptor::PROP_URL() ] <<= URL;
}
if (sal_True == md.addInputStream()) {
@@ -2120,7 +2120,7 @@ SfxDocumentMetaData::storeToMedium(const ::rtl::OUString & URL,
css::lang::WrappedTargetException, css::io::IOException)
{
::comphelper::MediaDescriptor md(Medium);
- if (!URL.equalsAscii("")) {
+ if (URL.getLength()) {
md[ ::comphelper::MediaDescriptor::PROP_URL() ] <<= URL;
}
SfxMedium aMedium(md.getAsConstPropertyValueList());
diff --git a/sfx2/source/doc/objuno.cxx b/sfx2/source/doc/objuno.cxx
index 80f8c320a516..067549f9efa4 100644
--- a/sfx2/source/doc/objuno.cxx
+++ b/sfx2/source/doc/objuno.cxx
@@ -1028,7 +1028,7 @@ void SAL_CALL SfxDocumentInfoObject::setFastPropertyValue(sal_Int32 nHandle, co
case MID_DOCINFO_AUTOLOADENABLED:
aValue <<= static_cast<sal_Bool>
( (_pImp->m_xDocProps->getAutoloadSecs() != 0)
- || !(_pImp->m_xDocProps->getAutoloadURL().equalsAscii("")));
+ || _pImp->m_xDocProps->getAutoloadURL().getLength());
break;
case MID_DOCINFO_AUTOLOADURL:
aValue <<= _pImp->m_xDocProps->getAutoloadURL();