summaryrefslogtreecommitdiff
path: root/sfx2/source/doc
diff options
context:
space:
mode:
authorOlivier Hallot <olivier.hallot@alta.org.br>2012-01-10 17:54:51 -0200
committerOlivier Hallot <olivier.hallot@alta.org.br>2012-01-10 23:39:13 -0200
commite24a27b4cc920cbb1b87c33f99b7379f50d2e0f7 (patch)
treeab6af7397220ee41793b7edef303075daf853bc6 /sfx2/source/doc
parentf19d269ab4286b2e2e9f579bc4705daf4f6756ab (diff)
Fix for fdo43460 Part XXXIII getLength() to isEmpty()
Part XXXIII Modules sfx2
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r--sfx2/source/doc/DocumentMetadataAccess.cxx26
-rw-r--r--sfx2/source/doc/Metadatable.cxx28
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx16
-rw-r--r--sfx2/source/doc/docfac.cxx2
-rw-r--r--sfx2/source/doc/docfile.cxx56
-rw-r--r--sfx2/source/doc/docfilt.cxx2
-rw-r--r--sfx2/source/doc/docinf.cxx2
-rw-r--r--sfx2/source/doc/docmacromode.cxx2
-rw-r--r--sfx2/source/doc/doctempl.cxx22
-rw-r--r--sfx2/source/doc/doctemplates.cxx60
-rw-r--r--sfx2/source/doc/doctemplateslocal.cxx4
-rw-r--r--sfx2/source/doc/guisaveas.cxx42
-rw-r--r--sfx2/source/doc/objcont.cxx6
-rw-r--r--sfx2/source/doc/objmisc.cxx18
-rw-r--r--sfx2/source/doc/objstor.cxx34
-rw-r--r--sfx2/source/doc/objuno.cxx2
-rw-r--r--sfx2/source/doc/objxtor.cxx4
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx24
18 files changed, 175 insertions, 175 deletions
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index 4b992ce145bf..c5ff48061fae 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -130,7 +130,7 @@ uno::Reference<rdf::XURI> createBaseURI(
uno::Reference<embed::XStorage> const & i_xStorage,
::rtl::OUString const & i_rPkgURI, ::rtl::OUString const & i_rSubDocument)
{
- if (!i_xContext.is() || !i_xStorage.is() || !i_rPkgURI.getLength()) {
+ if (!i_xContext.is() || !i_xStorage.is() || i_rPkgURI.isEmpty()) {
throw uno::RuntimeException();
}
@@ -142,10 +142,10 @@ uno::Reference<rdf::XURI> createBaseURI(
{
// expand it here (makeAbsolute requires hierarchical URI)
pkgURI = pkgURI.copy( RTL_CONSTASCII_LENGTH("vnd.sun.star.expand:") );
- if (pkgURI.getLength() != 0) {
+ if (!pkgURI.isEmpty()) {
pkgURI = ::rtl::Uri::decode(
pkgURI, rtl_UriDecodeStrict, RTL_TEXTENCODING_UTF8);
- if (pkgURI.getLength() == 0) {
+ if (pkgURI.isEmpty()) {
throw uno::RuntimeException();
}
::rtl::Bootstrap::expandMacros(pkgURI);
@@ -182,13 +182,13 @@ uno::Reference<rdf::XURI> createBaseURI(
}
buf.append(static_cast<sal_Unicode>('/'));
}
- if (i_rSubDocument.getLength())
+ if (!i_rSubDocument.isEmpty())
{
buf.append(i_rSubDocument);
buf.append(static_cast<sal_Unicode>('/'));
}
const ::rtl::OUString Path(buf.makeStringAndClear());
- if (Path.getLength())
+ if (!Path.isEmpty())
{
const uno::Reference< uri::XUriReference > xPathURI(
xUriFactory->parse(Path), uno::UNO_SET_THROW );
@@ -237,13 +237,13 @@ getURI(uno::Reference< uno::XComponentContext > const & i_xContext)
/** would storing the file to a XStorage succeed? */
static bool isFileNameValid(const ::rtl::OUString & i_rFileName)
{
- if (i_rFileName.getLength() <= 0) return false;
+ if (i_rFileName.isEmpty()) return false;
if (i_rFileName[0] == '/') return false; // no absolute paths!
sal_Int32 idx(0);
do {
const ::rtl::OUString segment(
i_rFileName.getToken(0, static_cast<sal_Unicode> ('/'), idx) );
- if (!segment.getLength() || // no empty segments
+ if (segment.isEmpty() || // no empty segments
segment.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".")) || // no . segments
segment.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("..")) || // no .. segments
!::comphelper::OStorageHelper::IsValidZipEntryFileName(
@@ -533,7 +533,7 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl,
::rtl::OUString rest;
try {
if (!splitPath(i_rPath, dir, rest)) throw uno::RuntimeException();
- if (dir.getLength() == 0) {
+ if (dir.isEmpty()) {
if (i_xStorage->isStreamElement(i_rPath)) {
const uno::Reference<io::XStream> xStream(
i_xStorage->openStreamElement(i_rPath,
@@ -653,7 +653,7 @@ writeStream(struct DocumentMetadataAccess_Impl & i_rImpl,
::rtl::OUString rest;
if (!splitPath(i_rPath, dir, rest)) throw uno::RuntimeException();
try {
- if (dir.getLength() == 0) {
+ if (dir.isEmpty()) {
exportStream(i_rImpl, i_xStorage, i_xGraphName, i_rPath,
i_rBaseURI);
} else {
@@ -807,7 +807,7 @@ DocumentMetadataAccess::DocumentMetadataAccess(
::rtl::OUString const & i_rURI)
: m_pImpl(new DocumentMetadataAccess_Impl(i_xContext, i_rRegistrySupplier))
{
- OSL_ENSURE(i_rURI.getLength(), "DMA::DMA: no URI given!");
+ OSL_ENSURE(!i_rURI.isEmpty(), "DMA::DMA: no URI given!");
OSL_ENSURE(i_rURI.endsWithAsciiL("/", 1), "DMA::DMA: URI without / given!");
if (!i_rURI.endsWithAsciiL("/", 1)) throw uno::RuntimeException();
m_pImpl->m_xBaseURI.set(rdf::URI::create(m_pImpl->m_xContext, i_rURI));
@@ -1111,7 +1111,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
"DocumentMetadataAccess::loadMetadataFromStorage: "
"base URI not absolute")), *this, 1);
}
- if (!baseURI.getLength() || !baseURI.endsWithAsciiL("/", 1)) {
+ if (baseURI.isEmpty() || !baseURI.endsWithAsciiL("/", 1)) {
throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"DocumentMetadataAccess::loadMetadataFromStorage: "
"base URI does not end with slash")), *this, 1);
@@ -1293,7 +1293,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
if (md.addInputStream()) {
md[ ::comphelper::MediaDescriptor::PROP_INPUTSTREAM() ] >>= xIn;
}
- if (!xIn.is() && (URL.getLength() == 0)) {
+ if (!xIn.is() && URL.isEmpty()) {
throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"DocumentMetadataAccess::loadMetadataFromMedium: "
"inalid medium: no URL, no input stream")), *this, 0);
@@ -1349,7 +1349,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
::comphelper::MediaDescriptor md(i_rMedium);
::rtl::OUString URL;
md[ ::comphelper::MediaDescriptor::PROP_URL() ] >>= URL;
- if (URL.getLength() == 0) {
+ if (URL.isEmpty()) {
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 1acb5c5ea090..f23e7823ff3f 100644
--- a/sfx2/source/doc/Metadatable.cxx
+++ b/sfx2/source/doc/Metadatable.cxx
@@ -554,9 +554,9 @@ XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupXmlId(
m_XmlIdReverseMap.find(&i_rObject) );
if (iter != m_XmlIdReverseMap.end())
{
- OSL_ENSURE(iter->second.first.getLength(),
+ OSL_ENSURE(!iter->second.first.isEmpty(),
"null stream in m_XmlIdReverseMap");
- OSL_ENSURE(iter->second.second.getLength(),
+ OSL_ENSURE(!iter->second.second.isEmpty(),
"null id in m_XmlIdReverseMap");
o_rStream = iter->second.first;
o_rIdref = iter->second.second;
@@ -706,7 +706,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.getLength())
+ if (!old_idref.isEmpty())
{
old_id = m_pImpl->m_XmlIdMap.find(old_idref);
OSL_ENSURE(old_id != m_pImpl->m_XmlIdMap.end(), "old id not found");
@@ -743,7 +743,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.getLength())
+ if (!old_idref.isEmpty())
{
old_id = m_pImpl->m_XmlIdMap.find(old_idref);
OSL_ENSURE(old_id != m_pImpl->m_XmlIdMap.end(), "old id not found");
@@ -794,7 +794,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.getLength(),
+ OSL_ENSURE(!iter->second.second.isEmpty(),
"null id in m_XmlIdReverseMap");
m_pImpl->m_XmlIdReverseMap.erase(iter);
}
@@ -1028,9 +1028,9 @@ XmlIdRegistryClipboard::XmlIdRegistry_Impl::LookupXmlId(
m_XmlIdReverseMap.find(&i_rObject) );
if (iter != m_XmlIdReverseMap.end())
{
- OSL_ENSURE(iter->second.m_Stream.getLength(),
+ OSL_ENSURE(!iter->second.m_Stream.isEmpty(),
"null stream in m_XmlIdReverseMap");
- OSL_ENSURE(iter->second.m_XmlId.getLength(),
+ OSL_ENSURE(!iter->second.m_XmlId.isEmpty(),
"null id in m_XmlIdReverseMap");
o_rStream = iter->second.m_Stream;
o_rIdref = iter->second.m_XmlId;
@@ -1139,7 +1139,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.getLength())
+ if (!old_idref.isEmpty())
{
old_id = m_pImpl->m_XmlIdMap.find(old_idref);
OSL_ENSURE(old_id != m_pImpl->m_XmlIdMap.end(), "old id not found");
@@ -1174,7 +1174,7 @@ XmlIdRegistryClipboard::RegisterMetadatableAndCreateID(Metadatable & i_rObject)
::rtl::OUString old_path;
::rtl::OUString old_idref;
LookupXmlId(i_rObject, old_path, old_idref);
- if (old_idref.getLength() &&
+ if (!old_idref.isEmpty() &&
(m_pImpl->LookupElement(old_path, old_idref) == &i_rObject))
{
return;
@@ -1220,7 +1220,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.getLength(),
+ OSL_ENSURE(!iter->second.m_XmlId.isEmpty(),
"null id in m_XmlIdReverseMap");
m_pImpl->m_XmlIdReverseMap.erase(iter);
}
@@ -1327,14 +1327,14 @@ void
Metadatable::SetMetadataReference(
const ::com::sun::star::beans::StringPair & i_rReference)
{
- if (i_rReference.Second.getLength() == 0)
+ if (i_rReference.Second.isEmpty())
{
RemoveMetadataReference();
}
else
{
::rtl::OUString streamName( i_rReference.First );
- if (streamName.getLength() == 0)
+ if (streamName.isEmpty())
{
// handle empty stream name as auto-detect.
// necessary for importing flat file format.
@@ -1415,7 +1415,7 @@ Metadatable::RegisterAsCopyOf(Metadatable const & i_rSource,
{
beans::StringPair SourceRef(
i_rSource.m_pReg->GetXmlIdForElement(i_rSource) );
- bool isLatent( SourceRef.Second.getLength() == 0 );
+ bool isLatent( SourceRef.Second.isEmpty() );
XmlIdRegistryDocument * pSourceRegDoc(
dynamic_cast<XmlIdRegistryDocument*>(i_rSource.m_pReg) );
OSL_ENSURE(pSourceRegDoc, "RegisterAsCopyOf: 2 clipboards?");
@@ -1584,7 +1584,7 @@ Metadatable::JoinMetadatable(Metadatable const & i_rOther,
{
SolarMutexGuard aGuard;
beans::StringPair mdref( getMetadataReference() );
- if (!mdref.Second.getLength())
+ if (mdref.Second.isEmpty())
{
ensureMetadataReference(); // N.B.: side effect!
mdref = getMetadataReference();
diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx
index 05f98b4c37e7..8b4416c35e0f 100644
--- a/sfx2/source/doc/SfxDocumentMetaData.cxx
+++ b/sfx2/source/doc/SfxDocumentMetaData.cxx
@@ -735,7 +735,7 @@ SfxDocumentMetaData::setMetaText(const char* i_name,
css::uno::Reference<css::xml::dom::XNode> xNode = m_meta.find(name)->second;
try {
- if (i_rValue.getLength() == 0) {
+ if (i_rValue.isEmpty()) {
if (xNode.is()) { // delete
m_xParent->removeChild(xNode);
xNode.clear();
@@ -1070,7 +1070,7 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes()
// update elements with attributes
std::vector<std::pair<const char *, ::rtl::OUString> > attributes;
- if (m_TemplateName.getLength() || m_TemplateURL.getLength()
+ if (!m_TemplateName.isEmpty() || !m_TemplateURL.isEmpty()
|| isValidDateTime(m_TemplateDate)) {
attributes.push_back(std::make_pair(
static_cast<const char*>("xlink:type"),
@@ -1093,7 +1093,7 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes()
}
attributes.clear();
- if (m_AutoloadURL.getLength() || (0 != m_AutoloadSecs)) {
+ if (!m_AutoloadURL.isEmpty() || (0 != m_AutoloadSecs)) {
attributes.push_back(std::make_pair(
static_cast<const char*>("xlink:href" ), m_AutoloadURL ));
attributes.push_back(std::make_pair(
@@ -1105,7 +1105,7 @@ void SAL_CALL SfxDocumentMetaData::updateUserDefinedAndAttributes()
}
attributes.clear();
- if (m_DefaultTarget.getLength()) {
+ if (!m_DefaultTarget.isEmpty()) {
attributes.push_back(std::make_pair(
static_cast<const char*>("office:target-frame-name"),
m_DefaultTarget));
@@ -1574,7 +1574,7 @@ SfxDocumentMetaData::setLanguage(const css::lang::Locale & the_value)
throw (css::uno::RuntimeException)
{
::rtl::OUString text = the_value.Language;
- if (the_value.Country.getLength() > 0) {
+ if (!the_value.Country.isEmpty()) {
text += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-")).concat(the_value.Country);
}
setMetaTextAndNotify("dc:language", text);
@@ -1775,7 +1775,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.getLength() == 0) continue;
+ if (text.isEmpty()) continue;
css::beans::NamedValue stat;
stat.Name = ::rtl::OUString::createFromAscii(s_stdStats[i]);
sal_Int32 val;
@@ -2079,7 +2079,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.getLength()) {
+ if (!URL.isEmpty()) {
md[ ::comphelper::MediaDescriptor::PROP_URL() ] <<= URL;
}
if (sal_True == md.addInputStream()) {
@@ -2122,7 +2122,7 @@ SfxDocumentMetaData::storeToMedium(const ::rtl::OUString & URL,
css::lang::WrappedTargetException, css::io::IOException)
{
::comphelper::MediaDescriptor md(Medium);
- if (URL.getLength()) {
+ if (!URL.isEmpty()) {
md[ ::comphelper::MediaDescriptor::PROP_URL() ] <<= URL;
}
SfxMedium aMedium(md.getAsConstPropertyValueList());
diff --git a/sfx2/source/doc/docfac.cxx b/sfx2/source/doc/docfac.cxx
index 78768582c1df..b180461c73f6 100644
--- a/sfx2/source/doc/docfac.cxx
+++ b/sfx2/source/doc/docfac.cxx
@@ -230,7 +230,7 @@ void SfxObjectFactory::SetSystemTemplate( const String& rServiceName, const Stri
::utl::LocalFileHelper::ConvertPhysicalNameToURL( sPath, sURL );
::rtl::OUString aUserTemplateURL( sURL );
- if ( aUserTemplateURL.getLength() != 0)
+ if ( !aUserTemplateURL.isEmpty())
{
try
{
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index 250f58606b12..21838839b9fb 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -411,7 +411,7 @@ void SfxMedium::AddLog( const ::rtl::OUString& aMessage )
void SfxMedium::SetError( sal_uInt32 nError, const ::rtl::OUString& aLogMessage )
{
eError = nError;
- if ( eError != ERRCODE_NONE && aLogMessage.getLength() )
+ if ( eError != ERRCODE_NONE && !aLogMessage.isEmpty() )
AddLog( aLogMessage );
}
@@ -547,7 +547,7 @@ Reference < XContent > SfxMedium::GetContent() const
{
}
- if ( !aBaseURL.getLength() )
+ if ( aBaseURL.isEmpty() )
aBaseURL = GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
}
@@ -797,15 +797,15 @@ void SfxMedium::StorageBackup_Impl()
Reference< ::com::sun::star::ucb::XCommandEnvironment > xDummyEnv;
sal_Bool bBasedOnOriginalFile = ( !pImp->pTempFile && !( aLogicName.Len() && pImp->m_bSalvageMode )
- && GetURLObject().GetMainURL( INetURLObject::NO_DECODE ).getLength()
+ && !GetURLObject().GetMainURL( INetURLObject::NO_DECODE ).isEmpty()
&& ::utl::LocalFileHelper::IsLocalFile( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) )
&& ::utl::UCBContentHelper::IsDocument( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ) );
- if ( bBasedOnOriginalFile && !pImp->m_aBackupURL.getLength()
+ if ( bBasedOnOriginalFile && pImp->m_aBackupURL.isEmpty()
&& ::ucbhelper::Content::create( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ), xDummyEnv, aOriginalContent ) )
{
DoInternalBackup_Impl( aOriginalContent );
- if( !pImp->m_aBackupURL.getLength() )
+ if( pImp->m_aBackupURL.isEmpty() )
SetError( ERRCODE_SFX_CANTCREATEBACKUP, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
}
}
@@ -813,7 +813,7 @@ void SfxMedium::StorageBackup_Impl()
//------------------------------------------------------------------
::rtl::OUString SfxMedium::GetBackup_Impl()
{
- if ( !pImp->m_aBackupURL.getLength() )
+ if ( pImp->m_aBackupURL.isEmpty() )
StorageBackup_Impl();
return pImp->m_aBackupURL;
@@ -897,12 +897,12 @@ sal_Int8 SfxMedium::ShowLockedDocumentDialog( const uno::Sequence< ::rtl::OUStri
{
if ( aData.getLength() > LOCKFILE_EDITTIME_ID )
{
- if ( aData[LOCKFILE_OOOUSERNAME_ID].getLength() )
+ if ( !aData[LOCKFILE_OOOUSERNAME_ID].isEmpty() )
aInfo = aData[LOCKFILE_OOOUSERNAME_ID];
else
aInfo = aData[LOCKFILE_SYSUSERNAME_ID];
- if ( aInfo.getLength() && aData[LOCKFILE_EDITTIME_ID].getLength() )
+ if ( !aInfo.isEmpty() && !aData[LOCKFILE_EDITTIME_ID].isEmpty() )
{
aInfo += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " ( " ) );
aInfo += aData[LOCKFILE_EDITTIME_ID];
@@ -1546,8 +1546,8 @@ sal_Bool SfxMedium::StorageCommit_Impl()
// since the temporary file is created always now, the scenario is close to be impossible
if ( !pImp->pTempFile )
{
- OSL_ENSURE( pImp->m_aBackupURL.getLength(), "No backup on storage commit!\n" );
- if ( pImp->m_aBackupURL.getLength()
+ OSL_ENSURE( !pImp->m_aBackupURL.isEmpty(), "No backup on storage commit!\n" );
+ if ( !pImp->m_aBackupURL.isEmpty()
&& ::ucbhelper::Content::create( GetURLObject().GetMainURL( INetURLObject::NO_DECODE ),
xDummyEnv,
aOriginalContent ) )
@@ -1638,10 +1638,10 @@ sal_Bool SfxMedium::TransactedTransferForFS_Impl( const INetURLObject& aSource,
{
if( bOverWrite && ::utl::UCBContentHelper::IsDocument( aDest.GetMainURL( INetURLObject::NO_DECODE ) ) )
{
- if( ! pImp->m_aBackupURL.getLength() )
+ if( pImp->m_aBackupURL.isEmpty() )
DoInternalBackup_Impl( aOriginalContent );
- if( pImp->m_aBackupURL.getLength() )
+ if( !pImp->m_aBackupURL.isEmpty() )
{
Reference< XInputStream > aTempInput = aTempCont.openStream();
bTransactStarted = sal_True;
@@ -2019,7 +2019,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
{
RTL_LOGFILE_CONTEXT( aLog, "sfx2 (mv76033) SfxMedium::DoInternalBackup_Impl( with destdir )" );
- if ( pImp->m_aBackupURL.getLength() )
+ if ( !pImp->m_aBackupURL.isEmpty() )
return; // the backup was done already
::utl::TempFile aTransactTemp( aPrefix, &aExtension, &aDestDir );
@@ -2047,14 +2047,14 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
{}
}
- if ( !pImp->m_aBackupURL.getLength() )
+ if ( pImp->m_aBackupURL.isEmpty() )
aTransactTemp.EnableKillingFile( sal_True );
}
//------------------------------------------------------------------
void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalContent )
{
- if ( pImp->m_aBackupURL.getLength() )
+ if ( !pImp->m_aBackupURL.isEmpty() )
return; // the backup was done already
::rtl::OUString aFileName = GetURLObject().getName( INetURLObject::LAST_SEGMENT,
@@ -2068,7 +2068,7 @@ void SfxMedium::DoInternalBackup_Impl( const ::ucbhelper::Content& aOriginalCont
DoInternalBackup_Impl( aOriginalContent, aPrefix, aExtension, aBakDir );
- if ( !pImp->m_aBackupURL.getLength() )
+ if ( pImp->m_aBackupURL.isEmpty() )
{
// the copiing to the backup catalog failed ( for example because
// of using an encrypted partition as target catalog )
@@ -2150,7 +2150,7 @@ void SfxMedium::ClearBackup_Impl()
{
// currently a document is always stored in a new medium,
// thus if a backup can not be removed the backup URL should not be cleaned
- if ( pImp->m_aBackupURL.getLength() )
+ if ( !pImp->m_aBackupURL.isEmpty() )
{
if ( ::utl::UCBContentHelper::Kill( pImp->m_aBackupURL ) )
{
@@ -2535,7 +2535,7 @@ sal_uInt32 SfxMedium::CreatePasswordToModifyHash( const ::rtl::OUString& aPasswd
{
sal_uInt32 nHash = 0;
- if ( aPasswd.getLength() )
+ if ( !aPasswd.isEmpty() )
{
if ( bWriter )
{
@@ -2850,7 +2850,7 @@ SfxMedium::SfxMedium( const ::com::sun::star::uno::Sequence< ::com::sun::star::b
SFX_ITEMSET_ARG( pSet, pFileNameItem, SfxStringItem, SID_FILE_NAME, sal_False );
if (!pFileNameItem) throw uno::RuntimeException();
::rtl::OUString aNewTempFileURL = SfxMedium::CreateTempCopyWithExt( pFileNameItem->GetValue() );
- if ( aNewTempFileURL.getLength() )
+ if ( !aNewTempFileURL.isEmpty() )
{
pSet->Put( SfxStringItem( SID_FILE_NAME, aNewTempFileURL ) );
pSet->ClearItem( SID_INPUTSTREAM );
@@ -3279,7 +3279,7 @@ void SfxMedium::CreateTempFile( sal_Bool bReplace )
::rtl::OUString aFileName = aTmpURLObj.getName( INetURLObject::LAST_SEGMENT,
true,
INetURLObject::DECODE_WITH_CHARSET );
- if ( aFileName.getLength() && aTmpURLObj.removeSegment() )
+ if ( !aFileName.isEmpty() && aTmpURLObj.removeSegment() )
{
::ucbhelper::Content aTargetContent( aTmpURLObj.GetMainURL( INetURLObject::NO_DECODE ), xComEnv );
if ( aTargetContent.transferContent( pImp->aContent, ::ucbhelper::InsertOperation_COPY, aFileName, NameClash::OVERWRITE ) )
@@ -3424,7 +3424,7 @@ sal_Bool SfxMedium::SignContents_Impl( sal_Bool bScriptingContent, const ::rtl::
{
// remove the document signature if any
::rtl::OUString aDocSigName = xSigner->getDocumentContentSignatureDefaultStreamName();
- if ( aDocSigName.getLength() && xMetaInf->hasByName( aDocSigName ) )
+ if ( !aDocSigName.isEmpty() && xMetaInf->hasByName( aDocSigName ) )
xMetaInf->removeElement( aDocSigName );
uno::Reference< embed::XTransactedObject > xTransact( xMetaInf, uno::UNO_QUERY_THROW );
@@ -3512,20 +3512,20 @@ sal_Bool SfxMedium::IsOpen() const
{
::rtl::OUString aResult;
- if ( aURL.getLength() )
+ if ( !aURL.isEmpty() )
{
sal_Int32 nPrefixLen = aURL.lastIndexOf( '.' );
String aExt = ( nPrefixLen == -1 ) ? String() : String( aURL.copy( nPrefixLen ) );
::rtl::OUString aNewTempFileURL = ::utl::TempFile( String(), &aExt ).GetURL();
- if ( aNewTempFileURL.getLength() )
+ if ( !aNewTempFileURL.isEmpty() )
{
INetURLObject aSource( aURL );
INetURLObject aDest( aNewTempFileURL );
::rtl::OUString aFileName = aDest.getName( INetURLObject::LAST_SEGMENT,
true,
INetURLObject::DECODE_WITH_CHARSET );
- if ( aFileName.getLength() && aDest.removeSegment() )
+ if ( !aFileName.isEmpty() && aDest.removeSegment() )
{
try
{
@@ -3586,7 +3586,7 @@ sal_Bool SfxMedium::CallApproveHandler( const uno::Reference< task::XInteraction
::rtl::OUString aResult;
::rtl::OUString aOrigURL = aLogicName;
- if ( aOrigURL.getLength() )
+ if ( !aOrigURL.isEmpty() )
{
sal_Int32 nPrefixLen = aOrigURL.lastIndexOf( '.' );
String aExt = ( nPrefixLen == -1 ) ? String() : String( aOrigURL.copy( nPrefixLen ) );
@@ -3594,7 +3594,7 @@ sal_Bool SfxMedium::CallApproveHandler( const uno::Reference< task::XInteraction
// TODO/LATER: In future the aLogicName should be set to shared folder URL
// and a temporary file should be created. Transport_Impl should be impossible then.
- if ( aNewURL.getLength() )
+ if ( !aNewURL.isEmpty() )
{
uno::Reference< embed::XStorage > xStorage = GetStorage();
uno::Reference< embed::XOptimizedStorage > xOptStorage( xStorage, uno::UNO_QUERY );
@@ -3632,7 +3632,7 @@ sal_Bool SfxMedium::CallApproveHandler( const uno::Reference< task::XInteraction
{}
}
- if ( !aResult.getLength() )
+ if ( aResult.isEmpty() )
{
Close();
SetPhysicalName_Impl( String() );
@@ -3659,7 +3659,7 @@ sal_Bool SfxMedium::SwitchDocumentToFile( ::rtl::OUString aURL )
sal_Bool bResult = sal_False;
::rtl::OUString aOrigURL = aLogicName;
- if ( aURL.getLength() && aOrigURL.getLength() )
+ if ( !aURL.isEmpty() && !aOrigURL.isEmpty() )
{
uno::Reference< embed::XStorage > xStorage = GetStorage();
uno::Reference< embed::XOptimizedStorage > xOptStorage( xStorage, uno::UNO_QUERY );
diff --git a/sfx2/source/doc/docfilt.cxx b/sfx2/source/doc/docfilt.cxx
index aa2a88450a4b..3477d9cb9804 100644
--- a/sfx2/source/doc/docfilt.cxx
+++ b/sfx2/source/doc/docfilt.cxx
@@ -196,7 +196,7 @@ String SfxFilter::GetTypeFromStorage( const com::sun::star::uno::Reference< com:
{
::rtl::OUString aMediaType;
xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")) ) >>= aMediaType;
- if ( aMediaType.getLength() )
+ if ( !aMediaType.isEmpty() )
{
::com::sun::star::datatransfer::DataFlavor aDataFlavor;
aDataFlavor.MimeType = aMediaType;
diff --git a/sfx2/source/doc/docinf.cxx b/sfx2/source/doc/docinf.cxx
index b75531f788c2..539f31c5743f 100644
--- a/sfx2/source/doc/docinf.cxx
+++ b/sfx2/source/doc/docinf.cxx
@@ -160,7 +160,7 @@ sal_uInt32 SFX2_DLLPUBLIC LoadOlePropertySet(
{
::rtl::OUString aPropName = xCustomSect->GetPropertyName( *aIt );
uno::Any aPropValue = xCustomSect->GetAnyValue( *aIt );
- if( (aPropName.getLength() > 0) && aPropValue.hasValue() ) {
+ if( !aPropName.isEmpty() && aPropValue.hasValue() ) {
try {
xUserDefined->addProperty( aPropName,
beans::PropertyAttribute::REMOVEABLE, aPropValue );
diff --git a/sfx2/source/doc/docmacromode.cxx b/sfx2/source/doc/docmacromode.cxx
index f60b60da839f..763411a1a0fa 100644
--- a/sfx2/source/doc/docmacromode.cxx
+++ b/sfx2/source/doc/docmacromode.cxx
@@ -241,7 +241,7 @@ namespace sfx2
if ( aURLReferer.removeSegment() )
aLocation = aURLReferer.GetMainURL( INetURLObject::NO_DECODE );
- if ( aLocation.getLength() && xSignatures->isLocationTrusted( aLocation ) )
+ if ( !aLocation.isEmpty() && xSignatures->isLocationTrusted( aLocation ) )
{
return allowMacroExecution();
}
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index a62d1fe69034..8a194f861284 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -739,7 +739,7 @@ sal_Bool SfxDocumentTemplates::CopyOrMove
INetURLObject aSourceObj( pSource->GetTargetURL() );
::rtl::OUString aNewTargetURL = GetTemplateTargetURLFromComponent( pTargetRgn->GetTitle(), aTitle );
- if ( !aNewTargetURL.getLength() )
+ if ( aNewTargetURL.isEmpty() )
return sal_False;
if ( bMove )
@@ -996,7 +996,7 @@ sal_Bool SfxDocumentTemplates::CopyFrom
}
}
- if( ! aTitle.getLength() )
+ if( aTitle.isEmpty() )
{
INetURLObject aURL( aTemplURL );
aURL.CutExtension();
@@ -1549,7 +1549,7 @@ sal_Bool SfxDocumentTemplates::HasUserContents( sal_uInt16 nRegion, sal_uInt16 n
if ( pRegion )
{
::rtl::OUString aRegionTargetURL = pRegion->GetTargetURL();
- if ( aRegionTargetURL.getLength() )
+ if ( !aRegionTargetURL.isEmpty() )
{
sal_uInt16 nLen = 0;
sal_uInt16 nStartInd = 0;
@@ -1577,7 +1577,7 @@ sal_Bool SfxDocumentTemplates::HasUserContents( sal_uInt16 nRegion, sal_uInt16 n
if ( pEntryData )
{
::rtl::OUString aEntryTargetURL = pEntryData->GetTargetURL();
- if ( aEntryTargetURL.getLength()
+ if ( !aEntryTargetURL.isEmpty()
&& ::utl::UCBContentHelper::IsSubPath( aRegionTargetURL, aEntryTargetURL ) )
{
bResult = sal_True;
@@ -1719,7 +1719,7 @@ sal_Bool DocTempl_EntryData_Impl::DeleteObjectShell()
// -----------------------------------------------------------------------
const OUString& DocTempl_EntryData_Impl::GetHierarchyURL()
{
- if ( !maOwnURL.getLength() )
+ if ( maOwnURL.isEmpty() )
{
INetURLObject aTemplateObj( GetParent()->GetHierarchyURL() );
@@ -1728,7 +1728,7 @@ const OUString& DocTempl_EntryData_Impl::GetHierarchyURL()
INetURLObject::ENCODE_ALL );
maOwnURL = aTemplateObj.GetMainURL( INetURLObject::NO_DECODE );
- DBG_ASSERT( maOwnURL.getLength(), "GetHierarchyURL(): Could not create URL!" );
+ DBG_ASSERT( !maOwnURL.isEmpty(), "GetHierarchyURL(): Could not create URL!" );
}
return maOwnURL;
@@ -1737,7 +1737,7 @@ const OUString& DocTempl_EntryData_Impl::GetHierarchyURL()
// -----------------------------------------------------------------------
const OUString& DocTempl_EntryData_Impl::GetTargetURL()
{
- if ( !maTargetURL.getLength() )
+ if ( maTargetURL.isEmpty() )
{
uno::Reference< XCommandEnvironment > aCmdEnv;
Content aRegion;
@@ -1853,7 +1853,7 @@ size_t RegionData_Impl::GetCount() const
// -----------------------------------------------------------------------
const OUString& RegionData_Impl::GetHierarchyURL()
{
- if ( !maOwnURL.getLength() )
+ if ( maOwnURL.isEmpty() )
{
INetURLObject aRegionObj( GetParent()->GetRootURL() );
@@ -1862,7 +1862,7 @@ const OUString& RegionData_Impl::GetHierarchyURL()
INetURLObject::ENCODE_ALL );
maOwnURL = aRegionObj.GetMainURL( INetURLObject::NO_DECODE );
- DBG_ASSERT( maOwnURL.getLength(), "GetHierarchyURL(): Could not create URL!" );
+ DBG_ASSERT( !maOwnURL.isEmpty(), "GetHierarchyURL(): Could not create URL!" );
}
return maOwnURL;
@@ -1871,7 +1871,7 @@ const OUString& RegionData_Impl::GetHierarchyURL()
// -----------------------------------------------------------------------
const OUString& RegionData_Impl::GetTargetURL()
{
- if ( !maTargetURL.getLength() )
+ if ( maTargetURL.isEmpty() )
{
uno::Reference< XCommandEnvironment > aCmdEnv;
Content aRegion;
@@ -2257,7 +2257,7 @@ sal_Bool SfxDocTemplate_Impl::GetTitleFromURL( const OUString& rURL,
catch ( Exception& ) {}
}
- if ( ! aTitle.getLength() )
+ if ( aTitle.isEmpty() )
{
INetURLObject aURL( rURL );
aURL.CutExtension();
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 7dd7338dfe66..dcaaeca101a4 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -504,7 +504,7 @@ void SfxDocTplService_Impl::getDefaultLocale()
if ( !mbLocaleSet )
{
rtl::OUString aLocale( utl::ConfigManager::getLocale() );
- if ( aLocale.getLength() > 0 )
+ if ( !aLocale.isEmpty() )
{
sal_Int32 nPos = aLocale.indexOf( sal_Unicode( '-' ) );
if ( nPos != -1 )
@@ -570,7 +570,7 @@ OUString SfxDocTplService_Impl::getLongName( const OUString& rShortName )
}
}
- if ( !aRet.getLength() )
+ if ( aRet.isEmpty() )
aRet = rShortName;
return aRet;
@@ -721,10 +721,10 @@ sal_Bool SfxDocTplService_Impl::getTitleFromURL( const OUString& rURL, OUString&
catch ( Exception& ) {}
}
- if ( ! aType.getLength() && mxType.is() )
+ if ( aType.isEmpty() && mxType.is() )
{
::rtl::OUString aDocType = mxType->queryTypeByURL( rURL );
- if ( aDocType.getLength() )
+ if ( !aDocType.isEmpty() )
try
{
uno::Reference< container::XNameAccess > xTypeDetection( mxType, uno::UNO_QUERY_THROW );
@@ -737,7 +737,7 @@ sal_Bool SfxDocTplService_Impl::getTitleFromURL( const OUString& rURL, OUString&
{}
}
- if ( ! aTitle.getLength() )
+ if ( aTitle.isEmpty() )
{
INetURLObject aURL( rURL );
aURL.CutExtension();
@@ -1613,7 +1613,7 @@ sal_Bool SfxDocTplService_Impl::removeGroup( const OUString& rGroupName )
if ( getProperty( aGroup, aPropName, aValue ) )
aValue >>= aGroupTargetURL;
- if ( !aGroupTargetURL.getLength() )
+ if ( aGroupTargetURL.isEmpty() )
return sal_False; // nothing is allowed to be removed
if ( !maTemplateDirs.getLength() )
@@ -1727,7 +1727,7 @@ sal_Bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName,
if ( getProperty( aGroup, aPropName, aValue ) )
aValue >>= aGroupTargetURL;
- if ( !aGroupTargetURL.getLength() )
+ if ( aGroupTargetURL.isEmpty() )
return sal_False;
if ( !maTemplateDirs.getLength() )
@@ -1840,8 +1840,8 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
if ( getProperty( aTemplateToRemove, aTargetTemplPropName, aValue ) )
aValue >>= aTemplateToRemoveTargetURL;
- if ( !aGroupTargetURL.getLength() || !maTemplateDirs.getLength()
- || (aTemplateToRemoveTargetURL.getLength() && !::utl::UCBContentHelper::IsSubPath( maTemplateDirs[ maTemplateDirs.getLength() - 1 ], aTemplateToRemoveTargetURL )) )
+ if ( aGroupTargetURL.isEmpty() || !maTemplateDirs.getLength()
+ || (!aTemplateToRemoveTargetURL.isEmpty() && !::utl::UCBContentHelper::IsSubPath( maTemplateDirs[ maTemplateDirs.getLength() - 1 ], aTemplateToRemoveTargetURL )) )
return sal_False; // it is not allowed to remove the template
}
@@ -1857,7 +1857,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.frame.ModuleManager")) ),
uno::UNO_QUERY_THROW );
sDocServiceName = xModuleManager->identify( uno::Reference< uno::XInterface >( rStorable, uno::UNO_QUERY ) );
- if ( !sDocServiceName.getLength() )
+ if ( sDocServiceName.isEmpty() )
throw uno::RuntimeException();
// get the actual filter name
@@ -1886,7 +1886,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
throw uno::RuntimeException();
xApplConfig->getByName( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooSetupFactoryActualTemplateFilter" ) ) ) >>= aFilterName;
- if ( !aFilterName.getLength() )
+ if ( aFilterName.isEmpty() )
throw uno::RuntimeException();
// find the related type name
@@ -1901,7 +1901,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
if ( aFilterData[nInd].Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Type" ) ) )
aFilterData[nInd].Value >>= aTypeName;
- if ( !aTypeName.getLength() )
+ if ( aTypeName.isEmpty() )
throw uno::RuntimeException();
// find the mediatype and extension
@@ -1921,24 +1921,24 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
::rtl::OUString aMediaType = aTypeProps.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("MediaType")), ::rtl::OUString() );
::rtl::OUString aExt = aAllExt[0];
- if ( !aMediaType.getLength() || !aExt.getLength() )
+ if ( aMediaType.isEmpty() || aExt.isEmpty() )
throw uno::RuntimeException();
// construct destination url
- if ( !aGroupTargetURL.getLength() )
+ if ( aGroupTargetURL.isEmpty() )
{
aGroupTargetURL = CreateNewGroupFsys( rGroupName, aGroup );
- if ( !aGroupTargetURL.getLength() )
+ if ( aGroupTargetURL.isEmpty() )
throw uno::RuntimeException();
}
::rtl::OUString aNewTemplateTargetURL = CreateNewUniqueFileWithPrefix( aGroupTargetURL, rTemplateName, aExt );
- if ( !aNewTemplateTargetURL.getLength() )
+ if ( aNewTemplateTargetURL.isEmpty() )
{
aNewTemplateTargetURL = CreateNewUniqueFileWithPrefix( aGroupTargetURL, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UserTemplate" ) ), aExt );
- if ( !aNewTemplateTargetURL.getLength() )
+ if ( aNewTemplateTargetURL.isEmpty() )
throw uno::RuntimeException();
}
@@ -1956,7 +1956,7 @@ sal_Bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
rStorable->store();
// the storing was successful, now the old template with the same name can be removed if it existed
- if ( aTemplateToRemoveTargetURL.getLength() )
+ if ( !aTemplateToRemoveTargetURL.isEmpty() )
{
removeContent( aTemplateToRemoveTargetURL );
@@ -2024,11 +2024,11 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName,
if ( getProperty( aGroup, aPropName, aValue ) )
aValue >>= aTargetURL;
- if ( !aTargetURL.getLength() )
+ if ( aTargetURL.isEmpty() )
{
aTargetURL = CreateNewGroupFsys( rGroupName, aGroup );
- if ( !aTargetURL.getLength() )
+ if ( aTargetURL.isEmpty() )
return sal_False;
}
@@ -2070,7 +2070,7 @@ sal_Bool SfxDocTplService_Impl::addTemplate( const OUString& rGroupName,
::rtl::OUString aNewTemplateTargetURL = CreateNewUniqueFileWithPrefix( aTargetURL, aPattern, aSourceObj.getExtension() );
INetURLObject aNewTemplateTargetObj( aNewTemplateTargetURL );
::rtl::OUString aNewTemplateTargetName = aNewTemplateTargetObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DECODE_WITH_CHARSET );
- if ( !aNewTemplateTargetURL.getLength() || !aNewTemplateTargetName.getLength() )
+ if ( aNewTemplateTargetURL.isEmpty() || aNewTemplateTargetName.isEmpty() )
return sal_False;
// get access to source file
@@ -2175,7 +2175,7 @@ sal_Bool SfxDocTplService_Impl::removeTemplate( const OUString& rGroupName,
aValue >>= aTargetURL;
// delete the target template
- if ( aTargetURL.getLength() )
+ if ( !aTargetURL.isEmpty() )
{
if ( !maTemplateDirs.getLength()
|| !::utl::UCBContentHelper::IsSubPath( maTemplateDirs[ maTemplateDirs.getLength() - 1 ], aTargetURL ) )
@@ -2491,7 +2491,7 @@ void SfxDocTplService_Impl::addHierGroup( GroupList_Impl& rList,
OUString aType( xRow->getString( 3 ) );
OUString aHierURL = xContentAccess->queryContentIdentifierString();
- if ( !aType.getLength() )
+ if ( aType.isEmpty() )
{
OUString aTmpTitle;
@@ -2502,7 +2502,7 @@ void SfxDocTplService_Impl::addHierGroup( GroupList_Impl& rList,
continue;
}
- if ( aType.getLength() )
+ if ( !aType.isEmpty() )
bUpdateType = sal_True;
}
@@ -2523,7 +2523,7 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList,
{
::rtl::OUString aTitle;
- if ( !rUITitle.getLength() )
+ if ( rUITitle.isEmpty() )
{
// reserved FS names that should not be used
if ( rTitle.compareToAscii( "wizard" ) == 0 )
@@ -2536,7 +2536,7 @@ void SfxDocTplService_Impl::addFsysGroup( GroupList_Impl& rList,
else
aTitle = rUITitle;
- if ( !aTitle.getLength() )
+ if ( aTitle.isEmpty() )
return;
GroupData_Impl* pGroup = NULL;
@@ -2813,7 +2813,7 @@ DocTemplates_EntryData_Impl* GroupData_Impl::addEntry( const OUString& rTitle,
pData = new DocTemplates_EntryData_Impl( rTitle );
pData->setTargetURL( rTargetURL );
pData->setType( rType );
- if ( rHierURL.getLength() )
+ if ( !rHierURL.isEmpty() )
{
pData->setHierarchyURL( rHierURL );
pData->setHierarchy( sal_True );
@@ -2822,7 +2822,7 @@ DocTemplates_EntryData_Impl* GroupData_Impl::addEntry( const OUString& rTitle,
}
else
{
- if ( rHierURL.getLength() )
+ if ( !rHierURL.isEmpty() )
{
pData->setHierarchyURL( rHierURL );
pData->setHierarchy( sal_True );
@@ -2928,7 +2928,7 @@ void SfxURLRelocator_Impl::implExpandURL( ::rtl::OUString& io_url )
// -----------------------------------------------------------------------
void SfxURLRelocator_Impl::makeRelocatableURL( rtl::OUString & rURL )
{
- if ( rURL.getLength() > 0 )
+ if ( !rURL.isEmpty() )
{
initOfficeInstDirs();
implExpandURL( rURL );
@@ -2939,7 +2939,7 @@ void SfxURLRelocator_Impl::makeRelocatableURL( rtl::OUString & rURL )
// -----------------------------------------------------------------------
void SfxURLRelocator_Impl::makeAbsoluteURL( rtl::OUString & rURL )
{
- if ( rURL.getLength() > 0 )
+ if ( !rURL.isEmpty() )
{
initOfficeInstDirs();
implExpandURL( rURL );
diff --git a/sfx2/source/doc/doctemplateslocal.cxx b/sfx2/source/doc/doctemplateslocal.cxx
index fc569f78cb85..973be7ba3fbf 100644
--- a/sfx2/source/doc/doctemplateslocal.cxx
+++ b/sfx2/source/doc/doctemplateslocal.cxx
@@ -187,11 +187,11 @@ void SAL_CALL DocTemplLocaleHelper::startElement( const ::rtl::OUString& aName,
m_aResultSeq.realloc( nNewEntryNum );
::rtl::OUString aNameValue = xAttribs->getValueByName( m_aNameAttr );
- if ( !aNameValue.getLength() )
+ if ( aNameValue.isEmpty() )
throw xml::sax::SAXException(); // TODO: the ID value must present
::rtl::OUString aUINameValue = xAttribs->getValueByName( m_aUINameAttr );
- if ( !aUINameValue.getLength() )
+ if ( aUINameValue.isEmpty() )
throw xml::sax::SAXException(); // TODO: the ID value must present
m_aResultSeq[nNewEntryNum-1].First = aNameValue;
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 0b7371750bdb..3b81c1ad34ca 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -410,11 +410,11 @@ const ::comphelper::SequenceAsHashMap& ModelData_Impl::GetDocProps()
//-------------------------------------------------------------------------
::rtl::OUString ModelData_Impl::GetModuleName()
{
- if ( !m_aModuleName.getLength() )
+ if ( m_aModuleName.isEmpty() )
{
m_aModuleName = m_pOwner->GetModuleManager()->identify(
uno::Reference< uno::XInterface >( m_xModel, uno::UNO_QUERY ) );
- if ( !m_aModuleName.getLength() )
+ if ( m_aModuleName.isEmpty() )
throw uno::RuntimeException(); // TODO:
}
return m_aModuleName;
@@ -559,7 +559,7 @@ sal_Bool ModelData_Impl::ExecuteFilterDialog_Impl( const ::rtl::OUString& aFilte
{
::rtl::OUString aServiceName;
aProps[nProperty].Value >>= aServiceName;
- if( aServiceName.getLength() )
+ if( !aServiceName.isEmpty() )
{
uno::Reference< ui::dialogs::XExecutableDialog > xFilterDialog(
m_pOwner->GetServiceFactory()->createInstance( aServiceName ), uno::UNO_QUERY );
@@ -722,11 +722,11 @@ sal_Int8 ModelData_Impl::CheckFilter( const ::rtl::OUString& aFilterName )
{
::comphelper::SequenceAsHashMap aFiltPropsHM;
sal_Int32 nFiltFlags = 0;
- if ( aFilterName.getLength() )
+ if ( !aFilterName.isEmpty() )
{
// get properties of filter
uno::Sequence< beans::PropertyValue > aFilterProps;
- if ( aFilterName.getLength() )
+ if ( !aFilterName.isEmpty() )
m_pOwner->GetFilterConfiguration()->getByName( aFilterName ) >>= aFilterProps;
aFiltPropsHM = ::comphelper::SequenceAsHashMap( aFilterProps );
@@ -792,7 +792,7 @@ sal_Bool ModelData_Impl::CheckFilterOptionsDialogExistence()
::rtl::OUString aUIServName = aPropsHM.getUnpackedValueOrDefault(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIComponent")),
::rtl::OUString() );
- if ( aUIServName.getLength() )
+ if ( !aUIServName.isEmpty() )
return sal_True;
}
}
@@ -855,7 +855,7 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
sfx2::FileDialogHelper* pFileDlg = NULL;
::rtl::OUString aDocServiceName = GetDocServiceName();
- DBG_ASSERT( aDocServiceName.getLength(), "No document service for this module set!" );
+ DBG_ASSERT( !aDocServiceName.isEmpty(), "No document service for this module set!" );
sal_Int32 nMust = getMustFlags( nStoreMode );
sal_Int32 nDont = getDontFlags( nStoreMode );
@@ -930,7 +930,7 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
aFilterNameString,
::rtl::OUString() );
- if ( aOldFilterName.getLength() )
+ if ( !aOldFilterName.isEmpty() )
m_pOwner->GetFilterConfiguration()->getByName( aOldFilterName ) >>= aOldFilterProps;
::comphelper::SequenceAsHashMap aOldFiltPropsHM( aOldFilterProps );
@@ -957,10 +957,10 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
}
::rtl::OUString aReccomendedDir = GetReccomendedDir( aSuggestedDir );
- if ( aReccomendedDir.getLength() )
+ if ( !aReccomendedDir.isEmpty() )
pFileDlg->SetDisplayDirectory( aReccomendedDir );
::rtl::OUString aReccomendedName = GetReccomendedName( aSuggestedName, aAdjustToType );
- if ( aReccomendedName.getLength() )
+ if ( !aReccomendedName.isEmpty() )
pFileDlg->SetFileName( aReccomendedName );
uno::Reference < view::XSelectionSupplier > xSel( GetModel()->getCurrentController(), uno::UNO_QUERY );
@@ -1146,17 +1146,17 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog()
{
::rtl::OUString aReccomendedDir;
- if ( ( aSuggestedDir.getLength() || GetStorable()->hasLocation() )
+ if ( ( !aSuggestedDir.isEmpty() || GetStorable()->hasLocation() )
&& !GetMediaDescr().getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepairPackage")),
sal_False ) )
{
INetURLObject aLocation;
- if ( aSuggestedDir.getLength() )
+ if ( !aSuggestedDir.isEmpty() )
aLocation = INetURLObject( aSuggestedDir );
else
{
::rtl::OUString aOldURL = GetStorable()->getLocation();
- if ( aOldURL.getLength() )
+ if ( !aOldURL.isEmpty() )
{
INetURLObject aTmp( aOldURL );
if ( aTmp.removeSegment() )
@@ -1185,12 +1185,12 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog()
// the last used name might be provided by aSuggestedName from the old selection, or from the MediaDescriptor
::rtl::OUString aReccomendedName;
- if ( aSuggestedName.getLength() )
+ if ( !aSuggestedName.isEmpty() )
aReccomendedName = aSuggestedName;
else
{
aReccomendedName = INetURLObject( GetStorable()->getLocation() ).GetName( INetURLObject::DECODE_WITH_CHARSET );
- if ( !aReccomendedName.getLength() )
+ if ( aReccomendedName.isEmpty() )
{
try {
uno::Reference< frame::XTitle > xTitle( GetModel(), uno::UNO_QUERY_THROW );
@@ -1198,7 +1198,7 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog()
} catch( const uno::Exception& ) {}
}
- if ( aReccomendedName.getLength() && aTypeName.getLength() )
+ if ( !aReccomendedName.isEmpty() && !aTypeName.isEmpty() )
{
// adjust the extension to the type
uno::Reference< container::XNameAccess > xTypeDetection = uno::Reference< container::XNameAccess >(
@@ -1473,15 +1473,15 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
// The Dispatch supports parameter FolderName that overwrites SuggestedSaveAsDir
::rtl::OUString aSuggestedDir = aModelData.GetMediaDescr().getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "FolderName" ) ), ::rtl::OUString() );
- if ( !aSuggestedDir.getLength() )
+ if ( aSuggestedDir.isEmpty() )
{
aSuggestedDir = aModelData.GetMediaDescr().getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SuggestedSaveAsDir" ) ), ::rtl::OUString() );
- if ( !aSuggestedDir.getLength() )
+ if ( aSuggestedDir.isEmpty() )
aSuggestedDir = aModelData.GetDocProps().getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SuggestedSaveAsDir" ) ), ::rtl::OUString() );
}
aSuggestedName = aModelData.GetMediaDescr().getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SuggestedSaveAsName" ) ), ::rtl::OUString() );
- if ( !aSuggestedName.getLength() )
+ if ( aSuggestedName.isEmpty() )
aSuggestedName = aModelData.GetDocProps().getUnpackedValueOrDefault( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SuggestedSaveAsName" ) ), ::rtl::OUString() );
::rtl::OUString sStandardDir;
@@ -1561,7 +1561,7 @@ sal_Bool SfxStoringHelper::GUIStoreModel( const uno::Reference< frame::XModel >&
else
aModelData.GetMediaDescr()[aFilterNameString] <<= aFilterName;
- DBG_ASSERT( aFilterName.getLength(), "Illegal filter!" );
+ DBG_ASSERT( !aFilterName.isEmpty(), "Illegal filter!" );
}
else
{
@@ -1670,7 +1670,7 @@ sal_Bool SfxStoringHelper::CheckFilterOptionsAppearence(
::rtl::OUString aServiceName = aPropsHM.getUnpackedValueOrDefault(
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("UIComponent")),
::rtl::OUString() );
- if( aServiceName.getLength() )
+ if( !aServiceName.isEmpty() )
bUseFilterOptions = sal_True;
}
}
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index 38073547f2b3..10347382802c 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -868,7 +868,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
::rtl::OUString aTemplURL( xDocProps->getTemplateURL() );
String aFoundName;
- if ( aTemplName.getLength() || (aTemplURL.getLength() && !IsReadOnly()) )
+ if ( !aTemplName.isEmpty() || (!aTemplURL.isEmpty() && !IsReadOnly()) )
{
// try to locate template, first using filename this must be done
// because writer global document uses this "great" idea to manage
@@ -876,14 +876,14 @@ void SfxObjectShell::UpdateFromTemplate_Impl( )
// an error if the template filename points not to a valid file
SfxDocumentTemplates aTempl;
aTempl.Construct();
- if ( aTemplURL.getLength() )
+ if ( !aTemplURL.isEmpty() )
{
String aURL;
if( ::utl::LocalFileHelper::ConvertSystemPathToURL( aTemplURL, GetMedium()->GetName(), aURL ) )
aFoundName = aURL;
}
- if( !aFoundName.Len() && aTemplName.getLength() )
+ if( !aFoundName.Len() && !aTemplName.isEmpty() )
// if the template filename did not lead to success,
// try to get a file name for the logical template name
aTempl.GetFull( String(), aTemplName, aFoundName );
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index cb655855c613..8c64f35d28ca 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -224,7 +224,7 @@ void SfxObjectShell::FlushDocInfo()
::rtl::OUString url(xDocProps->getAutoloadURL());
sal_Int32 delay(xDocProps->getAutoloadSecs());
SetAutoLoad( INetURLObject(url), delay * 1000,
- (delay > 0) || url.getLength() );
+ (delay > 0) || !url.isEmpty() );
}
//-------------------------------------------------------------------------
@@ -235,7 +235,7 @@ void SfxObjectShell::SetError( sal_uInt32 lErr, const ::rtl::OUString& aLogMessa
{
pImp->lErr=lErr;
- if( lErr != ERRCODE_NONE && aLogMessage.getLength() )
+ if( lErr != ERRCODE_NONE && !aLogMessage.isEmpty() )
AddLog( aLogMessage );
}
}
@@ -509,7 +509,7 @@ sal_Bool SfxObjectShell::SwitchToShared( sal_Bool bShared, sal_Bool bSave )
{
::rtl::OUString aOrigURL = GetMedium()->GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
- if ( !aOrigURL.getLength() && bSave )
+ if ( aOrigURL.isEmpty() && bSave )
{
// this is a new document, let it be stored before switching to the shared mode;
// the storing should be done without shared flag, since it is possible that the
@@ -627,7 +627,7 @@ void SfxObjectShell::FreeSharedFile( const ::rtl::OUString& aTempFileURL )
{
SetSharedXMLFlag( sal_False );
- if ( IsDocShared() && aTempFileURL.getLength()
+ if ( IsDocShared() && !aTempFileURL.isEmpty()
&& !::utl::UCBContentHelper::EqualURLs( aTempFileURL, GetSharedFileURL() ) )
{
if ( pImp->m_bAllowShareControlFileClean )
@@ -674,7 +674,7 @@ sal_Bool SfxObjectShell::HasSharedXMLFlagSet() const
sal_Bool SfxObjectShell::IsDocShared() const
{
- return ( pImp->m_aSharedFileURL.getLength() > 0 );
+ return ( !pImp->m_aSharedFileURL.isEmpty() );
}
//--------------------------------------------------------------------
@@ -1271,7 +1271,7 @@ void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags )
::rtl::OUString url(xDocProps->getAutoloadURL());
sal_Int32 delay(xDocProps->getAutoloadSecs());
SetAutoLoad( INetURLObject(url), delay * 1000,
- (delay > 0) || url.getLength() );
+ (delay > 0) || !url.isEmpty() );
if( !bSetModifiedTRUE && IsEnableSetModified() )
SetModified( sal_False );
Invalidate( SID_SAVEASDOC );
@@ -1978,7 +1978,7 @@ sal_Bool SfxObjectShell_Impl::setCurrentMacroExecMode( sal_uInt16 nMacroMode )
if ( pMedium )
{
sLocation = pMedium->GetName();
- if ( !sLocation.getLength() )
+ if ( sLocation.isEmpty() )
{
// for documents made from a template: get the name of the template
sLocation = rDocShell.getDocProperties()->getTemplateURL();
@@ -2165,7 +2165,7 @@ void SfxObjectShell::StoreLog()
::rtl::Bootstrap::expandMacros( aBuildID );
- if ( aFileURL.getLength() )
+ if ( !aFileURL.isEmpty() )
{
aFileURL += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/user/temp/document_io_logring.txt" ) );
try
@@ -2177,7 +2177,7 @@ void SfxObjectShell::StoreLog()
uno::Reference< io::XTruncate > xTruncate( xOutStream, uno::UNO_QUERY_THROW );
xTruncate->truncate();
- if ( aBuildID.getLength() )
+ if ( !aBuildID.isEmpty() )
WriteStringInStream( xOutStream, aBuildID );
uno::Sequence< ::rtl::OUString > aLogSeq = pImp->m_xLogRing->getCollectedLog();
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 20f56e3258b1..74bf26724936 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -282,8 +282,8 @@ sal_Bool SfxObjectShell::PutURLContentsToVersionStream_Impl(
{
::rtl::OUString aTempURL = ::utl::TempFile().GetURL();
- DBG_ASSERT( aTempURL.getLength(), "Can't create a temporary file!\n" );
- if ( aTempURL.getLength() )
+ DBG_ASSERT( !aTempURL.isEmpty(), "Can't create a temporary file!\n" );
+ if ( !aTempURL.isEmpty() )
{
try
{
@@ -337,7 +337,7 @@ void SfxObjectShell::SetupStorage( const uno::Reference< embed::XStorage >& xSto
// is an SfxObjectShell and so we can't take this as an error
datatransfer::DataFlavor aDataFlavor;
SotExchange::GetFormatDataFlavor( nClipFormat, aDataFlavor );
- if ( aDataFlavor.MimeType.getLength() )
+ if ( !aDataFlavor.MimeType.isEmpty() )
{
try
{
@@ -424,7 +424,7 @@ sal_Bool SfxObjectShell::GeneralInit_Impl( const uno::Reference< embed::XStorage
uno::Reference < beans::XPropertySet > xPropSet( xStorage, uno::UNO_QUERY_THROW );
Any a = xPropSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ) );
::rtl::OUString aMediaType;
- if ( !(a>>=aMediaType) || !aMediaType.getLength() )
+ if ( !(a>>=aMediaType) || aMediaType.isEmpty() )
{
if ( bTypeMustBeSetAlready )
{
@@ -868,7 +868,7 @@ sal_uInt32 SfxObjectShell::HandleFilter( SfxMedium* pMedium, SfxObjectShell* pDo
{
::rtl::OUString aServiceName;
aProps[nProperty].Value >>= aServiceName;
- if( aServiceName.getLength() )
+ if( !aServiceName.isEmpty() )
{
com::sun::star::uno::Reference< XInteractionHandler > rHandler = pMedium->GetInteractionHandler();
if( rHandler.is() )
@@ -1148,7 +1148,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
bNoPreserveForOasis = (
(aODFVersion.equals( ODFVER_012_TEXT ) && nVersion == SvtSaveOptions::ODFVER_011) ||
- (!aODFVersion.getLength() && nVersion >= SvtSaveOptions::ODFVER_012)
+ (aODFVersion.isEmpty() && nVersion >= SvtSaveOptions::ODFVER_012)
);
}
}
@@ -1407,7 +1407,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
{
AddLog( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "pVersionItem != NULL" ) ) );
aTmpVersionURL = CreateTempCopyOfStorage_Impl( xMedStorage );
- bOk = ( aTmpVersionURL.getLength() > 0 );
+ bOk = !aTmpVersionURL.isEmpty();
}
}
}
@@ -1510,7 +1510,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
}
}
- if ( aTmpVersionURL.getLength() )
+ if ( !aTmpVersionURL.isEmpty() )
::utl::UCBContentHelper::Kill( aTmpVersionURL );
}
else
@@ -1572,7 +1572,7 @@ sal_Bool SfxObjectShell::SaveTo_Impl
::rtl::OUString aScriptSignName = xDDSigns->getScriptingContentSignatureDefaultStreamName();
- if ( aScriptSignName.getLength() )
+ if ( !aScriptSignName.isEmpty() )
{
pMedium->Close();
@@ -1747,7 +1747,7 @@ sal_Bool SfxObjectShell::DisconnectStorage_Impl( SfxMedium& rSrcMedium, SfxMediu
{
uno::Reference< embed::XOptimizedStorage > xOptStorage( xStorage, uno::UNO_QUERY_THROW );
::rtl::OUString aBackupURL = rTargetMedium.GetBackup_Impl();
- if ( !aBackupURL.getLength() )
+ if ( aBackupURL.isEmpty() )
{
// the backup could not be created, try to disconnect the storage and close the source SfxMedium
// in this case the optimization is not possible, connect storage to a temporary file
@@ -1881,7 +1881,7 @@ sal_Bool SfxObjectShell::DoSaveObjectAs( SfxMedium& rMedium, sal_Bool bCommit )
{
Any a = xPropSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ) );
::rtl::OUString aMediaType;
- if ( !(a>>=aMediaType) || !aMediaType.getLength() )
+ if ( !(a>>=aMediaType) || aMediaType.isEmpty() )
{
OSL_FAIL( "The mediatype must be set already!\n" );
SetupStorage( xNewStor, SOFFICE_FILEFORMAT_CURRENT, sal_False );
@@ -2176,7 +2176,7 @@ sal_Bool SfxObjectShell::ImportFrom( SfxMedium& rMedium, bool bInsert )
}
uno::Reference< document::XFilter > xLoader;
- if ( aFilterImplName.getLength() )
+ if ( !aFilterImplName.isEmpty() )
{
try{
xLoader = uno::Reference< document::XFilter >
@@ -2271,7 +2271,7 @@ sal_Bool SfxObjectShell::ExportTo( SfxMedium& rMedium )
}
}
- if ( aFilterImplName.getLength() )
+ if ( !aFilterImplName.isEmpty() )
{
try{
xExporter = uno::Reference< document::XExporter >
@@ -2642,7 +2642,7 @@ sal_Bool SfxObjectShell::CommonSaveAs_Impl
if ( pFilterOptItem )
pSet->Put( *pFilterOptItem );
- if ( IsDocShared() && aTempFileURL.getLength() )
+ if ( IsDocShared() && !aTempFileURL.isEmpty() )
{
// this is a shared document that has to be disconnected from the old location
FreeSharedFile( aTempFileURL );
@@ -2826,7 +2826,7 @@ sal_Bool SfxObjectShell::IsInformationLost()
// if current filter can lead to information loss and it was used
// for the latest store then the user should be asked to store in own format
- if ( aFilterName.getLength() && aFilterName.equals( aPreusedFilterName ) )
+ if ( !aFilterName.isEmpty() && aFilterName.equals( aPreusedFilterName ) )
{
const SfxFilter *pFilt = GetMedium()->GetFilter();
DBG_ASSERT( pFilt && aFilterName.equals( pFilt->GetName() ), "MediaDescriptor contains wrong filter!\n" );
@@ -3249,7 +3249,7 @@ sal_Bool StoragesOfUnknownMediaTypeAreCopied_Impl( const uno::Reference< embed::
// TODO/LATER: there should be a way to detect whether an object with such a MediaType can exist
// probably it should be placed in the MimeType-ClassID table or in standalone table
- if ( aMediaType.getLength()
+ if ( !aMediaType.isEmpty()
&& aMediaType.compareToAscii( "application/vnd.sun.star.oleobject" ) != COMPARE_EQUAL )
{
::com::sun::star::datatransfer::DataFlavor aDataFlavor;
@@ -3391,7 +3391,7 @@ sal_Bool SfxObjectShell::CopyStoragesOfUnknownMediaType( const uno::Reference< e
// TODO/LATER: there should be a way to detect whether an object with such a MediaType can exist
// probably it should be placed in the MimeType-ClassID table or in standalone table
- if ( aMediaType.getLength()
+ if ( !aMediaType.isEmpty()
&& aMediaType.compareToAscii( "application/vnd.sun.star.oleobject" ) != COMPARE_EQUAL )
{
::com::sun::star::datatransfer::DataFlavor aDataFlavor;
diff --git a/sfx2/source/doc/objuno.cxx b/sfx2/source/doc/objuno.cxx
index 185fbc4b3b32..76413d3d0b6c 100644
--- a/sfx2/source/doc/objuno.cxx
+++ b/sfx2/source/doc/objuno.cxx
@@ -1007,7 +1007,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().getLength());
+ || !_pImp->m_xDocProps->getAutoloadURL().isEmpty());
break;
case MID_DOCINFO_AUTOLOADURL:
aValue <<= _pImp->m_xDocProps->getAutoloadURL();
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 01087cd39a53..89d42be7327e 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -942,7 +942,7 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp
if ( _rxComponent.is() )
{
::rtl::OString aVBAConstName = lclGetVBAGlobalConstName( _rxComponent );
- if ( aVBAConstName.getLength() > 0 )
+ if ( !aVBAConstName.isEmpty() )
{
pAppMgr->SetGlobalUNOConstant( aVBAConstName.getStr(), Any( _rxComponent ) );
s_aRegisteredVBAConstants[ _rxComponent.get() ] = aVBAConstName;
@@ -952,7 +952,7 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp
else if ( xOldCurrentComp.is() )
{
::rtl::OString aVBAConstName = lclGetVBAGlobalConstName( xOldCurrentComp );
- if ( aVBAConstName.getLength() > 0 )
+ if ( !aVBAConstName.isEmpty() )
{
pAppMgr->SetGlobalUNOConstant( aVBAConstName.getStr(), Any( Reference< XInterface >() ) );
s_aRegisteredVBAConstants.erase( xOldCurrentComp.get() );
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index a8a73111d12d..4fb211f21ff3 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -306,8 +306,8 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
return 0;
}
uri = xContent->getIdentifier()->getContentIdentifier();
- OSL_ENSURE(uri.getLength(), "GetDMA: empty uri?");
- if (uri.getLength() && !uri.endsWithAsciiL("/", 1))
+ OSL_ENSURE(!uri.isEmpty(), "GetDMA: empty uri?");
+ if (!uri.isEmpty() && !uri.endsWithAsciiL("/", 1))
{
uri = uri + ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/"));
}
@@ -959,7 +959,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.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("SetEmbedded")) )
+ if ( rURL.isEmpty() && 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
@@ -1088,7 +1088,7 @@ uno::Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() throw(::c
seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("WinExtent"));
seqArgsNew[ nNewLength - 1 ].Value <<= aRectSeq;
- if ( m_pData->m_aPreusedFilterName.getLength() )
+ if ( !m_pData->m_aPreusedFilterName.isEmpty() )
{
seqArgsNew.realloc( ++nNewLength );
seqArgsNew[ nNewLength - 1 ].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreusedFilterName"));
@@ -2704,11 +2704,11 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
const uno::Sequence< beans::PropertyValue >& seqArguments ,
sal_Bool bSaveTo )
{
- if( !sURL.getLength() )
+ if( sURL.isEmpty() )
throw frame::IllegalArgumentIOException();
sal_Bool bSaved = sal_False;
- if ( !bSaveTo && m_pData->m_pObjectShell && sURL.getLength()
+ if ( !bSaveTo && m_pData->m_pObjectShell && !sURL.isEmpty()
&& sURL.compareToAscii( "private:stream", 14 ) != COMPARE_EQUAL
&& ::utl::UCBContentHelper::EqualURLs( getLocation(), sURL ) )
{
@@ -2717,7 +2717,7 @@ void SfxBaseModel::impl_store( const ::rtl::OUString& sURL
::comphelper::SequenceAsHashMap aArgHash( seqArguments );
::rtl::OUString aFilterString( RTL_CONSTASCII_USTRINGPARAM( "FilterName" ) );
::rtl::OUString aFilterName = aArgHash.getUnpackedValueOrDefault( aFilterString, ::rtl::OUString() );
- if ( aFilterName.getLength() )
+ if ( !aFilterName.isEmpty() )
{
SfxMedium* pMedium = m_pData->m_pObjectShell->GetMedium();
if ( pMedium )
@@ -2950,8 +2950,8 @@ void SfxBaseModel::postEvent_Impl( const ::rtl::OUString& aName, const uno::Refe
if ( impl_isDisposed() )
return;
- DBG_ASSERT( aName.getLength(), "Empty event name!" );
- if (!aName.getLength())
+ DBG_ASSERT( !aName.isEmpty(), "Empty event name!" );
+ if (aName.isEmpty())
return;
::cppu::OInterfaceContainerHelper* pIC =
@@ -3240,7 +3240,7 @@ uno::Reference< script::provider::XScriptProvider > SAL_CALL SfxBaseModel::getSc
rtl::OUString SfxBaseModel::getRuntimeUID() const
{
- OSL_ENSURE( m_pData->m_sRuntimeUID.getLength() > 0,
+ OSL_ENSURE( !m_pData->m_sRuntimeUID.isEmpty(),
"SfxBaseModel::getRuntimeUID - ID is empty!" );
return m_pData->m_sRuntimeUID;
}
@@ -3336,7 +3336,7 @@ uno::Reference< ui::XUIConfigurationManager > SAL_CALL SfxBaseModel::getUIConfig
rtl::OUString aMediaType;
uno::Reference< beans::XPropertySet > xPropSet( xConfigStorage, uno::UNO_QUERY );
Any a = xPropSet->getPropertyValue( aMediaTypeProp );
- if ( !( a >>= aMediaType ) || ( aMediaType.getLength() == 0 ))
+ if ( !( a >>= aMediaType ) || aMediaType.isEmpty())
{
a <<= aUIConfigMediaType;
xPropSet->setPropertyValue( aMediaTypeProp, a );
@@ -3703,7 +3703,7 @@ bool SfxBaseModel::impl_getPrintHelper()
throw (css::uno::RuntimeException)
{
SfxModelGuard aGuard( *this );
- if (m_pData->m_sModuleIdentifier.getLength() > 0)
+ if (!m_pData->m_sModuleIdentifier.isEmpty())
return m_pData->m_sModuleIdentifier;
if (m_pData->m_pObjectShell)
return m_pData->m_pObjectShell->GetFactory().GetDocumentServiceName();