diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-05-01 00:53:03 +0300 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-05-02 09:53:48 +0200 |
commit | 855f52ead7fa361b6a73105d1f0086559a8ed5b6 (patch) | |
tree | 042fb792f2c64666ef5fa01436ccafd728860eca /vcl/source | |
parent | 0c434b06a3792a6429fbe718a0231c48597c1ff5 (diff) |
Use hasElements to check Sequence emptiness in [v-x]*
Similar to clang-tidy readability-container-size-empty
Change-Id: I71e7af4ac3043d8d40922e99f8a4798f0993294c
Reviewed-on: https://gerrit.libreoffice.org/71603
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/filter/FilterConfigCache.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/print3.cxx | 16 | ||||
-rw-r--r-- | vcl/source/graphic/UnoGraphicProvider.cxx | 4 | ||||
-rw-r--r-- | vcl/source/treelist/transfer.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/printdlg.cxx | 4 |
6 files changed, 17 insertions, 17 deletions
diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx index 864be3324c07..4e18ac06a8a1 100644 --- a/vcl/source/filter/FilterConfigCache.cxx +++ b/vcl/source/filter/FilterConfigCache.cxx @@ -87,7 +87,7 @@ void FilterConfigCache::FilterConfigCacheEntry::CreateFilterName( const OUString OUString FilterConfigCache::FilterConfigCacheEntry::GetShortName() { OUString aShortName; - if ( lExtensionList.getLength() ) + if ( lExtensionList.hasElements() ) { aShortName = lExtensionList[ 0 ]; if ( aShortName.startsWith( "*." ) ) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 54c891ca6448..218b65a908b9 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -5639,7 +5639,7 @@ class PDFStreamIf : void SAL_CALL PDFStreamIf::writeBytes( const css::uno::Sequence< sal_Int8 >& aData ) { - if( m_bWrite && aData.getLength() ) + if( m_bWrite && aData.hasElements() ) { sal_Int32 nBytes = aData.getLength(); m_pWriter->writeBuffer( aData.getConstArray(), nBytes ); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 78715752b711..b60a2dddc6af 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -1508,7 +1508,7 @@ void PrinterController::setValue( const css::beans::PropertyValue& i_rPropertyVa void PrinterController::setUIOptions( const css::uno::Sequence< css::beans::PropertyValue >& i_rOptions ) { - SAL_WARN_IF( mpImplData->maUIOptions.getLength() != 0, "vcl.gdi", "setUIOptions called twice !" ); + SAL_WARN_IF( mpImplData->maUIOptions.hasElements(), "vcl.gdi", "setUIOptions called twice !" ); mpImplData->maUIOptions = i_rOptions; @@ -1564,7 +1564,7 @@ void PrinterController::setUIOptions( const css::uno::Sequence< css::beans::Prop } if( !aDep.maDependsOnName.isEmpty() ) mpImplData->maControlDependencies[ aPropName ] = aDep; - if( aChoicesDisabled.getLength() > 0 ) + if( aChoicesDisabled.hasElements() ) mpImplData->maChoiceDisableMap[ aPropName ] = aChoicesDisabled; } } @@ -1874,7 +1874,7 @@ css::uno::Any PrinterOptionsHelper::setUIControlOpt(const css::uno::Sequence< OU sal_Int32 nElements = 2 // ControlType + ID + (i_rTitle.isEmpty() ? 0 : 1) // Text - + (i_rHelpIds.getLength() ? 1 : 0) // HelpId + + (i_rHelpIds.hasElements() ? 1 : 0) // HelpId + (i_pVal ? 1 : 0) // Property + i_rControlOptions.maAddProps.size() // additional props + (i_rControlOptions.maGroupHint.isEmpty() ? 0 : 1) // grouping @@ -1897,7 +1897,7 @@ css::uno::Any PrinterOptionsHelper::setUIControlOpt(const css::uno::Sequence< OU aCtrl[nUsed ].Name = "Text"; aCtrl[nUsed++].Value <<= i_rTitle; } - if( i_rHelpIds.getLength() ) + if( i_rHelpIds.hasElements() ) { aCtrl[nUsed ].Name = "HelpId"; aCtrl[nUsed++].Value <<= i_rHelpIds; @@ -2011,10 +2011,10 @@ css::uno::Any PrinterOptionsHelper::setChoiceRadiosControlOpt(const css::uno::Se { UIControlOptions aOpt( i_rControlOptions ); sal_Int32 nUsed = aOpt.maAddProps.size(); - aOpt.maAddProps.resize( nUsed + 1 + (i_rDisabledChoices.getLength() ? 1 : 0) ); + aOpt.maAddProps.resize( nUsed + 1 + (i_rDisabledChoices.hasElements() ? 1 : 0) ); aOpt.maAddProps[nUsed].Name = "Choices"; aOpt.maAddProps[nUsed].Value <<= i_rChoices; - if( i_rDisabledChoices.getLength() ) + if( i_rDisabledChoices.hasElements() ) { aOpt.maAddProps[nUsed+1].Name = "ChoicesDisabled"; aOpt.maAddProps[nUsed+1].Value <<= i_rDisabledChoices; @@ -2037,10 +2037,10 @@ css::uno::Any PrinterOptionsHelper::setChoiceListControlOpt(const OUString& i_rI { UIControlOptions aOpt( i_rControlOptions ); sal_Int32 nUsed = aOpt.maAddProps.size(); - aOpt.maAddProps.resize( nUsed + 1 + (i_rDisabledChoices.getLength() ? 1 : 0) ); + aOpt.maAddProps.resize( nUsed + 1 + (i_rDisabledChoices.hasElements() ? 1 : 0) ); aOpt.maAddProps[nUsed].Name = "Choices"; aOpt.maAddProps[nUsed].Value <<= i_rChoices; - if( i_rDisabledChoices.getLength() ) + if( i_rDisabledChoices.hasElements() ) { aOpt.maAddProps[nUsed+1].Name = "ChoicesDisabled"; aOpt.maAddProps[nUsed+1].Value <<= i_rDisabledChoices; diff --git a/vcl/source/graphic/UnoGraphicProvider.cxx b/vcl/source/graphic/UnoGraphicProvider.cxx index 450fd2b26f4b..95292ee13186 100644 --- a/vcl/source/graphic/UnoGraphicProvider.cxx +++ b/vcl/source/graphic/UnoGraphicProvider.cxx @@ -202,7 +202,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadBitmap( const uno ReadDIB(aBmp, aBmpStream, true); - if( aMaskSeq.getLength() ) + if( aMaskSeq.hasElements() ) { SvMemoryStream aMaskStream( aMaskSeq.getArray(), aMaskSeq.getLength(), StreamMode::READ ); Bitmap aMask; @@ -816,7 +816,7 @@ void SAL_CALL GraphicProvider::storeGraphic( const uno::Reference< ::graphic::XG { rFilter.ExportGraphic( aGraphic, aPath, aMemStrm, rFilter.GetExportFormatNumberForShortName( OUString::createFromAscii( pFilterShortName ) ), - ( aFilterDataSeq.getLength() ? &aFilterDataSeq : nullptr ) ); + ( aFilterDataSeq.hasElements() ? &aFilterDataSeq : nullptr ) ); } pOStm->WriteBytes( aMemStrm.GetData(), aMemStrm.TellEnd() ); } diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx index 9f538cfef5b9..c9cf060a4fc7 100644 --- a/vcl/source/treelist/transfer.cxx +++ b/vcl/source/treelist/transfer.cxx @@ -2011,14 +2011,14 @@ bool TransferableDataHelper::GetSotStorageStream( const DataFlavor& rFlavor, too { Sequence<sal_Int8> aSeq = GetSequence(rFlavor, OUString()); - if (aSeq.getLength()) + if (aSeq.hasElements()) { rxStream = new SotStorageStream( "" ); rxStream->WriteBytes( aSeq.getConstArray(), aSeq.getLength() ); rxStream->Seek( 0 ); } - return aSeq.getLength(); + return aSeq.hasElements(); } Reference<XInputStream> TransferableDataHelper::GetInputStream( SotClipboardFormatId nFormat, const OUString& rDestDoc ) @@ -2034,7 +2034,7 @@ Reference<XInputStream> TransferableDataHelper::GetInputStream( const DataFlavor { Sequence<sal_Int8> aSeq = GetSequence(rFlavor, rDestDoc); - if (!aSeq.getLength()) + if (!aSeq.hasElements()) return Reference<XInputStream>(); Reference<XInputStream> xStream(new comphelper::SequenceInputStream(aSeq)); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index e34633ebc1c4..9ece9c929ffd 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -1461,11 +1461,11 @@ void PrintDialog::setupOptionalUI() mpTabCtrl->SetPageText(nPageId, aText); // set help id - if (aHelpIds.getLength() > 0) + if (aHelpIds.hasElements()) mpTabCtrl->SetHelpId(nPageId, OUStringToOString(aHelpIds.getConstArray()[0], RTL_TEXTENCODING_UTF8)); // set help text - if (aHelpTexts.getLength() > 0) + if (aHelpTexts.hasElements()) mpTabCtrl->SetHelpText(nPageId, aHelpTexts.getConstArray()[0]); pPage->Show(); |