summaryrefslogtreecommitdiff
path: root/sd
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 /sd
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>
Diffstat (limited to 'sd')
-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
19 files changed, 24 insertions, 24 deletions
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;