summaryrefslogtreecommitdiff
path: root/sd/source/ui
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/source/ui
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/source/ui')
-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
14 files changed, 17 insertions, 17 deletions
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;