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 | |
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>
46 files changed, 89 insertions, 89 deletions
diff --git a/vbahelper/source/msforms/vbacombobox.cxx b/vbahelper/source/msforms/vbacombobox.cxx index 78ceafb5ea88..851cee0a4098 100644 --- a/vbahelper/source/msforms/vbacombobox.cxx +++ b/vbahelper/source/msforms/vbacombobox.cxx @@ -93,7 +93,7 @@ ScVbaComboBox::getListIndex() m_xProps->getPropertyValue( "StringItemList" ) >>= sItems; // should really return the item that has focus regardless of // it been selected - if ( sItems.getLength() > 0 ) + if ( sItems.hasElements() ) { OUString sText = getText(); sal_Int32 nLen = sItems.getLength(); @@ -106,7 +106,7 @@ ScVbaComboBox::getListIndex() } } - } + } SAL_INFO("vbahelper", "getListIndex returning -1" ); return uno::makeAny( sal_Int32( -1 ) ); } diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx index 99c6b41fea33..d33916f8d5af 100644 --- a/vbahelper/source/msforms/vbacontrol.cxx +++ b/vbahelper/source/msforms/vbacontrol.cxx @@ -538,7 +538,7 @@ void SAL_CALL ScVbaControl::fireEvent( const script::ScriptEvent& rEvt ) uno::Reference< uno::XInterface > xIf( xControlShape->getControl(), uno::UNO_QUERY_THROW ); evt.ScriptCode = xNameQuery->getCodeNameForObject( xIf ); // handle if we passed in our own arguments - if ( !rEvt.Arguments.getLength() ) + if ( !rEvt.Arguments.hasElements() ) evt.Arguments[ 0 ] <<= aEvt; xScriptListener->firing( evt ); } diff --git a/vbahelper/source/msforms/vbalistbox.cxx b/vbahelper/source/msforms/vbalistbox.cxx index da919b42dad1..13c878440193 100644 --- a/vbahelper/source/msforms/vbalistbox.cxx +++ b/vbahelper/source/msforms/vbalistbox.cxx @@ -47,7 +47,7 @@ ScVbaListBox::getListIndex() { uno::Sequence< sal_Int16 > sSelection; m_xProps->getPropertyValue( "SelectedItems" ) >>= sSelection; - if ( sSelection.getLength() == 0 ) + if ( !sSelection.hasElements() ) return uno::Any( sal_Int32( -1 ) ); return uno::Any( sSelection[ 0 ] ); } @@ -62,7 +62,7 @@ ScVbaListBox::getValue() if( getMultiSelect() ) throw uno::RuntimeException( "Attribute use invalid." ); uno::Any aRet; - if ( sSelection.getLength() ) + if ( sSelection.hasElements() ) aRet <<= sItems[ sSelection[ 0 ] ]; return aRet; } 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(); diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index 0efa066ebd97..bb396a4b10b6 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -330,7 +330,7 @@ void SelectionManager::initialize( const Sequence< Any >& arguments ) * needs to be added. The display used whould be that of the normal event loop * and synchronization should be done via the SolarMutex. */ - if( arguments.getLength() > 0 ) + if( arguments.hasElements() ) arguments.getConstArray()[0] >>= m_xDisplayConnection; if( ! m_xDisplayConnection.is() ) { @@ -1281,7 +1281,7 @@ bool SelectionManager::getPasteDataTypes( Atom selection, Sequence< DataFlavor > aAtoms = Sequence< sal_Int8 >(); std::vector< Atom > aNativeTypes; - if( aAtoms.getLength() ) + if( aAtoms.hasElements() ) { sal_Int32 nAtoms = aAtoms.getLength() / sizeof(Atom); Atom* pAtoms = reinterpret_cast<Atom*>(aAtoms.getArray()); @@ -3960,7 +3960,7 @@ void SelectionManagerHolder::initialize( const Sequence< Any >& arguments ) { OUString aDisplayName; - if( arguments.getLength() > 0 ) + if( arguments.hasElements() ) { css::uno::Reference< XDisplayConnection > xConn; arguments.getConstArray()[0] >>= xConn; diff --git a/vcl/unx/generic/dtrans/X11_service.cxx b/vcl/unx/generic/dtrans/X11_service.cxx index 5c1f451f8d49..8020b677017f 100644 --- a/vcl/unx/generic/dtrans/X11_service.cxx +++ b/vcl/unx/generic/dtrans/X11_service.cxx @@ -61,7 +61,7 @@ css::uno::Reference< XInterface > X11SalInstance::CreateClipboard( const Sequenc rManager.initialize(mgrArgs); OUString sel; - if (arguments.getLength() == 0) { + if (!arguments.hasElements()) { sel = "CLIPBOARD"; } else if (arguments.getLength() != 1 || !(arguments[0] >>= sel)) { throw css::lang::IllegalArgumentException( diff --git a/vcl/unx/gtk/a11y/atktable.cxx b/vcl/unx/gtk/a11y/atktable.cxx index 91e526e0d3b8..016d697dce59 100644 --- a/vcl/unx/gtk/a11y/atktable.cxx +++ b/vcl/unx/gtk/a11y/atktable.cxx @@ -350,7 +350,7 @@ table_wrapper_get_summary( AtkTable *table ) static gint convertToGIntArray( const uno::Sequence< ::sal_Int32 >& aSequence, gint **pSelected ) { - if( aSequence.getLength() ) + if( aSequence.hasElements() ) { *pSelected = g_new( gint, aSequence.getLength() ); diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index 0ed5b6fe7d71..e82674af9040 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -351,7 +351,7 @@ public: bool FilterEntry::hasSubFilters() const { - return( 0 < m_aSubFilters.getLength() ); + return m_aSubFilters.hasElements(); } void FilterEntry::getSubFilters( css::uno::Sequence< css::beans::StringPair >& _rSubFilterList ) @@ -633,7 +633,7 @@ void SAL_CALL SalGtkFilePicker::appendFilterGroup( const OUString& /*sGroupTitle // ensure that we have a filter list OUString sInitialCurrentFilter; - if( aFilters.getLength() ) + if( aFilters.hasElements() ) sInitialCurrentFilter = aFilters[0].First; ensureFilterVector( sInitialCurrentFilter ); @@ -1580,7 +1580,7 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu { // parameter checking uno::Any aAny; - if( 0 == aArguments.getLength() ) + if( !aArguments.hasElements() ) throw lang::IllegalArgumentException( "no arguments", static_cast<XFilePicker2*>( this ), 1 ); diff --git a/vcl/unx/gtk/salprn-gtk.cxx b/vcl/unx/gtk/salprn-gtk.cxx index c3be7e405451..feec41bb5b4d 100644 --- a/vcl/unx/gtk/salprn-gtk.cxx +++ b/vcl/unx/gtk/salprn-gtk.cxx @@ -429,7 +429,7 @@ GtkPrintDialog::impl_initCustomTab() //Fix fdo#69381 //Next options if this one is empty - if ( aOptProp.getLength() == 0) + if (!aOptProp.hasElements()) continue; for (int n = 0; n != aOptProp.getLength(); n++) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 585061667c0a..e72d659536bd 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -699,7 +699,7 @@ void VclGtkClipboard::removeClipboardListener( const Reference< datatransfer::cl Reference< XInterface > GtkInstance::CreateClipboard(const Sequence< Any >& arguments) { OUString sel; - if (arguments.getLength() == 0) { + if (!arguments.hasElements()) { sel = "CLIPBOARD"; } else if (arguments.getLength() != 1 || !(arguments[0] >>= sel)) { throw css::lang::IllegalArgumentException( diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 6d4e4c86537b..c320758fbcfd 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -1014,11 +1014,11 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab bool bFloating = !aFrameProperties.empty(); // Additional checks: if we can do this. - if (bFloating && m_aTableRanges[0].getLength() > 0 && m_aTableRanges[0][0].getLength() > 0) + if (bFloating && m_aTableRanges[0].hasElements() && m_aTableRanges[0][0].hasElements()) { xStart = m_aTableRanges[0][0][0]; uno::Sequence< uno::Sequence< uno::Reference<text::XTextRange> > >& rLastRow = m_aTableRanges[m_aTableRanges.size() - 1]; - if (rLastRow.getLength()) + if (rLastRow.hasElements()) { uno::Sequence< uno::Reference<text::XTextRange> >& rLastCell = rLastRow[rLastRow.getLength() - 1]; xEnd = rLastCell[1]; diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index d3daa6f9f908..772ff5bdf3c6 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -136,7 +136,7 @@ static void lcl_handleDropdownField( const uno::Reference< beans::XPropertySet > const FFDataHandler::DropDownEntries_t& rEntries = pFFDataHandler->getDropDownEntries(); uno::Sequence< OUString > sItems( rEntries.size() ); ::std::copy( rEntries.begin(), rEntries.end(), sItems.begin()); - if ( sItems.getLength() ) + if ( sItems.hasElements() ) rxFieldProps->setPropertyValue( "Items", uno::makeAny( sItems ) ); sal_Int32 nResult = pFFDataHandler->getDropDownResult().toInt32(); diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index f5f97a5f9daa..4afa77f94f05 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -544,7 +544,7 @@ void ListDef::CreateNumberingRules( DomainMapper& rDMapper, lcl_mergeProperties( rAbsCharStyleProps, rCharStyleProps ); } - if( aAbsCharStyleProps.getLength() ) + if( aAbsCharStyleProps.hasElements() ) { // Change the sequence into a vector PropertyValueVector_t aStyleProps; diff --git a/xmloff/source/chart/SchXMLAxisContext.cxx b/xmloff/source/chart/SchXMLAxisContext.cxx index 29992bb8ca2e..f55877609937 100644 --- a/xmloff/source/chart/SchXMLAxisContext.cxx +++ b/xmloff/source/chart/SchXMLAxisContext.cxx @@ -529,7 +529,7 @@ void SchXMLAxisContext::CreateAxis() if( xCooSysCnt.is() ) { uno::Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() ); - if( aCooSysSeq.getLength() ) + if( aCooSysSeq.hasElements() ) { bool bSwapXandYAxis = false; Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] ); @@ -732,7 +732,7 @@ void SchXMLAxisContext::CorrectAxisPositions( const Reference< chart2::XChartDoc { Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xNewDoc->getFirstDiagram(), uno::UNO_QUERY_THROW ); uno::Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); - if( aCooSysSeq.getLength() ) + if( aCooSysSeq.hasElements() ) { Reference< chart2::XCoordinateSystem > xCooSys( aCooSysSeq[0] ); if( xCooSys.is() ) diff --git a/xmloff/source/chart/SchXMLChartContext.cxx b/xmloff/source/chart/SchXMLChartContext.cxx index b7f0a2ff8087..7c3d355f9c64 100644 --- a/xmloff/source/chart/SchXMLChartContext.cxx +++ b/xmloff/source/chart/SchXMLChartContext.cxx @@ -93,7 +93,7 @@ void lcl_MoveDataToCandleStickSeries( { uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aLabeledSeq( xDataSource->getDataSequences()); - if( aLabeledSeq.getLength()) + if( aLabeledSeq.hasElements()) { lcl_setRoleAtLabeledSequence( aLabeledSeq[0], rRole ); @@ -121,7 +121,7 @@ void lcl_setRoleAtFirstSequence( if( xSource.is()) { uno::Sequence< uno::Reference< chart2::data::XLabeledDataSequence > > aSeq( xSource->getDataSequences()); - if( aSeq.getLength()) + if( aSeq.hasElements()) lcl_setRoleAtLabeledSequence( aSeq[0], rRole ); } } @@ -156,7 +156,7 @@ void lcl_removeEmptyChartTypeGroups( const uno::Reference< chart2::XChartDocumen for( sal_Int32 nJ=aCTSeq.getLength(); nJ-- && (nRemainingGroups > 1); ) { uno::Reference< chart2::XDataSeriesContainer > xDSCnt( aCTSeq[nJ], uno::UNO_QUERY_THROW ); - if( xDSCnt->getDataSeries().getLength() == 0 ) + if( !xDSCnt->getDataSeries().hasElements() ) { // note: iterator stays valid as we have a local sequence xCTCnt->removeChartType( aCTSeq[nJ] ); diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index 337864d809fb..6507cb91b926 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -665,7 +665,7 @@ bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSeque try { xProp->getPropertyValue("HiddenValues") >>= aHiddenValues; - if( !aHiddenValues.getLength() ) + if( !aHiddenValues.hasElements() ) return true; } catch( const uno::Exception& ) @@ -673,7 +673,7 @@ bool lcl_SequenceHasUnhiddenData( const uno::Reference< chart2::data::XDataSeque return true; } } - return xDataSequence->getData().getLength(); + return xDataSequence->getData().hasElements(); } typedef vector< OUString > tStringVector; @@ -1230,7 +1230,7 @@ void SchXMLExportHelper_Impl::parseDocument( Reference< chart::XChartDocument > } //column-mapping or row-mapping - if( maSequenceMapping.getLength() ) + if( maSequenceMapping.hasElements() ) { enum XMLTokenEnum eTransToken = ::xmloff::token::XML_ROW_MAPPING; if( mbRowSourceColumns ) @@ -1633,7 +1633,7 @@ void SchXMLExportHelper_Impl::exportTable() if( nC < nComplexCount ) { const Sequence< uno::Any >& rComplexLabel = rComplexColumnDescriptions[nC]; - if( rComplexLabel.getLength()>0 ) + if( rComplexLabel.hasElements() ) { double fValue=0.0; if( rComplexLabel[0] >>=fValue ) @@ -1688,7 +1688,7 @@ void SchXMLExportHelper_Impl::exportTable() if( nC < nComplexCount ) { const Sequence< uno::Any >& rComplexLabel = rComplexRowDescriptions[nC]; - if( rComplexLabel.getLength()>0 ) + if( rComplexLabel.hasElements() ) { double fValue=0.0; if( rComplexLabel[0] >>=fValue ) @@ -1762,7 +1762,7 @@ Reference< chart2::XCoordinateSystem > lcl_getCooSys( const Reference< chart2::X if(xCooSysCnt.is()) { Sequence< Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems() ); - if(aCooSysSeq.getLength()>0) + if(aCooSysSeq.hasElements()) xCooSys = aCooSysSeq[0]; } return xCooSys; @@ -2493,7 +2493,7 @@ namespace } else { - if( !aData.getLength() ) + if( !aData.hasElements() ) aData = xDataSequence->getData(); OUString aString; sal_Int32 nCount = aData.getLength(); diff --git a/xmloff/source/chart/SchXMLImport.cxx b/xmloff/source/chart/SchXMLImport.cxx index 57e4e5fe05a7..bc3219ee0115 100644 --- a/xmloff/source/chart/SchXMLImport.cxx +++ b/xmloff/source/chart/SchXMLImport.cxx @@ -454,7 +454,7 @@ Reference< chart2::XDataSeries > SchXMLImportHelper::GetNewDataSeries( uno::UNO_QUERY ); if( xCurrentType.is()) { - if( bPushLastChartType && aChartTypes.getLength()) + if( bPushLastChartType && aChartTypes.hasElements()) { sal_Int32 nIndex( aChartTypes.getLength() - 1 ); aChartTypes.realloc( aChartTypes.getLength() + 1 ); diff --git a/xmloff/source/chart/SchXMLTableContext.cxx b/xmloff/source/chart/SchXMLTableContext.cxx index 9dceca28faed..cb0423c92976 100644 --- a/xmloff/source/chart/SchXMLTableContext.cxx +++ b/xmloff/source/chart/SchXMLTableContext.cxx @@ -379,7 +379,7 @@ void SchXMLTableContext::EndElement() void SchXMLTableContext::setRowPermutation( const uno::Sequence< sal_Int32 > & rPermutation ) { maRowPermutation = rPermutation; - mbHasRowPermutation = ( rPermutation.getLength() > 0 ); + mbHasRowPermutation = rPermutation.hasElements(); if( mbHasRowPermutation && mbHasColumnPermutation ) { @@ -391,7 +391,7 @@ void SchXMLTableContext::setRowPermutation( const uno::Sequence< sal_Int32 > & r void SchXMLTableContext::setColumnPermutation( const uno::Sequence< sal_Int32 > & rPermutation ) { maColumnPermutation = rPermutation; - mbHasColumnPermutation = ( rPermutation.getLength() > 0 ); + mbHasColumnPermutation = rPermutation.hasElements(); if( mbHasColumnPermutation && mbHasRowPermutation ) { @@ -716,7 +716,7 @@ static void lcl_ApplyCellToComplexLabel( const SchXMLCell& rCell, Sequence< uno: rComplexLabel.realloc(1); rComplexLabel[0] <<= rCell.aString; } - else if( rCell.aComplexString.getLength() && rCell.eType == SCH_CELL_TYPE_COMPLEX_STRING ) + else if( rCell.aComplexString.hasElements() && rCell.eType == SCH_CELL_TYPE_COMPLEX_STRING ) { sal_Int32 nCount = rCell.aComplexString.getLength(); rComplexLabel.realloc( nCount ); diff --git a/xmloff/source/core/RDFaExportHelper.cxx b/xmloff/source/core/RDFaExportHelper.cxx index ea90734c99e0..2d0c48a2c4d0 100644 --- a/xmloff/source/core/RDFaExportHelper.cxx +++ b/xmloff/source/core/RDFaExportHelper.cxx @@ -121,7 +121,7 @@ RDFaExportHelper::AddRDFa( uno::Sequence<rdf::Statement> const & rStatements( RDFaResult.First ); - if (0 == rStatements.getLength()) + if (!rStatements.hasElements()) { return; // no RDFa } diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 3f94c56586bc..c6746b3ea51b 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -1100,7 +1100,7 @@ void SvXMLExport::ImplExportSettings() for (auto const& settings : aSettings) { - if ( !settings.aSettings.getLength() ) + if ( !settings.aSettings.hasElements() ) continue; const OUString& sSettingsName( GetXMLToken( settings.eGroupName ) ); @@ -1787,7 +1787,7 @@ void SvXMLExport::GetViewSettingsAndViews(uno::Sequence<beans::PropertyValue>& r uno::Sequence<beans::PropertyValue> aProps; if( aAny >>= aProps ) { - if( aProps.getLength() > 0 ) + if( aProps.hasElements() ) { bAdd = true; break; diff --git a/xmloff/source/draw/animationexport.cxx b/xmloff/source/draw/animationexport.cxx index 84387f7624da..b721d22fce90 100644 --- a/xmloff/source/draw/animationexport.cxx +++ b/xmloff/source/draw/animationexport.cxx @@ -1140,7 +1140,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat } Sequence< Any > aValues( xAnimate->getValues() ); - if( aValues.getLength() ) + if( aValues.hasElements() ) { aTemp <<= aValues; convertValue( eAttributeName, sTmp, aTemp ); @@ -1173,7 +1173,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat if(nNodeType != AnimationNodeType::SET) { Sequence< double > aKeyTimes( xAnimate->getKeyTimes() ); - if( aKeyTimes.getLength() ) + if( aKeyTimes.hasElements() ) { sal_Int32 nLength = aKeyTimes.getLength(); const double* p = aKeyTimes.getConstArray(); @@ -1217,7 +1217,7 @@ void AnimationsExporterImpl::exportAnimate( const Reference< XAnimate >& xAnimat } Sequence< TimeFilterPair > aTimeFilter( xAnimate->getTimeFilter() ); - if( aTimeFilter.getLength() ) + if( aTimeFilter.hasElements() ) { sal_Int32 nLength = aTimeFilter.getLength(); const TimeFilterPair* p = aTimeFilter.getConstArray(); diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 58d2c2c811b5..c10213a3d7a7 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2053,7 +2053,7 @@ void XMLShapeExport::ImpExportLineShape( if (pSourcePolyPolygon->getLength() > 0) { const drawing::PointSequence& rInnerSequence = (*pSourcePolyPolygon)[0]; - if (rInnerSequence.getLength() > 0) + if (rInnerSequence.hasElements()) { const awt::Point& rPoint = rInnerSequence[0]; aStart = awt::Point(rPoint.X + aBasePosition.X, rPoint.Y + aBasePosition.Y); @@ -4674,7 +4674,7 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > aPathTextFrames; if ( rProp.Value >>= aPathTextFrames ) { - if ( static_cast<sal_uInt16>(aPathTextFrames.getLength()) ) + if ( aPathTextFrames.hasElements() ) { sal_uInt16 k, nElements = static_cast<sal_uInt16>(aPathTextFrames.getLength()); for ( k = 0; k < nElements; k++ ) diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 9f67a8225821..43ca70cb59ed 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -2867,7 +2867,7 @@ void SdXMLAppletShapeContext::EndElement() xProps->setPropertyValue("VisibleArea", Any(aRect) ); } - if( maParams.getLength() ) + if( maParams.hasElements() ) { xProps->setPropertyValue("AppletCommands", Any(maParams) ); } @@ -3083,7 +3083,7 @@ void SdXMLPluginShapeContext::EndElement() if( !mbMedia ) { // in case we have a plugin object - if( maParams.getLength() ) + if( maParams.hasElements() ) { xProps->setPropertyValue("PluginCommands", Any(maParams) ); } diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index 1642fcfd8247..20aebd730727 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -216,7 +216,7 @@ namespace xmloff void OElementExport::exportEvents() { - if (!m_aEvents.getLength()) + if (!m_aEvents.hasElements()) // nothing to do return; @@ -1232,7 +1232,7 @@ namespace xmloff { Sequence< OUString > aListSourceSequence; aListSource >>= aListSourceSequence; - if ( aListSourceSequence.getLength() ) + if ( aListSourceSequence.hasElements() ) sListSource = aListSourceSequence[ 0 ]; } return sListSource; diff --git a/xmloff/source/meta/xmlmetae.cxx b/xmloff/source/meta/xmlmetae.cxx index 865d536b385c..9ee67dd9bf63 100644 --- a/xmloff/source/meta/xmlmetae.cxx +++ b/xmloff/source/meta/xmlmetae.cxx @@ -254,7 +254,7 @@ void SvXMLMetaExport::MExport_() const uno::Sequence< beans::NamedValue > aDocStatistic = mxDocProps->getDocumentStatistics(); // write document statistic if there is any provided - if ( aDocStatistic.getLength() ) + if ( aDocStatistic.hasElements() ) { for ( sal_Int32 nInd = 0; nInd < aDocStatistic.getLength(); nInd++ ) { diff --git a/xmloff/source/style/XMLFontStylesContext.cxx b/xmloff/source/style/XMLFontStylesContext.cxx index b31bd380e0ee..b56460353b0b 100644 --- a/xmloff/source/style/XMLFontStylesContext.cxx +++ b/xmloff/source/style/XMLFontStylesContext.cxx @@ -277,7 +277,7 @@ const char EOT_FORMAT[] = "embedded-opentype"; void XMLFontStyleContextFontFaceUri::EndElement() { - if( ( linkPath.getLength() == 0 ) && ( maFontData.getLength() == 0 ) ) + if( ( linkPath.getLength() == 0 ) && ( !maFontData.hasElements() ) ) { SAL_WARN( "xmloff", "svg:font-face-uri tag with no link or base64 data; ignoring." ); return; @@ -299,7 +299,7 @@ void XMLFontStyleContextFontFaceUri::EndElement() SAL_WARN( "xmloff", "Unknown format of embedded font; assuming TTF." ); eot = false; } - if ( maFontData.getLength() == 0 ) + if ( !maFontData.hasElements() ) handleEmbeddedFont( linkPath, eot ); else handleEmbeddedFont( maFontData, eot ); diff --git a/xmloff/source/style/tabsthdl.cxx b/xmloff/source/style/tabsthdl.cxx index 76dd4a70160b..c70e73f1dc9c 100644 --- a/xmloff/source/style/tabsthdl.cxx +++ b/xmloff/source/style/tabsthdl.cxx @@ -45,7 +45,7 @@ bool XMLTabStopPropHdl::equals( const uno::Any& r1, const uno::Any& r2 ) const if( aSeq1.getLength() == aSeq2.getLength() ) { bEqual = true; - if( aSeq1.getLength() > 0 ) + if( aSeq1.hasElements() ) { const style::TabStop* pTabs1 = aSeq1.getConstArray(); const style::TabStop* pTabs2 = aSeq2.getConstArray(); diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx index 1391f7937722..1790478651e3 100644 --- a/xmloff/source/style/xmlimppr.cxx +++ b/xmloff/source/style/xmlimppr.cxx @@ -689,7 +689,7 @@ bool SvXMLImportPropertyMapper::FillTolerantMultiPropertySet_( try { Sequence< SetPropertyTolerantFailed > aResults(rTolMultiPropSet->setPropertyValuesTolerant( aNames, aValues )); - if (aResults.getLength() == 0) + if (!aResults.hasElements()) bSuccessful = true; else { diff --git a/xmloff/source/text/XMLRedlineExport.cxx b/xmloff/source/text/XMLRedlineExport.cxx index 672eeb4f26f9..7e21cacd9a88 100644 --- a/xmloff/source/text/XMLRedlineExport.cxx +++ b/xmloff/source/text/XMLRedlineExport.cxx @@ -377,7 +377,7 @@ void XMLRedlineExport::ExportChangedRegion( // if we actually got a hierarchical change, make element and // process change info - if (aSuccessorData.getLength() > 0) + if (aSuccessorData.hasElements()) { // The only change that can be "undone" is an insertion - // after all, you can't re-insert an deletion, but you can diff --git a/xmloff/source/text/XMLSectionExport.cxx b/xmloff/source/text/XMLSectionExport.cxx index 45b02e05c35d..ed9e9e2e6cae 100644 --- a/xmloff/source/text/XMLSectionExport.cxx +++ b/xmloff/source/text/XMLSectionExport.cxx @@ -396,7 +396,7 @@ void XMLSectionExport::ExportRegularSectionStart( } Sequence<sal_Int8> aPassword; xPropSet->getPropertyValue("ProtectionKey") >>= aPassword; - if (aPassword.getLength() > 0) + if (aPassword.hasElements()) { OUStringBuffer aBuffer; ::comphelper::Base64::encode(aBuffer, aPassword); diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 8576b261d5ce..df43562daf23 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -2852,7 +2852,7 @@ bool XMLTextFieldExport::GetDependentFieldPropertySet( aAny >>= aFields; // any fields? - if (aFields.getLength() > 0) + if (aFields.hasElements()) { // get first one and return Reference<XDependentTextField> xTField = aFields[0]; diff --git a/xmloff/source/transform/Oasis2OOo.cxx b/xmloff/source/transform/Oasis2OOo.cxx index 966f2291ff2d..5a73c1e86f02 100644 --- a/xmloff/source/transform/Oasis2OOo.cxx +++ b/xmloff/source/transform/Oasis2OOo.cxx @@ -1552,7 +1552,7 @@ void XMLTrackedChangesOASISTContext_Impl::StartElement( Any aAny = rPropSet->getPropertyValue( aPropName); Sequence < sal_Int8 > aKey; aAny >>= aKey; - if( aKey.getLength() ) + if( aKey.hasElements() ) { OUStringBuffer aBuffer; ::comphelper::Base64::encode( aBuffer, aKey ); diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx index 48acefb63f14..186dc6923f61 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_expmodels.cxx @@ -89,7 +89,7 @@ void ElementDescriptor::readMultiPageModel( StyleBag * all_styles ) readEvents(); uno::Reference< container::XNameContainer > xPagesContainer( _xProps, uno::UNO_QUERY ); - if ( xPagesContainer.is() && xPagesContainer->getElementNames().getLength() ) + if ( xPagesContainer.is() && xPagesContainer->getElementNames().hasElements() ) { ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument ); pElem->readBullitinBoard( all_styles ); @@ -124,7 +124,7 @@ void ElementDescriptor::readFrameModel( StyleBag * all_styles ) addSubElement( title ); } uno::Reference< container::XNameContainer > xControlContainer( _xProps, uno::UNO_QUERY ); - if ( xControlContainer.is() && xControlContainer->getElementNames().getLength() ) + if ( xControlContainer.is() && xControlContainer->getElementNames().hasElements() ) { ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument ); pElem->readBullitinBoard( all_styles ); @@ -154,7 +154,7 @@ void ElementDescriptor::readPageModel( StyleBag * all_styles ) readDefaults(); readStringAttr( "Title", XMLNS_DIALOGS_PREFIX ":title" ); uno::Reference< container::XNameContainer > xControlContainer( _xProps, uno::UNO_QUERY ); - if ( xControlContainer.is() && xControlContainer->getElementNames().getLength() ) + if ( xControlContainer.is() && xControlContainer->getElementNames().hasElements() ) { ElementDescriptor * pElem = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":bulletinboard", _xDocument ); pElem->readBullitinBoard( all_styles ); @@ -314,7 +314,7 @@ void ElementDescriptor::readComboBoxModel( StyleBag * all_styles ) // string item list Sequence< OUString > itemValues; - if ((readProp( "StringItemList" ) >>= itemValues) && itemValues.getLength() > 0) + if ((readProp( "StringItemList" ) >>= itemValues) && itemValues.hasElements()) { ElementDescriptor * popup = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menupopup", _xDocument ); @@ -362,7 +362,7 @@ void ElementDescriptor::readListBoxModel( StyleBag * all_styles ) readDataAwareAttr( XMLNS_DIALOGS_PREFIX ":source-cell-range" ); // string item list Sequence< OUString > itemValues; - if ((readProp( "StringItemList" ) >>= itemValues) && itemValues.getLength() > 0) + if ((readProp( "StringItemList" ) >>= itemValues) && itemValues.hasElements()) { ElementDescriptor * popup = new ElementDescriptor( _xProps, _xPropState, XMLNS_DIALOGS_PREFIX ":menupopup", _xDocument ); diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx index 82cf6eca2116..9341952eef35 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_export.cxx @@ -1397,7 +1397,7 @@ void exportDialogModel( // dump out stylebag all_styles.dump( xOut ); - if ( xDialogModel->getElementNames().getLength() ) + if ( xDialogModel->getElementNames().hasElements() ) { // open up bulletinboard OUString aBBoardName( XMLNS_DIALOGS_PREFIX ":bulletinboard" ); diff --git a/xmlsecurity/source/component/documentdigitalsignatures.cxx b/xmlsecurity/source/component/documentdigitalsignatures.cxx index 43b74580d472..5e2f2d5ee056 100644 --- a/xmlsecurity/source/component/documentdigitalsignatures.cxx +++ b/xmlsecurity/source/component/documentdigitalsignatures.cxx @@ -207,7 +207,7 @@ void DocumentDigitalSignatures::initialize( const Sequence< Any >& aArguments) m_nArgumentsCount = aArguments.getLength(); - if (aArguments.getLength() > 0) + if (aArguments.hasElements()) { if (!(aArguments[0] >>= m_sODFVersion)) throw css::lang::IllegalArgumentException( diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index b1e9ff3c3437..f0023fbcb87e 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -57,7 +57,7 @@ CertificateViewer::CertificateViewer(weld::Window* _pParent, mxGeneralPage.reset(new CertificateViewerGeneralTP(mxTabCtrl->get_page("general"), this)); mxDetailsPage.reset(new CertificateViewerDetailsTP(mxTabCtrl->get_page("details"), this)); - if (mxSecurityEnvironment->buildCertificatePath(mxCert).getLength() == 0) + if (!mxSecurityEnvironment->buildCertificatePath(mxCert).hasElements()) mxTabCtrl->remove_page("path"); else mxPathId.reset(new CertificateViewerCertPathTP(mxTabCtrl->get_page("path"), this)); diff --git a/xmlsecurity/source/helper/documentsignaturemanager.cxx b/xmlsecurity/source/helper/documentsignaturemanager.cxx index 8ca9f07f4d64..9cd197e786ae 100644 --- a/xmlsecurity/source/helper/documentsignaturemanager.cxx +++ b/xmlsecurity/source/helper/documentsignaturemanager.cxx @@ -133,7 +133,7 @@ bool DocumentSignatureManager::IsXAdESRelevant() bool DocumentSignatureManager::readManifest() { // Check if manifest was already read - if (m_manifest.getLength() > 0) + if (m_manifest.hasElements()) return true; if (!mxContext.is()) diff --git a/xmlsecurity/source/xmlsec/biginteger.cxx b/xmlsecurity/source/xmlsec/biginteger.cxx index 421bbeba3d04..0bfcbd326de1 100644 --- a/xmlsecurity/source/xmlsec/biginteger.cxx +++ b/xmlsecurity/source/xmlsec/biginteger.cxx @@ -77,7 +77,7 @@ OUString bigIntegerToNumericString ( const Sequence< sal_Int8 >& integer ) { OUString aRet ; - if( integer.getLength() ) { + if( integer.hasElements() ) { xmlSecBn bn ; xmlChar* chNumeral ; diff --git a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx index af114619e7f9..104414f815de 100644 --- a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx +++ b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx @@ -103,7 +103,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::convertWithCipherContext( c throw lang::DisposedException(); uno::Sequence< sal_Int8 > aToConvert; - if ( aData.getLength() ) + if ( aData.hasElements() ) { sal_Int32 nOldLastBlockLen = m_aLastBlock.getLength(); OSL_ENSURE( nOldLastBlockLen <= m_nBlockSize, "Unexpected last block size!" ); @@ -154,7 +154,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::convertWithCipherContext( c uno::Sequence< sal_Int8 > aResult; OSL_ENSURE( aToConvert.getLength() % m_nBlockSize == 0, "Unexpected size of the data to encrypt!" ); - if ( aToConvert.getLength() ) + if ( aToConvert.hasElements() ) { int nResultLen = 0; aResult.realloc( aToConvert.getLength() + m_nBlockSize ); @@ -214,7 +214,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDis OSL_ENSURE( m_aLastBlock.getLength() < m_nBlockSize * 2 , "Unexpected size of cashed incomplete last block!" ); uno::Sequence< sal_Int8 > aResult; - if ( m_aLastBlock.getLength() ) + if ( m_aLastBlock.hasElements() ) { int nPrefResLen = 0; aResult.realloc( m_aLastBlock.getLength() + m_nBlockSize ); diff --git a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx index 238f1bb9e41a..688a94d31a5e 100644 --- a/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx +++ b/xmlsecurity/source/xmlsec/nss/nssinitializer.cxx @@ -539,7 +539,7 @@ css::uno::Reference< css::xml::crypto::XDigestContext > SAL_CALL ONSSInitializer else throw css::lang::IllegalArgumentException("Unexpected digest requested.", css::uno::Reference< css::uno::XInterface >(), 1 ); - if ( aParams.getLength() ) + if ( aParams.hasElements() ) throw css::lang::IllegalArgumentException("Unexpected arguments provided for digest creation.", css::uno::Reference< css::uno::XInterface >(), 2 ); css::uno::Reference< css::xml::crypto::XDigestContext > xResult; @@ -566,7 +566,7 @@ css::uno::Reference< css::xml::crypto::XCipherContext > SAL_CALL ONSSInitializer if ( aKey.getLength() != 16 && aKey.getLength() != 24 && aKey.getLength() != 32 ) throw css::lang::IllegalArgumentException("Unexpected key length.", css::uno::Reference< css::uno::XInterface >(), 2 ); - if ( aParams.getLength() ) + if ( aParams.hasElements() ) throw css::lang::IllegalArgumentException("Unexpected arguments provided for cipher creation.", css::uno::Reference< css::uno::XInterface >(), 5 ); css::uno::Reference< css::xml::crypto::XCipherContext > xResult; diff --git a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx index c64b69c2002e..c65d8012af2a 100644 --- a/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx @@ -482,7 +482,7 @@ X509Certificate_NssImpl* SecurityEnvironment_NssImpl::createX509CertificateFromD { X509Certificate_NssImpl* pX509Certificate = nullptr; - if (aDerCertificate.getLength() > 0) + if (aDerCertificate.hasElements()) { pX509Certificate = new X509Certificate_NssImpl(); if (pX509Certificate == nullptr) |