summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2019-05-03 19:51:47 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-12 14:18:12 +0200
commit038e4b3b1e10d072b432cb06234521ae9a262a70 (patch)
tree6fb8087fd6a11fea6440dae91e8419043ad5f784
parent7bc6a7187c26690c64acb397e68d921be71e362e (diff)
Use hasElements to check Sequence emptiness in sax..sdext
Similar to clang-tidy readability-container-size-empty Change-Id: If6a567708d3c59355d54933fad23c85195846624 Reviewed-on: https://gerrit.libreoffice.org/71763 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sax/qa/cppunit/attributes.cxx2
-rw-r--r--sax/source/expatwrap/sax_expat.cxx2
-rw-r--r--sax/source/expatwrap/xml2utf.cxx6
-rw-r--r--sax/source/fastparser/fastparser.cxx2
-rw-r--r--sax/source/fastparser/legacyfastparser.cxx2
-rw-r--r--sax/source/tools/fastserializer.cxx6
-rw-r--r--sc/inc/chgtrack.hxx2
-rw-r--r--sc/qa/unit/helper/qahelper.cxx2
-rw-r--r--sc/source/core/data/dpoutput.cxx4
-rw-r--r--sc/source/core/data/dptabres.cxx2
-rw-r--r--sc/source/core/data/globalx.cxx2
-rw-r--r--sc/source/core/data/tabprotection.cxx4
-rw-r--r--sc/source/core/tool/userlist.cxx4
-rw-r--r--sc/source/filter/excel/xechart.cxx4
-rw-r--r--sc/source/filter/excel/xeescher.cxx2
-rw-r--r--sc/source/filter/excel/xeroot.cxx7
-rw-r--r--sc/source/filter/excel/xichart.cxx4
-rw-r--r--sc/source/filter/excel/xistream.cxx12
-rw-r--r--sc/source/filter/ftools/fapihelper.cxx2
-rw-r--r--sc/source/filter/xcl97/xcl97rec.cxx4
-rw-r--r--sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx2
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx2
-rw-r--r--sc/source/filter/xml/xmlimprt.cxx4
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx4
-rw-r--r--sc/source/ui/Accessibility/AccessibleDocument.cxx2
-rw-r--r--sc/source/ui/docshell/docsh2.cxx2
-rw-r--r--sc/source/ui/miscdlgs/optsolver.cxx6
-rw-r--r--sc/source/ui/miscdlgs/solveroptions.cxx2
-rw-r--r--sc/source/ui/unoobj/cellsuno.cxx2
-rw-r--r--sc/source/ui/unoobj/chart2uno.cxx8
-rw-r--r--sc/source/ui/unoobj/docuno.cxx2
-rw-r--r--sc/source/ui/unoobj/fmtuno.cxx8
-rw-r--r--sc/source/ui/unoobj/linkuno.cxx2
-rw-r--r--sc/source/ui/vba/vbaeventshelper.cxx2
-rw-r--r--sc/source/ui/vba/vbaglobals.cxx2
-rw-r--r--sc/source/ui/vba/vbatitle.hxx2
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx2
-rw-r--r--sc/source/ui/view/viewfun5.cxx2
-rw-r--r--sc/source/ui/xmlsource/xmlsourcedlg.cxx2
-rw-r--r--scripting/source/basprov/basscript.cxx2
-rw-r--r--scripting/source/protocolhandler/scripthandler.cxx6
-rw-r--r--scripting/source/provider/ProviderCache.cxx2
-rw-r--r--scripting/source/vbaevents/eventhelper.cxx6
-rw-r--r--sd/source/filter/eppt/eppt.cxx2
-rw-r--r--sd/source/filter/eppt/pptexanimations.cxx6
-rw-r--r--sd/source/filter/eppt/pptx-animations.cxx2
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx2
-rw-r--r--sd/source/filter/xml/sdxmlwrp.cxx2
-rw-r--r--sd/source/ui/app/optsitem.cxx4
-rw-r--r--sd/source/ui/dlg/PhotoAlbumDialog.cxx2
-rw-r--r--sd/source/ui/framework/factories/BasicPaneFactory.cxx2
-rw-r--r--sd/source/ui/framework/factories/BasicToolBarFactory.cxx2
-rw-r--r--sd/source/ui/framework/factories/BasicViewFactory.cxx2
-rw-r--r--sd/source/ui/framework/factories/PresentationFactory.cxx2
-rw-r--r--sd/source/ui/framework/module/CenterViewFocusModule.cxx2
-rw-r--r--sd/source/ui/framework/module/ModuleController.cxx2
-rw-r--r--sd/source/ui/framework/tools/FrameworkHelper.cxx2
-rw-r--r--sd/source/ui/presenter/PresenterPreviewCache.cxx2
-rw-r--r--sd/source/ui/presenter/SlideRenderer.cxx2
-rw-r--r--sd/source/ui/unoidl/unopage.cxx4
-rw-r--r--sd/source/ui/unoidl/unosrch.cxx2
-rw-r--r--sd/source/ui/view/drviews2.cxx4
-rw-r--r--sdext/source/minimizer/fileopendialog.cxx4
-rw-r--r--sdext/source/minimizer/optimizerdialog.cxx4
-rw-r--r--sdext/source/minimizer/optimizerdialogcontrols.cxx4
-rw-r--r--sdext/source/pdfimport/test/tests.cxx2
-rw-r--r--sdext/source/presenter/PresenterTextView.cxx2
67 files changed, 105 insertions, 108 deletions
diff --git a/sax/qa/cppunit/attributes.cxx b/sax/qa/cppunit/attributes.cxx
index c0ffdd7178ab..6c71e9aa182a 100644
--- a/sax/qa/cppunit/attributes.cxx
+++ b/sax/qa/cppunit/attributes.cxx
@@ -61,7 +61,7 @@ void AttributesTest::test()
xAttributeList->clear();
CPPUNIT_ASSERT( !xAttributeList->hasAttribute(1) );
- CPPUNIT_ASSERT_EQUAL( sal_Int32(0), xAttributeList->getFastAttributes().getLength() );
+ CPPUNIT_ASSERT( !xAttributeList->getFastAttributes().hasElements() );
xAttributeList->addUnknown("c", "c");
CPPUNIT_ASSERT_EQUAL( sal_Int32(1), xAttributeList->getUnknownAttributes().getLength() );
}
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index e98da4dd2a83..2ba000328529 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -372,7 +372,7 @@ void SAL_CALL
SaxExpatParser::initialize(css::uno::Sequence< css::uno::Any > const& rArguments)
{
// possible arguments: a string "DoSmeplease"
- if (rArguments.getLength())
+ if (rArguments.hasElements())
{
OUString str;
if ((rArguments[0] >>= str) && "DoSmeplease" == str)
diff --git a/sax/source/expatwrap/xml2utf.cxx b/sax/source/expatwrap/xml2utf.cxx
index 535075e1f7e2..c71f0bf2a993 100644
--- a/sax/source/expatwrap/xml2utf.cxx
+++ b/sax/source/expatwrap/xml2utf.cxx
@@ -59,7 +59,7 @@ sal_Int32 XMLFile2UTFConverter::readAndConvert( Sequence<sal_Int8> &seq , sal_In
if( ! m_bStarted && nRead )
{
// ensure that enough data is available to parse encoding
- if( seqStart.getLength() )
+ if( seqStart.hasElements() )
{
// prefix with what we had so far.
sal_Int32 nLength = seq.getLength();
@@ -382,7 +382,7 @@ Sequence<sal_Unicode> Text2UnicodeConverter::convert( const Sequence<sal_Int8> &
const sal_Int8 *pbSource = seqText.getConstArray();
std::unique_ptr<sal_Int8[]> pbTempMem;
- if( m_seqSource.getLength() ) {
+ if( m_seqSource.hasElements() ) {
// put old rest and new byte sequence into one array
pbTempMem.reset(new sal_Int8[ nSourceSize ]);
memcpy( pbTempMem.get() , m_seqSource.getConstArray() , m_seqSource.getLength() );
@@ -450,7 +450,7 @@ Sequence<sal_Int8> Unicode2TextConverter::convert(const sal_Unicode *puSource ,
{
std::unique_ptr<sal_Unicode[]> puTempMem;
- if( m_seqSource.getLength() ) {
+ if( m_seqSource.hasElements() ) {
// For surrogates !
// put old rest and new byte sequence into one array
// In general when surrogates are used, they should be rarely
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 01557cc608d4..1ac7b209d311 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -1334,7 +1334,7 @@ FastSaxParser::~FastSaxParser()
void SAL_CALL
FastSaxParser::initialize(css::uno::Sequence< css::uno::Any > const& rArguments)
{
- if (rArguments.getLength())
+ if (rArguments.hasElements())
{
OUString str;
if ( rArguments[0] >>= str )
diff --git a/sax/source/fastparser/legacyfastparser.cxx b/sax/source/fastparser/legacyfastparser.cxx
index ba047016df8d..53b3ac8ef78c 100644
--- a/sax/source/fastparser/legacyfastparser.cxx
+++ b/sax/source/fastparser/legacyfastparser.cxx
@@ -296,7 +296,7 @@ SaxLegacyFastParser::SaxLegacyFastParser( ) : m_aNamespaceHandler( new Namespace
void SAL_CALL SaxLegacyFastParser::initialize(Sequence< Any > const& rArguments )
{
- if (rArguments.getLength())
+ if (rArguments.hasElements())
{
Reference< XFastTokenHandler > xTokenHandler;
OUString str;
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx
index f6849e8abf5d..4a4091438a40 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -255,15 +255,15 @@ namespace sax_fastparser {
{
if( HAS_NAMESPACE( nElement ) ) {
auto const Namespace(mxFastTokenHandler->getUTF8Identifier(NAMESPACE(nElement)));
- assert(Namespace.getLength() != 0);
+ assert(Namespace.hasElements());
writeBytes(Namespace);
writeBytes(sColon, N_CHARS(sColon));
auto const Element(mxFastTokenHandler->getUTF8Identifier(TOKEN(nElement)));
- assert(Element.getLength() != 0);
+ assert(Element.hasElements());
writeBytes(Element);
} else {
auto const Element(mxFastTokenHandler->getUTF8Identifier(nElement));
- assert(Element.getLength() != 0);
+ assert(Element.hasElements());
writeBytes(Element);
}
}
diff --git a/sc/inc/chgtrack.hxx b/sc/inc/chgtrack.hxx
index fa18d418dfc6..a1bb011b9769 100644
--- a/sc/inc/chgtrack.hxx
+++ b/sc/inc/chgtrack.hxx
@@ -1134,7 +1134,7 @@ public:
{ aProtectPass = rPass; }
const css::uno::Sequence< sal_Int8 >& GetProtection() const
{ return aProtectPass; }
- bool IsProtected() const { return aProtectPass.getLength() != 0; }
+ bool IsProtected() const { return aProtectPass.hasElements(); }
// If time stamps of actions of this
// ChangeTrack and a second one are to be
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 083319ba316d..b38dcdfac161 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -361,7 +361,7 @@ std::vector<OUString> getChartRangeRepresentations(const SdrOle2Obj& rChartObj)
}
Sequence<Reference<chart2::data::XLabeledDataSequence> > xDataSeqs = xDataSource->getDataSequences();
- if (!xDataSeqs.getLength())
+ if (!xDataSeqs.hasElements())
{
cout << "There should be at least one data sequences." << endl;
return aRangeReps;
diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index 6a2b2a98a4f7..cb117b6a6f90 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -1342,7 +1342,7 @@ void ScDPOutput::GetPositionData(const ScAddress& rPos, DataPilotTablePositionDa
break;
const uno::Sequence<sheet::MemberResult> rSequence = pColFields[nField].maResult;
- if (rSequence.getLength() == 0)
+ if (!rSequence.hasElements())
break;
const sheet::MemberResult* pArray = rSequence.getConstArray();
@@ -1371,7 +1371,7 @@ void ScDPOutput::GetPositionData(const ScAddress& rPos, DataPilotTablePositionDa
break;
const uno::Sequence<sheet::MemberResult> rSequence = pRowFields[nField].maResult;
- if (rSequence.getLength() == 0)
+ if (!rSequence.hasElements())
break;
const sheet::MemberResult* pArray = rSequence.getConstArray();
diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 51c00020168d..8be7e52a27c4 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -1325,7 +1325,7 @@ void ScDPResultMember::FillMemberResults(
// IsVisible() test is in ScDPResultDimension::FillMemberResults
// (not on data layout dimension)
- if (!pSequences->getLength())
+ if (!pSequences->hasElements())
// empty sequence. Bail out.
return;
diff --git a/sc/source/core/data/globalx.cxx b/sc/source/core/data/globalx.cxx
index 7408cf4ab7a8..044b8e83d9ec 100644
--- a/sc/source/core/data/globalx.cxx
+++ b/sc/source/core/data/globalx.cxx
@@ -126,7 +126,7 @@ OUString ScGlobal::GetOrdinalSuffix( sal_Int32 nNumber)
}
uno::Sequence< OUString > aSuffixes = xOrdinalSuffix->getOrdinalSuffix( nNumber,
ScGlobal::pLocaleData->getLanguageTag().getLocale());
- if ( aSuffixes.getLength() > 0 )
+ if ( aSuffixes.hasElements() )
return aSuffixes[0];
else
return OUString();
diff --git a/sc/source/core/data/tabprotection.cxx b/sc/source/core/data/tabprotection.cxx
index 69fd340acedd..a3a4b777c33f 100644
--- a/sc/source/core/data/tabprotection.cxx
+++ b/sc/source/core/data/tabprotection.cxx
@@ -180,7 +180,7 @@ Sequence<sal_Int8> ScTableProtectionImpl::hashPassword(const OUString& aPassText
Sequence<sal_Int8> ScTableProtectionImpl::hashPassword(
const Sequence<sal_Int8>& rPassHash, ScPasswordHash eHash)
{
- if (!rPassHash.getLength() || eHash == PASSHASH_UNSPECIFIED)
+ if (!rPassHash.hasElements() || eHash == PASSHASH_UNSPECIFIED)
return rPassHash;
// TODO: Right now, we only support double-hash by SHA1.
@@ -227,7 +227,7 @@ bool ScTableProtectionImpl::isProtectedWithPass() const
if (!mbProtected)
return false;
- return !maPassText.isEmpty() || maPassHash.getLength() || maPasswordHash.hasPassword();
+ return !maPassText.isEmpty() || maPassHash.hasElements() || maPasswordHash.hasPassword();
}
void ScTableProtectionImpl::setProtected(bool bProtected)
diff --git a/sc/source/core/tool/userlist.cxx b/sc/source/core/tool/userlist.cxx
index 35e931f2d0b4..f4ae75ee844e 100644
--- a/sc/source/core/tool/userlist.cxx
+++ b/sc/source/core/tool/userlist.cxx
@@ -210,7 +210,7 @@ ScUserList::ScUserList()
for ( sal_Int32 j = 0; j < xCalendars.getLength(); ++j )
{
xCal = xCalendars[j].Days;
- if ( xCal.getLength() )
+ if ( xCal.hasElements() )
{
OUStringBuffer aDayShortBuf, aDayLongBuf;
sal_Int32 i;
@@ -242,7 +242,7 @@ ScUserList::ScUserList()
}
xCal = xCalendars[j].Months;
- if ( xCal.getLength() )
+ if ( xCal.hasElements() )
{
OUStringBuffer aMonthShortBuf, aMonthLongBuf;
sal_Int32 i;
diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx
index 017cde1e6093..c87d46dc928d 100644
--- a/sc/source/filter/excel/xechart.cxx
+++ b/sc/source/filter/excel/xechart.cxx
@@ -2749,7 +2749,7 @@ void XclExpChValueRange::Convert( const ScaleData& rScaleData )
// tdf#114168 If IntervalCount is 5, then enable automatic minor calculation.
// During import, if minorUnit is set and majorUnit not, then it is impossible
// to calculate IntervalCount.
- const bool bAutoMinor = bLogScale || bAutoMajor || (rSubIncrementSeq.getLength() < 1) ||
+ const bool bAutoMinor = bLogScale || bAutoMajor || !rSubIncrementSeq.hasElements() ||
lclIsAutoAnyOrGetValue( nCount, rSubIncrementSeq[ 0 ].IntervalCount ) || (nCount < 1) || (nCount == 5);
if( maData.mfMajorStep && !bAutoMinor )
@@ -3090,7 +3090,7 @@ sal_uInt16 XclExpChAxesSet::Convert( Reference< XDiagram > const & xDiagram, sal
if( xCoordSysCont.is() )
{
Sequence< Reference< XCoordinateSystem > > aCoordSysSeq = xCoordSysCont->getCoordinateSystems();
- if( aCoordSysSeq.getLength() > 0 )
+ if( aCoordSysSeq.hasElements() )
{
/* Process first coordinate system only. Import filter puts all
chart types into one coordinate system. */
diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx
index 0c04cc5ea690..2500d75048fa 100644
--- a/sc/source/filter/excel/xeescher.cxx
+++ b/sc/source/filter/excel/xeescher.cxx
@@ -832,7 +832,7 @@ XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rRoot, Reference<
OUString aDefText;
if( aCtrlProp.GetProperty( aStringList, "StringItemList" ) &&
aCtrlProp.GetProperty( aDefText, "Text" ) &&
- aStringList.getLength() && !aDefText.isEmpty() )
+ aStringList.hasElements() && !aDefText.isEmpty() )
{
const OUString* pBegin = aStringList.getConstArray();
const OUString* pEnd = pBegin + aStringList.getLength();
diff --git a/sc/source/filter/excel/xeroot.cxx b/sc/source/filter/excel/xeroot.cxx
index cdc562a40e59..4268bbd97830 100644
--- a/sc/source/filter/excel/xeroot.cxx
+++ b/sc/source/filter/excel/xeroot.cxx
@@ -301,11 +301,8 @@ bool XclExpRoot::IsDocumentEncrypted() const
if (pDocProt && pDocProt->isProtected() && pDocProt->isOptionEnabled(ScDocProtection::STRUCTURE))
return true;
- if ( GetEncryptionData().getLength() > 0 )
- // Password is entered directly into the save dialog.
- return true;
-
- return false;
+ // Whether password is entered directly into the save dialog.
+ return GetEncryptionData().hasElements();
}
uno::Sequence< beans::NamedValue > XclExpRoot::GenerateEncryptionData( const OUString& aPass )
diff --git a/sc/source/filter/excel/xichart.cxx b/sc/source/filter/excel/xichart.cxx
index 3954dccff2dd..bc86a848d8af 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -3643,7 +3643,7 @@ void XclImpChAxesSet::Convert( Reference< XDiagram > const & xDiagram ) const
{
Reference< XCoordinateSystemContainer > xCoordSystemCont( xDiagram, UNO_QUERY_THROW );
Sequence< Reference< XCoordinateSystem > > aCoordSystems = xCoordSystemCont->getCoordinateSystems();
- if( aCoordSystems.getLength() == 0 )
+ if( !aCoordSystems.hasElements() )
xCoordSystemCont->addCoordinateSystem( xCoordSystem );
}
catch( Exception& )
@@ -3730,7 +3730,7 @@ Reference< XCoordinateSystem > XclImpChAxesSet::CreateCoordSystem( Reference< XD
{
Sequence< Reference< XCoordinateSystem > > aCoordSystems = xCoordSystemCont->getCoordinateSystems();
OSL_ENSURE( aCoordSystems.getLength() <= 1, "XclImpChAxesSet::CreateCoordSystem - too many existing coordinate systems" );
- if( aCoordSystems.getLength() > 0 )
+ if( aCoordSystems.hasElements() )
xCoordSystem = aCoordSystems[ 0 ];
}
diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx
index d5f8c1e70f15..a17170fdff26 100644
--- a/sc/source/filter/excel/xistream.cxx
+++ b/sc/source/filter/excel/xistream.cxx
@@ -64,8 +64,8 @@ XclImpDecrypterRef XclImpDecrypter::Clone() const
::comphelper::DocPasswordVerifierResult XclImpDecrypter::verifyPassword( const OUString& rPassword, uno::Sequence< beans::NamedValue >& o_rEncryptionData )
{
o_rEncryptionData = OnVerifyPassword( rPassword );
- mnError = o_rEncryptionData.getLength() ? ERRCODE_NONE : ERRCODE_ABORT;
- return o_rEncryptionData.getLength() ? ::comphelper::DocPasswordVerifierResult::OK : ::comphelper::DocPasswordVerifierResult::WrongPassword;
+ mnError = o_rEncryptionData.hasElements() ? ERRCODE_NONE : ERRCODE_ABORT;
+ return o_rEncryptionData.hasElements() ? ::comphelper::DocPasswordVerifierResult::OK : ::comphelper::DocPasswordVerifierResult::WrongPassword;
}
::comphelper::DocPasswordVerifierResult XclImpDecrypter::verifyEncryptionData( const uno::Sequence< beans::NamedValue >& rEncryptionData )
@@ -173,7 +173,7 @@ bool XclImpBiff5Decrypter::OnVerifyEncryptionData( const uno::Sequence< beans::N
{
maEncryptionData.realloc( 0 );
- if( rEncryptionData.getLength() )
+ if( rEncryptionData.hasElements() )
{
// init codec
maCodec.InitCodec( rEncryptionData );
@@ -182,7 +182,7 @@ bool XclImpBiff5Decrypter::OnVerifyEncryptionData( const uno::Sequence< beans::N
maEncryptionData = rEncryptionData;
}
- return maEncryptionData.getLength();
+ return maEncryptionData.hasElements();
}
void XclImpBiff5Decrypter::OnUpdate( std::size_t /*nOldStrmPos*/, std::size_t nNewStrmPos, sal_uInt16 nRecSize )
@@ -273,7 +273,7 @@ bool XclImpBiff8Decrypter::OnVerifyEncryptionData( const uno::Sequence< beans::N
{
maEncryptionData.realloc( 0 );
- if( rEncryptionData.getLength() )
+ if( rEncryptionData.hasElements() )
{
// init codec
mpCodec->InitCodec( rEncryptionData );
@@ -282,7 +282,7 @@ bool XclImpBiff8Decrypter::OnVerifyEncryptionData( const uno::Sequence< beans::N
maEncryptionData = rEncryptionData;
}
- return maEncryptionData.getLength();
+ return maEncryptionData.hasElements();
}
void XclImpBiff8Decrypter::OnUpdate( std::size_t nOldStrmPos, std::size_t nNewStrmPos, sal_uInt16 /*nRecSize*/ )
diff --git a/sc/source/filter/ftools/fapihelper.cxx b/sc/source/filter/ftools/fapihelper.cxx
index ca2aecfa499f..5e2ce066a286 100644
--- a/sc/source/filter/ftools/fapihelper.cxx
+++ b/sc/source/filter/ftools/fapihelper.cxx
@@ -119,7 +119,7 @@ uno::Sequence< beans::NamedValue > ScfApiHelper::QueryEncryptionDataForMedium( S
rMedium.GetItemSet()->ClearItem( SID_PASSWORD );
rMedium.GetItemSet()->ClearItem( SID_ENCRYPTIONDATA );
- if( !bIsDefaultPassword && (aEncryptionData.getLength() > 0) )
+ if( !bIsDefaultPassword && aEncryptionData.hasElements() )
rMedium.GetItemSet()->Put( SfxUnoAnyItem( SID_ENCRYPTIONDATA, uno::makeAny( aEncryptionData ) ) );
return aEncryptionData;
diff --git a/sc/source/filter/xcl97/xcl97rec.cxx b/sc/source/filter/xcl97/xcl97rec.cxx
index b605042e6259..1b82c93065b0 100644
--- a/sc/source/filter/xcl97/xcl97rec.cxx
+++ b/sc/source/filter/xcl97/xcl97rec.cxx
@@ -191,7 +191,7 @@ bool IsValidObject( const XclObj& rObj )
return false;
uno::Sequence<uno::Reference<chart2::XCoordinateSystem> > xCooSysSeq = xCooSysContainer->getCoordinateSystems();
- if (!xCooSysSeq.getLength())
+ if (!xCooSysSeq.hasElements())
return false;
for (sal_Int32 nCooSys = 0; nCooSys < xCooSysSeq.getLength(); ++nCooSys)
@@ -201,7 +201,7 @@ bool IsValidObject( const XclObj& rObj )
return false;
uno::Sequence<uno::Reference<chart2::XChartType> > xChartTypeSeq = xChartTypeCont->getChartTypes();
- if (!xChartTypeSeq.getLength())
+ if (!xChartTypeSeq.hasElements())
// No chart type. Not good.
return false;
}
diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
index 35babb1de541..cf12913a17f9 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
@@ -802,7 +802,7 @@ void ScXMLChangeTrackingImportHelper::CreateChangeTrack(ScDocument* pTempDoc)
SetNewCell(static_cast<ScMyContentAction*>(rxAction.get()));
}
aActions.clear();
- if (aProtect.getLength())
+ if (aProtect.hasElements())
pTrack->SetProtection(aProtect);
else if (pDoc->GetChangeTrack() && pDoc->GetChangeTrack()->IsProtected())
pTrack->SetProtection(pDoc->GetChangeTrack()->GetProtection());
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 828849f4ad7a..7a0c605cba00 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3414,7 +3414,7 @@ void ScXMLExport::ExportShape(const uno::Reference < drawing::XShape >& xShape,
uno::Sequence< OUString > aRepresentations(
xReceiver->getUsedRangeRepresentations());
SvXMLAttributeList* pAttrList = nullptr;
- if(aRepresentations.getLength())
+ if(aRepresentations.hasElements())
{
// add the ranges used by the chart to the shape
// element to be able to start listening after
diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx
index df3a83f63126..fb6c5aeb044c 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1101,7 +1101,7 @@ void ScXMLImport::SetConfigurationSettings(const uno::Sequence<beans::PropertyVa
{
uno::Sequence<sal_Int8> aPass;
::comphelper::Base64::decode(aPass, sKey);
- if (aPass.getLength())
+ if (aPass.hasElements())
{
if (pDoc->GetChangeTrack())
pDoc->GetChangeTrack()->SetProtection(aPass);
@@ -1371,7 +1371,7 @@ void ScXMLImport::SetStyleToRanges()
// store first cell of first range for each style, once per sheet
uno::Sequence<table::CellRangeAddress> aAddresses(xSheetCellRanges->getRangeAddresses());
pStyle->ApplyCondFormat(aAddresses);
- if ( aAddresses.getLength() > 0 )
+ if ( aAddresses.hasElements() )
{
const table::CellRangeAddress& rRange = aAddresses[0];
if ( rRange.Sheet != pStyle->GetLastSheet() )
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 8de761208428..0d5419c49e51 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -155,7 +155,7 @@ ErrCode ScXMLImportWrapper::ImportFromComponent(const uno::Reference<uno::XCompo
// set Base URL
uno::Reference< beans::XPropertySet > xInfoSet;
- if( aArgs.getLength() > 0 )
+ if( aArgs.hasElements() )
aArgs.getConstArray()[0] >>= xInfoSet;
OSL_ENSURE( xInfoSet.is(), "missing property set" );
if( xInfoSet.is() )
@@ -650,7 +650,7 @@ bool ScXMLImportWrapper::ExportToComponent(const uno::Reference<uno::XComponentC
// set Base URL
uno::Reference< beans::XPropertySet > xInfoSet;
- if( aArgs.getLength() > 0 )
+ if( aArgs.hasElements() )
aArgs.getConstArray()[0] >>= xInfoSet;
OSL_ENSURE( xInfoSet.is(), "missing property set" );
if( xInfoSet.is() )
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 9b20bfc1bb5a..f95028b5aca3 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -2318,7 +2318,7 @@ css::uno::Sequence< css::uno::Any >
if ( bSuccess )
{
uno::Sequence< uno::Any> aSeq = GetScAccFlowToSequence();
- if ( aSeq.getLength() )
+ if ( aSeq.hasElements() )
{
return aSeq;
}
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index 638b8a6365ae..4b872f0548de 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -124,7 +124,7 @@ void ScDocShell::InitItems()
{
// set forbidden characters if necessary
uno::Sequence<lang::Locale> aLocales = aAsian.GetStartEndCharLocales();
- if (aLocales.getLength())
+ if (aLocales.hasElements())
{
std::shared_ptr<SvxForbiddenCharactersTable> xForbiddenTable(
SvxForbiddenCharactersTable::makeForbiddenCharactersTable(comphelper::getProcessComponentContext()));
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx b/sc/source/ui/miscdlgs/optsolver.cxx
index a5380399c49e..17b760d65a1f 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -337,7 +337,7 @@ void ScOptSolverDlg::Init(const ScAddress& rCursorPos)
// get available solver implementations
//! sort by descriptions?
ScSolverUtil::GetImplementations( maImplNames, maDescriptions );
- sal_Int32 nImplCount = maImplNames.getLength();
+ bool bImplHasElements = maImplNames.hasElements();
const ScOptSolverSave* pOldData = mpDocShell->GetSolverSaveData();
if ( pOldData )
@@ -359,7 +359,7 @@ void ScOptSolverDlg::Init(const ScAddress& rCursorPos)
if ( !mrDoc.GetRangeAtBlock( ScRange(rCursorPos), &aCursorStr ) )
aCursorStr = rCursorPos.Format(ScRefFlags::ADDR_ABS, nullptr, mrDoc.GetAddressConvention());
m_xEdObjectiveCell->SetRefString( aCursorStr );
- if ( nImplCount > 0 )
+ if ( bImplHasElements )
maEngine = maImplNames[0]; // use first implementation
}
ShowConditions();
@@ -769,7 +769,7 @@ bool ScOptSolverDlg::FindTimeout( sal_Int32& rTimeout )
{
bool bFound = false;
- if ( !maProperties.getLength() )
+ if ( !maProperties.hasElements() )
maProperties = ScSolverUtil::GetDefaults( maEngine ); // get property defaults from component
sal_Int32 nPropCount = maProperties.getLength();
diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx
index 26ff15c2e2d2..e4b92356edcc 100644
--- a/sc/source/ui/miscdlgs/solveroptions.cxx
+++ b/sc/source/ui/miscdlgs/solveroptions.cxx
@@ -101,7 +101,7 @@ ScSolverOptionsDialog::ScSolverOptionsDialog(weld::Window* pParent,
if ( nSelect >= 0 ) // select in list box
m_xLbEngine->set_active(nSelect);
- if ( !maProperties.getLength() )
+ if ( !maProperties.hasElements() )
ReadFromComponent(); // fill maProperties from component (using maEngine)
FillListBox(); // using maProperties
}
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index 0c726ab498af..c51eb115b0aa 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -5051,7 +5051,7 @@ void SAL_CALL ScCellRangeObj::setArrayTokens( const uno::Sequence<sheet::Formula
ScDocShell* pDocSh = GetDocShell();
if ( pDocSh )
{
- if ( rTokens.getLength() )
+ if ( rTokens.hasElements() )
{
if ( ScTableSheetObj::getImplementation( static_cast<cppu::OWeakObject*>(this) ) )
{
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index a7b20ce1e03c..ea575923bd68 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1521,7 +1521,7 @@ ScChart2DataProvider::createDataSource(
}
uno::Reference< chart2::data::XLabeledDataSequence > xChartSeries = lcl_createLabeledDataSequenceFromTokens(
std::move(aValueTokens), std::move(aLabelTokens), m_pDocument, this, m_bIncludeHiddenCells ); //ownership of pointers is transferred!
- if ( xChartSeries.is() && xChartSeries->getValues().is() && xChartSeries->getValues()->getData().getLength() )
+ if ( xChartSeries.is() && xChartSeries->getValues().is() && xChartSeries->getValues()->getData().hasElements() )
{
aSeqs.push_back( xChartSeries );
}
@@ -2031,7 +2031,7 @@ uno::Reference< sheet::XRangeSelection > SAL_CALL ScChart2DataProvider::getRange
sal_Bool SAL_CALL ScChart2DataProvider::createDataSequenceByFormulaTokensPossible(
const Sequence<sheet::FormulaToken>& aTokens )
{
- if (aTokens.getLength() <= 0)
+ if (!aTokens.hasElements())
return false;
ScTokenArray aCode;
@@ -2089,7 +2089,7 @@ ScChart2DataProvider::createDataSequenceByFormulaTokens(
const Sequence<sheet::FormulaToken>& aTokens )
{
uno::Reference<chart2::data::XDataSequence> xResult;
- if (aTokens.getLength() <= 0)
+ if (!aTokens.hasElements())
return xResult;
ScTokenArray aCode;
@@ -2875,7 +2875,7 @@ uno::Sequence< uno::Any> SAL_CALL ScChart2DataSequence::getData()
BuildDataCache();
- if (!m_aMixedDataCache.getLength())
+ if (!m_aMixedDataCache.hasElements())
{
// Build a cache for the 1st time...
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index ae2d063fcfcb..7443bf3ba018 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -2886,7 +2886,7 @@ uno::Reference<uno::XInterface> SAL_CALL ScModelObj::createInstanceWithArguments
SolarMutexGuard aGuard;
uno::Reference<uno::XInterface> xInt(create(ServiceSpecifier, &aArgs));
- if ( aArgs.getLength() )
+ if ( aArgs.hasElements() )
{
// used only for cell value binding so far - it can be initialized after creating
diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index 40af3ba2d59b..4cd31ca6aae9 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -214,14 +214,14 @@ void ScTableConditionalFormat::FillFormat( ScConditionalFormat& rFormat,
if ( !aData.maPosStr.isEmpty() )
pCoreEntry->SetSrcString( aData.maPosStr );
- if ( aData.maTokens1.getLength() )
+ if ( aData.maTokens1.hasElements() )
{
ScTokenArray aTokenArray;
if ( ScTokenConversion::ConvertToTokenArray(*pDoc, aTokenArray, aData.maTokens1) )
pCoreEntry->SetFormula1(aTokenArray);
}
- if ( aData.maTokens2.getLength() )
+ if ( aData.maTokens2.hasElements() )
{
ScTokenArray aTokenArray;
if ( ScTokenConversion::ConvertToTokenArray(*pDoc, aTokenArray, aData.maTokens2) )
@@ -634,14 +634,14 @@ ScValidationData* ScTableValidationObj::CreateValidationData( ScDocument* pDoc,
pRet->SetIgnoreBlank(bIgnoreBlank);
pRet->SetListType(nShowList);
- if ( aTokens1.getLength() )
+ if ( aTokens1.hasElements() )
{
ScTokenArray aTokenArray;
if ( ScTokenConversion::ConvertToTokenArray(*pDoc, aTokenArray, aTokens1) )
pRet->SetFormula1(aTokenArray);
}
- if ( aTokens2.getLength() )
+ if ( aTokens2.hasElements() )
{
ScTokenArray aTokenArray;
if ( ScTokenConversion::ConvertToTokenArray(*pDoc, aTokenArray, aTokens2) )
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index c4493df34536..eec400c28695 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -1592,7 +1592,7 @@ sal_Bool SAL_CALL ScExternalDocLinkObj::hasElements()
SolarMutexGuard aGuard;
// #i116940# be consistent with getByName: count only table names which have a cache already
- return ( getElementNames().getLength() > 0 );
+ return getElementNames().hasElements();
}
sal_Int32 SAL_CALL ScExternalDocLinkObj::getTokenIndex()
diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx
index aa660ae320e1..8dec1896e6a6 100644
--- a/sc/source/ui/vba/vbaeventshelper.cxx
+++ b/sc/source/ui/vba/vbaeventshelper.cxx
@@ -93,7 +93,7 @@ SCTAB lclGetTabFromArgs( const uno::Sequence< uno::Any >& rArgs, sal_Int32 nInde
if( xRanges.is() )
{
uno::Sequence< table::CellRangeAddress > aRangeAddresses = xRanges->getRangeAddresses();
- if( aRangeAddresses.getLength() > 0 )
+ if( aRangeAddresses.hasElements() )
return aRangeAddresses[ 0 ].Sheet;
}
diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx
index 7343471af556..62ac352756c6 100644
--- a/sc/source/ui/vba/vbaglobals.cxx
+++ b/sc/source/ui/vba/vbaglobals.cxx
@@ -44,7 +44,7 @@ ScVbaGlobals::ScVbaGlobals( uno::Sequence< uno::Any > const& aArgs, uno::Referen
uno::Sequence< beans::PropertyValue > aInitArgs( aArgs.getLength() + 1 );
aInitArgs[ 0 ].Name = "Application";
aInitArgs[ 0 ].Value <<= getApplication();
- if ( aArgs.getLength() > 0 )
+ if ( aArgs.hasElements() )
{
aInitArgs[ 1 ].Name = "ExcelDocumentContext";
aInitArgs[ 1 ].Value <<= getXSomethingFromArgs< frame::XModel >( aArgs, 0 );
diff --git a/sc/source/ui/vba/vbatitle.hxx b/sc/source/ui/vba/vbatitle.hxx
index 9b40f2a452d9..7777e66c84d7 100644
--- a/sc/source/ui/vba/vbatitle.hxx
+++ b/sc/source/ui/vba/vbatitle.hxx
@@ -135,7 +135,7 @@ public:
css::uno::Sequence< OUString > getServiceNames() override
{
static css::uno::Sequence< OUString > aServiceNames;
- if ( aServiceNames.getLength() == 0 )
+ if ( !aServiceNames.hasElements() )
{
aServiceNames.realloc( 1 );
aServiceNames[ 0 ] = "ooo.vba.excel.XTitle";
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index 57dfaddeccda..cbb78bb0d2bd 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -198,7 +198,7 @@ ScVbaWorkbook::getFileFormat( )
void
ScVbaWorkbook::init()
{
- if ( !ColorData.getLength() )
+ if ( !ColorData.hasElements() )
ResetColors();
uno::Reference< frame::XModel > xModel( getModel(), uno::UNO_QUERY );
if ( xModel.is() )
diff --git a/sc/source/ui/view/viewfun5.cxx b/sc/source/ui/view/viewfun5.cxx
index e65148fbee37..77184add68a5 100644
--- a/sc/source/ui/view/viewfun5.cxx
+++ b/sc/source/ui/view/viewfun5.cxx
@@ -656,7 +656,7 @@ bool ScViewFunc::PasteLink( const uno::Reference<datatransfer::XTransferable>& r
// so the source knows it will be used for a link
uno::Sequence<sal_Int8> aSequence = aDataHelper.GetSequence(SotClipboardFormatId::LINK, OUString());
- if (!aSequence.getLength())
+ if (!aSequence.hasElements())
{
OSL_FAIL("DDE Data not found.");
return false;
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
index 77f971b52236..bda40fb0ea79 100644
--- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx
+++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx
@@ -186,7 +186,7 @@ void ScXMLSourceDlg::SelectSourceFile()
return;
uno::Sequence<OUString> aFiles = xFilePicker->getSelectedFiles();
- if (!aFiles.getLength())
+ if (!aFiles.hasElements())
return;
// There should only be one file returned from the file picker.
diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx
index fbefb064dc97..067765a574e6 100644
--- a/scripting/source/basprov/basscript.cxx
+++ b/scripting/source/basprov/basscript.cxx
@@ -224,7 +224,7 @@ namespace basprov
if ( m_documentBasicManager && m_xDocumentScriptContext.is() )
aOldThisComponent = m_documentBasicManager->SetGlobalUNOConstant( "ThisComponent", makeAny( m_xDocumentScriptContext ) );
- if ( m_caller.getLength() && m_caller[ 0 ].hasValue() )
+ if ( m_caller.hasElements() && m_caller[ 0 ].hasValue() )
{
SbxVariableRef xCallerVar = new SbxVariable( SbxVARIANT );
unoToSbxValue( xCallerVar.get(), m_caller[ 0 ] );
diff --git a/scripting/source/protocolhandler/scripthandler.cxx b/scripting/source/protocolhandler/scripthandler.cxx
index f8ad8c7fd63d..8a4cffec6deb 100644
--- a/scripting/source/protocolhandler/scripthandler.cxx
+++ b/scripting/source/protocolhandler/scripthandler.cxx
@@ -76,7 +76,7 @@ void SAL_CALL ScriptProtocolHandler::initialize(
// first argument contains a reference to the frame (may be empty or the desktop,
// but usually it's a "real" frame)
- if ( aArguments.getLength() && !( aArguments[ 0 ] >>= m_xFrame ) )
+ if ( aArguments.hasElements() && !( aArguments[ 0 ] >>= m_xFrame ) )
{
OUString temp = "ScriptProtocolHandler::initialize: could not extract reference to the frame";
throw RuntimeException( temp );
@@ -183,7 +183,7 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
Sequence< Any > outArgs( 0 );
Sequence< sal_Int16 > outIndex;
- if ( lArgs.getLength() > 0 )
+ if ( lArgs.hasElements() )
{
int argCount = 0;
for ( int index = 0; index < lArgs.getLength(); index++ )
@@ -226,7 +226,7 @@ void SAL_CALL ScriptProtocolHandler::dispatchWithNotification(
// given name/signature
std::rethrow_exception(aFirstCaughtException);
- if ( inArgs.getLength() == 0 )
+ if ( !inArgs.hasElements() )
// no chance to retry if we can't strip more in-args
std::rethrow_exception(aFirstCaughtException);
diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx
index f669a9cc3a31..cf54ea0aee22 100644
--- a/scripting/source/provider/ProviderCache.cxx
+++ b/scripting/source/provider/ProviderCache.cxx
@@ -148,7 +148,7 @@ ProviderCache::populateCache()
Sequence< OUString > serviceNames = xServiceInfo->getSupportedServiceNames();
- if ( serviceNames.getLength() > 0 )
+ if ( serviceNames.hasElements() )
{
for ( sal_Int32 index = 0; index < serviceNames.getLength(); index++ )
{
diff --git a/scripting/source/vbaevents/eventhelper.cxx b/scripting/source/vbaevents/eventhelper.cxx
index 512f0f2e8027..21a52e9b28c4 100644
--- a/scripting/source/vbaevents/eventhelper.cxx
+++ b/scripting/source/vbaevents/eventhelper.cxx
@@ -86,12 +86,12 @@ static const sal_Int32 DELIMLEN = strlen(DELIM);
static bool isKeyEventOk( awt::KeyEvent& evt, const Sequence< Any >& params )
{
- return ( params.getLength() > 0 ) && ( params[ 0 ] >>= evt );
+ return params.hasElements() && ( params[ 0 ] >>= evt );
}
static bool isMouseEventOk( awt::MouseEvent& evt, const Sequence< Any >& params )
{
- return ( params.getLength() > 0 ) && ( params[ 0 ] >>= evt );
+ return params.hasElements() && ( params[ 0 ] >>= evt );
}
static Sequence< Any > ooMouseEvtToVBADblClick( const Sequence< Any >& params )
@@ -890,7 +890,7 @@ EventListener::firing_Impl(const ScriptEvent& evt, Any* pRet )
{
aArguments = evt.Arguments;
}
- if ( aArguments.getLength() )
+ if ( aArguments.hasElements() )
{
// call basic event handlers for event
diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx
index 7a378baa3bbf..92caecc4da3c 100644
--- a/sd/source/filter/eppt/eppt.cxx
+++ b/sd/source/filter/eppt/eppt.cxx
@@ -836,7 +836,7 @@ bool PPTWriter::ImplCreateDocument()
if ( aXCont.is() )
{
css::uno::Sequence< OUString> aNameSeq( aXCont->getElementNames() );
- if ( aNameSeq.getLength() )
+ if ( aNameSeq.hasElements() )
{
mpPptEscherEx->OpenContainer( EPP_NamedShows );
sal_uInt32 nCustomShowIndex = 0;
diff --git a/sd/source/filter/eppt/pptexanimations.cxx b/sd/source/filter/eppt/pptexanimations.cxx
index cf2ed32f21f2..ae0c3c8e6c32 100644
--- a/sd/source/filter/eppt/pptexanimations.cxx
+++ b/sd/source/filter/eppt/pptexanimations.cxx
@@ -749,7 +749,7 @@ bool AnimationExporter::GetNodeType( const Reference< XAnimationNode >& xNode, s
{
// trying to get the nodetype
Sequence< NamedValue > aUserData = xNode->getUserData();
- if ( aUserData.getLength() )
+ if ( aUserData.hasElements() )
{
const NamedValue* p = aUserData.getConstArray();
sal_Int32 nLength = aUserData.getLength();
@@ -862,7 +862,7 @@ void AnimationExporter::GetUserData( const Sequence< NamedValue >& rUserData, co
{
// storing user data into pAny, to allow direct access later
memset( pAny, 0, nLen );
- if ( !rUserData.getLength() )
+ if ( !rUserData.hasElements() )
return;
const NamedValue* p = rUserData.getConstArray();
@@ -1788,7 +1788,7 @@ void AnimationExporter::exportAnimateKeyPoints( SvStream& rStrm, const Reference
Sequence< double > aKeyTimes( xAnimate->getKeyTimes() );
Sequence< Any > aValues( xAnimate->getValues() );
OUString aFormula( xAnimate->getFormula() );
- if ( !aKeyTimes.getLength() )
+ if ( !aKeyTimes.hasElements() )
return;
EscherExContainer aAnimKeyPoints( rStrm, DFF_msofbtAnimKeyPoints );
diff --git a/sd/source/filter/eppt/pptx-animations.cxx b/sd/source/filter/eppt/pptx-animations.cxx
index c1c86f46ae3a..1a35c7777e2a 100644
--- a/sd/source/filter/eppt/pptx-animations.cxx
+++ b/sd/source/filter/eppt/pptx-animations.cxx
@@ -195,7 +195,7 @@ void WriteAnimateTo(const FSHelperPtr& pFS, const Any& rValue, const OUString& r
void WriteAnimateValues(const FSHelperPtr& pFS, const Reference<XAnimate>& rXAnimate)
{
const Sequence<double> aKeyTimes = rXAnimate->getKeyTimes();
- if (aKeyTimes.getLength() <= 0)
+ if (!aKeyTimes.hasElements())
return;
const Sequence<Any> aValues = rXAnimate->getValues();
const OUString& sFormula = rXAnimate->getFormula();
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index a7d51cfcd57e..e6a1495ee4a5 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -1769,7 +1769,7 @@ bool PowerPointExport::WriteColorSchemes(const FSHelperPtr& pFS, const OUString&
aGrabBag.getValue(rThemePath) >>= aCurrentTheme;
- if (!aCurrentTheme.getLength())
+ if (!aCurrentTheme.hasElements())
return false;
// Order is important
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 9e3c9c579689..cedd642a65f3 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -358,7 +358,7 @@ ErrCode ReadThroughComponent(
// set Base URL
uno::Reference< beans::XPropertySet > xInfoSet;
- if( rFilterArguments.getLength() > 0 )
+ if( rFilterArguments.hasElements() )
rFilterArguments.getConstArray()[0] >>= xInfoSet;
DBG_ASSERT( xInfoSet.is(), "missing property set" );
if( xInfoSet.is() )
diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index 8dec8fc79e2d..34e69ef7d6e8 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -113,7 +113,7 @@ void SdOptionsGeneric::Init() const
const Sequence< OUString > aNames( GetPropertyNames() );
const Sequence< Any > aValues = mpCfgItem->GetProperties( aNames );
- if( aNames.getLength() && ( aValues.getLength() == aNames.getLength() ) )
+ if( aNames.hasElements() && ( aValues.getLength() == aNames.getLength() ) )
{
const Any* pValues = aValues.getConstArray();
@@ -134,7 +134,7 @@ void SdOptionsGeneric::Commit( SdOptionsItem& rCfgItem ) const
const Sequence< OUString > aNames( GetPropertyNames() );
Sequence< Any > aValues( aNames.getLength() );
- if( aNames.getLength() && ( aValues.getLength() == aNames.getLength() ) )
+ if( aNames.hasElements() && ( aValues.getLength() == aNames.getLength() ) )
{
if( WriteData( aValues.getArray() ) )
rCfgItem.PutProperties( aNames, aValues );
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index 3f9b7cef8378..6381c22e663c 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -518,7 +518,7 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, FileHdl, weld::Button&, void)
if ( aDlg.Execute() == ERRCODE_NONE )
{
Sequence< OUString > aFilesArr = aDlg.GetSelectedFiles();
- if( aFilesArr.getLength() )
+ if( aFilesArr.hasElements() )
{
sUrl = aDlg.GetDisplayDirectory();
// Write out configuration
diff --git a/sd/source/ui/framework/factories/BasicPaneFactory.cxx b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
index 7d009fa8548b..2754b71d369f 100644
--- a/sd/source/ui/framework/factories/BasicPaneFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicPaneFactory.cxx
@@ -122,7 +122,7 @@ void SAL_CALL BasicPaneFactory::disposing()
void SAL_CALL BasicPaneFactory::initialize (const Sequence<Any>& aArguments)
{
- if (aArguments.getLength() <= 0)
+ if (!aArguments.hasElements())
return;
try
diff --git a/sd/source/ui/framework/factories/BasicToolBarFactory.cxx b/sd/source/ui/framework/factories/BasicToolBarFactory.cxx
index bb1ede4c63ea..b0cb5f05a43c 100644
--- a/sd/source/ui/framework/factories/BasicToolBarFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicToolBarFactory.cxx
@@ -69,7 +69,7 @@ void BasicToolBarFactory::Shutdown()
void SAL_CALL BasicToolBarFactory::initialize (const Sequence<Any>& aArguments)
{
- if (aArguments.getLength() <= 0)
+ if (!aArguments.hasElements())
return;
try
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 71eb27ac19e7..fa3628550e99 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -230,7 +230,7 @@ void SAL_CALL BasicViewFactory::releaseResource (const Reference<XResource>& rxV
void SAL_CALL BasicViewFactory::initialize (const Sequence<Any>& aArguments)
{
- if (aArguments.getLength() <= 0)
+ if (!aArguments.hasElements())
return;
try
diff --git a/sd/source/ui/framework/factories/PresentationFactory.cxx b/sd/source/ui/framework/factories/PresentationFactory.cxx
index fe8d1331a7f9..42df2c979b6a 100644
--- a/sd/source/ui/framework/factories/PresentationFactory.cxx
+++ b/sd/source/ui/framework/factories/PresentationFactory.cxx
@@ -174,7 +174,7 @@ void PresentationFactoryProvider::disposing()
void SAL_CALL PresentationFactoryProvider::initialize(
const Sequence<Any>& aArguments)
{
- if (aArguments.getLength() <= 0)
+ if (!aArguments.hasElements())
return;
try
diff --git a/sd/source/ui/framework/module/CenterViewFocusModule.cxx b/sd/source/ui/framework/module/CenterViewFocusModule.cxx
index 8c7e6abbd2d6..d462489339a7 100644
--- a/sd/source/ui/framework/module/CenterViewFocusModule.cxx
+++ b/sd/source/ui/framework/module/CenterViewFocusModule.cxx
@@ -126,7 +126,7 @@ void CenterViewFocusModule::HandleNewView (
FrameworkHelper::msViewURLPrefix,
AnchorBindingMode_DIRECT));
Reference<XView> xView;
- if (xViewIds.getLength() > 0)
+ if (xViewIds.hasElements())
xView.set( mxConfigurationController->getResource(xViewIds[0]),UNO_QUERY);
Reference<lang::XUnoTunnel> xTunnel (xView, UNO_QUERY);
if (xTunnel.is() && mpBase!=nullptr)
diff --git a/sd/source/ui/framework/module/ModuleController.cxx b/sd/source/ui/framework/module/ModuleController.cxx
index edfe932474f0..104cb91e152d 100644
--- a/sd/source/ui/framework/module/ModuleController.cxx
+++ b/sd/source/ui/framework/module/ModuleController.cxx
@@ -240,7 +240,7 @@ void SAL_CALL ModuleController::requestResource (const OUString& rsResourceURL)
void SAL_CALL ModuleController::initialize (const Sequence<Any>& aArguments)
{
- if (aArguments.getLength() > 0)
+ if (aArguments.hasElements())
{
try
{
diff --git a/sd/source/ui/framework/tools/FrameworkHelper.cxx b/sd/source/ui/framework/tools/FrameworkHelper.cxx
index 9e7fb199b27a..5878aab82ffe 100644
--- a/sd/source/ui/framework/tools/FrameworkHelper.cxx
+++ b/sd/source/ui/framework/tools/FrameworkHelper.cxx
@@ -249,7 +249,7 @@ namespace
Reference< XConfiguration > xConfiguration( i_rConfigController->getRequestedConfiguration(), UNO_SET_THROW );
Sequence< Reference< XResourceId > > aViewIds( xConfiguration->getResources(
i_rPaneId, FrameworkHelper::msViewURLPrefix, AnchorBindingMode_DIRECT ) );
- if ( aViewIds.getLength() > 0 )
+ if ( aViewIds.hasElements() )
return i_rConfigController->getResource( aViewIds[0] );
}
catch( const Exception& )
diff --git a/sd/source/ui/presenter/PresenterPreviewCache.cxx b/sd/source/ui/presenter/PresenterPreviewCache.cxx
index fafe1d9408b9..54fde4e3408b 100644
--- a/sd/source/ui/presenter/PresenterPreviewCache.cxx
+++ b/sd/source/ui/presenter/PresenterPreviewCache.cxx
@@ -89,7 +89,7 @@ PresenterPreviewCache::~PresenterPreviewCache()
void SAL_CALL PresenterPreviewCache::initialize (const Sequence<Any>& rArguments)
{
- if (rArguments.getLength() != 0)
+ if (rArguments.hasElements())
throw RuntimeException();
}
diff --git a/sd/source/ui/presenter/SlideRenderer.cxx b/sd/source/ui/presenter/SlideRenderer.cxx
index 9757b7d661a4..8a8d318209ed 100644
--- a/sd/source/ui/presenter/SlideRenderer.cxx
+++ b/sd/source/ui/presenter/SlideRenderer.cxx
@@ -53,7 +53,7 @@ void SAL_CALL SlideRenderer::initialize (const Sequence<Any>& rArguments)
{
ThrowIfDisposed();
- if (rArguments.getLength() != 0)
+ if (rArguments.hasElements())
{
throw RuntimeException("SlideRenderer: invalid number of arguments",
static_cast<XWeak*>(this));
diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx
index 5c638c3125d5..a1ae1c4c3197 100644
--- a/sd/source/ui/unoidl/unopage.cxx
+++ b/sd/source/ui/unoidl/unopage.cxx
@@ -2057,7 +2057,7 @@ Sequence< uno::Type > SAL_CALL SdDrawPage::getTypes()
throwIfDisposed();
- if( maTypeSequence.getLength() == 0 )
+ if( !maTypeSequence.hasElements() )
{
const PageKind ePageKind = GetPage() ? GetPage()->GetPageKind() : PageKind::Standard;
bool bPresPage = IsImpressDocument() && ePageKind != PageKind::Handout;
@@ -2675,7 +2675,7 @@ Sequence< uno::Type > SAL_CALL SdMasterPage::getTypes()
throwIfDisposed();
- if( maTypeSequence.getLength() == 0 )
+ if( !maTypeSequence.hasElements() )
{
const PageKind ePageKind = GetPage() ? GetPage()->GetPageKind() : PageKind::Standard;
bool bPresPage = IsImpressDocument() && SvxFmDrawPage::mpPage && ePageKind != PageKind::Handout;
diff --git a/sd/source/ui/unoidl/unosrch.cxx b/sd/source/ui/unoidl/unosrch.cxx
index 7417a781e369..ee6b482b19ab 100644
--- a/sd/source/ui/unoidl/unosrch.cxx
+++ b/sd/source/ui/unoidl/unosrch.cxx
@@ -779,7 +779,7 @@ uno::Type SAL_CALL SdUnoFindAllAccess::getElementType()
sal_Bool SAL_CALL SdUnoFindAllAccess::hasElements()
{
- return maSequence.getLength() > 0;
+ return maSequence.hasElements();
}
// XIndexAccess
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 391bff60b99b..2c5df1abb7a1 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -1712,7 +1712,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
const css::uno::Sequence< css::scanner::ScannerContext >
aContexts( mxScannerManager->getAvailableScanners() );
- if( aContexts.getLength() )
+ if( aContexts.hasElements() )
{
css::scanner::ScannerContext aContext( aContexts.getConstArray()[ 0 ] );
mxScannerManager->configureScannerAndScan( aContext, mxScannerListener );
@@ -1738,7 +1738,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
{
const css::uno::Sequence< css::scanner::ScannerContext > aContexts( mxScannerManager->getAvailableScanners() );
- if( aContexts.getLength() )
+ if( aContexts.hasElements() )
{
mxScannerManager->startScan( aContexts.getConstArray()[ 0 ], mxScannerListener );
bDone = true;
diff --git a/sdext/source/minimizer/fileopendialog.cxx b/sdext/source/minimizer/fileopendialog.cxx
index 472951469571..b415a696625e 100644
--- a/sdext/source/minimizer/fileopendialog.cxx
+++ b/sdext/source/minimizer/fileopendialog.cxx
@@ -134,7 +134,7 @@ FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxContext
break;
}
}
- if ( aExtensions.getLength() )
+ if ( aExtensions.hasElements() )
{
// The filter title must be formed in the same way it is
// currently done in the internal implementation:
@@ -166,7 +166,7 @@ void FileOpenDialog::setDefaultName( const OUString& rDefaultName )
OUString FileOpenDialog::getURL() const
{
Sequence< OUString > aFileSeq( mxFilePicker->getSelectedFiles() );
- return aFileSeq.getLength() ? aFileSeq[ 0 ] : OUString();
+ return aFileSeq.hasElements() ? aFileSeq[ 0 ] : OUString();
};
OUString FileOpenDialog::getFilterName() const
{
diff --git a/sdext/source/minimizer/optimizerdialog.cxx b/sdext/source/minimizer/optimizerdialog.cxx
index eb9670a31464..61b877e7fa72 100644
--- a/sdext/source/minimizer/optimizerdialog.cxx
+++ b/sdext/source/minimizer/optimizerdialog.cxx
@@ -164,7 +164,7 @@ void OptimizerDialog::UpdateConfiguration()
aAny = getControlProperty( "ListBox0Pg0", "SelectedItems" );
if ( aAny >>= aSelectedItems )
{
- if ( aSelectedItems.getLength() )
+ if ( aSelectedItems.hasElements() )
{
sal_Int16 nSelectedItem = aSelectedItems[ 0 ];
aAny = getControlProperty( "ListBox0Pg0", "StringItemList" );
@@ -184,7 +184,7 @@ void OptimizerDialog::UpdateConfiguration()
if ( !(aAny >>= aSelectedItems) )
return;
- if ( aSelectedItems.getLength() )
+ if ( aSelectedItems.hasElements() )
{
sal_Int16 nSelectedItem = aSelectedItems[ 0 ];
aAny = getControlProperty( "ListBox0Pg3", "StringItemList" );
diff --git a/sdext/source/minimizer/optimizerdialogcontrols.cxx b/sdext/source/minimizer/optimizerdialogcontrols.cxx
index 6d237ddbfb48..f36185f2e515 100644
--- a/sdext/source/minimizer/optimizerdialogcontrols.cxx
+++ b/sdext/source/minimizer/optimizerdialogcontrols.cxx
@@ -461,7 +461,7 @@ void OptimizerDialog::InitPage1()
DeactivatePage( 1 );
setControlProperty( "CheckBox3Pg3", "State", Any( false ) );
- setControlProperty( "CheckBox3Pg3", "Enabled", Any( aCustomShowList.getLength() != 0 ) );
+ setControlProperty( "CheckBox3Pg3", "Enabled", Any( aCustomShowList.hasElements() ) );
setControlProperty( "ListBox0Pg3", "Enabled", Any( false ) );
UpdateControlStatesPage1();
@@ -646,7 +646,7 @@ void OptimizerDialog::UpdateControlStatesPage4()
Any aAny = getControlProperty( "ListBox0Pg3", "SelectedItems" );
if ( aAny >>= aSelectedItems )
{
- if ( aSelectedItems.getLength() )
+ if ( aSelectedItems.hasElements() )
{
sal_Int16 nSelectedItem = aSelectedItems[ 0 ];
aAny = getControlProperty( "ListBox0Pg3", "StringItemList" );
diff --git a/sdext/source/pdfimport/test/tests.cxx b/sdext/source/pdfimport/test/tests.cxx
index 4cbf870dc28a..aef522b470bd 100644
--- a/sdext/source/pdfimport/test/tests.cxx
+++ b/sdext/source/pdfimport/test/tests.cxx
@@ -161,7 +161,7 @@ namespace
double start ) override
{
GraphicsContext& rContext( getCurrentContext() );
- if( dashes.getLength() )
+ if( dashes.hasElements() )
comphelper::sequenceToContainer(rContext.DashArray,dashes);
CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE( "line dashing start offset", 0.0, start, 0.000000001 );
}
diff --git a/sdext/source/presenter/PresenterTextView.cxx b/sdext/source/presenter/PresenterTextView.cxx
index 59350c34f3fa..a11bc4f193e3 100644
--- a/sdext/source/presenter/PresenterTextView.cxx
+++ b/sdext/source/presenter/PresenterTextView.cxx
@@ -1173,7 +1173,7 @@ PresenterTextParagraph::Line::Line (
void PresenterTextParagraph::Line::ProvideCellBoxes()
{
- if ( mnLineStartCharacterIndex < mnLineEndCharacterIndex && maCellBoxes.getLength()==0 )
+ if ( mnLineStartCharacterIndex < mnLineEndCharacterIndex && !maCellBoxes.hasElements() )
{
if (mxLayoutedLine.is())
maCellBoxes = mxLayoutedLine->queryInkMeasures();