diff options
author | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-01-10 17:54:51 -0200 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@alta.org.br> | 2012-01-10 23:39:13 -0200 |
commit | e24a27b4cc920cbb1b87c33f99b7379f50d2e0f7 (patch) | |
tree | ab6af7397220ee41793b7edef303075daf853bc6 | |
parent | f19d269ab4286b2e2e9f579bc4705daf4f6756ab (diff) |
Fix for fdo43460 Part XXXIII getLength() to isEmpty()
Part XXXIII
Modules
sfx2
56 files changed, 371 insertions, 371 deletions
diff --git a/sfx2/qa/cppunit/test_metadatable.cxx b/sfx2/qa/cppunit/test_metadatable.cxx index eb239f7743f0..8a6db03b99c2 100644 --- a/sfx2/qa/cppunit/test_metadatable.cxx +++ b/sfx2/qa/cppunit/test_metadatable.cxx @@ -144,14 +144,14 @@ void MetadatableTest::test() m2.EnsureMetadataReference(); beans::StringPair m2id(m2.GetMetadataReference()); - CPPUNIT_ASSERT_MESSAGE("ensure failed", m2id.Second.getLength()); + CPPUNIT_ASSERT_MESSAGE("ensure failed", !m2id.Second.isEmpty()); m2.EnsureMetadataReference(); CPPUNIT_ASSERT_MESSAGE("ensure failed (idempotent)", m2.GetMetadataReference() == m2id); m1.m_bInUndo = true; CPPUNIT_ASSERT_MESSAGE("move to undo failed", - !m1.GetMetadataReference().Second.getLength()); + m1.GetMetadataReference().Second.isEmpty()); m1.m_bInUndo = false; CPPUNIT_ASSERT_MESSAGE("move from undo failed", @@ -165,33 +165,33 @@ void MetadatableTest::test() } m1.m_bInUndo = false; CPPUNIT_ASSERT_MESSAGE("move from undo: duplicate", - !m1.GetMetadataReference().Second.getLength()); + m1.GetMetadataReference().Second.isEmpty()); m3.RegisterAsCopyOf(m2); CPPUNIT_ASSERT_MESSAGE("copy: source", m2.GetMetadataReference() == id1); CPPUNIT_ASSERT_MESSAGE("copy: duplicate", - !m3.GetMetadataReference().Second.getLength()); + m3.GetMetadataReference().Second.isEmpty()); m4.RegisterAsCopyOf(m3); CPPUNIT_ASSERT_MESSAGE("copy: source", m2.GetMetadataReference() == id1); CPPUNIT_ASSERT_MESSAGE("copy: duplicate", - !m3.GetMetadataReference().Second.getLength()); + m3.GetMetadataReference().Second.isEmpty()); CPPUNIT_ASSERT_MESSAGE("copy: duplicate", - !m4.GetMetadataReference().Second.getLength()); + m4.GetMetadataReference().Second.isEmpty()); m2.m_bInUndo = true; CPPUNIT_ASSERT_MESSAGE("duplicate to undo", m3.GetMetadataReference() == id1); CPPUNIT_ASSERT_MESSAGE("duplicate to undo", - !m2.GetMetadataReference().Second.getLength()); + m2.GetMetadataReference().Second.isEmpty()); m2.m_bInUndo = false; CPPUNIT_ASSERT_MESSAGE("duplicate from undo", m2.GetMetadataReference() == id1); CPPUNIT_ASSERT_MESSAGE("duplicate from undo", - !m3.GetMetadataReference().Second.getLength()); + m3.GetMetadataReference().Second.isEmpty()); m4.EnsureMetadataReference(); // new! beans::StringPair m4id(m4.GetMetadataReference()); CPPUNIT_ASSERT_MESSAGE("ensure on duplicate", - m4id.Second.getLength() && !(m4id == id1)); + !m4id.Second.isEmpty() && !(m4id == id1)); MockMetadatable mc1(*pRegClip, true); // in clipboard MockMetadatable mc2(*pRegClip, true); @@ -214,52 +214,52 @@ void MetadatableTest::test() mc1.GetMetadataReference() == id2); mc2.EnsureMetadataReference(); beans::StringPair mc2id(mc2.GetMetadataReference()); - CPPUNIT_ASSERT_MESSAGE("ensure failed", mc2id.Second.getLength()); + CPPUNIT_ASSERT_MESSAGE("ensure failed", !mc2id.Second.isEmpty()); mc2.EnsureMetadataReference(); CPPUNIT_ASSERT_MESSAGE("ensure failed (idempotent)", mc2.GetMetadataReference() == mc2id); mc2.RemoveMetadataReference(); CPPUNIT_ASSERT_MESSAGE("remove failed", - !mc2.GetMetadataReference().Second.getLength()); + mc2.GetMetadataReference().Second.isEmpty()); // set up mc2 as copy of m2 and mc3 as copy of m3 mc3.RegisterAsCopyOf(m3); CPPUNIT_ASSERT_MESSAGE("copy to clipboard (latent)", - !mc3.GetMetadataReference().Second.getLength() ); + mc3.GetMetadataReference().Second.isEmpty() ); mc2.RegisterAsCopyOf(m2); CPPUNIT_ASSERT_MESSAGE("copy to clipboard (non-latent)", mc2.GetMetadataReference() == id1); // paste mc2 to m2p and mc3 to m3p m2p.RegisterAsCopyOf(mc2); CPPUNIT_ASSERT_MESSAGE("paste from clipboard (non-latent)", - !m2p.GetMetadataReference().Second.getLength() ); + m2p.GetMetadataReference().Second.isEmpty() ); m3p.RegisterAsCopyOf(mc3); CPPUNIT_ASSERT_MESSAGE("paste from clipboard (latent)", - !m3p.GetMetadataReference().Second.getLength() ); + m3p.GetMetadataReference().Second.isEmpty() ); // delete m2, m2p, m3 m2.RemoveMetadataReference(); CPPUNIT_ASSERT_MESSAGE("remove failed", - !m2.GetMetadataReference().Second.getLength()); + m2.GetMetadataReference().Second.isEmpty()); CPPUNIT_ASSERT_MESSAGE("paste-remove (non-latent)", m2p.GetMetadataReference() == id1); m2p.RemoveMetadataReference(); CPPUNIT_ASSERT_MESSAGE("remove failed", - !m2p.GetMetadataReference().Second.getLength()); + m2p.GetMetadataReference().Second.isEmpty()); CPPUNIT_ASSERT_MESSAGE("paste-remove2 (non-latent)", m3.GetMetadataReference() == id1); m3.RemoveMetadataReference(); CPPUNIT_ASSERT_MESSAGE("remove failed", - !m3.GetMetadataReference().Second.getLength()); + m3.GetMetadataReference().Second.isEmpty()); CPPUNIT_ASSERT_MESSAGE("paste-remove (latent)", m3p.GetMetadataReference() == id1); // delete mc2 mc2.SetMetadataReference(beans::StringPair()); CPPUNIT_ASSERT_MESSAGE("in clipboard becomes non-latent", - !mc3.GetMetadataReference().Second.getLength() ); + mc3.GetMetadataReference().Second.isEmpty() ); // paste mc2 m2p.RegisterAsCopyOf(mc2); CPPUNIT_ASSERT_MESSAGE("remove-paste", - !m2p.GetMetadataReference().Second.getLength()); + m2p.GetMetadataReference().Second.isEmpty()); CPPUNIT_ASSERT_MESSAGE("remove-paste (stolen)", m3p.GetMetadataReference() == id1); diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 3ac312273f34..9fe9a833d6d6 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -153,7 +153,7 @@ static sal_Bool checkURL( const char *pName, const char *pExt, rtl::OUString &rU rURL += rtl::OUString::createFromAscii( pExt ); rtl::Bootstrap::expandMacros( rURL ); - if (rURL.getLength() != 0) + if (!rURL.isEmpty()) return DirectoryItem::get( rURL, aDirItem ) == DirectoryItem::E_None; else return sal_False; @@ -940,7 +940,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq ) ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("RepositoryURL")), ::rtl::OUString()); - if ( xSystemShell.is() && sTemplRepoURL.getLength() > 0 ) + if ( xSystemShell.is() && !sTemplRepoURL.isEmpty() ) { ::rtl::OUStringBuffer aURLBuf( sTemplRepoURL ); aURLBuf.appendAscii(RTL_CONSTASCII_STRINGPARAM("?lang=")); diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx index b9ae282e3b20..c807c8ae03a0 100644 --- a/sfx2/source/appl/appuno.cxx +++ b/sfx2/source/appl/appuno.cxx @@ -686,7 +686,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sStandardDir)) ) { ::rtl::OUString sVal; - sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty()); DBG_ASSERT( bOK, "invalid type or value for StandardDir" ); if (bOK) rSet.Put( SfxStringItem( SID_STANDARD_DIR, sVal ) ); @@ -706,7 +706,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFileName)) ) { ::rtl::OUString sVal; - sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty()); DBG_ASSERT( bOK, "invalid type or value for FileName" ); if (bOK) rSet.Put( SfxStringItem( SID_FILE_NAME, sVal ) ); @@ -732,13 +732,13 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque ::rtl::OUString sVal; sal_Bool bOK = (rProp.Value >>= sVal); DBG_ASSERT( bOK, "invalid type for FrameName" ); - if (bOK && sVal.getLength()) + if (bOK && !sVal.isEmpty()) rSet.Put( SfxStringItem( SID_TARGETNAME, sVal ) ); } else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sMediaType)) ) { ::rtl::OUString sVal; - sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty()); DBG_ASSERT( bOK, "invalid type or value for MediaType" ); if (bOK) rSet.Put( SfxStringItem( SID_CONTENTTYPE, sVal ) ); @@ -746,7 +746,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sTemplateName)) ) { ::rtl::OUString sVal; - sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty()); DBG_ASSERT( bOK, "invalid type or value for TemplateName" ); if (bOK) rSet.Put( SfxStringItem( SID_TEMPLATE_NAME, sVal ) ); @@ -754,7 +754,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sTemplateRegionName)) ) { ::rtl::OUString sVal; - sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty()); DBG_ASSERT( bOK, "invalid type or value for TemplateRegionName" ); if (bOK) rSet.Put( SfxStringItem( SID_TEMPLATE_REGIONNAME, sVal ) ); @@ -762,7 +762,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sJumpMark)) ) { ::rtl::OUString sVal; - sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty()); DBG_ASSERT( bOK, "invalid type or value for JumpMark" ); if (bOK) rSet.Put( SfxStringItem( SID_JUMPMARK, sVal ) ); @@ -770,7 +770,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sCharacterSet)) ) { ::rtl::OUString sVal; - sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty()); DBG_ASSERT( bOK, "invalid type or value for CharacterSet" ); if (bOK) rSet.Put( SfxStringItem( SID_CHARSET, sVal ) ); @@ -778,7 +778,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sFilterFlags)) ) { ::rtl::OUString sVal; - sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty()); DBG_ASSERT( bOK, "invalid type or value for FilterFlags" ); if (bOK) rSet.Put( SfxStringItem( SID_FILE_FILTEROPTIONS, sVal ) ); @@ -810,7 +810,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sDocumentTitle)) ) { ::rtl::OUString sVal; - sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty()); DBG_ASSERT( bOK, "invalid type or value for DocumentTitle" ); if (bOK) rSet.Put( SfxStringItem( SID_DOCINFO_TITLE, sVal ) ); @@ -827,7 +827,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sHierarchicalDocumentName)) ) { ::rtl::OUString sVal; - sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty()); DBG_ASSERT( bOK, "invalid type or value for HierarchicalDocumentName" ); if (bOK) rSet.Put( SfxStringItem( SID_DOC_HIERARCHICALNAME, sVal ) ); @@ -859,7 +859,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSuggestedSaveAsDir)) ) { ::rtl::OUString sVal; - sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty()); DBG_ASSERT( bOK, "invalid type or value for SuggestedSaveAsDir" ); if (bOK) rSet.Put( SfxStringItem( SID_SUGGESTEDSAVEASDIR, sVal ) ); @@ -867,7 +867,7 @@ void TransformParameters( sal_uInt16 nSlotId, const ::com::sun::star::uno::Seque else if ( aName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sSuggestedSaveAsName)) ) { ::rtl::OUString sVal; - sal_Bool bOK = ((rProp.Value >>= sVal) && sVal.getLength()); + sal_Bool bOK = ((rProp.Value >>= sVal) && !sVal.isEmpty()); DBG_ASSERT( bOK, "invalid type or value for SuggestedSaveAsName" ); if (bOK) rSet.Put( SfxStringItem( SID_SUGGESTEDSAVEASNAME, sVal ) ); diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index 7cddda525b5b..deb135a4f2e0 100644 --- a/sfx2/source/appl/fileobj.cxx +++ b/sfx2/source/appl/fileobj.cxx @@ -411,7 +411,7 @@ String impl_getFilter( const String& _rURL ) css::uno::Sequence< css::beans::PropertyValue > aDescrList = aDescr.getAsConstPropertyValueList(); ::rtl::OUString sType = xTypeDetection->queryTypeByDescriptor( aDescrList, sal_True ); - if ( sType.getLength() ) + if ( !sType.isEmpty() ) { css::uno::Reference< css::container::XNameAccess > xTypeCont( xTypeDetection, css::uno::UNO_QUERY ); diff --git a/sfx2/source/appl/helpdispatch.cxx b/sfx2/source/appl/helpdispatch.cxx index b21e5f11b1b2..dad5423334a6 100644 --- a/sfx2/source/appl/helpdispatch.cxx +++ b/sfx2/source/appl/helpdispatch.cxx @@ -76,7 +76,7 @@ void SAL_CALL HelpDispatch_Impl::dispatch( if ( 0 == ( *pBegin ).Name.compareToAscii( "HelpKeyword" ) ) { rtl::OUString sHelpKeyword; - if ( ( ( *pBegin ).Value >>= sHelpKeyword ) && sHelpKeyword.getLength() > 0 ) + if ( ( ( *pBegin ).Value >>= sHelpKeyword ) && !sHelpKeyword.isEmpty() ) { sKeyword = String( sHelpKeyword ); bHasKeyword = ( sKeyword.Len() > 0 ); diff --git a/sfx2/source/appl/imagemgr.cxx b/sfx2/source/appl/imagemgr.cxx index 2b9109932b4f..cf62e9e7770c 100644 --- a/sfx2/source/appl/imagemgr.cxx +++ b/sfx2/source/appl/imagemgr.cxx @@ -167,7 +167,7 @@ Image SAL_CALL GetImage( try { - if ( aCommandURL.getLength() > 0 ) + if ( !aCommandURL.isEmpty() ) { Reference< XImageManager > xModuleImageManager; rtl::OUString aModuleId = xModuleManager->identify( rFrame ); diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 6b09c100bea8..53253d109fff 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -677,7 +677,7 @@ void IndexTabPage_Impl::InitializeIndex() { // abi: Do not copy, but use references const ::rtl::OUString& aKeywordPair = aKeywordList[i]; - DBG_ASSERT( aKeywordPair.getLength() > 0, "invalid help index" ); + DBG_ASSERT( !aKeywordPair.isEmpty(), "invalid help index" ); const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aRefList = aKeywordRefList[i]; const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aAnchorList = aAnchorRefList[i]; const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aTitleList = aTitleRefList[i]; @@ -1491,7 +1491,7 @@ void BookmarksTabPage_Impl::AddBookmarks( const String& rTitle, const String& rU sHelpURL.append(sContent); String sURL = String(sHelpURL.makeStringAndClear()); AppendConfigToken(sURL, bUseQuestionMark); - if (sAnchor.getLength()) + if (!sAnchor.isEmpty()) sURL += String(sAnchor); return ::rtl::OUString(sURL); } diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index 6093d8025379..32a542df815a 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -125,7 +125,7 @@ static rtl::OUString HelpLocaleString() const rtl::OUString aEnglish( RTL_CONSTASCII_USTRINGPARAM( "en" ) ); // detect installed locale aLocaleStr = utl::ConfigManager::getLocale(); - bool bOk = aLocaleStr.getLength() != 0; + bool bOk = !aLocaleStr.isEmpty(); if ( !bOk ) aLocaleStr = aEnglish; else @@ -165,7 +165,7 @@ static rtl::OUString HelpLocaleString() void AppendConfigToken( String& rURL, sal_Bool bQuestionMark, const rtl::OUString &rLang ) { ::rtl::OUString aLocaleStr( rLang ); - if ( !aLocaleStr.getLength() ) + if ( aLocaleStr.isEmpty() ) aLocaleStr = HelpLocaleString(); // query part exists? @@ -197,7 +197,7 @@ sal_Bool GetHelpAnchor_Impl( const String& _rURL, String& _rAnchor ) if ( ( aCnt.getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AnchorName")) ) >>= sAnchor ) ) { - if ( sAnchor.getLength() > 0 ) + if ( !sAnchor.isEmpty() ) { _rAnchor = String( sAnchor ); bRet = sal_True; @@ -276,7 +276,7 @@ SfxHelpOptions_Impl::SfxHelpOptions_Impl() do { rtl::OString aToken = aTmp.getToken( 0, ',', nIndex ); - if ( aToken.getLength() ) + if ( !aToken.isEmpty() ) m_aIds.insert( aToken ); } while ( nIndex >= 0 ); @@ -368,7 +368,7 @@ SfxHelp::SfxHelp() : ::rtl::OUString sHelpDebug; ::rtl::OUString sEnvVarName( RTL_CONSTASCII_USTRINGPARAM( "HELP_DEBUG" ) ); osl_getEnvironment( sEnvVarName.pData, &sHelpDebug.pData ); - bIsDebug = ( 0 != sHelpDebug.getLength() ); + bIsDebug = !sHelpDebug.isEmpty(); } pImp = new SfxHelp_Impl( bIsDebug ); @@ -464,7 +464,7 @@ String SfxHelp::GetHelpModuleName_Impl() rtl::OUString aFactoryShortName; rtl::OUString aModuleIdentifier = getCurrentModuleIdentifier_Impl(); - if ( aModuleIdentifier.getLength() > 0 ) + if ( !aModuleIdentifier.isEmpty() ) { try { @@ -491,7 +491,7 @@ String SfxHelp::GetHelpModuleName_Impl() } rtl::OUString sDefaultModule = getDefaultModule_Impl(); - if ( aFactoryShortName.getLength() > 0 ) + if ( !aFactoryShortName.isEmpty() ) { // Map some module identifiers to their "real" help module string. if ( aFactoryShortName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("chart2")) ) @@ -645,7 +645,7 @@ XubString SfxHelp::GetHelpText( const String& aCommandURL, const Window* pWindow sHelpText += String( sModuleName ); sHelpText += DEFINE_CONST_UNICODE(": "); sHelpText += aCommandURL; - if ( aNewHelpId.getLength() ) + if ( !aNewHelpId.isEmpty() ) { sHelpText += DEFINE_CONST_UNICODE(" - "); sHelpText += String(rtl::OStringToOUString(aNewHelpId, RTL_TEXTENCODING_UTF8)); @@ -662,7 +662,7 @@ static bool impl_hasHelpInstalled( const rtl::OUString &rLang = rtl::OUString() AppendConfigToken( aHelpRootURL, sal_True, rLang ); Sequence< ::rtl::OUString > aFactories = SfxContentHelper::GetResultSet( aHelpRootURL ); - return ( aFactories.getLength() != 0 ); + return ( aFactories.getLength() != 0 ); } sal_Bool SfxHelp::SearchKeyword( const XubString& rKeyword ) diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index fd1bddd31e14..141aacdeab27 100644 --- a/sfx2/source/appl/shutdownicon.cxx +++ b/sfx2/source/appl/shutdownicon.cxx @@ -508,7 +508,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR // Retrieve the current filter - if ( !aFilterName.getLength() ) + if ( aFilterName.isEmpty() ) xPickerControls->getValue( CommonFilePickerElementIds::LISTBOX_FILTER, ControlActions::GET_SELECTED_ITEM ) >>= aFilterName; } @@ -516,7 +516,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR // Convert UI filter name to internal filter name - if ( aFilterName.getLength() ) + if ( !aFilterName.isEmpty() ) { const SfxFilter* pFilter = SFX_APP()->GetFilterMatcher().GetFilter4UIName( aFilterName, 0, SFX_FILTER_NOTINFILEDLG ); @@ -524,7 +524,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR { aFilterName = pFilter->GetFilterName(); - if ( aFilterName.getLength() ) + if ( !aFilterName.isEmpty() ) { aArgs.realloc( ++nArgs ); aArgs[nArgs-1].Name = OUString(RTL_CONSTASCII_USTRINGPARAM("FilterName")); @@ -538,7 +538,7 @@ IMPL_STATIC_LINK( ShutdownIcon, DialogClosedHdl_Impl, FileDialogHelper*, EMPTYAR else { OUString aBaseDirURL = sFiles[0]; - if ( aBaseDirURL.getLength() > 0 && aBaseDirURL[aBaseDirURL.getLength()-1] != '/' ) + if ( !aBaseDirURL.isEmpty() && aBaseDirURL[aBaseDirURL.getLength()-1] != '/' ) aBaseDirURL += OUString(RTL_CONSTASCII_USTRINGPARAM("/")); int iFiles; diff --git a/sfx2/source/appl/shutdowniconunx.cxx b/sfx2/source/appl/shutdowniconunx.cxx index a9a147ce9f56..d0b17edc9ec9 100644 --- a/sfx2/source/appl/shutdowniconunx.cxx +++ b/sfx2/source/appl/shutdowniconunx.cxx @@ -192,7 +192,7 @@ static void add_ugly_db_item( GtkMenuShell *pMenuShell, const char *pAsciiURL, aEntry[m].Value >>= aDescription; } - if ( aURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(BASE_URL)) && aDescription.getLength() ) + if ( aURL.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(BASE_URL)) && !aDescription.isEmpty() ) { add_item (pMenuShell, pAsciiURL, &aDescription, nResId, pFnCallback); break; diff --git a/sfx2/source/appl/xpackcreator.cxx b/sfx2/source/appl/xpackcreator.cxx index 3f404fdc725e..44c4ed180959 100644 --- a/sfx2/source/appl/xpackcreator.cxx +++ b/sfx2/source/appl/xpackcreator.cxx @@ -103,7 +103,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const ::rtl::OUString& sal_True ); SotStorageRef aStorage = new SotStorage( pUCBStorage ); - if ( aTempURL.getLength() ) + if ( !aTempURL.isEmpty() ) { pTempStream = new SvFileStream( aTempURL, STREAM_STD_READWRITE ); SotStorageRef aTargetStorage = new SotStorage( sal_True, *pTempStream ); @@ -142,7 +142,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const ::rtl::OUString& if ( pTempStream ) delete pTempStream; - if ( aTempURL.getLength() ) + if ( !aTempURL.isEmpty() ) ::utl::UCBContentHelper::Kill( aTempURL ); throw; @@ -152,7 +152,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const ::rtl::OUString& if ( pTempStream ) delete pTempStream; - if ( aTempURL.getLength() ) + if ( !aTempURL.isEmpty() ) ::utl::UCBContentHelper::Kill( aTempURL ); throw; @@ -164,7 +164,7 @@ void SAL_CALL OPackageStructureCreator::convertToPackage( const ::rtl::OUString& if ( pTempStream ) delete pTempStream; - if ( aTempURL.getLength() ) + if ( !aTempURL.isEmpty() ) ::utl::UCBContentHelper::Kill( aTempURL ); } diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx index 51d3fecdc630..794432fe45b8 100644 --- a/sfx2/source/bastyp/fltfnc.cxx +++ b/sfx2/source/bastyp/fltfnc.cxx @@ -291,7 +291,7 @@ namespace { rtl::OUString aName; - if (rName.getLength()) + if (!rName.isEmpty()) aName = SfxObjectShell::GetServiceNameFromFactory(rName); // find the impl-Data of any comparable FilterMatcher that was created @@ -354,7 +354,7 @@ void SfxFilterMatcher_Impl::InitForIterating() const // global filter array has not been created yet SfxFilterContainer::ReadFilters_Impl(); - if ( aName.getLength() ) + if ( !aName.isEmpty() ) { // matcher of factory: use only filters of that document type ((SfxFilterMatcher_Impl*)this)->pList = new SfxFilterList_Impl; @@ -400,7 +400,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterIgnoringContent( } *ppFilter = NULL; - if ( sTypeName.getLength() ) + if ( !sTypeName.isEmpty() ) { // make sure filter list is initialized m_rImpl.InitForIterating(); @@ -446,7 +446,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c aDescriptor[::comphelper::MediaDescriptor::PROP_INPUTSTREAM() ] <<= xInStream; aDescriptor[::comphelper::MediaDescriptor::PROP_INTERACTIONHANDLER()] <<= rMedium.GetInteractionHandler(); - if ( m_rImpl.aName.getLength() ) + if ( !m_rImpl.aName.isEmpty() ) aDescriptor[::comphelper::MediaDescriptor::PROP_DOCUMENTSERVICE()] <<= m_rImpl.aName; if ( pOldFilter ) @@ -462,7 +462,7 @@ sal_uInt32 SfxFilterMatcher::GuessFilterControlDefaultUI( SfxMedium& rMedium, c else sTypeName = xDetection->queryTypeByURL(sURL); - if (sTypeName.getLength()) + if (!sTypeName.isEmpty()) { // detect filter by given type // In case of this matcher is bound to a particular document type: @@ -613,7 +613,7 @@ const SfxFilter* SfxFilterMatcher::GetFilterForProps( const com::sun::star::uno: ::rtl::OUString aValue; // try to get the preferred filter (works without loading all filters!) - if ( (aProps[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreferredFilter"))] >>= aValue) && aValue.getLength() ) + if ( (aProps[::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("PreferredFilter"))] >>= aValue) && !aValue.isEmpty() ) { const SfxFilter* pFilter = SfxFilter::GetFilterByName( aValue ); if ( !pFilter || (pFilter->GetFilterFlags() & nMust) != nMust || (pFilter->GetFilterFlags() & nDont ) ) @@ -621,7 +621,7 @@ const SfxFilter* SfxFilterMatcher::GetFilterForProps( const com::sun::star::uno: // pFilter == 0: if preferred filter is a Writer filter, but Writer module is not installed continue; - if ( m_rImpl.aName.getLength() ) + if ( !m_rImpl.aName.isEmpty() ) { // if this is not the global FilterMatcher: check if filter matches the document type ::rtl::OUString aService; @@ -893,7 +893,7 @@ const SfxFilter* SfxFilterMatcherIter::Next() sal_Int32 nItem = 0 ; for( nItem=0; nItem<nCount; ++nItem ) { - if( sPrefix.getLength() > 0 ) + if( !sPrefix.isEmpty() ) { sString.append( sPrefix ); } @@ -1027,11 +1027,11 @@ void SfxFilterContainer::ReadSingleFilter_Impl( } } - if ( !sServiceName.getLength() ) + if ( sServiceName.isEmpty() ) return; // old formats are found ... using HumanPresentableName! - if( sHumanName.getLength() ) + if( !sHumanName.isEmpty() ) { nClipboardId = SotExchange::RegisterFormatName( sHumanName ); diff --git a/sfx2/source/bastyp/frmhtmlw.cxx b/sfx2/source/bastyp/frmhtmlw.cxx index 958c5781431b..300eac3aed9c 100644 --- a/sfx2/source/bastyp/frmhtmlw.cxx +++ b/sfx2/source/bastyp/frmhtmlw.cxx @@ -156,7 +156,7 @@ void SfxFrameHTMLWriter::Out_DocInfo( SvStream& rStrm, const String& rBaseURL, { // Reload if( (i_xDocProps->getAutoloadSecs() != 0) || - i_xDocProps->getAutoloadURL().getLength() ) + !i_xDocProps->getAutoloadURL().isEmpty() ) { String sContent = String::CreateFromInt32( i_xDocProps->getAutoloadSecs() ); @@ -268,7 +268,7 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( rtl::OStringBuffer sOut; ::rtl::OUString aStr; uno::Any aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameURL")) ); - if ( (aAny >>= aStr) && aStr.getLength() ) + if ( (aAny >>= aStr) && !aStr.isEmpty() ) { String aURL = INetURLObject( aStr ).GetMainURL( INetURLObject::DECODE_TO_IURI ); if( aURL.Len() ) @@ -284,7 +284,7 @@ void SfxFrameHTMLWriter::Out_FrameDescriptor( } aAny = xSet->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("FrameName")) ); - if ( (aAny >>= aStr) && aStr.getLength() ) + if ( (aAny >>= aStr) && !aStr.isEmpty() ) { sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_name) .append(RTL_CONSTASCII_STRINGPARAM("=\"")); diff --git a/sfx2/source/config/evntconf.cxx b/sfx2/source/config/evntconf.cxx index b839bd89bb9b..a28438310472 100644 --- a/sfx2/source/config/evntconf.cxx +++ b/sfx2/source/config/evntconf.cxx @@ -247,7 +247,7 @@ void PropagateEvent_Impl( SfxObjectShell *pDoc, rtl::OUString aEventName, const if ( xSupplier.is() ) { uno::Reference < container::XNameReplace > xEvents = xSupplier->getEvents(); - if ( aEventName.getLength() ) + if ( !aEventName.isEmpty() ) { uno::Any aEventData = CreateEventData_Impl( pMacro ); diff --git a/sfx2/source/control/sfxstatuslistener.cxx b/sfx2/source/control/sfxstatuslistener.cxx index 59915d27fba6..0fa06828e1ec 100644 --- a/sfx2/source/control/sfxstatuslistener.cxx +++ b/sfx2/source/control/sfxstatuslistener.cxx @@ -115,7 +115,7 @@ void SfxStatusListener::ReBind() // new UNO API void SAL_CALL SfxStatusListener::dispose() throw( ::com::sun::star::uno::RuntimeException ) { - if ( m_xDispatch.is() && m_aCommand.Complete.getLength() > 0 ) + if ( m_xDispatch.is() && !m_aCommand.Complete.isEmpty() ) { try { diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx index 014fd38e980d..f78dd308ec62 100644 --- a/sfx2/source/control/unoctitm.cxx +++ b/sfx2/source/control/unoctitm.cxx @@ -533,7 +533,7 @@ void SfxDispatchController_Impl::addParametersToArgs( const com::sun::star::util rtl::OUString aParamName = aToken.getToken( 0, '=', nParmIndex ); rtl::OUString aValue = (nParmIndex!=-1) ? aToken.getToken( 0, '=', nParmIndex ) : ::rtl::OUString(); - if ( aParamName.getLength() > 0 ) + if ( !aParamName.isEmpty() ) { nParmIndex = 0; aToken = aParamName; @@ -545,7 +545,7 @@ void SfxDispatchController_Impl::addParametersToArgs( const com::sun::star::util rArgs.realloc( nLen+1 ); rArgs[nLen].Name = aParamName; - if ( aParamType.getLength() == 0 ) + if ( aParamType.isEmpty() ) { // Default: LONG rArgs[nLen].Value <<= aValue.toInt32(); diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index eb8aed48ca7e..81c404cfd526 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -237,7 +237,7 @@ void SfxModelessDialog::StateChanged( StateChangedType nStateChange ) { if ( nStateChange == STATE_CHANGE_INITSHOW ) { - if ( pImp->aWinState.getLength() ) + if ( !pImp->aWinState.isEmpty() ) { SetWindowState( pImp->aWinState ); } @@ -376,13 +376,13 @@ long SfxModelessDialog::Notify( NotifyEvent& rEvt ) pImp->pMgr->Activate_Impl(); Window* pWindow = rEvt.GetWindow(); rtl::OString sHelpId; - while ( !sHelpId.getLength() && pWindow ) + while ( sHelpId.isEmpty() && pWindow ) { sHelpId = pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } - if ( sHelpId.getLength() ) + if ( !sHelpId.isEmpty() ) SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), sHelpId ); } else if ( rEvt.GetType() == EVENT_LOSEFOCUS && !HasChildPathFocus() ) @@ -474,13 +474,13 @@ long SfxFloatingWindow::Notify( NotifyEvent& rEvt ) pImp->pMgr->Activate_Impl(); Window* pWindow = rEvt.GetWindow(); rtl::OString sHelpId; - while ( !sHelpId.getLength() && pWindow ) + while ( sHelpId.isEmpty() && pWindow ) { sHelpId = pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } - if ( sHelpId.getLength() ) + if ( !sHelpId.isEmpty() ) SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), sHelpId ); } else if ( rEvt.GetType() == EVENT_LOSEFOCUS ) @@ -634,7 +634,7 @@ void SfxFloatingWindow::StateChanged( StateChangedType nStateChange ) if ( nStateChange == STATE_CHANGE_INITSHOW ) { // FloatingWindows are not centered by default - if ( pImp->aWinState.getLength() ) + if ( !pImp->aWinState.isEmpty() ) SetWindowState( pImp->aWinState ); pImp->bConstructed = sal_True; } diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index df7f9634b974..2020bd9cf6c2 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -244,7 +244,7 @@ SfxDocumentInfoItem::SfxDocumentInfoItem( const String& rFile, : SfxStringItem( SID_DOCINFO, rFile ) , m_AutoloadDelay( i_xDocProps->getAutoloadSecs() ) , m_AutoloadURL( i_xDocProps->getAutoloadURL() ) - , m_isAutoloadEnabled( (m_AutoloadDelay > 0) || m_AutoloadURL.getLength() ) + , m_isAutoloadEnabled( (m_AutoloadDelay > 0) || !m_AutoloadURL.isEmpty() ) , m_DefaultTarget( i_xDocProps->getDefaultTarget() ) , m_TemplateName( i_xDocProps->getTemplateName() ) , m_Author( i_xDocProps->getAuthor() ) @@ -2435,7 +2435,7 @@ sal_Bool SfxCustomPropertiesPage::FillItemSet( SfxItemSet& rSet ) sal_Int32 i = 0, nCount = aPropertySeq.getLength(); for ( ; i < nCount; ++i ) { - if ( aPropertySeq[i].Name.getLength() > 0 ) + if ( !aPropertySeq[i].Name.isEmpty() ) pInfo->AddCustomProperty( aPropertySeq[i].Name, aPropertySeq[i].Value ); } } diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index 4c85197e687b..4fa2f035f466 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -605,7 +605,7 @@ void SfxDockingWindow::ToggleFloatingMode() if (IsFloatingMode()) { SetAlignment(SFX_ALIGN_NOALIGNMENT); - if ( pImp->aWinState.getLength() ) + if ( !pImp->aWinState.isEmpty() ) GetFloatingWindow()->SetWindowState( pImp->aWinState ); else GetFloatingWindow()->SetOutputSizePixel( GetFloatingSize() ); @@ -901,7 +901,7 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW, */ { - if ( GetHelpId().getLength() ) + if ( !GetHelpId().isEmpty() ) { SetUniqueId( GetHelpId() ); SetHelpId(""); @@ -952,7 +952,7 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW, */ { - if ( GetHelpId().getLength() ) + if ( !GetHelpId().isEmpty() ) { SetUniqueId( GetHelpId() ); SetHelpId(""); @@ -1121,7 +1121,7 @@ void SfxDockingWindow::Initialize(SfxChildWinInfo *pInfo) SetFloatingMode( bFloatMode ); if ( bFloatMode ) { - if ( pImp->aWinState.getLength() ) + if ( !pImp->aWinState.isEmpty() ) GetFloatingWindow()->SetWindowState( pImp->aWinState ); else GetFloatingWindow()->SetOutputSizePixel( GetFloatingSize() ); @@ -1200,7 +1200,7 @@ void SfxDockingWindow::Initialize_Impl() if ( pFloatWin ) { // initialize floating window - if ( !pImp->aWinState.getLength() ) + if ( pImp->aWinState.isEmpty() ) // window state never set before, get if from defaults pImp->aWinState = pFloatWin->GetWindowState(); @@ -1831,13 +1831,13 @@ long SfxDockingWindow::Notify( NotifyEvent& rEvt ) Window* pWindow = rEvt.GetWindow(); rtl::OString sHelpId; - while ( !sHelpId.getLength() && pWindow ) + while ( sHelpId.isEmpty() && pWindow ) { sHelpId = pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } - if ( sHelpId.getLength() ) + if ( !sHelpId.isEmpty() ) SfxHelp::OpenHelpAgent( &pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame(), sHelpId ); // In VCL Notify goes first to the window itself, also call the diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 25a07e3ea4b6..bacc37a38b36 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -432,7 +432,7 @@ sal_Bool FileDialogHelper_Impl::CheckFilterOptionsCapability( const SfxFilter* _ if( aProps[nProperty].Name.equals( DEFINE_CONST_OUSTRING( "UIComponent") ) ) { aProps[nProperty].Value >>= aServiceName; - if( aServiceName.getLength() ) + if( !aServiceName.isEmpty() ) bResult = sal_True; } } @@ -488,7 +488,7 @@ void FileDialogHelper_Impl::updateExportButton() OUString sOldLabel( xCtrlAccess->getLabel( CommonFilePickerElementIds::PUSHBUTTON_OK ) ); // initialize button label; we need the label with the mnemonic char - if ( !maButtonLabel.getLength() || maButtonLabel.indexOf( MNEMONIC_CHAR ) == -1 ) + if ( maButtonLabel.isEmpty() || maButtonLabel.indexOf( MNEMONIC_CHAR ) == -1 ) { // cut the ellipses, if necessary sal_Int32 nIndex = sOldLabel.indexOf( sEllipses ); @@ -780,7 +780,7 @@ ErrCode FileDialogHelper_Impl::getGraphic( const OUString& rURL, // select graphic filter from dialog filter selection OUString aCurFilter( getFilter() ); - sal_uInt16 nFilter = aCurFilter.getLength() && mpGraphicFilter->GetImportFormatCount() + sal_uInt16 nFilter = !aCurFilter.isEmpty() && mpGraphicFilter->GetImportFormatCount() ? mpGraphicFilter->GetImportFormatNumber( aCurFilter ) : GRFILTER_FORMAT_DONTKNOW; @@ -829,7 +829,7 @@ ErrCode FileDialogHelper_Impl::getGraphic( Graphic& rGraphic ) const aPath = aPathSeq[0]; } - if ( aPath.getLength() ) + if ( !aPath.isEmpty() ) nRet = getGraphic( aPath, rGraphic ); else nRet = ERRCODE_IO_GENERAL; @@ -1270,7 +1270,7 @@ void FileDialogHelper_Impl::postExecute( sal_Int16 _nResult ) // ------------------------------------------------------------------------ void FileDialogHelper_Impl::implInitializeFileName( ) { - if ( maFileName.getLength() ) + if ( !maFileName.isEmpty() ) { INetURLObject aObj( maPath ); aObj.Append( maFileName ); @@ -1615,7 +1615,7 @@ OUString FileDialogHelper_Impl::getPath() const if ( mxFileDlg.is() ) aPath = mxFileDlg->getDisplayDirectory(); - if ( !aPath.getLength() ) + if ( aPath.isEmpty() ) aPath = maPath; return aPath; @@ -1651,7 +1651,7 @@ void FileDialogHelper_Impl::getRealFilter( String& _rFilter ) const // ------------------------------------------------------------------------ void FileDialogHelper_Impl::displayFolder( const ::rtl::OUString& _rPath ) { - if ( ! _rPath.getLength() ) + if ( _rPath.isEmpty() ) // nothing to do return; @@ -1693,7 +1693,7 @@ void FileDialogHelper_Impl::setFilter( const OUString& rFilter ) maCurFilter = rFilter; - if ( rFilter.getLength() && mpMatcher ) + if ( !rFilter.isEmpty() && mpMatcher ) { const SfxFilter* pFilter = mpMatcher->GetFilter4FilterName( rFilter, m_nMustFlags, m_nDontFlags ); @@ -1703,7 +1703,7 @@ void FileDialogHelper_Impl::setFilter( const OUString& rFilter ) uno::Reference< XFilterManager > xFltMgr( mxFileDlg, UNO_QUERY ); - if ( maCurFilter.getLength() && xFltMgr.is() ) + if ( !maCurFilter.isEmpty() && xFltMgr.is() ) { try { @@ -1788,7 +1788,7 @@ void FileDialogHelper_Impl::addFilters( const String& rFactory, ::sfx2::appendFiltersForSave( aIter, xFltMgr, sFirstFilter, *this, rFactory ); // set our initial selected filter (if we do not already have one) - if ( !maSelectFilter.getLength() ) + if ( maSelectFilter.isEmpty() ) maSelectFilter = sFirstFilter; } @@ -1805,7 +1805,7 @@ void FileDialogHelper_Impl::addFilter( const OUString& rFilterName, { xFltMgr->appendFilter( rFilterName, rExtension ); - if ( !maSelectFilter.getLength() ) + if ( maSelectFilter.isEmpty() ) maSelectFilter = rFilterName; } catch( const IllegalArgumentException& ) @@ -1969,7 +1969,7 @@ void FileDialogHelper_Impl::saveConfig() if ( ! mbIsSaveDlg ) { OUString aPath = getPath(); - if ( aPath.getLength() && + if ( !aPath.isEmpty() && utl::LocalFileHelper::IsLocalFile( aPath ) ) { aUserData.SetToken( 1, ' ', aPath ); @@ -2068,10 +2068,10 @@ void FileDialogHelper_Impl::loadConfig() xDlg->setValue( ExtendedFilePickerElementIds::CHECKBOX_PREVIEW, 0, aValue ); } - if ( !maPath.getLength() ) + if ( maPath.isEmpty() ) displayFolder( getInitPath( aUserData, 2 ) ); - if ( ! maCurFilter.getLength() ) + if ( maCurFilter.isEmpty() ) { String aFilter = aUserData.GetToken( 3, ' ' ); aFilter = DecodeSpaces_Impl( aFilter ); @@ -2084,7 +2084,7 @@ void FileDialogHelper_Impl::loadConfig() catch( const IllegalArgumentException& ){} } - if ( !maPath.getLength() ) + if ( maPath.isEmpty() ) displayFolder( SvtPathOptions().GetGraphicPath() ); } else @@ -2103,7 +2103,7 @@ void FileDialogHelper_Impl::loadConfig() if ( ! aUserData.Len() ) aUserData = DEFINE_CONST_UNICODE( STD_CONFIG_STR ); - if ( ! maPath.getLength() ) + if ( maPath.isEmpty() ) displayFolder( getInitPath( aUserData, 1 ) ); if ( mbHasAutoExt ) @@ -2128,7 +2128,7 @@ void FileDialogHelper_Impl::loadConfig() catch( const IllegalArgumentException& ){} } - if ( !maPath.getLength() ) + if ( maPath.isEmpty() ) displayFolder( SvtPathOptions().GetWorkPath() ); } } @@ -2137,7 +2137,7 @@ void FileDialogHelper_Impl::loadConfig() void FileDialogHelper_Impl::setDefaultValues() { // when no filter is set, we set the curentFilter to <all> - if ( !maCurFilter.getLength() && maSelectFilter.getLength() ) + if ( maCurFilter.isEmpty() && !maSelectFilter.isEmpty() ) { uno::Reference< XFilterManager > xFltMgr( mxFileDlg, UNO_QUERY ); try @@ -2149,7 +2149,7 @@ void FileDialogHelper_Impl::setDefaultValues() } // when no path is set, we use the standard 'work' folder - if ( ! maPath.getLength() ) + if ( maPath.isEmpty() ) { OUString aWorkFolder = SvtPathOptions().GetWorkPath(); try @@ -2277,7 +2277,7 @@ FileDialogHelper::FileDialogHelper( ::rtl::OUString aWildcard; if ( aExtName.indexOf( (sal_Unicode)'*' ) != 0 ) { - if ( aExtName.getLength() && aExtName.indexOf( (sal_Unicode)'.' ) != 0 ) + if ( !aExtName.isEmpty() && aExtName.indexOf( (sal_Unicode)'.' ) != 0 ) aWildcard = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*." ) ); else aWildcard = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "*" ) ); @@ -2549,7 +2549,7 @@ void FileDialogHelper::SetDisplayDirectory( const String& _rPath ) { INetURLObject aObjPathName( _rPath ); ::rtl::OUString sFolder( aObjPathName.GetMainURL( INetURLObject::NO_DECODE ) ); - if ( sFolder.getLength() == 0 ) + if ( sFolder.isEmpty() ) { // _rPath is not a valid path -> fallback to home directory osl::Security aSecurity; diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index 863017cf7243..b32342eda485 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -452,7 +452,7 @@ namespace sfx2 } } - if ( _rToBeExtended.getLength() ) + if ( !_rToBeExtended.isEmpty() ) _rToBeExtended += getSeparatorString(); _rToBeExtended += _rWC; } @@ -574,7 +574,7 @@ namespace sfx2 void operator() ( const FilterDescriptor& _rFilter ) { - if ( _rFilter.Second.getLength() ) + if ( !_rFilter.Second.isEmpty() ) rTarget.push_back( _rFilter ); } }; @@ -917,7 +917,7 @@ namespace sfx2 ::rtl::OUString sFilterName = lFilterProps.getUnpackedValueOrDefault( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Name")), ::rtl::OUString()); - if (sFilterName.getLength()) + if (!sFilterName.isEmpty()) m_lFilters.push_back(sFilterName); } } @@ -942,7 +942,7 @@ namespace sfx2 if (nIndex<0 || nIndex>=(sal_Int32)m_lFilters.size()) return 0; const ::rtl::OUString& sFilterName = m_lFilters[nIndex]; - if (!sFilterName.getLength()) + if (sFilterName.isEmpty()) return 0; return SfxFilter::GetFilterByName(String(sFilterName)); } @@ -971,7 +971,7 @@ namespace sfx2 try { _rxFilterManager->appendFilter( sUIName, sExtension ); - if ( !_rFirstNonEmpty.getLength() ) + if ( _rFirstNonEmpty.isEmpty() ) _rFirstNonEmpty = sUIName; } catch( const IllegalArgumentException& ) @@ -997,7 +997,7 @@ namespace sfx2 try { _rxFilterManager->appendFilter( sUIName, sExtension ); - if ( !_rFirstNonEmpty.getLength() ) + if ( _rFirstNonEmpty.isEmpty() ) _rFirstNonEmpty = sUIName; } catch( const IllegalArgumentException& ) @@ -1152,7 +1152,7 @@ namespace sfx2 aImportantFilterGroup[n].aWildcard, sal_False, _rFileDlgImpl ); _rxFilterManager->appendFilter( aUIName, aImportantFilterGroup[n].aWildcard ); - if ( !_rFirstNonEmpty.getLength() ) + if ( _rFirstNonEmpty.isEmpty() ) _rFirstNonEmpty = sUIName; } @@ -1176,7 +1176,7 @@ namespace sfx2 aFilterGroup[n].aWildcard, sal_False, _rFileDlgImpl ); _rxFilterManager->appendFilter( aUIName, aFilterGroup[n].aWildcard ); - if ( !_rFirstNonEmpty.getLength() ) + if ( _rFirstNonEmpty.isEmpty() ) _rFirstNonEmpty = sUIName; } diff --git a/sfx2/source/dialog/mailmodel.cxx b/sfx2/source/dialog/mailmodel.cxx index c400deb9ff95..18340c1ce9ce 100644 --- a/sfx2/source/dialog/mailmodel.cxx +++ b/sfx2/source/dialog/mailmodel.cxx @@ -217,7 +217,7 @@ SfxMailModel::SaveResult SfxMailModel::ShowFilterOptionsDialog( { ::rtl::OUString aServiceName; aProps[nProperty].Value >>= aServiceName; - if( aServiceName.getLength() ) + if( !aServiceName.isEmpty() ) { uno::Reference< ui::dialogs::XExecutableDialog > xFilterDialog( xSMGR->createInstance( aServiceName ), uno::UNO_QUERY ); @@ -358,7 +358,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( } // We need at least a valid module name and model reference - if (( aModule.getLength() > 0 ) && xModel.is() ) + if ( !aModule.isEmpty() && xModel.is() ) { bool bModified( false ); bool bHasLocation( false ); @@ -376,10 +376,10 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( bool bPrivateProtocol = ( aFileObj.GetProtocol() == INET_PROT_PRIV_SOFFICE ); - bHasLocation = ( aLocation.getLength() > 0 ) && !bPrivateProtocol; + bHasLocation = !aLocation.isEmpty() && !bPrivateProtocol; OSL_ASSERT( !bPrivateProtocol ); } - if ( rType.getLength() > 0 ) + if ( !rType.isEmpty() ) bStoreTo = true; if ( xStorable.is() ) @@ -451,7 +451,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( ::rtl::OUString() ); } - if ( !bHasLocation || ( aFilterName.getLength() == 0 )) + if ( !bHasLocation || aFilterName.isEmpty()) { // Retrieve the user defined default filter css::uno::Reference< css::container::XNameAccess > xNameAccess( xModuleManager, css::uno::UNO_QUERY ); @@ -482,8 +482,8 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( // No filter found => error // No type and no location => error - if (( aFilterName.getLength() == 0 ) || - (( aTypeName.getLength() == 0 ) && !bHasLocation )) + if (( aFilterName.isEmpty() ) || + ( aTypeName.isEmpty() && !bHasLocation )) return eRet; // Determine filen name and extension @@ -519,7 +519,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( // Use provided save file name. If empty determine file name aFileName = aSaveFileName; - if ( aFileName.getLength() == 0 ) + if ( aFileName.isEmpty() ) { if ( !bHasLocation ) { @@ -536,11 +536,11 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( } // No file name => error - if ( aFileName.getLength() == 0 ) + if ( aFileName.isEmpty() ) return eRet; - OSL_ASSERT( aFilterName.getLength() > 0 ); - OSL_ASSERT( aFileName.getLength() > 0 ); + OSL_ASSERT( !aFilterName.isEmpty() ); + OSL_ASSERT( !aFileName.isEmpty() ); // Creates a temporary directory to store a predefined file into it. // This makes it possible to store the file for "send document as e-mail" @@ -564,7 +564,7 @@ SfxMailModel::SaveResult SfxMailModel::SaveDocumentAsFormat( rtl::OUString aPassword = aMediaDescrPropsHM.getUnpackedValueOrDefault( aPasswordPropName, ::rtl::OUString() ); - if ( aPassword.getLength() > 0 ) + if ( !aPassword.isEmpty() ) { aArgs.realloc( ++nNumArgs ); aArgs[nNumArgs-1].Name = aPasswordPropName; @@ -794,7 +794,7 @@ SfxMailModel::SendMailResult SfxMailModel::AttachDocument( rtl::OUString sFileName; SaveResult eSaveResult = SaveDocumentAsFormat( sAttachmentTitle, xFrameOrModel, sDocumentType, sFileName ); - if ( eSaveResult == SAVE_SUCCESSFULL && ( sFileName.getLength() > 0 ) ) + if ( eSaveResult == SAVE_SUCCESSFULL && !sFileName.isEmpty() ) maAttachedDocuments.push_back(sFileName); return eSaveResult == SAVE_SUCCESSFULL ? SEND_MAIL_OK : SEND_MAIL_ERROR; } @@ -896,7 +896,7 @@ SfxMailModel::SendMailResult SfxMailModel::Send( const css::uno::Reference< css: Sequence< OUString > aAttachmentSeq(&(maAttachedDocuments[0]),maAttachedDocuments.size()); - if ( xSimpleMailMessage->getSubject().getLength() == 0 ) { + if ( xSimpleMailMessage->getSubject().isEmpty() ) { OUString baseName( maAttachedDocuments[0].copy( maAttachedDocuments[0].lastIndexOf( '/' ) + 1 ) ); OUString subject( baseName ); if ( maAttachedDocuments.size() > 1 ) diff --git a/sfx2/source/dialog/newstyle.cxx b/sfx2/source/dialog/newstyle.cxx index 49787f332e49..3dc68298256c 100644 --- a/sfx2/source/dialog/newstyle.cxx +++ b/sfx2/source/dialog/newstyle.cxx @@ -65,7 +65,7 @@ IMPL_LINK( SfxNewStyleDlg, OKHdl, Control *, pControl ) IMPL_LINK_INLINE_START( SfxNewStyleDlg, ModifyHdl, ComboBox *, pBox ) { - aOKBtn.Enable( comphelper::string::remove(pBox->GetText(), ' ').getLength() > 0 ); + aOKBtn.Enable( !comphelper::string::remove(pBox->GetText(), ' ').isEmpty() ); return 0; } IMPL_LINK_INLINE_END( SfxNewStyleDlg, ModifyHdl, ComboBox *, pBox ) diff --git a/sfx2/source/dialog/recfloat.cxx b/sfx2/source/dialog/recfloat.cxx index 6b7b71dc85e7..debd5c3f8b3c 100644 --- a/sfx2/source/dialog/recfloat.cxx +++ b/sfx2/source/dialog/recfloat.cxx @@ -119,7 +119,7 @@ static rtl::OUString GetLabelFromCommandURL( const rtl::OUString& rCommandURL, c { try { - if ( rCommandURL.getLength() > 0 ) + if ( !rCommandURL.isEmpty() ) { uno::Sequence< beans::PropertyValue > aPropSeq; uno::Any a( xUICommandLabels->getByName( rCommandURL )); @@ -172,7 +172,7 @@ sal_Bool SfxRecordingFloatWrapper_Impl::QueryClose() // asking for recorded macro should be replaced if index access is available! sal_Bool bRet = sal_True; com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder = pBindings->GetRecorder(); - if ( xRecorder.is() && xRecorder->getRecordedMacro().getLength() ) + if ( xRecorder.is() && !xRecorder->getRecordedMacro().isEmpty() ) { QueryBox aBox( GetWindow(), WB_YES_NO | WB_DEF_NO , String( SfxResId( STR_MACRO_LOSS ) ) ); aBox.SetText( String( SfxResId(STR_CANCEL_RECORDING) ) ); diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index 5ec3cc9f3e3c..cb12153f9c2b 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -1471,13 +1471,13 @@ long SfxTabDialog::Notify( NotifyEvent& rNEvt ) { Window* pWindow = rNEvt.GetWindow(); rtl::OString sHelpId; - while ( !sHelpId.getLength() && pWindow ) + while ( sHelpId.isEmpty() && pWindow ) { sHelpId = pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } - if ( sHelpId.getLength() ) + if ( !sHelpId.isEmpty() ) SfxHelp::OpenHelpAgent( &pViewFrame->GetFrame(), sHelpId ); } } diff --git a/sfx2/source/dialog/taskpane.cxx b/sfx2/source/dialog/taskpane.cxx index 4b36bef1f1cf..d83ad1b871b5 100644 --- a/sfx2/source/dialog/taskpane.cxx +++ b/sfx2/source/dialog/taskpane.cxx @@ -118,7 +118,7 @@ namespace sfx2 "org.openoffice.Office.UI.")); aPathComposer.append( sWindowStateRef ); aPathComposer.appendAscii(RTL_CONSTASCII_STRINGPARAM("/UIElements/States")); - if ( i_rResourceURL.getLength() ) + if ( !i_rResourceURL.isEmpty() ) { aPathComposer.append('/').append( i_rResourceURL ); } @@ -167,7 +167,7 @@ namespace sfx2 Image lcl_getPanelImage( const Reference< XFrame >& i_rDocFrame, const ::utl::OConfigurationNode& i_rPanelConfigNode ) { const ::rtl::OUString sImageURL( ::comphelper::getString( i_rPanelConfigNode.getNodeValue( "ImageURL" ) ) ); - if ( sImageURL.getLength() ) + if ( !sImageURL.isEmpty() ) { try { @@ -632,10 +632,10 @@ namespace sfx2 sFirstVisiblePanelResource = *resource; } - if ( sFirstVisiblePanelResource.getLength() == 0 ) + if ( sFirstVisiblePanelResource.isEmpty() ) sFirstVisiblePanelResource = sFirstPanelResource; - if ( sFirstVisiblePanelResource.getLength() ) + if ( !sFirstVisiblePanelResource.isEmpty() ) { ::boost::optional< size_t > aPanelPos( GetPanelPos( sFirstVisiblePanelResource ) ); OSL_ENSURE( !!aPanelPos, "ModuleTaskPane_Impl::impl_isToolPanelResource: just inserted it, and it's not there?!" ); 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(); diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index f490d6e11bea..12e895f6578c 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -246,7 +246,7 @@ void SfxURLToolBoxControl_Impl::StateChanged continue; ::rtl::OUString sURL; - if (!(lProps[p].Value>>=sURL) || !sURL.getLength()) + if (!(lProps[p].Value>>=sURL) || sURL.isEmpty()) continue; INetURLObject aURL ( sURL ); diff --git a/sfx2/source/menu/mnuitem.cxx b/sfx2/source/menu/mnuitem.cxx index 68fe2c6ca056..9e9585794663 100644 --- a/sfx2/source/menu/mnuitem.cxx +++ b/sfx2/source/menu/mnuitem.cxx @@ -365,7 +365,7 @@ IMPL_LINK( SfxAppMenuControl_Impl, Activate, Menu *, pActMenu ) if ( pMenuAttributes ) aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes - if ( aImageId.getLength() > 0 ) + if ( !aImageId.isEmpty() ) { Reference< ::com::sun::star::frame::XFrame > xFrame; Image aImage = GetImage( xFrame, aImageId, false ); diff --git a/sfx2/source/menu/mnumgr.cxx b/sfx2/source/menu/mnumgr.cxx index 920c4158c79b..567812342b76 100644 --- a/sfx2/source/menu/mnumgr.cxx +++ b/sfx2/source/menu/mnumgr.cxx @@ -210,7 +210,7 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) Image aImage; String sThesImplName( aHelper.GetThesImplName( aLocale ) ); ::rtl::OUString aSynonymsImageUrl( aCfg.GetSynonymsContextImage( sThesImplName ) ); - if (sThesImplName.Len() > 0 && aSynonymsImageUrl.getLength() > 0) + if (sThesImplName.Len() > 0 && !aSynonymsImageUrl.isEmpty()) aImage = Image( lcl_GetImageFromPngUrl( aSynonymsImageUrl ) ); for (sal_uInt16 i = 0; (size_t)i < nNumSynonyms; ++i) @@ -224,7 +224,7 @@ PopupMenu* InsertThesaurusSubmenu_Impl( SfxBindings* pBindings, Menu* pSVMenu ) aCmd += aItemText; pThesSubMenu->SetItemCommand( nId, aCmd ); - if (aSynonymsImageUrl.getLength() > 0) + if (!aSynonymsImageUrl.isEmpty()) pThesSubMenu->SetItemImage( nId, aImage ); } } diff --git a/sfx2/source/menu/thessubmenu.cxx b/sfx2/source/menu/thessubmenu.cxx index 39ba8a30533a..318b287173f7 100644 --- a/sfx2/source/menu/thessubmenu.cxx +++ b/sfx2/source/menu/thessubmenu.cxx @@ -174,7 +174,7 @@ bool SfxThesSubMenuHelper::GetMeanings( { bool bHasMoreSynonyms = false; rSynonyms.clear(); - if (IsSupportedLocale( rLocale ) && rWord.getLength() && nMaxSynonms > 0) + if (IsSupportedLocale( rLocale ) && !rWord.isEmpty() && nMaxSynonms > 0) { try { diff --git a/sfx2/source/menu/virtmenu.cxx b/sfx2/source/menu/virtmenu.cxx index 4943377be372..28fd98c3b355 100644 --- a/sfx2/source/menu/virtmenu.cxx +++ b/sfx2/source/menu/virtmenu.cxx @@ -135,7 +135,7 @@ static Image RetrieveAddOnImage( Reference< com::sun::star::frame::XFrame >& rFr { Image aImage; - if ( aImageId.getLength() > 0 ) + if ( !aImageId.isEmpty() ) { aImage = GetImage( rFrame, aImageId, bBigImage ); if ( !!aImage ) diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index 6c7e2796347c..474a9219cebd 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -101,7 +101,7 @@ void SAL_CALL SfxEvents_Impl::replaceByName( const OUSTRING & aName, const ANY & if ( ( aNormalizedDescriptor.size() == 1 ) && ( aNormalizedDescriptor.has( PROP_EVENT_TYPE) == 0 ) && ( aNormalizedDescriptor.get( PROP_EVENT_TYPE ) >>= sType ) - && ( sType.getLength() == 0 ) + && ( sType.isEmpty() ) ) { // An empty event type means no binding. Therefore reset data @@ -226,7 +226,7 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg nIndex += 1; } - if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STAR_BASIC)) && aScript.getLength()) + if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STAR_BASIC)) && !aScript.isEmpty()) { com::sun::star::uno::Any aAny; SfxMacroLoader::loadMacro( aScript, aAny, pDoc ); @@ -234,7 +234,7 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg else if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Service")) || aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Script"))) { - if ( aScript.getLength() ) + if ( !aScript.isEmpty() ) { SfxViewFrame* pView = pDoc ? SfxViewFrame::GetFirst( pDoc ) : @@ -284,7 +284,7 @@ static void Execute( ANY& aEventData, const css::document::DocumentEvent& aTrigg } } } - else if ( aType.getLength() == 0 ) + else if ( aType.isEmpty() ) { // Empty type means no active binding for the event. Just ignore do nothing. } @@ -408,7 +408,7 @@ SvxMacro* SfxEvents_Impl::ConvertToMacro( const ANY& rElement, SfxObjectShell* p ScriptType eType( STARBASIC ); if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STAR_BASIC))) eType = STARBASIC; - else if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Script")) && aScriptURL.getLength()) + else if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Script")) && !aScriptURL.isEmpty()) eType = EXTENDED_STYPE; else if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(SVX_MACRO_LANGUAGE_JAVASCRIPT))) eType = JAVASCRIPT; @@ -416,7 +416,7 @@ SvxMacro* SfxEvents_Impl::ConvertToMacro( const ANY& rElement, SfxObjectShell* p DBG_ERRORFILE( "ConvertToMacro: Unknown macro type" ); } - if ( aMacroName.getLength() ) + if ( !aMacroName.isEmpty() ) { if (aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application"))) aLibrary = SFX_APP()->GetName(); @@ -453,16 +453,16 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i ::rtl::OUString aLibrary = i_eventDescriptor.getOrDefault( PROP_LIBRARY, ::rtl::OUString() ); ::rtl::OUString aMacroName = i_eventDescriptor.getOrDefault( PROP_MACRO_NAME, ::rtl::OUString() ); - if ( aType.getLength() ) + if ( !aType.isEmpty() ) o_normalizedDescriptor.put( PROP_EVENT_TYPE, aType ); - if ( aScript.getLength() ) + if ( !aScript.isEmpty() ) o_normalizedDescriptor.put( PROP_SCRIPT, aScript ); if (aType.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(STAR_BASIC))) { - if ( aScript.getLength() ) + if ( !aScript.isEmpty() ) { - if ( !aMacroName.getLength() || !aLibrary.getLength() ) + if ( aMacroName.isEmpty() || aLibrary.isEmpty() ) { sal_Int32 nHashPos = aScript.indexOf( '/', 8 ); sal_Int32 nArgsPos = aScript.indexOf( '(' ); @@ -483,7 +483,7 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i } } } - else if ( aMacroName.getLength() ) + else if ( !aMacroName.isEmpty() ) { aScript = OUSTRING( RTL_CONSTASCII_USTRINGPARAM( MACRO_PRFIX ) ); if ( aLibrary.compareTo( SFX_APP()->GetName() ) != 0 && !aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("StarDesktop")) && !aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("application")) ) @@ -499,7 +499,7 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i if (!aLibrary.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("document"))) { - if ( !aLibrary.getLength() || (pDoc && ( String(aLibrary) == pDoc->GetTitle( SFX_TITLE_APINAME ) || String(aLibrary) == pDoc->GetTitle() )) ) + if ( aLibrary.isEmpty() || (pDoc && ( String(aLibrary) == pDoc->GetTitle( SFX_TITLE_APINAME ) || String(aLibrary) == pDoc->GetTitle() )) ) aLibrary = String::CreateFromAscii("document"); else aLibrary = String::CreateFromAscii("application"); diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx index 540211e4d972..3f6ec91ac7f0 100644 --- a/sfx2/source/toolbox/tbxitem.cxx +++ b/sfx2/source/toolbox/tbxitem.cxx @@ -149,7 +149,7 @@ svt::ToolboxController* SAL_CALL SfxToolBoxControllerFactory( const Reference< X aTargetURL.Complete = aCommandURL; Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.util.URLTransformer"))), UNO_QUERY ); xTrans->parseStrict( aTargetURL ); - if ( aTargetURL.Arguments.getLength() ) + if ( !aTargetURL.Arguments.isEmpty() ) return NULL; SfxObjectShell* pObjShell = NULL; @@ -1731,7 +1731,7 @@ IMPL_LINK( SfxAppToolBoxControl_Impl, Activate, Menu *, pActMenu ) if ( pMenuAttributes ) aImageId = pMenuAttributes->aImageId; // Retrieve image id from menu attributes - if ( aImageId.getLength() > 0 ) + if ( !aImageId.isEmpty() ) { Reference< ::com::sun::star::frame::XFrame > xFrame; Image aImage = GetImage( xFrame, aImageId, false ); diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index e18398fb4352..f143cc2ce602 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -126,13 +126,13 @@ long SfxFrameWindow_Impl::Notify( NotifyEvent& rNEvt ) // TODO/LATER: do we still need this code? Window* pWindow = rNEvt.GetWindow(); rtl::OString sHelpId; - while ( !sHelpId.getLength() && pWindow ) + while ( sHelpId.isEmpty() && pWindow ) { sHelpId = pWindow->GetHelpId(); pWindow = pWindow->GetParent(); } - if ( sHelpId.getLength() ) + if ( !sHelpId.isEmpty() ) SfxHelp::OpenHelpAgent( pFrame, sHelpId ); // if focus was on an external window, the clipboard content might have been changed diff --git a/sfx2/source/view/frmload.cxx b/sfx2/source/view/frmload.cxx index 2a737419b8c7..7b8a58346b30 100644 --- a/sfx2/source/view/frmload.cxx +++ b/sfx2/source/view/frmload.cxx @@ -122,7 +122,7 @@ const SfxFilter* SfxFrameLoader_Impl::impl_detectFilterForURL( const ::rtl::OUSt ::rtl::OUString sFilter; try { - if ( !sURL.getLength() ) + if ( sURL.isEmpty() ) return 0; Reference< XTypeDetection > xDetect( @@ -139,7 +139,7 @@ const SfxFilter* SfxFrameLoader_Impl::impl_detectFilterForURL( const ::rtl::OUSt Sequence< PropertyValue > aQueryArgs( aNewArgs.getPropertyValues() ); ::rtl::OUString sType = xDetect->queryTypeByDescriptor( aQueryArgs, sal_True ); - if ( sType.getLength() ) + if ( !sType.isEmpty() ) { const SfxFilter* pFilter = rMatcher.GetFilter4EA( sType ); if ( pFilter ) @@ -157,7 +157,7 @@ const SfxFilter* SfxFrameLoader_Impl::impl_detectFilterForURL( const ::rtl::OUSt } const SfxFilter* pFilter = 0; - if (sFilter.getLength()) + if (!sFilter.isEmpty()) pFilter = rMatcher.GetFilter4FilterName(sFilter); return pFilter; } @@ -184,7 +184,7 @@ const SfxFilter* SfxFrameLoader_Impl::impl_getFilterFromServiceName_nothrow( con { ::comphelper::NamedValueCollection aType( xEnum->nextElement() ); ::rtl::OUString sFilterName = aType.getOrDefault( "Name", ::rtl::OUString() ); - if ( !sFilterName.getLength() ) + if ( sFilterName.isEmpty() ) continue; const SfxFilter* pFilter = rMatcher.GetFilter4FilterName( sFilterName ); @@ -276,22 +276,22 @@ void SfxFrameLoader_Impl::impl_determineFilter( ::comphelper::NamedValueCollecti const SfxFilter* pFilter = NULL; // get filter by its name directly ... - if ( sFilterName.getLength() ) + if ( !sFilterName.isEmpty() ) pFilter = rMatcher.GetFilter4FilterName( sFilterName ); // or search the preferred filter for the detected type ... - if ( !pFilter && sTypeName.getLength() ) + if ( !pFilter && !sTypeName.isEmpty() ) pFilter = rMatcher.GetFilter4EA( sTypeName ); // or use given document service for detection, too - if ( !pFilter && sServiceName.getLength() ) + if ( !pFilter && !sServiceName.isEmpty() ) pFilter = impl_getFilterFromServiceName_nothrow( sServiceName ); // or use interaction to ask user for right filter. - if ( !pFilter && xInteraction.is() && sURL.getLength() ) + if ( !pFilter && xInteraction.is() && !sURL.isEmpty() ) { ::rtl::OUString sSelectedFilter = impl_askForFilter_nothrow( xInteraction, sURL ); - if ( sSelectedFilter.getLength() ) + if ( !sSelectedFilter.isEmpty() ) pFilter = rMatcher.GetFilter4FilterName( sSelectedFilter ); } @@ -336,14 +336,14 @@ bool SfxFrameLoader_Impl::impl_determineTemplateDocument( ::comphelper::NamedVal // determine the full URL of the template to use, if any String sTemplateURL; - if ( sTemplateRegioName.getLength() && sTemplateName.getLength() ) + if ( !sTemplateRegioName.isEmpty() && !sTemplateName.isEmpty() ) { SfxDocumentTemplates aTmpFac; aTmpFac.GetFull( sTemplateRegioName, sTemplateName, sTemplateURL ); } else { - if ( sServiceName.getLength() ) + if ( !sServiceName.isEmpty() ) sTemplateURL = SfxObjectFactory::GetStandardTemplate( sServiceName ); else sTemplateURL = SfxObjectFactory::GetStandardTemplate( SfxObjectShell::GetServiceNameFromFactory( sURL ) ); @@ -384,7 +384,7 @@ sal_uInt16 SfxFrameLoader_Impl::impl_findSlotParam( const ::rtl::OUString& i_rFa sSlotParam = i_rFactoryURL.copy( nSlotPos + 5 ); } - if ( sSlotParam.getLength() ) + if ( !sSlotParam.isEmpty() ) return sal_uInt16( sSlotParam.toInt32() ); return 0; @@ -473,7 +473,7 @@ sal_Int16 SfxFrameLoader_Impl::impl_determineEffectiveViewId_nothrow( const SfxO ::comphelper::NamedValueCollection aNamedViewData( aViewData ); ::rtl::OUString sViewId = aNamedViewData.getOrDefault( "ViewId", ::rtl::OUString() ); - if ( !sViewId.getLength() ) + if ( sViewId.isEmpty() ) break; // somewhat weird convention here ... in the view data, the ViewId is a string, effectively describing diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 7dcaeec000cf..f8903d6be2db 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -788,7 +788,7 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOU if ( aURL.Protocol.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(".uno:")) ) { rtl::OUString aMasterCommand = SfxOfficeDispatch::GetMasterUnoCommand( aURL ); - sal_Bool bMasterCommand( aMasterCommand.getLength() > 0 ); + sal_Bool bMasterCommand( !aMasterCommand.isEmpty() ); pAct = m_pData->m_pViewShell->GetViewFrame() ; SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool( pAct ); @@ -893,15 +893,15 @@ REFERENCE< XDISPATCH > SAL_CALL SfxBaseController::queryDispatch( const UNOU } } } - else if( sTargetFrameName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("_self")) || sTargetFrameName.getLength()==0 ) + else if( sTargetFrameName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("_self")) || sTargetFrameName.isEmpty() ) { // check for already loaded URL ... but with additional jumpmark! REFERENCE< XMODEL > xModel = getModel(); - if( xModel.is() && aURL.Mark.getLength() ) + if( xModel.is() && !aURL.Mark.isEmpty() ) { SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool( pAct ); const SfxSlot* pSlot = rSlotPool.GetSlot( SID_JUMPTOMARK ); - if( aURL.Main.getLength() && aURL.Main == xModel->getURL() && pSlot ) + if( !aURL.Main.isEmpty() && aURL.Main == xModel->getURL() && pSlot ) return REFERENCE< XDISPATCH >( new SfxOfficeDispatch( pAct->GetBindings(), pAct->GetDispatcher(), pSlot, aURL) ); } } @@ -1385,14 +1385,14 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) // if there's a JumpMark given, then, well, jump to it ::comphelper::NamedValueCollection aViewArgs( getCreationArguments() ); const ::rtl::OUString sJumpMark = aViewArgs.getOrDefault( "JumpMark", ::rtl::OUString() ); - const bool bHasJumpMark = ( sJumpMark.getLength() > 0 ); + const bool bHasJumpMark = !sJumpMark.isEmpty(); OSL_ENSURE( ( !m_pData->m_pViewShell->GetObjectShell()->IsLoading() ) - || ( !sJumpMark.getLength() ), + || ( sJumpMark.isEmpty() ), "SfxBaseController::ConnectSfxFrame_Impl: so this code wasn't dead?" ); // Before CWS autorecovery, there was code which postponed jumping to the Mark to a later time // (SfxObjectShell::PositionView_Impl), but it seems this branch was never used, since this method // here is never called before the load process finished. At least not with a non-empty jump mark - if ( sJumpMark.getLength() ) + if ( !sJumpMark.isEmpty() ) m_pData->m_pViewShell->JumpToMark( sJumpMark ); // if no plugin mode and no jump mark was supplied, check whether the document itself can provide view data, and @@ -1425,7 +1425,7 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) { const ::comphelper::NamedValueCollection aViewData( xViewData->getByIndex(i) ); ::rtl::OUString sViewId( aViewData.getOrDefault( "ViewId", ::rtl::OUString() ) ); - if ( sViewId.getLength() == 0 ) + if ( sViewId.isEmpty() ) continue; const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId ); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 8e123e3d9d3d..9bfb4e67695d 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -1987,7 +1987,7 @@ SfxViewShell* SfxViewFrame::LoadViewIntoFrame_Impl( const SfxObjectShell& i_rDoc aTransformLoadArgs.remove( "Hidden" ); ::rtl::OUString sURL( RTL_CONSTASCII_USTRINGPARAM( "private:object" ) ); - if ( !sURL.getLength() ) + if ( sURL.isEmpty() ) sURL = i_rDoc.GetFactory().GetFactoryURL(); Reference< XComponentLoader > xLoader( i_rFrame, UNO_QUERY_THROW ); @@ -2119,7 +2119,7 @@ void SfxViewFrame::SaveCurrentViewData_Impl( const sal_uInt16 i_nNewViewId ) { const ::comphelper::NamedValueCollection aCurViewData( xViewData->getByIndex(i) ); ::rtl::OUString sViewId( aCurViewData.getOrDefault( "ViewId", ::rtl::OUString() ) ); - if ( sViewId.getLength() == 0 ) + if ( sViewId.isEmpty() ) continue; const SfxViewFactory* pViewFactory = rDocFactory.GetViewFactoryByViewName( sViewId ); @@ -2648,7 +2648,7 @@ void CutLines( ::rtl::OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines, sa */ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro ) { - if ( !sMacro.getLength() ) + if ( sMacro.isEmpty() ) return; SfxApplication* pSfxApp = SFX_APP(); @@ -2770,7 +2770,7 @@ void SfxViewFrame::AddDispatchMacroToBasic_Impl( const ::rtl::OUString& sMacro ) ::rtl::OUString sModule( aModuleName ); if(xLib->hasByName(sModule)) { - if ( aOUSource.getLength() ) + if ( !aOUSource.isEmpty() ) { sRoutine.append( aOUSource ); } diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx index d85b2c6e6167..2c6bc1284420 100644 --- a/sfx2/source/view/viewsh.cxx +++ b/sfx2/source/view/viewsh.cxx @@ -587,14 +587,14 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) if ( nId == SID_MAIL_SENDDOCASMS ) { aDocType = impl_searchFormatTypeForApp(xFrame, E_MS_DOC); - if (aDocType.getLength() > 0) + if (!aDocType.isEmpty()) eResult = aModel.SaveAndSend( xFrame, aDocType ); } else if ( nId == SID_MAIL_SENDDOCASOOO ) { aDocType = impl_searchFormatTypeForApp(xFrame, E_OOO_DOC); - if (aDocType.getLength() > 0) + if (!aDocType.isEmpty()) eResult = aModel.SaveAndSend( xFrame, aDocType ); } @@ -663,7 +663,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) INetURLObject aFileObj( aLocation ); bool bPrivateProtocol = ( aFileObj.GetProtocol() == INET_PROT_PRIV_SOFFICE ); - bool bHasLocation = ( aLocation.getLength() > 0 ) && !bPrivateProtocol; + bool bHasLocation = !aLocation.isEmpty() && !bPrivateProtocol; css::uno::Reference< css::container::XContainerQuery > xContainerQuery( xSMGR->createInstance( rtl::OUString( @@ -673,7 +673,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) // Retrieve filter from type sal_Int32 nFilterFlags = FILTERFLAG_EXPORT; aFilterName = impl_retrieveFilterNameFromTypeAndModule( xContainerQuery, aTypeName, aModule, nFilterFlags ); - if ( aFilterName.getLength() == 0 ) + if ( aFilterName.isEmpty() ) { // Draw/Impress uses a different type. 2nd chance try to use alternative type name aFilterName = impl_retrieveFilterNameFromTypeAndModule( @@ -682,7 +682,7 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) // No filter found => error // No type and no location => error - if (( aFilterName.getLength() == 0 ) || ( aTypeName.getLength() == 0 )) + if ( aFilterName.isEmpty() || aTypeName.isEmpty()) { rReq.Done(sal_False); return; @@ -702,8 +702,8 @@ void SfxViewShell::ExecMisc_Impl( SfxRequest &rReq ) aFileName = aFObj.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::NO_DECODE ); } - OSL_ASSERT( aFilterName.getLength() > 0 ); - OSL_ASSERT( aFileName.getLength() > 0 ); + OSL_ASSERT( !aFilterName.isEmpty() ); + OSL_ASSERT( !aFileName.isEmpty() ); // Creates a temporary directory to store our predefined file into it. ::utl::TempFile aTempDir( NULL, sal_True ); @@ -863,7 +863,7 @@ void SfxViewShell::GetState_Impl( SfxItemSet &rSet ) aPrinterName = pPrinter->GetName(); else aPrinterName = Printer::GetDefaultPrinterName(); - if ( aPrinterName.getLength() > 0 ) + if ( !aPrinterName.isEmpty() ) { uno::Reference < frame::XFrame > xFrame( pFrame->GetFrame().GetFrameInterface() ); |