From 2ddc66e6981a7d819cd6196a7ccbc811ca213be2 Mon Sep 17 00:00:00 2001 From: Arkadiy Illarionov Date: Thu, 2 May 2019 17:53:27 +0300 Subject: Use hasElements to check Sequence emptiness in sw Similar to clang-tidy readability-container-size-empty Change-Id: If44f20a7aa678915e32d12101e1af71476f4b590 Reviewed-on: https://gerrit.libreoffice.org/71679 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/uibase/uno/SwXDocumentSettings.cxx | 2 +- sw/source/uibase/uno/unomailmerge.cxx | 2 +- sw/source/uibase/uno/unotxdoc.cxx | 4 ++-- sw/source/uibase/uno/unotxvw.cxx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'sw/source/uibase/uno') diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index 1e7bb75f04a5..924db95bb73e 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -641,7 +641,7 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf if(rValue >>= aNew) { mpDoc->getIDocumentRedlineAccess().SetRedlinePassword(aNew); - if(aNew.getLength()) + if(aNew.hasElements()) { RedlineFlags eMode = mpDoc->getIDocumentRedlineAccess().GetRedlineFlags(); eMode |= RedlineFlags::On; diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index f38cfba8782c..128b9a25765c 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -550,7 +550,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( // need to translate the selection: the API here requires a sequence of bookmarks, but the Merge // method we will call below requires a sequence of indices. - if ( aCurSelection.getLength() ) + if ( aCurSelection.hasElements() ) { Sequence< Any > aTranslated( aCurSelection.getLength() ); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 5b95045842a3..28b3958fc55f 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -1764,7 +1764,7 @@ Reference< XInterface > SwXTextDocument::createInstanceWithArguments( Sequence< OUString > SwXTextDocument::getAvailableServiceNames() { static Sequence< OUString > aServices; - if ( aServices.getLength() == 0 ) + if ( !aServices.hasElements() ) { Sequence< OUString > aRet = SvxFmMSFactory::getAvailableServiceNames(); OUString* pRet = aRet.getArray(); @@ -1896,7 +1896,7 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, const Any& { SwDoc* pDoc = pDocShell->GetDoc(); pDoc->getIDocumentRedlineAccess().SetRedlinePassword(aNew); - if(aNew.getLength()) + if(aNew.hasElements()) { RedlineFlags eMode = pDoc->getIDocumentRedlineAccess().GetRedlineFlags(); eMode |= RedlineFlags::On; diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index 2be21959a05a..12bc55ac579e 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -581,7 +581,7 @@ void SAL_CALL SwXTextView::setRubyList( { SolarMutexGuard aGuard; - if(!GetView() || !rRubyList.getLength()) + if(!GetView() || !rRubyList.hasElements()) throw RuntimeException(); SwWrtShell& rSh = m_pView->GetWrtShell(); ShellMode eSelMode = m_pView->GetShellMode(); -- cgit v1.2.3