diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-05-04 21:20:18 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-06-05 19:24:57 +0200 |
commit | 2ed3d691b42525f6c1cc430d5863febcb102816e (patch) | |
tree | 97088acb96f8ad26f2ae67f3f8e5c2f6aab05cf0 /cui | |
parent | 6c31c2b01dd32cc7ba1230f2c4a98b8f7def219b (diff) |
Use hasElements to check Sequence emptiness in cppcanvas..desktop
Similar to clang-tidy readability-container-size-empty
Change-Id: I81c0ff78d2ecc7d984e3ed5e5ce60efe327fc162
Reviewed-on: https://gerrit.libreoffice.org/71799
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/customize/SvxConfigPageHelper.cxx | 2 | ||||
-rw-r--r-- | cui/source/customize/cfg.cxx | 4 | ||||
-rw-r--r-- | cui/source/dialogs/SignSignatureLineDialog.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/SpellDialog.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/hangulhanjadlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/insdlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/screenshotannotationdlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/scriptdlg.cxx | 2 | ||||
-rw-r--r-- | cui/source/dialogs/thesdlg.cxx | 4 | ||||
-rw-r--r-- | cui/source/options/cfgchart.cxx | 2 | ||||
-rw-r--r-- | cui/source/options/optlingu.cxx | 16 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 2 |
12 files changed, 21 insertions, 21 deletions
diff --git a/cui/source/customize/SvxConfigPageHelper.cxx b/cui/source/customize/SvxConfigPageHelper.cxx index e57858d0048a..2a707b3f5c74 100644 --- a/cui/source/customize/SvxConfigPageHelper.cxx +++ b/cui/source/customize/SvxConfigPageHelper.cxx @@ -101,7 +101,7 @@ css::uno::Reference< css::graphic::XGraphic > SvxConfigPageHelper::GetGraphic( aGraphicSeq = xImageManager->getImages( GetImageType(), aImageCmdSeq ); - if ( aGraphicSeq.getLength() > 0 ) + if ( aGraphicSeq.hasElements() ) { result = aGraphicSeq[0]; } diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index bf583d4d37a4..f3c2c1dce224 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -2725,7 +2725,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog(weld::Window *pWindow, { name[ 0 ] = elem.first; uno::Sequence< uno::Reference< graphic::XGraphic> > graphics = m_xImportedImageManager->getImages( SvxConfigPageHelper::GetImageType(), name ); - if ( graphics.getLength() > 0 ) + if ( graphics.hasElements() ) { m_aGraphics.push_back(graphics[0]); Image img(graphics[0]); @@ -2771,7 +2771,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog(weld::Window *pWindow, // added to the list } - if ( graphics.getLength() > 0 ) + if ( graphics.hasElements() ) { Image img(graphics[0]); if (!img.GetBitmapEx().IsEmpty()) diff --git a/cui/source/dialogs/SignSignatureLineDialog.cxx b/cui/source/dialogs/SignSignatureLineDialog.cxx index 12c6590934fb..ecdacc4a0e0e 100644 --- a/cui/source/dialogs/SignSignatureLineDialog.cxx +++ b/cui/source/dialogs/SignSignatureLineDialog.cxx @@ -142,7 +142,7 @@ IMPL_LINK_NOARG(SignSignatureLineDialog, loadImage, weld::Button&, void) if (xFilePicker->execute()) { Sequence<OUString> aSelectedFiles = xFilePicker->getSelectedFiles(); - if (aSelectedFiles.getLength() < 1) + if (!aSelectedFiles.hasElements()) return; Reference<XGraphicProvider> xProvider = GraphicProvider::create(xContext); diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index 89474b59222f..8c6773efb98c 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -1612,7 +1612,7 @@ bool SentenceEditWindow_Impl::MarkNextError( bool bIgnoreCurrentError, const css pAction->SetErrorMove(nOldErrorStart, nOldErrorEnd); const SpellErrorAttrib* pOldAttrib = static_cast<const SpellErrorAttrib*>( pTextEngine->FindAttrib( TextPaM(0, nOldErrorStart), TEXTATTR_SPELL_ERROR )); - pAction->SetErrorLanguageSelected(pOldAttrib && pOldAttrib->GetErrorDescription().aSuggestions.getLength() && + pAction->SetErrorLanguageSelected(pOldAttrib && pOldAttrib->GetErrorDescription().aSuggestions.hasElements() && LanguageTag( pOldAttrib->GetErrorDescription().aLocale).getLanguageType() == GetSpellDialog()->m_pLanguageLB->GetSelectedLanguage()); AddUndoAction(std::move(pAction)); diff --git a/cui/source/dialogs/hangulhanjadlg.cxx b/cui/source/dialogs/hangulhanjadlg.cxx index 342b35352782..65633ab79461 100644 --- a/cui/source/dialogs/hangulhanjadlg.cxx +++ b/cui/source/dialogs/hangulhanjadlg.cxx @@ -1192,7 +1192,7 @@ namespace svx _rOrg.getLength(), ConversionDirection_FROM_LEFT, css::i18n::TextConversionOption::NONE ); - bRet = _rEntries.getLength() > 0; + bRet = _rEntries.hasElements(); } catch( const IllegalArgumentException& ) { diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index 474bd7af4d95..2d9b5b8b9756 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -320,7 +320,7 @@ short SvInsertOleDlg::run() uno::Reference< io::XInputStream > SvInsertOleDlg::GetIconIfIconified( OUString* pGraphicMediaType ) { - if ( m_aIconMetaFile.getLength() ) + if ( m_aIconMetaFile.hasElements() ) { if ( pGraphicMediaType ) *pGraphicMediaType = m_aIconMediaType; diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx b/cui/source/dialogs/screenshotannotationdlg.cxx index e567944d226c..1536c19d4cfa 100644 --- a/cui/source/dialogs/screenshotannotationdlg.cxx +++ b/cui/source/dialogs/screenshotannotationdlg.cxx @@ -357,7 +357,7 @@ IMPL_LINK_NOARG(ScreenshotAnnotationDlg_Impl, saveButtonHandler, Button*, void) maLastFolderURL = xFilePicker->getDisplayDirectory(); const uno::Sequence< OUString > files(xFilePicker->getSelectedFiles()); - if (files.getLength()) + if (files.hasElements()) { OUString aConfirmedName = files[0]; diff --git a/cui/source/dialogs/scriptdlg.cxx b/cui/source/dialogs/scriptdlg.cxx index 11ef3a8820e2..75e89daf48ec 100644 --- a/cui/source/dialogs/scriptdlg.cxx +++ b/cui/source/dialogs/scriptdlg.cxx @@ -752,7 +752,7 @@ void SvxScriptOrgDialog::createEntry(weld::TreeIter& rEntry) { aNewName = aNewStdName + OUString::number(i); bool bFound = false; - if(childNodes.getLength() > 0 ) + if(childNodes.hasElements() ) { OUString nodeName = childNodes[0]->getName(); sal_Int32 extnPos = nodeName.lastIndexOf( '.' ); diff --git a/cui/source/dialogs/thesdlg.cxx b/cui/source/dialogs/thesdlg.cxx index 0a9e237e5c9c..f4cc269c0255 100644 --- a/cui/source/dialogs/thesdlg.cxx +++ b/cui/source/dialogs/thesdlg.cxx @@ -79,13 +79,13 @@ uno::Sequence< uno::Reference< linguistic2::XMeaning > > SvxThesaurusDialog::que xThesaurus->queryMeanings( rTerm, rLocale, rProperties ) ); // text with '.' at the end? - if ( 0 == aMeanings.getLength() && rTerm.endsWith(".") ) + if ( !aMeanings.hasElements() && rTerm.endsWith(".") ) { // try again without trailing '.' chars. It may be a word at the // end of a sentence and not an abbreviation... OUString aTxt(comphelper::string::stripEnd(rTerm, '.')); aMeanings = xThesaurus->queryMeanings( aTxt, rLocale, rProperties ); - if (aMeanings.getLength()) + if (aMeanings.hasElements()) { rTerm = aTxt; } diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx index 52ddde097f4c..0427e734ddc7 100644 --- a/cui/source/options/cfgchart.cxx +++ b/cui/source/options/cfgchart.cxx @@ -235,7 +235,7 @@ void SvxChartOptions::ImplCommit() uno::Sequence< OUString > aNames = GetPropertyNames(); uno::Sequence< uno::Any > aValues( aNames.getLength()); - if( aValues.getLength() >= 1 ) + if( aValues.hasElements() ) { // 1. default colors for series // convert list to sequence diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index ed8b59ed5644..3280514c63d7 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -580,7 +580,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() : const Sequence< Locale > aLocales( aInfo.xSpell->getLocales() ); //! suppress display of entries with no supported languages (see feature 110994) - if (aLocales.getLength()) + if (aLocales.hasElements()) { lcl_MergeLocales( aAllServiceLocales, aLocales ); lcl_MergeDisplayArray( *this, aInfo ); @@ -604,7 +604,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() : const Sequence< Locale > aLocales( aInfo.xGrammar->getLocales() ); //! suppress display of entries with no supported languages (see feature 110994) - if (aLocales.getLength()) + if (aLocales.hasElements()) { lcl_MergeLocales( aAllServiceLocales, aLocales ); lcl_MergeDisplayArray( *this, aInfo ); @@ -627,7 +627,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() : const Sequence< Locale > aLocales( aInfo.xHyph->getLocales() ); //! suppress display of entries with no supported languages (see feature 110994) - if (aLocales.getLength()) + if (aLocales.hasElements()) { lcl_MergeLocales( aAllServiceLocales, aLocales ); lcl_MergeDisplayArray( *this, aInfo ); @@ -650,7 +650,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() : const Sequence< Locale > aLocales( aInfo.xThes->getLocales() ); //! suppress display of entries with no supported languages (see feature 110994) - if (aLocales.getLength()) + if (aLocales.hasElements()) { lcl_MergeLocales( aAllServiceLocales, aLocales ); lcl_MergeDisplayArray( *this, aInfo ); @@ -665,22 +665,22 @@ SvxLinguData_Impl::SvxLinguData_Impl() : aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(cSpell, pAllLocales[nLocale]); SetChecked( aCfgSvcs ); - if (aCfgSvcs.getLength()) + if (aCfgSvcs.hasElements()) aCfgSpellTable[ nLang ] = aCfgSvcs; aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(cGrammar, pAllLocales[nLocale]); SetChecked( aCfgSvcs ); - if (aCfgSvcs.getLength()) + if (aCfgSvcs.hasElements()) aCfgGrammarTable[ nLang ] = aCfgSvcs; aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(cHyph, pAllLocales[nLocale]); SetChecked( aCfgSvcs ); - if (aCfgSvcs.getLength()) + if (aCfgSvcs.hasElements()) aCfgHyphTable[ nLang ] = aCfgSvcs; aCfgSvcs = xLinguSrvcMgr->getConfiguredServices(cThes, pAllLocales[nLocale]); SetChecked( aCfgSvcs ); - if (aCfgSvcs.getLength()) + if (aCfgSvcs.hasElements()) aCfgThesTable[ nLang ] = aCfgSvcs; } } diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index ef6f45014818..93b53e01005c 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -270,7 +270,7 @@ MailMergeCfg_Impl::MailMergeCfg_Impl() : Sequence<OUString> aNames { "EMailSupported" }; const Sequence< Any > aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); - if(aValues.getLength() && pValues[0].hasValue()) + if(aValues.hasElements() && pValues[0].hasValue()) pValues[0] >>= bIsEmailSupported; } |