[Libreoffice-commits] core.git: accessibility/source basctl/source basic/qa basic/source binaryurp/source canvas/source

Arkadiy Illarionov (via logerrit) logerrit at kemper.freedesktop.org
Tue Jun 11 18:25:44 UTC 2019


 accessibility/source/extended/textwindowaccessibility.cxx |    2 +-
 accessibility/source/helper/characterattributeshelper.cxx |    2 +-
 basctl/source/basicide/baside2b.cxx                       |    4 ++--
 basctl/source/basicide/baside3.cxx                        |    3 +--
 basctl/source/basicide/localizationmgr.cxx                |   10 +++++-----
 basctl/source/basicide/moduldlg.cxx                       |    6 +++---
 basctl/source/dlged/dlged.cxx                             |    2 +-
 basctl/source/dlged/propbrw.cxx                           |    2 +-
 basic/qa/cppunit/basictest.cxx                            |    2 +-
 basic/source/classes/sbunoobj.cxx                         |    4 ++--
 basic/source/classes/sbxmod.cxx                           |    4 ++--
 basic/source/runtime/methods.cxx                          |    7 +++----
 binaryurp/source/reader.cxx                               |    2 +-
 canvas/source/cairo/cairo_canvas.cxx                      |    2 +-
 canvas/source/cairo/cairo_canvashelper.cxx                |    4 ++--
 canvas/source/cairo/cairo_spritecanvas.cxx                |    2 +-
 canvas/source/cairo/cairo_textlayout.cxx                  |   12 ++++++------
 canvas/source/opengl/ogl_canvashelper.cxx                 |    4 ++--
 canvas/source/opengl/ogl_spritecanvas.cxx                 |    2 +-
 canvas/source/opengl/ogl_textlayout.cxx                   |    2 +-
 canvas/source/simplecanvas/simplecanvasimpl.cxx           |    2 +-
 canvas/source/tools/canvastools.cxx                       |    2 +-
 canvas/source/vcl/canvas.cxx                              |    2 +-
 canvas/source/vcl/canvashelper.cxx                        |    2 +-
 canvas/source/vcl/canvashelper_texturefill.cxx            |    4 ++--
 canvas/source/vcl/spritecanvas.cxx                        |    4 ++--
 canvas/source/vcl/textlayout.cxx                          |    4 ++--
 27 files changed, 48 insertions(+), 50 deletions(-)

New commits:
commit c88f76035cd1d088cc06067270677618340fd839
Author:     Arkadiy Illarionov <qarkai at gmail.com>
AuthorDate: Sat May 4 23:42:17 2019 +0300
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jun 11 20:24:40 2019 +0200

    Use hasElements to check Sequence emptiness in accessibility..canvas
    
    Similar to clang-tidy readability-container-size-empty
    
    Change-Id: I24c3f04b4eed3c1cd973166885660f113a26844f
    Reviewed-on: https://gerrit.libreoffice.org/71805
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index 3cebc2ba295e..63ea654a3728 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -1080,7 +1080,7 @@ void Document::retrieveRunAttributesImpl(
         aPropVal.State = css::beans::PropertyState_DIRECT_VALUE;
         aRunAttrSeq[ aPropVal.Name ] = aPropVal;
     }
-    if ( RequestedAttributes.getLength() == 0 )
+    if ( !RequestedAttributes.hasElements() )
     {
         rRunAttrSeq = aRunAttrSeq;
     }
diff --git a/accessibility/source/helper/characterattributeshelper.cxx b/accessibility/source/helper/characterattributeshelper.cxx
index 4935c4865de5..9cbeaaee8a7c 100644
--- a/accessibility/source/helper/characterattributeshelper.cxx
+++ b/accessibility/source/helper/characterattributeshelper.cxx
@@ -59,7 +59,7 @@ std::vector< PropertyValue > CharacterAttributesHelper::GetCharacterAttributes()
 
 Sequence< PropertyValue > CharacterAttributesHelper::GetCharacterAttributes( const css::uno::Sequence< OUString >& aRequestedAttributes )
 {
-    if ( aRequestedAttributes.getLength() == 0 )
+    if ( !aRequestedAttributes.hasElements() )
         return comphelper::containerToSequence(GetCharacterAttributes());
 
     std::vector< PropertyValue > aValues;
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index df2b10ef5ab1..4421e78cb6ff 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -2897,7 +2897,7 @@ std::vector< OUString > UnoTypeCodeCompletetor::GetXIdlClassMethods() const
     if( bCanComplete && ( xClass != nullptr ) )
     {
         Sequence< Reference< reflection::XIdlMethod > > aMethods = xClass->getMethods();
-        if( aMethods.getLength() != 0 )
+        if( aMethods.hasElements() )
         {
             for(sal_Int32 l = 0; l < aMethods.getLength(); ++l)
             {
@@ -2914,7 +2914,7 @@ std::vector< OUString > UnoTypeCodeCompletetor::GetXIdlClassFields() const
     if( bCanComplete && ( xClass != nullptr ) )
     {
         Sequence< Reference< reflection::XIdlField > > aFields = xClass->getFields();
-        if( aFields.getLength() != 0 )
+        if( aFields.hasElements() )
         {
             for(sal_Int32 l = 0; l < aFields.getLength(); ++l)
             {
diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx
index c0409fe8b924..eda571040c6b 100644
--- a/basctl/source/basicide/baside3.cxx
+++ b/basctl/source/basicide/baside3.cxx
@@ -675,8 +675,7 @@ void DialogWindow::SaveDialog()
             if( xStringResourceResolver.is() )
             {
                 Sequence< lang::Locale > aLocaleSeq = xStringResourceResolver->getLocales();
-                sal_Int32 nLocaleCount = aLocaleSeq.getLength();
-                if( nLocaleCount > 0 )
+                if( aLocaleSeq.hasElements() )
                     bResource = true;
             }
 
diff --git a/basctl/source/basicide/localizationmgr.cxx b/basctl/source/basicide/localizationmgr.cxx
index c0cd940e9c08..db4e8c296b7f 100644
--- a/basctl/source/basicide/localizationmgr.cxx
+++ b/basctl/source/basicide/localizationmgr.cxx
@@ -67,7 +67,7 @@ LocalizationMgr::LocalizationMgr(
 bool LocalizationMgr::isLibraryLocalized ()
 {
     if (m_xStringResourceManager.is())
-        return m_xStringResourceManager->getLocales().getLength() > 0;
+        return m_xStringResourceManager->getLocales().hasElements();
     return false;
 }
 
@@ -808,7 +808,7 @@ void LocalizationMgr::setControlResourceIDsForNewEditorObject( DlgEditor const *
         LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib );
 
     // Set resource property
-    if( !xStringResourceManager.is() || xStringResourceManager->getLocales().getLength() == 0 )
+    if( !xStringResourceManager.is() || !xStringResourceManager->getLocales().hasElements() )
         return;
 
     OUString aDialogName = pDlgWin->GetName();
@@ -838,7 +838,7 @@ void LocalizationMgr::renameControlResourceIDsForEditorObject( DlgEditor const *
         LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib );
 
     // Set resource property
-    if( !xStringResourceManager.is() || xStringResourceManager->getLocales().getLength() == 0 )
+    if( !xStringResourceManager.is() || !xStringResourceManager->getLocales().hasElements() )
         return;
 
     OUString aDialogName = pDlgWin->GetName();
@@ -888,7 +888,7 @@ void LocalizationMgr::setStringResourceAtDialog( const ScriptDocument& rDocument
     {
         // Not very elegant as dialog may or may not be localized yet
         // TODO: Find better place, where dialog is created
-        if( xStringResourceManager->getLocales().getLength() > 0 )
+        if( xStringResourceManager->getLocales().hasElements() )
         {
             Any aDialogCtrl;
             aDialogCtrl <<= xDialogModel;
@@ -1037,7 +1037,7 @@ void LocalizationMgr::copyResourcesForPastedEditorObject( DlgEditor const * pEdi
         LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib );
 
     // Set resource property
-    if( !xStringResourceManager.is() || xStringResourceManager->getLocales().getLength() == 0 )
+    if( !xStringResourceManager.is() || !xStringResourceManager->getLocales().hasElements() )
         return;
 
     OUString aDialogName = pDlgWin->GetName();
diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx
index dda0bbf1581d..9be10def7547 100644
--- a/basctl/source/basicide/moduldlg.cxx
+++ b/basctl/source/basicide/moduldlg.cxx
@@ -164,7 +164,7 @@ DragDropMode ExtTreeListBox::NotifyStartDrag( TransferDataContainer&, SvTreeList
                     Reference< XStringResourceManager > xSourceMgr =
                         LocalizationMgr::getStringResourceFromDialogLibrary( xDialogLib );
                     if( xSourceMgr.is() )
-                        bAllowMove = ( xSourceMgr->getLocales().getLength() == 0 );
+                        bAllowMove = !xSourceMgr->getLocales().hasElements();
                 }
                 if( bAllowMove )
                     nMode_ |= DragDropMode::CTRL_MOVE;
@@ -274,14 +274,14 @@ void Shell::CopyDialogResources(
         LocalizationMgr::getStringResourceFromDialogLibrary( xSourceDialogLib );
     if( !xSourceMgr.is() )
         return;
-    bool bSourceLocalized = ( xSourceMgr->getLocales().getLength() > 0 );
+    bool bSourceLocalized = xSourceMgr->getLocales().hasElements();
 
     Reference< container::XNameContainer > xDestDialogLib( rDestDoc.getLibrary( E_DIALOGS, rDestLibName, true ) );
     Reference< XStringResourceManager > xDestMgr =
         LocalizationMgr::getStringResourceFromDialogLibrary( xDestDialogLib );
     if( !xDestMgr.is() )
         return;
-    bool bDestLocalized = ( xDestMgr->getLocales().getLength() > 0 );
+    bool bDestLocalized = xDestMgr->getLocales().hasElements();
 
     if( !bSourceLocalized && !bDestLocalized )
         return;
diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 82f30d30b1c2..045640691e6f 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -853,7 +853,7 @@ void DlgEditor::Paste()
             }
             bool bLocalized = false;
             if( xStringResourceManager.is() )
-                bLocalized = ( xStringResourceManager->getLocales().getLength() > 0 );
+                bLocalized = xStringResourceManager->getLocales().hasElements();
 
             if ( xTransf->isDataFlavorSupported( m_ClipboardDataFlavors[0] ) )
             {
diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx
index 87983eeaf821..b638496946ea 100644
--- a/basctl/source/dlged/propbrw.cxx
+++ b/basctl/source/dlged/propbrw.cxx
@@ -515,7 +515,7 @@ void PropBrw::ImplUpdate( const Reference< XModel >& _rxContextDocument, SdrView
             aNewObjects = CreateMultiSelectionSequence( rMarkList );
         }
 
-        if ( aNewObjects.getLength() )
+        if ( aNewObjects.hasElements() )
             implSetNewObjectSequence( aNewObjects );
         else
             implSetNewObject( xNewObject );
diff --git a/basic/qa/cppunit/basictest.cxx b/basic/qa/cppunit/basictest.cxx
index 21e82ad0d326..07ce6384539f 100644
--- a/basic/qa/cppunit/basictest.cxx
+++ b/basic/qa/cppunit/basictest.cxx
@@ -80,7 +80,7 @@ SbxVariableRef MacroSnippet::Run( const css::uno::Sequence< css::uno::Any >& rAr
     SbMethod* pMeth = mpMod.is() ? static_cast<SbMethod*>(mpMod->Find( "doUnitTest",  SbxClassType::Method )) : nullptr;
     if ( pMeth )
     {
-        if ( rArgs.getLength() )
+        if ( rArgs.hasElements() )
         {
             SbxArrayRef aArgs = new SbxArray;
             for ( int i=0; i < rArgs.getLength(); ++i )
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index 0896c8b39ebb..c4bec7580d48 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -565,7 +565,7 @@ static void implSequenceToMultiDimArray( SbxDimArray*& pArray, Sequence< sal_Int
     }
     else
     {
-        if ( indices.getLength() < 1 )
+        if ( !indices.hasElements() )
         {
             // Should never ever get here ( indices.getLength()
             // should equal number of dimensions in the array )
@@ -3929,7 +3929,7 @@ Any SAL_CALL InvocationToAllListenerMapper::invoke(const OUString& FunctionName,
     Reference< XIdlClass > xReturnType = xMethod->getReturnType();
     Sequence< Reference< XIdlClass > > aExceptionSeq = xMethod->getExceptionTypes();
     if( ( xReturnType.is() && xReturnType->getTypeClass() != TypeClass_VOID ) ||
-        aExceptionSeq.getLength() > 0 )
+        aExceptionSeq.hasElements() )
     {
         bApproveFiring = true;
     }
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 36b4afbb28f7..0ba3cb5d8b66 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -171,7 +171,7 @@ DocObjectWrapper::DocObjectWrapper( SbModule* pVar ) : m_pMod( pVar )
 
 Sequence< Type > SAL_CALL DocObjectWrapper::getTypes()
 {
-    if ( m_Types.getLength() == 0 )
+    if ( !m_Types.hasElements() )
     {
         Sequence< Type > sTypes;
         if ( m_xAggregateTypeProv.is() )
@@ -2392,7 +2392,7 @@ void SbUserFormModule::triggerMethod( const OUString& aMethodToRun, Sequence< An
     SbxVariable* pMeth = SbObjModule::Find( aMethodToRun, SbxClassType::Method );
     if( pMeth )
     {
-        if ( aArguments.getLength() > 0 )   // Setup parameters
+        if ( aArguments.hasElements() )   // Setup parameters
         {
             auto xArray = tools::make_ref<SbxArray>();
             xArray->Put( pMeth, 0 );    // Method as parameter 0
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 6ff4a23a2500..2928107308aa 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -703,8 +703,7 @@ void SbRtl_RmDir(StarBASIC *, SbxArray & rPar, bool)
                     if( bCompatibility )
                     {
                         Sequence< OUString > aContent = xSFI->getFolderContents( aPath, true );
-                        sal_Int32 nCount = aContent.getLength();
-                        if( nCount > 0 )
+                        if( aContent.hasElements() )
                         {
                             StarBASIC::Error( ERRCODE_BASIC_ACCESS_ERROR );
                             return;
@@ -2704,7 +2703,7 @@ void SbRtl_Dir(StarBASIC *, SbxArray & rPar, bool)
                 }
 
 
-                if (rRTLData.aDirSeq.getLength() > 0)
+                if (rRTLData.aDirSeq.hasElements())
                 {
                     bool bFolderFlag = bool(rRTLData.nDirFlags & SbAttributes::DIRECTORY);
 
@@ -3760,7 +3759,7 @@ static OUString getObjectTypeName( SbxVariable* pVar )
                 {
                     // is this a VBA object ?
                     Sequence< OUString > sServices = xServInfo->getSupportedServiceNames();
-                    if ( sServices.getLength() )
+                    if ( sServices.hasElements() )
                     {
                         sRet = sServices[ 0 ];
                     }
diff --git a/binaryurp/source/reader.cxx b/binaryurp/source/reader.cxx
index fa5e91be704e..b11b77ffe658 100644
--- a/binaryurp/source/reader.cxx
+++ b/binaryurp/source/reader.cxx
@@ -102,7 +102,7 @@ void Reader::execute() {
             bridge_->getConnection());
         for (;;) {
             css::uno::Sequence< sal_Int8 > s(read(con, 8, true));
-            if (s.getLength() == 0) {
+            if (!s.hasElements()) {
                 break;
             }
             Unmarshal header(bridge_, state_, s);
diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx
index 134dabf26fc4..036d443aba7a 100644
--- a/canvas/source/cairo/cairo_canvas.cxx
+++ b/canvas/source/cairo/cairo_canvas.cxx
@@ -51,7 +51,7 @@ namespace cairocanvas
     void Canvas::initialize()
     {
         // #i64742# Only perform initialization when not in probe mode
-        if( maArguments.getLength() == 0 )
+        if( !maArguments.hasElements() )
             return;
 
         // tdf#93870 - force VCL canvas in OpenGL mode for now.
diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index 5a442dfc8997..71ca12e629ef 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -677,7 +677,7 @@ namespace cairocanvas
                                       rendering::FillRule eFillrule )
     {
         if( pTextures )
-            ENSURE_ARG_OR_THROW( pTextures->getLength(),
+            ENSURE_ARG_OR_THROW( pTextures->hasElements(),
                                  "CanvasHelper::fillTexturedPolyPolygon: empty texture sequence");
 
         bool bOpToDo = false;
@@ -960,7 +960,7 @@ namespace cairocanvas
             //tdf#103026 If the w scaling is 0, then all dashes become zero so
             //cairo will set the cairo_t status to CAIRO_STATUS_INVALID_DASH
             //and no further drawing will occur
-            if (strokeAttributes.DashArray.getLength() > 0 && w > 0.0)
+            if (strokeAttributes.DashArray.hasElements() && w > 0.0)
             {
                 auto aDashArray(comphelper::sequenceToContainer<std::vector<double>>(strokeAttributes.DashArray));
                 for (auto& rDash : aDashArray)
diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx
index b7b7792009e5..113c7541964b 100644
--- a/canvas/source/cairo/cairo_spritecanvas.cxx
+++ b/canvas/source/cairo/cairo_spritecanvas.cxx
@@ -54,7 +54,7 @@ namespace cairocanvas
         SAL_INFO("canvas.cairo", "CairoSpriteCanvas created " << this);
 
         // #i64742# Only call initialize when not in probe mode
-        if( maArguments.getLength() == 0 )
+        if( !maArguments.hasElements() )
             return;
 
         /* maArguments:
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index c9a99621a00d..5e7fca21f61a 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -166,7 +166,7 @@ namespace cairocanvas
         const sal_Int32 nAboveBaseline( -aMetric.GetAscent() );
         const sal_Int32 nBelowBaseline( aMetric.GetDescent() );
 
-        if( maLogicalAdvancements.getLength() )
+        if( maLogicalAdvancements.hasElements() )
         {
             return geometry::RealRectangle2D( 0, nAboveBaseline,
                                               maLogicalAdvancements[ maLogicalAdvancements.getLength()-1 ],
@@ -307,7 +307,7 @@ namespace cairocanvas
         // TODO(P2): cache that
         std::unique_ptr< long []> aOffsets(new long[maLogicalAdvancements.getLength()]);
 
-        if( maLogicalAdvancements.getLength() )
+        if( maLogicalAdvancements.hasElements() )
         {
             setupTextOffsets( aOffsets.get(), maLogicalAdvancements, viewState, renderState );
 
@@ -318,7 +318,7 @@ namespace cairocanvas
         aSysLayoutData = rOutDev.GetSysTextLayoutData(rOutpos, maText.Text,
                                                       ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
                                                       ::canvas::tools::numeric_cast<sal_uInt16>(maText.Length),
-                                                      maLogicalAdvancements.getLength() ? aOffsets.get() : nullptr);
+                                                      maLogicalAdvancements.hasElements() ? aOffsets.get() : nullptr);
 
         // Sort them so that all glyphs on the same glyph fallback level are consecutive
         std::sort(aSysLayoutData.rGlyphData.begin(), aSysLayoutData.rGlyphData.end(), compareFallbacks);
@@ -337,7 +337,7 @@ namespace cairocanvas
                 {
                     bCairoRenderable = false;
                     SAL_INFO("canvas.cairo", ":cairocanvas::TextLayout::draw(S,O,p,v,r): VCL FALLBACK " <<
-                             (maLogicalAdvancements.getLength() ? "ADV " : "") <<
+                             (maLogicalAdvancements.hasElements() ? "ADV " : "") <<
                              (aFontData.back().first.bAntialias ? "AA " : "") <<
                              (aFontData.back().first.bFakeBold ? "FB " : "") <<
                              (aFontData.back().first.bFakeItalic ? "FI " : "") <<
@@ -352,7 +352,7 @@ namespace cairocanvas
         // The fallback checks need to be done after final font is known.
         if (!bCairoRenderable)    // VCL FALLBACKS
         {
-            if (maLogicalAdvancements.getLength())        // VCL FALLBACK - with glyph advances
+            if (maLogicalAdvancements.hasElements())        // VCL FALLBACK - with glyph advances
             {
                 rOutDev.DrawTextArray( rOutpos, maText.Text, aOffsets.get(),
                                        ::canvas::tools::numeric_cast<sal_uInt16>(maText.StartPosition),
@@ -465,7 +465,7 @@ namespace cairocanvas
                     << (cairo_glyphs.size() > 1 ? cairo_glyphs[1].index : -1)
                     << ","
                     << (cairo_glyphs.size() > 2 ? cairo_glyphs[2].index : -1)
-                    << ") " << (maLogicalAdvancements.getLength() ? "ADV " : "")
+                    << ") " << (maLogicalAdvancements.hasElements() ? "ADV " : "")
                     << (rSysFontData.bAntialias ? "AA " : "")
                     << (rSysFontData.bFakeBold ? "FB " : "")
                     << (rSysFontData.bFakeItalic ? "FI " : "") << " || Name:"
diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx
index f29a69302063..cbbd639741f6 100644
--- a/canvas/source/opengl/ogl_canvashelper.cxx
+++ b/canvas/source/opengl/ogl_canvashelper.cxx
@@ -730,7 +730,7 @@ namespace oglcanvas
 
                 // handle custom spacing, if there
                 uno::Sequence<double> aLogicalAdvancements=xLayoutetText->queryLogicalAdvancements();
-                if( aLogicalAdvancements.getLength() )
+                if( aLogicalAdvancements.hasElements() )
                 {
                     // create the DXArray
                     const sal_Int32 nLen( aLogicalAdvancements.getLength() );
@@ -922,7 +922,7 @@ namespace oglcanvas
                 break;
         }
 
-        if (renderState.DeviceColor.getLength())
+        if (renderState.DeviceColor.hasElements())
             o_action.maARGBColor =
                 mpDevice->getDeviceColorSpace()->convertToARGB(renderState.DeviceColor)[0];
     }
diff --git a/canvas/source/opengl/ogl_spritecanvas.cxx b/canvas/source/opengl/ogl_spritecanvas.cxx
index ed2de8179748..ccc0025172b5 100644
--- a/canvas/source/opengl/ogl_spritecanvas.cxx
+++ b/canvas/source/opengl/ogl_spritecanvas.cxx
@@ -43,7 +43,7 @@ namespace oglcanvas
     void SpriteCanvas::initialize()
     {
         // Only call initialize when not in probe mode
-        if( maArguments.getLength() == 0 )
+        if( !maArguments.hasElements() )
             return;
 
         SAL_INFO("canvas.ogl", "SpriteCanvas::initialize called" );
diff --git a/canvas/source/opengl/ogl_textlayout.cxx b/canvas/source/opengl/ogl_textlayout.cxx
index b5ad271f63e4..63d21c6aa1fe 100644
--- a/canvas/source/opengl/ogl_textlayout.cxx
+++ b/canvas/source/opengl/ogl_textlayout.cxx
@@ -88,7 +88,7 @@ namespace oglcanvas
         const rendering::FontRequest& rFontRequest( mpFont->getFontRequest() );
         const double nFontSize( std::max( rFontRequest.CellSize,
                                             rFontRequest.ReferenceAdvancement ) );
-        if( maLogicalAdvancements.getLength() )
+        if( maLogicalAdvancements.hasElements() )
         {
             return geometry::RealRectangle2D( 0, -nFontSize/2,
                                               maLogicalAdvancements[ maLogicalAdvancements.getLength()-1 ],
diff --git a/canvas/source/simplecanvas/simplecanvasimpl.cxx b/canvas/source/simplecanvas/simplecanvasimpl.cxx
index fb82b701459a..9e209b5cf3e5 100644
--- a/canvas/source/simplecanvas/simplecanvasimpl.cxx
+++ b/canvas/source/simplecanvas/simplecanvasimpl.cxx
@@ -142,7 +142,7 @@ namespace
             uno::Reference<rendering::XCanvas> xRet;
 
             // can't do much without an XCanvas, can't we?
-            if( rArgs.getLength() < 1 )
+            if( !rArgs.hasElements() )
                 throw lang::IllegalArgumentException();
 
             xRet.set( rArgs[0], uno::UNO_QUERY );
diff --git a/canvas/source/tools/canvastools.cxx b/canvas/source/tools/canvastools.cxx
index 543f9170266c..759a39a27b2e 100644
--- a/canvas/source/tools/canvastools.cxx
+++ b/canvas/source/tools/canvastools.cxx
@@ -229,7 +229,7 @@ namespace canvas
                 }
                 virtual uno::Sequence< rendering::ARGBColor > SAL_CALL convertToARGB( const uno::Sequence< double >& deviceColor ) override
                 {
-                    SAL_WARN_IF(deviceColor.getLength() == 0, "canvas", "empty deviceColor argument");
+                    SAL_WARN_IF(!deviceColor.hasElements(), "canvas", "empty deviceColor argument");
                     const double*  pIn( deviceColor.getConstArray() );
                     const std::size_t nLen( deviceColor.getLength() );
                     ENSURE_ARG_OR_THROW2(nLen%4==0,
diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx
index 59c200c85b7e..c33185b2999c 100644
--- a/canvas/source/vcl/canvas.cxx
+++ b/canvas/source/vcl/canvas.cxx
@@ -74,7 +74,7 @@ namespace vclcanvas
     void Canvas::initialize()
     {
         // #i64742# Only perform initialization when not in probe mode
-        if( maArguments.getLength() == 0 )
+        if( !maArguments.hasElements() )
             return;
 
         /* maArguments:
diff --git a/canvas/source/vcl/canvashelper.cxx b/canvas/source/vcl/canvashelper.cxx
index a03ad7e1c6d3..47ea98d4b3c4 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -334,7 +334,7 @@ namespace vclcanvas
             }
 
             // apply dashing, if any
-            if( strokeAttributes.DashArray.getLength() )
+            if( strokeAttributes.DashArray.hasElements() )
             {
                 const std::vector<double>& aDashArray(
                     ::comphelper::sequenceToContainer< std::vector<double> >(strokeAttributes.DashArray) );
diff --git a/canvas/source/vcl/canvashelper_texturefill.cxx b/canvas/source/vcl/canvashelper_texturefill.cxx
index 50a0976cc56b..18d773e0df9e 100644
--- a/canvas/source/vcl/canvashelper_texturefill.cxx
+++ b/canvas/source/vcl/canvashelper_texturefill.cxx
@@ -571,7 +571,7 @@ namespace vclcanvas
     {
         ENSURE_ARG_OR_THROW( xPolyPolygon.is(),
                          "CanvasHelper::fillPolyPolygon(): polygon is NULL");
-        ENSURE_ARG_OR_THROW( textures.getLength(),
+        ENSURE_ARG_OR_THROW( textures.hasElements(),
                          "CanvasHelper::fillTexturedPolyPolygon: empty texture sequence");
 
         if( mpOutDevProvider )
@@ -591,7 +591,7 @@ namespace vclcanvas
                 ::canvas::ParametricPolyPolygon* pGradient =
                       dynamic_cast< ::canvas::ParametricPolyPolygon* >( textures[0].Gradient.get() );
 
-                if( pGradient && pGradient->getValues().maColors.getLength() )
+                if( pGradient && pGradient->getValues().maColors.hasElements() )
                 {
                     // copy state from Gradient polypoly locally
                     // (given object might change!)
diff --git a/canvas/source/vcl/spritecanvas.cxx b/canvas/source/vcl/spritecanvas.cxx
index ee1de2808c66..429559fbe964 100644
--- a/canvas/source/vcl/spritecanvas.cxx
+++ b/canvas/source/vcl/spritecanvas.cxx
@@ -54,7 +54,7 @@ namespace vclcanvas
         SolarMutexGuard aGuard;
 
         // #i64742# Only call initialize when not in probe mode
-        if( maArguments.getLength() == 0 )
+        if( !maArguments.hasElements() )
             return;
 
         SAL_INFO("canvas.vcl", "SpriteCanvas created" );
@@ -71,7 +71,7 @@ namespace vclcanvas
 
         SAL_INFO("canvas.vcl", "VCLSpriteCanvas::initialize called" );
 
-        ENSURE_ARG_OR_THROW( maArguments.getLength() >= 1,
+        ENSURE_ARG_OR_THROW( maArguments.hasElements(),
                              "VCLSpriteCanvas::initialize: wrong number of arguments" );
 
         /* maArguments:
diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx
index 0585a38c41f8..3eee412c3416 100644
--- a/canvas/source/vcl/textlayout.cxx
+++ b/canvas/source/vcl/textlayout.cxx
@@ -234,7 +234,7 @@ namespace vclcanvas
         const sal_Int32 nAboveBaseline( -aMetric.GetAscent() );
         const sal_Int32 nBelowBaseline( aMetric.GetDescent() );
 
-        if( maLogicalAdvancements.getLength() )
+        if( maLogicalAdvancements.hasElements() )
         {
             return geometry::RealRectangle2D( 0, nAboveBaseline,
                                               maLogicalAdvancements[ maLogicalAdvancements.getLength()-1 ],
@@ -330,7 +330,7 @@ namespace vclcanvas
 
         setupLayoutMode( rOutDev, mnTextDirection );
 
-        if( maLogicalAdvancements.getLength() )
+        if( maLogicalAdvancements.hasElements() )
         {
             // TODO(P2): cache that
             std::unique_ptr< long []> aOffsets(new long[maLogicalAdvancements.getLength()]);


More information about the Libreoffice-commits mailing list