summaryrefslogtreecommitdiff
path: root/scripting
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 /scripting
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 'scripting')
-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
4 files changed, 8 insertions, 8 deletions
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