Kaydet (Commit) deffca13 authored tarafından Arkadiy Illarionov's avatar Arkadiy Illarionov Kaydeden (comit) Noel Grandin

Use hasElements to check Sequence emptiness in [t-u]*

Similar to clang-tidy readability-container-size-empty

Change-Id: Idefe55e37f5c837c889548ffe7c5711400012a4d
Reviewed-on: https://gerrit.libreoffice.org/71667
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst e2abbc00
......@@ -38,7 +38,7 @@ void XNameAccess::testGetElementNames()
uno::Reference<container::XNameAccess> xNA(init(), uno::UNO_QUERY_THROW);
uno::Sequence<OUString> aNames = xNA->getElementNames();
CPPUNIT_ASSERT(aNames.getLength());
CPPUNIT_ASSERT(aNames.hasElements());
}
void XNameAccess::testHasByName()
......
......@@ -34,7 +34,7 @@ void XServiceInfo::testGetSupportedServiceNames()
uno::Reference<lang::XServiceInfo> xSI(init(), uno::UNO_QUERY_THROW);
uno::Sequence<OUString> aServiceNames = xSI->getSupportedServiceNames();
CPPUNIT_ASSERT(aServiceNames.getLength());
CPPUNIT_ASSERT(aServiceNames.hasElements());
}
void XServiceInfo::testSupportsService()
......
......@@ -172,8 +172,7 @@ void GlobalSheetSettings::testGlobalSheetSettingsProperties()
aNewValue <<= uno::Sequence<OUString>();
xGlobalSheetSettings->setPropertyValue(propName, aNewValue);
CPPUNIT_ASSERT(xGlobalSheetSettings->getPropertyValue(propName) >>= aUserLists);
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set PropertyValue UserLists", sal_Int32(0),
aUserLists.getLength());
CPPUNIT_ASSERT_MESSAGE("Unable to set PropertyValue UserLists", !aUserLists.hasElements());
propName = "LinkUpdateMode";
sal_Int16 aLinkUpdateMode = 42;
......
......@@ -69,7 +69,7 @@ void XCellRangeData::testGetDataArray()
{
uno::Reference< sheet::XCellRangeData > xCellRangeData( getXCellRangeData(), UNO_QUERY_THROW);
uno::Sequence< uno::Sequence < Any > > aColRow = xCellRangeData->getDataArray();
CPPUNIT_ASSERT(aColRow.getLength());
CPPUNIT_ASSERT(aColRow.hasElements());
}
void XCellRangeData::testGetDataArrayOnTableSheet()
......
......@@ -49,7 +49,7 @@ void XConsolidationDescriptor::testGetSources()
UNO_QUERY_THROW);
uno::Sequence<table::CellRangeAddress> aSources = xConsolidationDescriptor->getSources();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get sources", sal_Int32(0), aSources.getLength());
CPPUNIT_ASSERT_MESSAGE("Unable to get sources", !aSources.hasElements());
}
void XConsolidationDescriptor::testSetSources()
......
......@@ -250,7 +250,7 @@ table::CellAddress getLastUsedCellAddress( uno::Reference< sheet::XSpreadsheet >
void XDataPilotTable2::checkDrillDownSheetContent(uno::Reference< sheet::XSpreadsheet > const & xSheet, const uno::Sequence< uno::Sequence< Any > >& aData)
{
table::CellAddress aLastCell = getLastUsedCellAddress(xSheet, 0, 0);
CPPUNIT_ASSERT(aData.getLength() > 0);
CPPUNIT_ASSERT(aData.hasElements());
CPPUNIT_ASSERT(aLastCell.Row);
CPPUNIT_ASSERT(aLastCell.Column);
......
......@@ -55,7 +55,7 @@ void XFunctionDescriptions::testGetById()
OUString aName2;
uno::Sequence<beans::PropertyValue> aProps2 = xFD->getById(aId1);
CPPUNIT_ASSERT_MESSAGE("Received empty FunctionDescriptions from getById()",
aProps2.getLength());
aProps2.hasElements());
for (const auto& aProp : aProps2)
{
if (aProp.Name == "Id")
......
......@@ -46,7 +46,7 @@ void XRecentFunctions::testSetRecentFunctionIds()
xRecentFunctions->setRecentFunctionIds(aIds);
aIds = xRecentFunctions->getRecentFunctionIds();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to set Ids (empty list)", sal_Int32(0), aIds.getLength());
CPPUNIT_ASSERT_MESSAGE("Unable to set Ids (empty list)", !aIds.hasElements());
// max. size list
aIds.realloc(nMaxNumber);
......
......@@ -29,7 +29,7 @@ void XScenarioEnhanced::testGetRanges()
uno::Reference<sheet::XScenarioEnhanced> xSE(getScenarioSpreadsheet(), UNO_QUERY_THROW);
uno::Sequence<table::CellRangeAddress> aCellRangeAddr = xSE->getRanges();
CPPUNIT_ASSERT_MESSAGE("No ranges found", aCellRangeAddr.getLength() != 0);
CPPUNIT_ASSERT_MESSAGE("No ranges found", aCellRangeAddr.hasElements());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong CellRangeAddres", table::CellRangeAddress(1, 0, 0, 10, 10),
aCellRangeAddr[0]);
......
......@@ -36,7 +36,7 @@ void XSheetFilterableEx::testCreateFilterDescriptorByObject()
CPPUNIT_ASSERT_MESSAGE("no XSheetFilterDescriptor", xSFD.is());
uno::Sequence<sheet::TableFilterField> xTFF = xSFD->getFilterFields();
CPPUNIT_ASSERT_MESSAGE("The gained XSheetFilterDescriptor is empty", xTFF.getLength() != 0);
CPPUNIT_ASSERT_MESSAGE("The gained XSheetFilterDescriptor is empty", xTFF.hasElements());
for (const auto& field : xTFF)
{
......
......@@ -27,8 +27,7 @@ void XSheetFilterDescriptor::testGetSetFilterFields()
uno::Reference<sheet::XSheetFilterDescriptor> xSFD(init(), uno::UNO_QUERY_THROW);
uno::Sequence<sheet::TableFilterField> aDefaultTFF = xSFD->getFilterFields();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get TableFilterField", sal_Int32(0),
aDefaultTFF.getLength());
CPPUNIT_ASSERT_MESSAGE("Unable to get TableFilterField", !aDefaultTFF.hasElements());
uno::Sequence<sheet::TableFilterField> aTFF;
aTFF.realloc(1);
......
......@@ -27,8 +27,7 @@ void XSheetFilterDescriptor2::testGetSetFilterFields2()
uno::Reference<sheet::XSheetFilterDescriptor2> xSFD(init(), uno::UNO_QUERY_THROW);
uno::Sequence<sheet::TableFilterField2> aDefaultTFF = xSFD->getFilterFields2();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get TableFilterField", sal_Int32(0),
aDefaultTFF.getLength());
CPPUNIT_ASSERT_MESSAGE("Unable to get TableFilterField", !aDefaultTFF.hasElements());
uno::Sequence<sheet::TableFilterField2> aTFF;
aTFF.realloc(1);
......
......@@ -27,8 +27,7 @@ void XSheetFilterDescriptor3::testGetSetFilterFields3()
uno::Reference<sheet::XSheetFilterDescriptor3> xSFD(init(), uno::UNO_QUERY_THROW);
uno::Sequence<sheet::TableFilterField3> aDefaultTFF = xSFD->getFilterFields3();
CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to get TableFilterField", sal_Int32(0),
aDefaultTFF.getLength());
CPPUNIT_ASSERT_MESSAGE("Unable to get TableFilterField", !aDefaultTFF.hasElements());
uno::Sequence<sheet::TableFilterField3> aTFF;
aTFF.realloc(1);
......
......@@ -27,7 +27,7 @@ void XSheetPageBreak::testGetColumnPageBreaks()
uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak(init(), UNO_QUERY_THROW);
uno::Sequence< sheet::TablePageBreakData > xColPageBreak = xSheetPageBreak->getColumnPageBreaks();
CPPUNIT_ASSERT_MESSAGE("Unable to get column page breaks", xColPageBreak.getLength() != 0);
CPPUNIT_ASSERT_MESSAGE("Unable to get column page breaks", xColPageBreak.hasElements());
}
void XSheetPageBreak::testGetRowPageBreaks()
......@@ -35,7 +35,7 @@ void XSheetPageBreak::testGetRowPageBreaks()
uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak(init(), UNO_QUERY_THROW);
uno::Sequence< sheet::TablePageBreakData > xRowPageBreak = xSheetPageBreak->getRowPageBreaks();
CPPUNIT_ASSERT_MESSAGE("Unable to get row page breaks", xRowPageBreak.getLength() != 0);
CPPUNIT_ASSERT_MESSAGE("Unable to get row page breaks", xRowPageBreak.hasElements());
}
void XSheetPageBreak::testRemoveAllManualPageBreaks()
......
......@@ -63,7 +63,7 @@ void XSubTotalField::testGetSetTotalColumns()
uno::Reference< sheet::XSubTotalField > xSTF(init(), UNO_QUERY_THROW);
uno::Sequence< sheet::SubTotalColumn > sDefaultCols = xSTF->getSubTotalColumns();
CPPUNIT_ASSERT_MESSAGE("Unable to get SubTotalColumns", sDefaultCols.getLength() != 0);
CPPUNIT_ASSERT_MESSAGE("Unable to get SubTotalColumns", sDefaultCols.hasElements());
uno::Sequence< sheet::SubTotalColumn > sNewCols;
sNewCols.realloc(1);
......
......@@ -576,7 +576,7 @@ static bool performTest(
!nullAny.hasValue() || (ifc && !ifc->is()),
"getNullPolyAny");
bRet &= check(
xLBT->getNullPolySequence().member.getLength() == 0,
!xLBT->getNullPolySequence().member.hasElements(),
"getNullPolySequence");
bRet &= check(
xLBT->getNullPolyEnum().member == TestEnum_TEST,
......@@ -1105,7 +1105,7 @@ sal_Int32 TestBridgeImpl::run( const Sequence< OUString > & rArgs )
bool bRet = false;
try
{
if (! rArgs.getLength())
if (! rArgs.hasElements())
{
throw RuntimeException( "no test object specified!\n"
"usage : ServiceName of test object | -u unourl of test object" );
......
......@@ -1912,7 +1912,7 @@ void VCLXListBox::setProperty( const OUString& PropertyName, const css::uno::Any
for ( auto n = pListBox->GetEntryCount(); n; )
pListBox->SelectEntryPos( --n, false );
if ( aItems.getLength() )
if ( aItems.hasElements() )
selectItemsPos( aItems, true );
else
pListBox->SetNoSelection();
......
......@@ -421,7 +421,7 @@ void UnoControl::propertiesChange( const Sequence< PropertyChangeEvent >& rEvent
++pEvents;
aEvents.realloc( pEventsEnd - aEvents.getConstArray() );
if ( !aEvents.getLength() )
if ( !aEvents.hasElements() )
return;
}
}
......
......@@ -585,7 +585,7 @@ namespace toolkitform
// get selected items
Sequence< sal_Int16 > aSelectIndices;
OSL_VERIFY( xModelProps->getPropertyValue("SelectedItems") >>= aSelectIndices );
if( aSelectIndices.getLength() > 0 )
if( aSelectIndices.hasElements() )
{
pListWidget->SelectedEntries.resize( 0 );
for( sal_Int32 i = 0; i < aSelectIndices.getLength(); i++ )
......
......@@ -181,7 +181,7 @@ bool CachedContentResultSet::CCRS_Cache
return ( m_pResult->FetchError & FetchError::ENDOFDATA )
&& m_pResult->Orientation
&& m_pResult->Rows.getLength();
&& m_pResult->Rows.hasElements();
}
bool CachedContentResultSet::CCRS_Cache
......
......@@ -235,7 +235,7 @@ void SAL_CALL CachedDynamicResultSetStubFactory
OSL_ENSURE( TargetCache.is(), "a TargetCache is needed" );
Reference< XDynamicResultSet > xSource( Source );
if( SortingInfo.getLength() &&
if( SortingInfo.hasElements() &&
!( xSource->getCapabilities() & ContentResultSetCapability::SORTED )
)
{
......
......@@ -544,7 +544,7 @@ void SAL_CALL ContentResultSetWrapper::addPropertyChangeListener( const OUString
impl_getPropertyChangeListenerContainer();
bool bNeedRegister = !m_pPropertyChangeListeners->
getContainedTypes().getLength();
getContainedTypes().hasElements();
m_pPropertyChangeListeners->addInterface( aPropertyName, xListener );
if( bNeedRegister )
{
......@@ -589,7 +589,7 @@ void SAL_CALL ContentResultSetWrapper::addVetoableChangeListener( const OUString
impl_getVetoableChangeListenerContainer();
bool bNeedRegister = !m_pVetoableChangeListeners->
getContainedTypes().getLength();
getContainedTypes().hasElements();
m_pVetoableChangeListeners->addInterface( rPropertyName, xListener );
if( bNeedRegister )
{
......@@ -645,7 +645,7 @@ void SAL_CALL ContentResultSetWrapper::removePropertyChangeListener( const OUStr
m_pPropertyChangeListeners->removeInterface( rPropertyName, xListener );
if( !m_pPropertyChangeListeners->getContainedTypes().getLength() )
if( !m_pPropertyChangeListeners->getContainedTypes().hasElements() )
{
impl_init_xPropertySetOrigin();
{
......@@ -698,7 +698,7 @@ void SAL_CALL ContentResultSetWrapper::removeVetoableChangeListener( const OUStr
m_pVetoableChangeListeners->removeInterface( rPropertyName, xListener );
if( !m_pVetoableChangeListeners->getContainedTypes().getLength() )
if( !m_pVetoableChangeListeners->getContainedTypes().hasElements() )
{
impl_init_xPropertySetOrigin();
{
......
......@@ -364,9 +364,9 @@ void SAL_CALL UniversalContentBroker::initialize( const css::uno::Sequence< Any
{
{
osl::MutexGuard aGuard(m_aMutex);
if (m_aArguments.getLength() != 0)
if (m_aArguments.hasElements())
{
if (aArguments.getLength() != 0
if (aArguments.hasElements()
&& !(m_aArguments.getLength() == 2
&& aArguments.getLength() == 2
&& m_aArguments[0] == aArguments[0]
......@@ -378,7 +378,7 @@ void SAL_CALL UniversalContentBroker::initialize( const css::uno::Sequence< Any
}
return;
}
if (aArguments.getLength() == 0)
if (!aArguments.hasElements())
{
m_aArguments.realloc(2);
m_aArguments[0] <<= OUString("Local");
......
......@@ -889,7 +889,7 @@ Reference< XMultiServiceFactory > PropertySetRegistry::getConfigProvider()
{
const Sequence< Any >& rInitArgs = m_pImpl->m_aInitArgs;
if ( rInitArgs.getLength() > 0 )
if ( rInitArgs.hasElements() )
{
// Extract config provider from service init args.
rInitArgs[ 0 ] >>= m_pImpl->m_xConfigProvider;
......
......@@ -1794,7 +1794,7 @@ namespace cmis
else if ( aCommand.Name == "setPropertyValues" )
{
uno::Sequence< beans::PropertyValue > aProperties;
if ( !( aCommand.Argument >>= aProperties ) || !aProperties.getLength() )
if ( !( aCommand.Argument >>= aProperties ) || !aProperties.hasElements() )
ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
aRet <<= setPropertyValues( aProperties, xEnv );
}
......
......@@ -211,7 +211,7 @@ namespace ucb { namespace ucp { namespace ext
// unreachable
}
if ( !aProperties.getLength() )
if ( !aProperties.hasElements() )
{
::ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException(
OUString(), *this, -1 ) ),
......
......@@ -129,7 +129,7 @@ namespace ucb { namespace ucp { namespace ext
Sequence< Sequence< OUString > > aExtensionInfo( xPackageInfo->getExtensionList() );
for ( auto const & extInfo : aExtensionInfo )
{
if ( extInfo.getLength() <= 0 )
if ( !extInfo.hasElements() )
{
SAL_WARN( "ucb.ucp.ext", "illegal extension info" );
continue;
......
......@@ -399,7 +399,7 @@ BaseContent::addPropertiesChangeListener(
m_pPropertyListener.reset( new PropertyListeners( m_aEventListenerMutex ) );
if( PropertyNames.getLength() == 0 )
if( !PropertyNames.hasElements() )
m_pPropertyListener->addInterface( OUString(),Listener );
else
{
......
......@@ -2895,7 +2895,7 @@ TaskManager::copyPersistentSet( const OUString& srcUnqPath,
uno::Sequence< beans::Property > seqProperty =
x_src->getPropertySetInfo()->getProperties();
if( seqProperty.getLength() )
if( seqProperty.hasElements() )
{
uno::Reference< XPersistentPropertySet >
x_dstS = m_xFileRegistry->openPropertySet( new_Name,true );
......
......@@ -112,7 +112,7 @@ FileProvider::initialize(
{
if( ! m_pMyShell ) {
OUString config;
if( aArguments.getLength() > 0 &&
if( aArguments.hasElements() &&
(aArguments[0] >>= config) &&
config == "NoConfig" )
m_pMyShell.reset( new TaskManager( m_xContext, this, false ) );
......
......@@ -830,7 +830,7 @@ Sequence<Any> FTPContent::setPropertyValues(
}
}
if(evt.getLength()) {
if(evt.hasElements()) {
// title has changed
notifyPropertiesChange(evt);
(void)exchange(new FTPContentIdentifier(m_aFTPURL.ident(false,false)));
......
......@@ -968,7 +968,7 @@ uno::Any SAL_CALL Content::execute(
else if ( aCommand.Name == "setPropertyValues" )
{
uno::Sequence< beans::PropertyValue > aProperties;
if ( !( aCommand.Argument >>= aProperties ) || !aProperties.getLength() )
if ( !( aCommand.Argument >>= aProperties ) || !aProperties.hasElements() )
ucbhelper::cancelCommandExecution ( getBadArgExcept (), xEnv );
aRet <<= setPropertyValues( aProperties, xEnv );
}
......
......@@ -340,7 +340,7 @@ uno::Any SAL_CALL HierarchyContent::execute(
// Unreachable
}
if ( !aProperties.getLength() )
if ( !aProperties.hasElements() )
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
......
......@@ -927,7 +927,7 @@ bool HierarchyEntry::first( iterator const & it )
}
}
if ( it.m_pImpl->names.getLength() == 0 )
if ( !it.m_pImpl->names.hasElements() )
return false;
it.m_pImpl->pos = 0;
......
......@@ -163,7 +163,7 @@ HierarchyContentProvider::queryContent(
void SAL_CALL HierarchyContentProvider::initialize(
const uno::Sequence< uno::Any >& aArguments )
{
if ( aArguments.getLength() > 0 )
if ( aArguments.hasElements() )
OSL_FAIL( "HierarchyContentProvider::initialize : not supported!" );
}
......
......@@ -436,7 +436,7 @@ uno::Any SAL_CALL Content::execute(
// Unreachable
}
if ( !aProperties.getLength() )
if ( !aProperties.hasElements() )
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
......
......@@ -365,7 +365,7 @@ uno::Any SAL_CALL Content::execute(
// Unreachable
}
if ( !aProperties.getLength() )
if ( !aProperties.hasElements() )
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
......
......@@ -493,7 +493,7 @@ uno::Any SAL_CALL Content::execute(
// Unreachable
}
if ( !aProperties.getLength() )
if ( !aProperties.hasElements() )
{
ucbhelper::cancelCommandExecution(
uno::makeAny( lang::IllegalArgumentException(
......@@ -1392,7 +1392,7 @@ uno::Reference< sdbc::XRow > Content::getPropertyValues(
aProperties = rProperties;
}
if ( aProperties.getLength() > 0 )
if ( aProperties.hasElements() )
ContentProperties::UCBNamesToDAVNames(
aProperties, aPropNames );
......
......@@ -1201,7 +1201,7 @@ Reference< XContent > Content_Impl::getContent()
Reference< XUniversalContentBroker > pBroker(
UniversalContentBroker::create( getComponentContext() ) );
OSL_ENSURE( pBroker->queryContentProviders().getLength(),
OSL_ENSURE( pBroker->queryContentProviders().hasElements(),
"Content Broker not configured (no providers)!" );
Reference< XContentIdentifier > xId
......
......@@ -527,7 +527,7 @@ void SAL_CALL ContentImplHelper::removeProperty( const OUString& Name )
// Success!
if ( xSet->getPropertySetInfo()->getProperties().getLength() == 0 )
if ( !xSet->getPropertySetInfo()->getProperties().hasElements() )
{
// Remove empty propertyset from registry.
uno::Reference< css::ucb::XPropertySetRegistry >
......
......@@ -207,7 +207,7 @@ void GlobalEventConfig_Impl::initBindingInfo()
SAL_INFO("unotools", "reading binding for: " << lMacros[0]);
Sequence< Any > lValues = GetProperties( lMacros );
OUString sMacroURL;
if( lValues.getLength() > 0 )
if( lValues.hasElements() )
{
lValues[0] >>= sMacroURL;
sal_Int32 startIndex = lEventNames[i].indexOf('\'');
......
......@@ -916,7 +916,7 @@ bool SvtLinguConfig::GetSupportedDictionaryFormatsFor(
xNA.set( xNA->getByName( rSetEntry ), uno::UNO_QUERY_THROW );
if (xNA->getByName( "SupportedDictionaryFormats" ) >>= rFormatList)
bSuccess = true;
DBG_ASSERT( rFormatList.getLength(), "supported dictionary format list is empty" );
DBG_ASSERT( rFormatList.hasElements(), "supported dictionary format list is empty" );
}
catch (uno::Exception &)
{
......@@ -965,9 +965,9 @@ bool SvtLinguConfig::GetDictionaryEntry(
bSuccess = (xNA->getByName( "Locations" ) >>= aLocations) &&
(xNA->getByName( "Format" ) >>= aFormatName) &&
(xNA->getByName( "Locales" ) >>= aLocaleNames);
DBG_ASSERT( aLocations.getLength(), "Dictionary locations not set" );
DBG_ASSERT( aLocations.hasElements(), "Dictionary locations not set" );
DBG_ASSERT( !aFormatName.isEmpty(), "Dictionary format name not set" );
DBG_ASSERT( aLocaleNames.getLength(), "No locales set for the dictionary" );
DBG_ASSERT( aLocaleNames.hasElements(), "No locales set for the dictionary" );
// if successful continue
if (bSuccess)
......@@ -1174,7 +1174,7 @@ bool SvtLinguConfig::HasGrammarChecker() const
xNA.set( xNA->getByName("GrammarCheckerList"), uno::UNO_QUERY_THROW );
uno::Sequence< OUString > aElementNames( xNA->getElementNames() );
bRes = aElementNames.getLength() > 0;
bRes = aElementNames.hasElements();
}
catch (const uno::Exception&)
{
......
......@@ -146,7 +146,7 @@ void SvtOptionsDlgOptions_Impl::ReadNode( const OUString& _rNode, NodeType _eTyp
{
OUString sNodes( sNode + sSet );
Sequence< OUString > aNodes = GetNodeNames( sNodes );
if ( aNodes.getLength() > 0 )
if ( aNodes.hasElements() )
{
for ( sal_uInt32 n = 0; n < static_cast<sal_uInt32>(aNodes.getLength()); ++n )
{
......
......@@ -116,7 +116,7 @@ private:
void SvtUserOptions::ChangeListener::changesOccurred (util::ChangesEvent const& rEvent)
{
if (rEvent.Changes.getLength())
if (rEvent.Changes.hasElements())
m_rParent.Notify();
}
......
......@@ -154,9 +154,9 @@ void LocaleDataWrapper::invalidateData()
xDefaultCalendar.reset();
xSecondaryCalendar.reset();
bSecondaryCalendarValid = false;
if (aGrouping.getLength())
if (aGrouping.hasElements())
aGrouping[0] = 0;
if (aDateAcceptancePatterns.getLength())
if (aDateAcceptancePatterns.hasElements())
aDateAcceptancePatterns = Sequence<OUString>();
}
......@@ -259,7 +259,7 @@ css::uno::Sequence< css::lang::Locale > LocaleDataWrapper::getAllInstalledLocale
{
uno::Sequence< lang::Locale > &rInstalledLocales = InstalledLocales::get();
if ( rInstalledLocales.getLength() )
if ( rInstalledLocales.hasElements() )
return rInstalledLocales;
try
......@@ -281,7 +281,7 @@ css::uno::Sequence< css::lang::Locale > LocaleDataWrapper::getInstalledLocaleNam
const uno::Sequence< lang::Locale > &rInstalledLocales =
InstalledLocales::get();
if ( !rInstalledLocales.getLength() )
if ( !rInstalledLocales.hasElements() )
{
LocaleDataWrapper aLDW( ::comphelper::getProcessComponentContext(), LanguageTag( LANGUAGE_SYSTEM) );
aLDW.getAllInstalledLocaleNames();
......@@ -1080,7 +1080,7 @@ void LocaleDataWrapper::getDigitGroupingImpl()
* sequence. Needed additional API and a locale data element.
*/
if (!aGrouping.getLength())
if (!aGrouping.hasElements())
{
aGrouping.realloc(3); // room for {3,2,0}
aGrouping[0] = 0; // invalidate
......@@ -1106,7 +1106,7 @@ void LocaleDataWrapper::getDigitGroupingImpl()
const css::uno::Sequence< sal_Int32 > LocaleDataWrapper::getDigitGrouping() const
{
::utl::ReadWriteGuard aGuard( aMutex );
if (!aGrouping.getLength() || aGrouping[0] == 0)
if (!aGrouping.hasElements() || aGrouping[0] == 0)
{ // no cached content
aGuard.changeReadToWrite();
const_cast<LocaleDataWrapper*>(this)->getDigitGroupingImpl();
......@@ -1789,7 +1789,7 @@ css::uno::Sequence< OUString > LocaleDataWrapper::getDateAcceptancePatterns() co
{
::utl::ReadWriteGuard aGuard( aMutex );
if (aDateAcceptancePatterns.getLength())
if (aDateAcceptancePatterns.hasElements())
return aDateAcceptancePatterns;
aGuard.changeReadToWrite();
......@@ -1814,7 +1814,7 @@ void LocaleDataWrapper::setDateAcceptancePatterns(
{
::utl::ReadWriteGuard aGuard( aMutex, ReadWriteGuardMode::Write );
if (!aDateAcceptancePatterns.getLength() || !rPatterns.getLength())
if (!aDateAcceptancePatterns.hasElements() || !rPatterns.hasElements())
{
try
{
......@@ -1824,9 +1824,9 @@ void LocaleDataWrapper::setDateAcceptancePatterns(
{
SAL_WARN( "unotools.i18n", "setDateAcceptancePatterns: Exception caught " << e );
}
if (!rPatterns.getLength())
if (!rPatterns.hasElements())
return; // just a reset
if (!aDateAcceptancePatterns.getLength())
if (!aDateAcceptancePatterns.hasElements())
{
aDateAcceptancePatterns = rPatterns;
return;
......
......@@ -476,7 +476,7 @@ css::uno::Sequence< css::beans::NamedValue > MediaDescriptor::requestAndVerifyDo
erase( PROP_ENCRYPTIONDATA() );
// insert valid password into media descriptor (but not a default password)
if( (aEncryptionData.getLength() > 0) && !bIsDefaultPassword )
if( aEncryptionData.hasElements() && !bIsDefaultPassword )
(*this)[ PROP_ENCRYPTIONDATA() ] <<= aEncryptionData;
return aEncryptionData;
......
......@@ -36,7 +36,7 @@ static bool getStatusFromAny_Impl( const Any& aAny, OUString& aText, sal_Int32&
bool bNumIsSet = false;
Sequence< Any > aSetList;
if( ( aAny >>= aSetList ) && aSetList.getLength() )
if( ( aAny >>= aSetList ) && aSetList.hasElements() )
for( int ind = 0; ind < aSetList.getLength(); ind++ )
{
if( !bNumIsSet && ( aSetList[ind] >>= nNum ) )
......
......@@ -1281,7 +1281,7 @@ UcbLockBytesRef UcbLockBytes::CreateLockBytes( const Reference < XContent >& xCo
else
xSink = new UcbDataSink_Impl(xLockBytes.get());
if ( rProps.getLength() )
if ( rProps.hasElements() )
{
Reference < XCommandProcessor > xProcessor( xContent, UNO_QUERY );
Command aCommand;
......
......@@ -1402,7 +1402,7 @@ void SAL_CALL librdf_Repository::setStatementRDFa(
throw lang::IllegalArgumentException(
"librdf_Repository::setStatementRDFa: Subject is null", *this, 0);
}
if (!i_rPredicates.getLength()) {
if (!i_rPredicates.hasElements()) {
throw lang::IllegalArgumentException(
"librdf_Repository::setStatementRDFa: no Predicates",
*this, 1);
......
......@@ -200,7 +200,7 @@ handleFilterOptionsRequest_(
{
}
if( xFilterCFG.is() && rRequest.rProperties.getLength() )
if( xFilterCFG.is() && rRequest.rProperties.hasElements() )
{
try
{
......
......@@ -397,7 +397,7 @@ UUIInteractionHelper::handleRequest_impl(
std::vector< OUString > aArguments;
uno::Sequence< OUString > sModules
= aModSizeException.Names;
if ( sModules.getLength() )
if ( sModules.hasElements() )
{
OUStringBuffer aName;
for ( sal_Int32 index=0; index< sModules.getLength(); ++index )
......@@ -1142,7 +1142,7 @@ UUIInteractionHelper::handleMacroConfirmRequest(
bool bApprove = false;
bool bShowSignatures = aSignInfo.getLength() > 0;
bool bShowSignatures = aSignInfo.hasElements();
uno::Reference<awt::XWindow> xParent = getParentXWindow();
MacroWarning aWarning(Application::GetFrameWeld(xParent), bShowSignatures);
......
......@@ -61,9 +61,9 @@ bool fillContinuation(
}
return false;
}
else if (aRec.UserList.getLength() != 0)
else if (aRec.UserList.hasElements())
{
if (aRec.UserList[0].Passwords.getLength() == 0)
if (!aRec.UserList[0].Passwords.hasElements())