diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-05-02 17:53:27 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-04 13:57:07 +0200 |
commit | 2ddc66e6981a7d819cd6196a7ccbc811ca213be2 (patch) | |
tree | ab991ee652a9121ac18213f84d0df7855a2f2e29 /sw/source/uibase/uno | |
parent | dec6bb217dd3ae98bee8e48fab9f8e26b7645b2b (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/uno')
-rw-r--r-- | sw/source/uibase/uno/SwXDocumentSettings.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unomailmerge.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxvw.cxx | 2 |
4 files changed, 5 insertions, 5 deletions
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(); |