[Libreoffice-commits] core.git: 3 commits - basctl/source chart2/source cui/source filter/source fpicker/source include/svtools include/unotools sc/source sfx2/source svtools/source svx/source sw/source unotools/source vcl/source vcl/unx xmlsecurity/source

Noel Grandin noel.grandin at collabora.co.uk
Wed Apr 25 08:17:59 UTC 2018


 basctl/source/basicide/baside2b.cxx                                   |    8 --
 basctl/source/basicide/moduldl2.cxx                                   |   10 +-
 chart2/source/controller/dialogs/tp_DataSource.cxx                    |    4 -
 cui/source/customize/acccfg.cxx                                       |    5 -
 cui/source/customize/macropg.cxx                                      |    7 --
 cui/source/dialogs/linkdlg.cxx                                        |   10 +-
 cui/source/dialogs/multipat.cxx                                       |    4 -
 cui/source/options/certpath.cxx                                       |    8 --
 cui/source/options/dbregister.cxx                                     |    4 -
 cui/source/options/fontsubs.cxx                                       |   11 +--
 cui/source/options/optaboutconfig.cxx                                 |   12 +--
 cui/source/options/optdict.cxx                                        |   14 +---
 cui/source/options/optfltr.cxx                                        |    4 -
 cui/source/options/optjava.cxx                                        |   15 ++--
 cui/source/options/optpath.cxx                                        |   16 ++--
 cui/source/options/webconninfo.cxx                                    |    9 +-
 cui/source/tabpages/autocdlg.cxx                                      |   16 ++--
 cui/source/tabpages/macroass.cxx                                      |    7 --
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx                  |    8 +-
 fpicker/source/office/PlacesListBox.cxx                               |    4 -
 include/svtools/svtabbx.hxx                                           |    2 
 include/unotools/ucbstreamhelper.hxx                                  |   15 ++--
 sc/source/ui/condformat/condformatmgr.cxx                             |    6 -
 sc/source/ui/dialogs/searchresults.cxx                                |    4 -
 sc/source/ui/miscdlgs/conflictsdlg.cxx                                |    4 -
 sc/source/ui/miscdlgs/sharedocdlg.cxx                                 |    9 +-
 sc/source/ui/namedlg/namemgrtable.cxx                                 |    8 +-
 sfx2/source/dialog/versdlg.cxx                                        |   17 +----
 svtools/source/contnr/fileview.cxx                                    |    8 +-
 svtools/source/contnr/svtabbx.cxx                                     |   13 +--
 svx/source/dialog/ctredlin.cxx                                        |    8 +-
 svx/source/dialog/docrecovery.cxx                                     |    4 -
 svx/source/form/datanavi.cxx                                          |    4 -
 svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx |    8 +-
 sw/source/ui/chrdlg/swuiccoll.cxx                                     |    4 -
 sw/source/ui/dbui/addresslistdialog.cxx                               |    4 -
 sw/source/ui/dbui/mmoutputtypepage.cxx                                |    4 -
 sw/source/ui/dbui/selectdbtabledialog.cxx                             |   13 +--
 sw/source/ui/index/cnttab.cxx                                         |   11 +--
 sw/source/ui/misc/bookmark.cxx                                        |    4 -
 sw/source/ui/misc/glosbib.cxx                                         |    7 --
 unotools/source/ucbhelper/ucbstreamhelper.cxx                         |   34 +++++-----
 vcl/source/graphic/GraphicLoader.cxx                                  |    4 -
 vcl/unx/kde4/KDEData.cxx                                              |    2 
 xmlsecurity/source/dialogs/certificatechooser.cxx                     |    4 -
 xmlsecurity/source/dialogs/certificateviewer.cxx                      |    4 -
 xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx                |    4 -
 xmlsecurity/source/dialogs/macrosecurity.cxx                          |    8 +-
 48 files changed, 176 insertions(+), 217 deletions(-)

New commits:
commit f52f074a4d21be494a05ff9391b0206840f49c8c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Wed Apr 25 10:15:31 2018 +0200

    fix kde4 build
    
    after
        commit dbb1dbe7a741415acf1132a29aba7cff5dfe638c
            Date:   Mon Apr 23 15:23:08 2018 +0200
        loplugin:useuniqueptr in X11SalData
    
    Change-Id: I6398fd79b9190654258d60628952aa89dcd5898c

diff --git a/vcl/unx/kde4/KDEData.cxx b/vcl/unx/kde4/KDEData.cxx
index d9e9545621a1..1f3d0bfcbb3c 100644
--- a/vcl/unx/kde4/KDEData.cxx
+++ b/vcl/unx/kde4/KDEData.cxx
@@ -33,7 +33,7 @@ KDEData::~KDEData()
 
 void KDEData::Init()
 {
-    pXLib_ = new KDEXLib();
+    pXLib_.reset(new KDEXLib());
     pXLib_->Init();
     SetDisplay( SalKDEDisplay::self() );
 }
commit eeefb8c440b514cefdc4e82cc06843da9eabeb13
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Apr 24 15:04:47 2018 +0200

    make UcbStreamHelper return SvStream by std::unique_ptr
    
    Change-Id: I408f9193680ea73c61fcfb2bd1e860152219702c

diff --git a/include/unotools/ucbstreamhelper.hxx b/include/unotools/ucbstreamhelper.hxx
index 68309d094acf..d89048500bcd 100644
--- a/include/unotools/ucbstreamhelper.hxx
+++ b/include/unotools/ucbstreamhelper.hxx
@@ -25,6 +25,7 @@
 #include <unotools/unotoolsdllapi.h>
 
 #include <tools/stream.hxx>
+#include <memory>
 
 namespace com
 {
@@ -52,13 +53,13 @@ namespace utl
     class UNOTOOLS_DLLPUBLIC UcbStreamHelper
     {
     public:
-        static SvStream*    CreateStream( const OUString& rFileName, StreamMode eOpenMode );
-        static SvStream*    CreateStream( const OUString& rFileName, StreamMode eOpenMode,
-                                          bool bFileExists );
-        static SvStream*    CreateStream( const css::uno::Reference < css::io::XInputStream >& xStream );
-        static SvStream*    CreateStream( const css::uno::Reference < css::io::XStream >& xStream );
-        static SvStream*    CreateStream( const css::uno::Reference < css::io::XInputStream >& xStream, bool bCloseStream );
-        static SvStream*    CreateStream( const css::uno::Reference < css::io::XStream >& xStream, bool bCloseStream );
+        static std::unique_ptr<SvStream> CreateStream( const OUString& rFileName, StreamMode eOpenMode );
+        static std::unique_ptr<SvStream> CreateStream( const OUString& rFileName, StreamMode eOpenMode,
+                                             bool bFileExists );
+        static std::unique_ptr<SvStream> CreateStream( const css::uno::Reference < css::io::XInputStream >& xStream );
+        static std::unique_ptr<SvStream> CreateStream( const css::uno::Reference < css::io::XStream >& xStream );
+        static std::unique_ptr<SvStream> CreateStream( const css::uno::Reference < css::io::XInputStream >& xStream, bool bCloseStream );
+        static std::unique_ptr<SvStream> CreateStream( const css::uno::Reference < css::io::XStream >& xStream, bool bCloseStream );
     };
 }
 
diff --git a/unotools/source/ucbhelper/ucbstreamhelper.cxx b/unotools/source/ucbhelper/ucbstreamhelper.cxx
index 63260f632b91..87f7d903a481 100644
--- a/unotools/source/ucbhelper/ucbstreamhelper.cxx
+++ b/unotools/source/ucbhelper/ucbstreamhelper.cxx
@@ -42,11 +42,11 @@ using namespace ::com::sun::star::beans;
 namespace utl
 {
 
-static SvStream* lcl_CreateStream( const OUString& rFileName, StreamMode eOpenMode,
+static std::unique_ptr<SvStream> lcl_CreateStream( const OUString& rFileName, StreamMode eOpenMode,
                                    const Reference < XInteractionHandler >& xInteractionHandler,
                                    bool bEnsureFileExists )
 {
-    SvStream* pStream = nullptr;
+    std::unique_ptr<SvStream> pStream;
     UcbLockBytesRef xLockBytes;
     if ( eOpenMode & StreamMode::WRITE )
     {
@@ -119,7 +119,7 @@ static SvStream* lcl_CreateStream( const OUString& rFileName, StreamMode eOpenMo
                                                     eOpenMode, xInteractionHandler );
         if ( xLockBytes.is() )
         {
-            pStream = new SvStream( xLockBytes.get() );
+            pStream.reset(new SvStream( xLockBytes.get() ));
             pStream->SetBufferSize( 4096 );
             pStream->SetError( xLockBytes->GetError() );
         }
@@ -137,7 +137,7 @@ static SvStream* lcl_CreateStream( const OUString& rFileName, StreamMode eOpenMo
     return pStream;
 }
 
-SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode eOpenMode )
+std::unique_ptr<SvStream> UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode eOpenMode )
 {
     // related tdf#99312
     // create a specialized interaction handler to manages Web certificates and Web credentials when needed
@@ -149,7 +149,7 @@ SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode e
     return lcl_CreateStream( rFileName, eOpenMode, xIHScoped, true /* bEnsureFileExists */ );
 }
 
-SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode eOpenMode,
+std::unique_ptr<SvStream> UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode eOpenMode,
                                          bool bFileExists )
 {
     // related tdf#99312
@@ -162,13 +162,13 @@ SvStream* UcbStreamHelper::CreateStream( const OUString& rFileName, StreamMode e
 }
 
 
-SvStream* UcbStreamHelper::CreateStream( const Reference < XInputStream >& xStream )
+std::unique_ptr<SvStream> UcbStreamHelper::CreateStream( const Reference < XInputStream >& xStream )
 {
-    SvStream* pStream = nullptr;
+    std::unique_ptr<SvStream> pStream;
     UcbLockBytesRef xLockBytes = UcbLockBytes::CreateInputLockBytes( xStream );
     if ( xLockBytes.is() )
     {
-        pStream = new SvStream( xLockBytes.get() );
+        pStream.reset(new SvStream( xLockBytes.get() ));
         pStream->SetBufferSize( 4096 );
         pStream->SetError( xLockBytes->GetError() );
     }
@@ -176,15 +176,15 @@ SvStream* UcbStreamHelper::CreateStream( const Reference < XInputStream >& xStre
     return pStream;
 }
 
-SvStream* UcbStreamHelper::CreateStream( const Reference < XStream >& xStream )
+std::unique_ptr<SvStream> UcbStreamHelper::CreateStream( const Reference < XStream >& xStream )
 {
-    SvStream* pStream = nullptr;
+    std::unique_ptr<SvStream> pStream;
     if ( xStream->getOutputStream().is() )
     {
         UcbLockBytesRef xLockBytes = UcbLockBytes::CreateLockBytes( xStream );
         if ( xLockBytes.is() )
         {
-            pStream = new SvStream( xLockBytes.get() );
+            pStream.reset(new SvStream( xLockBytes.get() ));
             pStream->SetBufferSize( 4096 );
             pStream->SetError( xLockBytes->GetError() );
         }
@@ -195,16 +195,16 @@ SvStream* UcbStreamHelper::CreateStream( const Reference < XStream >& xStream )
     return pStream;
 }
 
-SvStream* UcbStreamHelper::CreateStream( const Reference < XInputStream >& xStream, bool bCloseStream )
+std::unique_ptr<SvStream> UcbStreamHelper::CreateStream( const Reference < XInputStream >& xStream, bool bCloseStream )
 {
-    SvStream* pStream = nullptr;
+    std::unique_ptr<SvStream> pStream;
     UcbLockBytesRef xLockBytes = UcbLockBytes::CreateInputLockBytes( xStream );
     if ( xLockBytes.is() )
     {
         if ( !bCloseStream )
             xLockBytes->setDontClose_Impl();
 
-        pStream = new SvStream( xLockBytes.get() );
+        pStream.reset(new SvStream( xLockBytes.get() ));
         pStream->SetBufferSize( 4096 );
         pStream->SetError( xLockBytes->GetError() );
     }
@@ -212,9 +212,9 @@ SvStream* UcbStreamHelper::CreateStream( const Reference < XInputStream >& xStre
     return pStream;
 };
 
-SvStream* UcbStreamHelper::CreateStream( const Reference < XStream >& xStream, bool bCloseStream )
+std::unique_ptr<SvStream> UcbStreamHelper::CreateStream( const Reference < XStream >& xStream, bool bCloseStream )
 {
-    SvStream* pStream = nullptr;
+    std::unique_ptr<SvStream> pStream;
     if ( xStream->getOutputStream().is() )
     {
         UcbLockBytesRef xLockBytes = UcbLockBytes::CreateLockBytes( xStream );
@@ -223,7 +223,7 @@ SvStream* UcbStreamHelper::CreateStream( const Reference < XStream >& xStream, b
             if ( !bCloseStream )
                 xLockBytes->setDontClose_Impl();
 
-            pStream = new SvStream( xLockBytes.get() );
+            pStream.reset(new SvStream( xLockBytes.get() ));
             pStream->SetBufferSize( 4096 );
             pStream->SetError( xLockBytes->GetError() );
         }
diff --git a/vcl/source/graphic/GraphicLoader.cxx b/vcl/source/graphic/GraphicLoader.cxx
index 9c453acf0864..d7f66c0fde7f 100644
--- a/vcl/source/graphic/GraphicLoader.cxx
+++ b/vcl/source/graphic/GraphicLoader.cxx
@@ -34,8 +34,8 @@ Graphic loadFromURL(OUString const& rURL, sal_Int16 nExtWidth, sal_Int16 nExtHei
 
     Graphic aGraphic;
 
-    std::unique_ptr<SvStream> pInputStream;
-    pInputStream.reset(utl::UcbStreamHelper::CreateStream(rURL, StreamMode::READ));
+    std::unique_ptr<SvStream> pInputStream
+        = utl::UcbStreamHelper::CreateStream(rURL, StreamMode::READ);
 
     if (pInputStream)
     {
commit bbf134a2b77909706492cbc41952210f89c0df71
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Tue Apr 24 13:36:34 2018 +0200

    SvTabListBox::SetTabs, pass count explicit
    
    passing count as first element in array, dodgy.
    
    Change-Id: I49905b554b3b4d6cc3fa419a36389cd2e5ded463

diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index a506a68e40b3..27da2dc9d828 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -1598,12 +1598,8 @@ WatchWindow::WatchWindow (Layout* pParent)
     aHeaderBar->InsertItem( ITEM_ID_VALUE, IDEResId(RID_STR_WATCHVALUE), nValueTabWidth );
     aHeaderBar->InsertItem( ITEM_ID_TYPE, IDEResId(RID_STR_WATCHTYPE), nTypeTabWidth );
 
-    long tabs[ 4 ];
-    tabs[ 0 ] = 3; // two tabs
-    tabs[ 1 ] = 0;
-    tabs[ 2 ] = nVarTabWidth;
-    tabs[ 3 ] = nVarTabWidth + nValueTabWidth;
-    aTreeListBox->SvHeaderTabListBox::SetTabs( tabs, MapUnit::MapPixel );
+    long aTabPositions[] = { 0, nVarTabWidth, nVarTabWidth + nValueTabWidth };
+    aTreeListBox->SvHeaderTabListBox::SetTabs( SAL_N_ELEMENTS(aTabPositions), aTabPositions, MapUnit::MapPixel );
     aTreeListBox->InitHeaderBar( aHeaderBar.get() );
 
     aTreeListBox->SetNodeDefaultImages( );
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 0722118559be..644b1593352c 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -151,9 +151,9 @@ CheckBox::CheckBox(vcl::Window* pParent, WinBits nStyle)
     , eMode(ObjectMode::Module)
     , m_aDocument(ScriptDocument::getApplicationScriptDocument())
 {
-    long const aTabs_[] = { 1, 12 };  // TabPos needs at least one...
-                                      // 12 because of the CheckBox
-    SetTabs( aTabs_ );
+    long const aTabPositions[] = { 12 };  // TabPos needs at least one...
+                                          // 12 because of the CheckBox
+    SetTabs( SAL_N_ELEMENTS(aTabPositions), aTabPositions );
     Init();
 }
 
@@ -484,8 +484,8 @@ LibPage::LibPage(vcl::Window * pParent)
     m_pLibBox->EnableInplaceEditing(true);
     m_pLibBox->SetStyle( WB_HSCROLL | WB_BORDER | WB_TABSTOP );
 
-    long const aTabs[] = { 2, 30, 120 };
-    m_pLibBox->SetTabs( aTabs, MapUnit::MapPixel );
+    long const aTabPositions[] = { 30, 120 };
+    m_pLibBox->SetTabs( SAL_N_ELEMENTS(aTabPositions), aTabPositions, MapUnit::MapPixel );
 
     FillListBox();
     m_pBasicsBox->SelectEntryPos( 0 );
diff --git a/chart2/source/controller/dialogs/tp_DataSource.cxx b/chart2/source/controller/dialogs/tp_DataSource.cxx
index 95cb5495d4ad..ad3ddf8a9e8d 100644
--- a/chart2/source/controller/dialogs/tp_DataSource.cxx
+++ b/chart2/source/controller/dialogs/tp_DataSource.cxx
@@ -126,7 +126,7 @@ OUString lcl_GetSequenceNameForLabel( ::chart::SeriesEntry const * pEntry )
 }
 
 static long lcl_pRoleListBoxTabs[] =
-    {   3,        // Number of Tabs
+    {
         0, 0, 75
     };
 
@@ -257,7 +257,7 @@ DataSourceTabPage::DataSourceTabPage(
     m_pBTN_DOWN->SetText( OUString( cBlackDownPointingTriangle ));
 
     // init controls
-    m_pLB_ROLE->SetTabs( lcl_pRoleListBoxTabs );
+    m_pLB_ROLE->SetTabs( SAL_N_ELEMENTS(lcl_pRoleListBoxTabs), lcl_pRoleListBoxTabs );
     m_pLB_ROLE->Show();
 
     updateControlsFromDialogModel();
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index 70ed7d80ecb6..f752506c4fe1 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -782,9 +782,8 @@ static const sal_uInt16 KEYCODE_ARRAY_SIZE = SAL_N_ELEMENTS(KEYCODE_ARRAY);
 
 // seems to be needed to layout the list box, which shows all
 // assignable shortcuts
-static long AccCfgTabs[] =
+static const long AccCfgTabs[] =
 {
-    2,  // Number of Tabs
     0,
     120 // Function
 };
@@ -943,7 +942,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( vcl::Window* pParent, const
     // initialize Entriesbox
     m_pEntriesBox->SetStyle(m_pEntriesBox->GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN);
     m_pEntriesBox->SetSelectionMode(SelectionMode::Single);
-    m_pEntriesBox->SetTabs(&AccCfgTabs[0]);
+    m_pEntriesBox->SetTabs(SAL_N_ELEMENTS(AccCfgTabs), AccCfgTabs);
     m_pEntriesBox->Resize(); // OS: Hack for right selection
     m_pEntriesBox->SetSpaceBetweenEntries(0);
     m_pEntriesBox->SetDragDropMode(DragDropMode::NONE);
diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx
index 40ac11c6c2ac..ac57cdd86611 100644
--- a/cui/source/customize/macropg.cxx
+++ b/cui/source/customize/macropg.cxx
@@ -65,9 +65,8 @@ SvxMacroTabPage_Impl::SvxMacroTabPage_Impl( const SfxItemSet& rAttrSet )
 }
 
 // attention, this array is indexed directly (0, 1, ...) in the code
-static long nTabs[] =
+static const long nTabs[] =
 {
-    2, // Number of Tabs
     0, 90
 };
 
@@ -698,8 +697,8 @@ void SvxMacroTabPage_::InitAndSetHandler( const Reference< container::XNameRepla
     rListBox.SetSelectHdl( LINK( this, SvxMacroTabPage_, SelectEvent_Impl ));
 
     rListBox.SetSelectionMode( SelectionMode::Single );
-    rListBox.SetTabs( &nTabs[0] );
-    Size aSize( nTabs[ 2 ], 0 );
+    rListBox.SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
+    Size aSize( nTabs[ 1 ], 0 );
     rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() );
     aSize.setWidth( 1764 );        // don't know what, so 42^2 is best to use...
     rHeaderBar.InsertItem( ITMEID_ASSMACRO, mpImpl->sAssignedMacro, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() );
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index ff0a1dfa3a3c..261de3cf79cf 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -79,7 +79,7 @@ public:
 
 // attention, this array is indexed directly (0, 1, ...) in the code
 static long nTabs[] =
-    {   4, // Number of Tabs
+    {
         0, 77, 144, 209
     };
 
@@ -110,13 +110,13 @@ SvBaseLinksDlg::SvBaseLinksDlg( vcl::Window * pParent, LinkManager* pMgr, bool b
     get(m_pPbBreakLink, "BREAK_LINK");
 
     m_pTbLinks->SetSelectionMode( SelectionMode::Multiple );
-    m_pTbLinks->SetTabs( &nTabs[0] );
+    m_pTbLinks->SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
     FixedText *pFtFiles = get<FixedText>("FILES");
-    pFtFiles->set_width_request(LogicToPixel(Size(nTabs[2] - nTabs[1] - 2, 0), MapMode(MapUnit::MapAppFont)).Width());
+    pFtFiles->set_width_request(LogicToPixel(Size(nTabs[1] - nTabs[0] - 2, 0), MapMode(MapUnit::MapAppFont)).Width());
     FixedText *pFtLinks = get<FixedText>("LINKS");
-    pFtLinks->set_width_request(LogicToPixel(Size(nTabs[3] - nTabs[2] - 2, 0), MapMode(MapUnit::MapAppFont)).Width());
+    pFtLinks->set_width_request(LogicToPixel(Size(nTabs[2] - nTabs[1] - 2, 0), MapMode(MapUnit::MapAppFont)).Width());
     FixedText *pFtTypes = get<FixedText>("TYPE");
-    pFtTypes->set_width_request(LogicToPixel(Size(nTabs[4] - nTabs[3] - 2, 0), MapMode(MapUnit::MapAppFont)).Width());
+    pFtTypes->set_width_request(LogicToPixel(Size(nTabs[3] - nTabs[2] - 2, 0), MapMode(MapUnit::MapAppFont)).Width());
     m_pTbLinks->Resize();  // OS: hack for correct selection
 
     // UpdateTimer for DDE-/Grf-links, which are waited for
diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx
index ca431ff2ffcc..d703b914acf7 100644
--- a/cui/source/dialogs/multipat.cxx
+++ b/cui/source/dialogs/multipat.cxx
@@ -188,8 +188,8 @@ SvxMultiPathDialog::SvxMultiPathDialog(vcl::Window* pParent)
     pRadioLBContainer->set_height_request(aSize.Height());
     m_pRadioLB = VclPtr<svx::SvxRadioButtonListBox>::Create(*pRadioLBContainer, 0);
 
-    static long aStaticTabs[]= { 2, 0, 12 };
-    m_pRadioLB->SvSimpleTable::SetTabs( aStaticTabs );
+    static long aStaticTabs[]= { 0, 12 };
+    m_pRadioLB->SvSimpleTable::SetTabs( SAL_N_ELEMENTS(aStaticTabs), aStaticTabs );
     OUString sHeader(get<FixedText>("pathlist")->GetText());
     m_pRadioLB->SetQuickHelpText( sHeader );
     sHeader = "\t" + sHeader;
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index a52b895b7f8c..59d0d8834b0c 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -36,12 +36,8 @@ CertPathDialog::CertPathDialog(vcl::Window* pParent)
     m_sAddDialogText = get<FixedText>("certdir")->GetText();
     m_sManual = get<FixedText>("manual")->GetText();
 
-    static long aStaticTabs[]=
-    {
-        3, 0, 15, 75
-    };
-
-    m_pCertPathList->SvSimpleTable::SetTabs( aStaticTabs );
+    static long aStaticTabs[] = { 0, 15, 75 };
+    m_pCertPathList->SvSimpleTable::SetTabs( SAL_N_ELEMENTS(aStaticTabs), aStaticTabs );
 
     OUString sProfile(get<FixedText>("profile")->GetText());
     OUString sDirectory(get<FixedText>("dir")->GetText());
diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx
index 200436cf5e10..fb9c836b2d87 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -140,7 +140,7 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( vcl::Window* pParent, cons
                             LogicToPixel( aSz, MapMode( MapUnit::MapAppFont ) ).Width(),
                             HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER );
 
-    static long aTabs[] = {3, 0, TAB_WIDTH1, TAB_WIDTH1 + TAB_WIDTH2 };
+    static long aTabs[] = {0, TAB_WIDTH1, TAB_WIDTH1 + TAB_WIDTH2 };
     Size aHeadSize = rBar.GetSizePixel();
 
     m_pPathBox->SetStyle( m_pPathBox->GetStyle()|nBits );
@@ -149,7 +149,7 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( vcl::Window* pParent, cons
     m_pPathBox->SetSelectionMode( SelectionMode::Single );
     m_pPathBox->SetPosSizePixel( Point( 0, aHeadSize.Height() ),
                                Size( aBoxSize.Width(), aBoxSize.Height() - aHeadSize.Height() ) );
-    m_pPathBox->SvSimpleTable::SetTabs( aTabs );
+    m_pPathBox->SvSimpleTable::SetTabs( SAL_N_ELEMENTS(aTabs), aTabs );
     m_pPathBox->SetHighlightRange();
 
     m_pPathBox->SetHelpId( HID_DBPATH_CTL_PATH );
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index b500f0107632..70051b6d69aa 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -66,8 +66,8 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( vcl::Window* pParent,
     m_pCheckLB->SetStyle(m_pCheckLB->GetStyle()|WB_HSCROLL|WB_VSCROLL);
     m_pCheckLB->SetSelectionMode(SelectionMode::Multiple);
     m_pCheckLB->SortByCol(2);
-    long aStaticTabs[] = { 4, 0, 0, 0, 0 };
-    m_pCheckLB->SvSimpleTable::SetTabs(&aStaticTabs[0]);
+    long aStaticTabs[] = { 0, 0, 0, 0 };
+    m_pCheckLB->SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aStaticTabs), aStaticTabs);
 
     OUString sHeader1(get<FixedText>("always")->GetText());
     OUString sHeader2(get<FixedText>("screenonly")->GetText());
@@ -421,11 +421,8 @@ void SvxFontSubstCheckListBox::setColSizes()
     nMax = std::max( nMax, nMin );
     const long nDoubleMax = 2*nMax;
     const long nRest = GetSizePixel().Width() - nDoubleMax;
-    long aStaticTabs[] = { 4, 0, 0, 0, 0 };
-    aStaticTabs[2] = nMax;
-    aStaticTabs[3] = nDoubleMax;
-    aStaticTabs[4] = nDoubleMax + nRest/2;
-    SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
+    long aStaticTabs[] = { 0, nMax, nDoubleMax, nDoubleMax + nRest/2 };
+    SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aStaticTabs), aStaticTabs, MapUnit::MapPixel);
 }
 
 void SvxFontSubstCheckListBox::Resize()
diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx
index f6d966fd4293..32f7a010447e 100644
--- a/cui/source/options/optaboutconfig.cxx
+++ b/cui/source/options/optaboutconfig.cxx
@@ -165,21 +165,19 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxI
     m_pPrefBox->InsertHeaderEntry(get<FixedText>("type")->GetText());
     m_pPrefBox->InsertHeaderEntry(get<FixedText>("value")->GetText());
 
-    long aTabs[] = {4,0,0,0,0};
-
     float fWidth = approximate_char_width();
 
-    aTabs[1] = 0;
-    aTabs[2] = aTabs[1] + fWidth * 65;
-    aTabs[3] = aTabs[2] + fWidth * 20;
-    aTabs[4] = aTabs[3] + fWidth * 8;
+    long aTabs[] = {0,0,0,0};
+    aTabs[1] = fWidth * 65;
+    aTabs[2] = aTabs[1] + fWidth * 20;
+    aTabs[3] = aTabs[2] + fWidth * 8;
 
     m_options.AlgorithmType2 = util::SearchAlgorithms2::ABSOLUTE;
     m_options.transliterateFlags |= TransliterationFlags::IGNORE_CASE;
     m_options.searchFlag |= (util::SearchFlags::REG_NOT_BEGINOFLINE |
                                         util::SearchFlags::REG_NOT_ENDOFLINE);
 
-    m_pPrefBox->SetTabs(aTabs, MapUnit::MapPixel);
+    m_pPrefBox->SetTabs(SAL_N_ELEMENTS(aTabs), aTabs, MapUnit::MapPixel);
     m_pPrefBox->SetAlternatingRowColors( true );
 }
 
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index 31194b4ab9db..b5f7665ebfa0 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -44,10 +44,7 @@ using namespace linguistic;
 
 // static ----------------------------------------------------------------
 
-static long nStaticTabs[]=
-{
-    2,10,71,120
-};
+static const long nStaticTabs[] = { 10, 71 };
 
 // static function -------------------------------------------------------
 
@@ -220,7 +217,7 @@ SvxEditDictionaryDialog::SvxEditDictionaryDialog(
         aDics = LinguMgr::GetDictionaryList()->getDictionaries();
 
     pWordsLB->SetSelectHdl(LINK(this, SvxEditDictionaryDialog, SelectHdl));
-    pWordsLB->SetTabs(nStaticTabs);
+    pWordsLB->SetTabs(SAL_N_ELEMENTS(nStaticTabs), nStaticTabs);
 
     //! we use an algorithm of our own to insert elements sorted
     pWordsLB->SetStyle(pWordsLB->GetStyle()|/*WB_SORT|*/WB_HSCROLL|WB_CLIPCHILDREN);
@@ -483,9 +480,10 @@ void SvxEditDictionaryDialog::ShowWords_Impl( sal_uInt16 nId )
         pReplaceFT->SetText(CuiResId(RID_SVXSTR_OPT_GRAMMAR_BY));
     }
 
+    sal_uInt16 nTabsCount;
     if(bIsNegative || !bLangNone)
     {
-        nStaticTabs[0]=2;
+        nTabsCount=2;
 
         // make controls for replacement text active
         if(!pReplaceFT->IsVisible())
@@ -499,7 +497,7 @@ void SvxEditDictionaryDialog::ShowWords_Impl( sal_uInt16 nId )
     }
     else
     {
-        nStaticTabs[0]=1;
+        nTabsCount=1;
 
         // deactivate controls for replacement text
         if(pReplaceFT->IsVisible())
@@ -513,7 +511,7 @@ void SvxEditDictionaryDialog::ShowWords_Impl( sal_uInt16 nId )
 
     }
 
-    pWordsLB->SetTabs(nStaticTabs);
+    pWordsLB->SetTabs(nTabsCount, nStaticTabs);
     pWordsLB->Clear();
 
     Sequence< Reference< XDictionaryEntry >  > aEntries( xDic->getEntries() );
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index 86d4cc437151..9ec7a56ed481 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -162,8 +162,8 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet
 
     m_pCheckLB = VclPtr<MSFltrSimpleTable>::Create(*m_pCheckLBContainer);
 
-    static long aStaticTabs[] = { 3, 0, 20, 40 };
-    m_pCheckLB->SvSimpleTable::SetTabs( aStaticTabs );
+    static long aStaticTabs[] = { 0, 20, 40 };
+    m_pCheckLB->SvSimpleTable::SetTabs( SAL_N_ELEMENTS(aStaticTabs), aStaticTabs );
 
     OUString sHeader = sHeader1 + "\t" + sHeader2 + "\t";
     m_pCheckLB->InsertHeaderEntry( sHeader, HEADERBAR_APPEND,
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 0ffe56682abe..9940db3014f7 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -94,11 +94,11 @@ public:
             std::max(GetSizePixel().Width() - (nCheckWidth + nVersionWidth + nFeatureWidth),
             6 + std::max(rBar.GetTextWidth(rBar.GetItemText(2)),
             GetTextWidth("Sun Microsystems Inc.")));
-        long aStaticTabs[]= { 4, 0, 0, 0, 0, 0 };
-        aStaticTabs[2] = nCheckWidth;
-        aStaticTabs[3] = aStaticTabs[2] + nVendorWidth;
-        aStaticTabs[4] = aStaticTabs[3] + nVersionWidth;
-        SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
+        long aStaticTabs[]= { 0, 0, 0, 0 };
+        aStaticTabs[1] = nCheckWidth;
+        aStaticTabs[2] = aStaticTabs[1] + nVendorWidth;
+        aStaticTabs[3] = aStaticTabs[2] + nVersionWidth;
+        SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aStaticTabs), aStaticTabs, MapUnit::MapPixel);
     }
     virtual void Resize() override
     {
@@ -137,9 +137,8 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( vcl::Window* pParent, const SfxItemSet&
     pJavaListContainer->set_height_request(aControlSize.Height());
     m_pJavaList = VclPtr<SvxJavaListBox>::Create(*pJavaListContainer, m_sAccessibilityText);
 
-    long const aStaticTabs[]= { 4, 0, 0, 0, 0 };
-
-    m_pJavaList->SvSimpleTable::SetTabs( aStaticTabs );
+    long const aStaticTabs[]= { 0, 0, 0, 0 };
+    m_pJavaList->SvSimpleTable::SetTabs( SAL_N_ELEMENTS(aStaticTabs), aStaticTabs );
 
     OUString sHeader ( "\t" + get<FixedText>("vendor")->GetText() +
         "\t" + get<FixedText>("version")->GetText() +
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index 90388aa1522b..59c93cf9d216 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -223,10 +223,10 @@ SvxPathTabPage::SvxPathTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
     long nWidth1 = rBar.GetTextWidth(rBar.GetItemText(ITEMID_TYPE));
     long nWidth2 = rBar.GetTextWidth(rBar.GetItemText(ITEMID_PATH));
 
-    long aTabs[] = {3, 0, 0, 0};
-    aTabs[2] = nWidth1 + 12;
-    aTabs[3] = aTabs[2] + nWidth2 + 12;
-    pPathBox->SetTabs(aTabs, MapUnit::MapPixel);
+    long aTabs[] = {0, 0, 0};
+    aTabs[1] = nWidth1 + 12;
+    aTabs[2] = aTabs[1] + nWidth2 + 12;
+    pPathBox->SetTabs(SAL_N_ELEMENTS(aTabs), aTabs, MapUnit::MapPixel);
 
     pPathBox->SetDoubleClickHdl( LINK( this, SvxPathTabPage, DoubleClickPathHdl_Impl ) );
     pPathBox->SetSelectHdl( LINK( this, SvxPathTabPage, PathSelect_Impl ) );
@@ -360,10 +360,10 @@ void SvxPathTabPage::Reset( const SfxItemSet* )
 
     }
 
-    long aTabs[] = {3, 0, 0, 0};
-    aTabs[2] = nWidth1 + 12;
-    aTabs[3] = aTabs[2] + nWidth2 + 12;
-    pPathBox->SetTabs(aTabs, MapUnit::MapPixel);
+    long aTabs[] = {0, 0, 0};
+    aTabs[1] = nWidth1 + 12;
+    aTabs[2] = aTabs[1] + nWidth2 + 12;
+    pPathBox->SetTabs(SAL_N_ELEMENTS(aTabs), aTabs, MapUnit::MapPixel);
 
     PathSelect_Impl( nullptr );
 }
diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx
index 0582a3e50f51..b057d77721c2 100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -92,9 +92,8 @@ void PasswordTable::setColWidths()
     long nWebSiteWidth = std::max(
         12 + rBar.GetTextWidth(rBar.GetItemText(1)),
         GetSizePixel().Width() - nUserNameWidth);
-    long aStaticTabs[]= { 2, 0, 0 };
-    aStaticTabs[2] = nWebSiteWidth;
-    SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
+    long aStaticTabs[]= { 0, nWebSiteWidth };
+    SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aStaticTabs), aStaticTabs, MapUnit::MapPixel);
 }
 
 // class WebConnectionInfoDialog -----------------------------------------
@@ -111,8 +110,8 @@ WebConnectionInfoDialog::WebConnectionInfoDialog(vcl::Window* pParent)
     SvSimpleTableContainer *pPasswordsLBContainer = get<SvSimpleTableContainer>("logins");
     m_pPasswordsLB = VclPtr<PasswordTable>::Create(*pPasswordsLBContainer, 0);
 
-    long const aStaticTabs[]= { 2, 0, 0 };
-    m_pPasswordsLB->SetTabs( aStaticTabs );
+    long const aStaticTabs[]= { 0, 0 };
+    m_pPasswordsLB->SetTabs( SAL_N_ELEMENTS(aStaticTabs), aStaticTabs );
     m_pPasswordsLB->InsertHeaderItem( 1, get<FixedText>("website")->GetText(),
         HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER | HeaderBarItemBits::FIXEDPOS | HeaderBarItemBits::CLICKABLE | HeaderBarItemBits::UPARROW );
     m_pPasswordsLB->InsertHeaderItem( 2, get<FixedText>("username")->GetText(),
diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx
index 4c50310887cc..5c6357e519ca 100644
--- a/cui/source/tabpages/autocdlg.cxx
+++ b/cui/source/tabpages/autocdlg.cxx
@@ -443,12 +443,12 @@ OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage( vcl::Window* pParent,
     m_pCheckLB->SetSelectHdl(LINK(this, OfaSwAutoFmtOptionsPage, SelectHdl));
     m_pCheckLB->SetDoubleClickHdl(LINK(this, OfaSwAutoFmtOptionsPage, DoubleClickEditHdl));
 
-    static long aStaticTabs[]=
+    static long const aStaticTabs[]=
     {
-        3, 0, 20, 40
+        0, 20, 40
     };
 
-    m_pCheckLB->SvSimpleTable::SetTabs(aStaticTabs);
+    m_pCheckLB->SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aStaticTabs), aStaticTabs);
     OUString sHeader = get<vcl::Window>("m")->GetText() + "\t"
                      + get<vcl::Window>("t")->GetText() + "\t";
     m_pCheckLB->InsertHeaderEntry(sHeader, HEADERBAR_APPEND,
@@ -884,8 +884,8 @@ OfaAutocorrReplacePage::OfaAutocorrReplacePage( vcl::Window* pParent,
     pCompareClass->loadDefaultCollator( aLanguageTag.getLocale(), 0 );
     pCharClass = new CharClass( aLanguageTag );
 
-    static long aTabs[] = { 2 /* Tab-Count */, 1, 61 };
-    m_pReplaceTLB->SetTabs( &aTabs[0] );
+    static long const aTabs[] = { 1, 61 };
+    m_pReplaceTLB->SetTabs( SAL_N_ELEMENTS(aTabs), aTabs );
 
     m_pReplaceTLB->SetStyle( m_pReplaceTLB->GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN );
     m_pReplaceTLB->SetSelectHdl( LINK(this, OfaAutocorrReplacePage, SelectHdl) );
@@ -1842,14 +1842,14 @@ OfaQuoteTabPage::OfaQuoteTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
 
     if ( bShowSWOptions )
     {
-        static long aStaticTabs[]=
+        static long const aStaticTabs[]=
         {
-            3, 0, 20, 40
+            0, 20, 40
         };
 
         m_pSwCheckLB->SetStyle(m_pSwCheckLB->GetStyle() | WB_HSCROLL| WB_VSCROLL);
 
-        m_pSwCheckLB->SvSimpleTable::SetTabs(aStaticTabs);
+        m_pSwCheckLB->SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aStaticTabs), aStaticTabs);
         OUString sHeader = get<vcl::Window>("m")->GetText() + "\t" + get<vcl::Window>("t")->GetText() + "\t";
         m_pSwCheckLB->InsertHeaderEntry( sHeader, HEADERBAR_APPEND,
                         HeaderBarItemBits::CENTER | HeaderBarItemBits::VCENTER | HeaderBarItemBits::FIXEDPOS | HeaderBarItemBits::FIXED);
diff --git a/cui/source/tabpages/macroass.cxx b/cui/source/tabpages/macroass.cxx
index a3e37471bd9b..c164baff3f79 100644
--- a/cui/source/tabpages/macroass.cxx
+++ b/cui/source/tabpages/macroass.cxx
@@ -78,9 +78,8 @@ static sal_uInt16 aPageRg[] = {
 };
 
 // attention, this array is indexed directly (0, 1, ...) in the code
-static long nTabs[] =
+static long const nTabs[] =
     {
-        2, // Number of Tabs
         0, 90
     };
 
@@ -392,8 +391,8 @@ void SfxMacroTabPage::InitAndSetHandler()
     mpImpl->pMacroLB->SetSelectHdl( LINK( this, SfxMacroTabPage, SelectMacro_Impl ));
 
     rListBox.SetSelectionMode( SelectionMode::Single );
-    rListBox.SetTabs( &nTabs[0] );
-    Size aSize( nTabs[ 2 ], 0 );
+    rListBox.SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
+    Size aSize( nTabs[ 1 ], 0 );
     rHeaderBar.InsertItem( ITEMID_EVENT, mpImpl->sStrEvent, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() );
     aSize.setWidth( 1764 );       // don't know what, so 42^2 is best to use...
     rHeaderBar.InsertItem( ITMEID_ASSMACRO, mpImpl->sAssignedMacro, LogicToPixel( aSize, MapMode( MapUnit::MapAppFont ) ).Width() );
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index c0cfa1b0c327..5ef80ab68062 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -1331,8 +1331,8 @@ void SvxPathControl::Resize()
         long nFirstColumnWidth = aWidths[1];
         m_pHeaderBar->SetItemSize(ITEMID_NAME, nFirstColumnWidth);
         m_pHeaderBar->SetItemSize(ITEMID_TYPE, 0xFFFF);
-        long nTabs[] = {2, 0, nFirstColumnWidth};
-        m_pFocusCtrl->SetTabs(&nTabs[0], MapUnit::MapPixel);
+        long nTabs[] = {0, nFirstColumnWidth};
+        m_pFocusCtrl->SetTabs(SAL_N_ELEMENTS(nTabs), nTabs, MapUnit::MapPixel);
     }
 }
 
@@ -1389,10 +1389,10 @@ XMLFilterListBox::XMLFilterListBox(Window* pParent, SvxPathControl* pPathControl
     m_pHeaderBar->InsertItem( ITEMID_TYPE, aStr2, nTabSize,
                             HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER );
 
-    static long nTabs[] = {2, 0, nTabSize };
+    static long nTabs[] = {0, nTabSize };
 
     SetSelectionMode( SelectionMode::Multiple );
-    SetTabs( &nTabs[0], MapUnit::MapPixel );
+    SetTabs( SAL_N_ELEMENTS(nTabs), nTabs, MapUnit::MapPixel );
     SetScrolledHdl( LINK( this, XMLFilterListBox, TabBoxScrollHdl_Impl ) );
     SetHighlightRange();
     Show();
diff --git a/fpicker/source/office/PlacesListBox.cxx b/fpicker/source/office/PlacesListBox.cxx
index aa5bc591f303..0138f2273698 100644
--- a/fpicker/source/office/PlacesListBox.cxx
+++ b/fpicker/source/office/PlacesListBox.cxx
@@ -25,8 +25,8 @@ PlacesListBox_Impl::PlacesListBox_Impl( PlacesListBox* pParent, const OUString&
     mpHeaderBar = VclPtr<HeaderBar>::Create( pParent, WB_BUTTONSTYLE | WB_BOTTOMBORDER );
     mpHeaderBar->SetPosSizePixel( Point( 0, 0 ), Size( 600, 16 ) );
 
-    long pTabs[] = { 2, 20, 600 };
-    SetTabs( &pTabs[0], MapUnit::MapPixel );
+    long aTabs[] = { 20, 600 };
+    SetTabs( SAL_N_ELEMENTS(aTabs), aTabs, MapUnit::MapPixel );
     mpHeaderBar->InsertItem( COLUMN_NAME, rTitle, 600, HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER );
 
     Size aHeadSize = mpHeaderBar->GetSizePixel();
diff --git a/include/svtools/svtabbx.hxx b/include/svtools/svtabbx.hxx
index 248e8447123c..6f9a44e54246 100644
--- a/include/svtools/svtabbx.hxx
+++ b/include/svtools/svtabbx.hxx
@@ -65,7 +65,7 @@ public:
     SvTabListBox( vcl::Window* pParent, WinBits );
     virtual ~SvTabListBox() override;
     virtual void dispose() override;
-    void            SetTabs(const long* pTabs, MapUnit = MapUnit::MapAppFont);
+    void            SetTabs(sal_uInt16 nTabs, long const pTabPositions[], MapUnit = MapUnit::MapAppFont);
     sal_uInt16      TabCount() const { return nTabCount; }
     using SvTreeListBox::GetTab;
     long            GetTab( sal_uInt16 nTab ) const;
diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx
index 2a18c4289ada..d6370799ac06 100644
--- a/sc/source/ui/condformat/condformatmgr.cxx
+++ b/sc/source/ui/condformat/condformatmgr.cxx
@@ -95,9 +95,9 @@ void ScCondFormatManagerWindow::setColSizes()
     HeaderBar &rBar = GetTheHeaderBar();
     if (rBar.GetItemCount() < 2)
         return;
-    long aStaticTabs[]= { 2, 0, 0 };
-    aStaticTabs[2] = rBar.GetSizePixel().Width() / 2;
-    SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
+    long aStaticTabs[]= { 0, 0 };
+    aStaticTabs[1] = rBar.GetSizePixel().Width() / 2;
+    SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aStaticTabs), aStaticTabs, MapUnit::MapPixel);
 }
 
 ScCondFormatManagerDlg::ScCondFormatManagerDlg(vcl::Window* pParent, ScDocument* pDoc, const ScConditionalFormatList* pFormatList):
diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx
index 374ce58407d4..38facd11121b 100644
--- a/sc/source/ui/dialogs/searchresults.cxx
+++ b/sc/source/ui/dialogs/searchresults.cxx
@@ -38,8 +38,8 @@ SearchResultsDlg::SearchResultsDlg( SfxBindings* _pBindings, vcl::Window* pParen
     pContainer->set_height_request(aControlSize.Height());
 
     mpList = VclPtr<SvSimpleTable>::Create(*pContainer);
-    long nTabs[] = {3, 0, 40, 60};
-    mpList->SetTabs(&nTabs[0]);
+    long nTabs[] = {0, 40, 60};
+    mpList->SetTabs(SAL_N_ELEMENTS(nTabs), nTabs);
     mpList->InsertHeaderEntry(ScResId(STR_SHEET) + "\t" + ScResId(STR_CELL) + "\t" + ScResId(STR_CONTENT));
     mpList->SetSelectHdl( LINK(this, SearchResultsDlg, ListSelectHdl) );
 }
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index 4ceb6c11d92d..9e5c2cba5abd 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -401,8 +401,8 @@ ScConflictsDlg::ScConflictsDlg( vcl::Window* pParent, ScViewData* pViewData, ScD
 
     SetMinOutputSizePixel( maDialogSize );
 
-    long const nTabs[] = { 3, 10, 216, 266 };
-    m_pLbConflicts->SetTabs( nTabs );
+    long const nTabs[] = { 10, 216, 266 };
+    m_pLbConflicts->SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
 
     OUString aTab('\t');
     OUString aHeader( maStrTitleConflict );
diff --git a/sc/source/ui/miscdlgs/sharedocdlg.cxx b/sc/source/ui/miscdlgs/sharedocdlg.cxx
index 020cd67c303e..9038c96d4a33 100644
--- a/sc/source/ui/miscdlgs/sharedocdlg.cxx
+++ b/sc/source/ui/miscdlgs/sharedocdlg.cxx
@@ -60,9 +60,8 @@ public:
         long nWebSiteWidth = std::max(
             12 + rBar.GetTextWidth(rBar.GetItemText(1)),
             GetSizePixel().Width() - nAccessedWidth);
-        long aStaticTabs[]= { 2, 0, 0 };
-        aStaticTabs[2] = nWebSiteWidth;
-        SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
+        long aStaticTabs[]= { 0, nWebSiteWidth };
+        SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aStaticTabs), aStaticTabs, MapUnit::MapPixel);
     }
 };
 
@@ -93,8 +92,8 @@ ScShareDocumentDlg::ScShareDocumentDlg( vcl::Window* pParent, ScViewData* pViewD
     m_pCbShare->SetToggleHdl( LINK( this, ScShareDocumentDlg, ToggleHandle ) );
     m_pFtWarning->Enable( bIsDocShared );
 
-    long const nTabs[] = { 2, 0, 0 };
-    m_pLbUsers->SetTabs( nTabs );
+    long const nTabs[] = { 0, 0 };
+    m_pLbUsers->SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
 
     OUString aHeader(get<FixedText>("name")->GetText());
     aHeader += "\t";
diff --git a/sc/source/ui/namedlg/namemgrtable.cxx b/sc/source/ui/namedlg/namemgrtable.cxx
index 3e47b7cf8f06..129f263ba33e 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -43,8 +43,8 @@ ScRangeManagerTable::ScRangeManagerTable(SvSimpleTableContainer& rParent,
     , maPos( rPos )
     , mpInitListener(nullptr)
 {
-    static long aStaticTabs[] = {3, 0, 0, 0 };
-    SetTabs( &aStaticTabs[0], MapUnit::MapPixel );
+    static long aStaticTabs[] = { 0, 0, 0 };
+    SetTabs( SAL_N_ELEMENTS(aStaticTabs), aStaticTabs, MapUnit::MapPixel );
 
     OUString aNameStr(ScGlobal::GetRscString(STR_HEADER_NAME));
     OUString aRangeStr(ScGlobal::GetRscString(STR_HEADER_RANGE_OR_EXPR));
@@ -98,8 +98,8 @@ void ScRangeManagerTable::setColWidths()
     rHeaderBar.SetItemSize( ITEMID_NAME, nTabSize);
     rHeaderBar.SetItemSize( ITEMID_RANGE, nTabSize);
     rHeaderBar.SetItemSize( ITEMID_SCOPE, nTabSize);
-    static long aStaticTabs[] = {3, 0, nTabSize, 2*nTabSize };
-    SetTabs( &aStaticTabs[0], MapUnit::MapPixel );
+    static long aStaticTabs[] = {0, nTabSize, 2*nTabSize };
+    SetTabs( SAL_N_ELEMENTS(aStaticTabs), aStaticTabs, MapUnit::MapPixel );
     HeaderEndDragHdl(nullptr);
 }
 
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index 79e59754ea9e..ff3dcb81ef6b 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -171,10 +171,8 @@ void SfxVersionsTabListBox_Impl::setColSizes()
         }
     }
 
-    long aStaticTabs[] = { 3, 0, 0, 0 };
-    aStaticTabs[2] = nMax;
-    aStaticTabs[3] = nMax + nMaxAuthorWidth;
-    SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
+    long aTabPositions[] = { 0, nMax, nMax + nMaxAuthorWidth };
+    SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aTabPositions), aTabPositions, MapUnit::MapPixel);
 }
 
 SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, bool bIsSaveVersionOnClose )
@@ -215,10 +213,8 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, bool bIsSaveVersion
     m_pVersionBox->SetStyle( m_pVersionBox->GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN );
     m_pVersionBox->SetSelectionMode( SelectionMode::Single );
 
-    long nTabs_Impl[] = { 3, 0, 0, 0 };
-
-
-    m_pVersionBox->SvSimpleTable::SetTabs(&nTabs_Impl[0]);
+    long aTabPositions[] = { 0, 0, 0 };
+    m_pVersionBox->SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aTabPositions), aTabPositions);
     OUString sHeader1(get<FixedText>("datetime")->GetText());
     OUString sHeader2(get<FixedText>("savedby")->GetText());
     OUString sHeader3(get<FixedText>("comments")->GetText());
@@ -517,9 +513,8 @@ SfxCmisVersionsDialog::SfxCmisVersionsDialog ( SfxViewFrame* pVwFrame )
     m_pVersionBox->SetStyle( m_pVersionBox->GetStyle() | WB_HSCROLL | WB_CLIPCHILDREN );
     m_pVersionBox->SetSelectionMode( SelectionMode::Single );
 
-    long nTabs_Impl[] = { 3, 0, 0, 0 };
-
-    m_pVersionBox->SvSimpleTable::SetTabs(&nTabs_Impl[0]);
+    long aTabPositions[] = { 0, 0, 0 };
+    m_pVersionBox->SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aTabPositions), aTabPositions);
     OUString sHeader1(get<FixedText>("datetime")->GetText());
     OUString sHeader2(get<FixedText>("savedby")->GetText());
     OUString sHeader3(get<FixedText>("comments")->GetText());
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 6e3257faece6..74b3769279c7 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -487,15 +487,15 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( vcl::Window* pParentWin,
     HeaderBarItemBits nBits = ( HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER | HeaderBarItemBits::CLICKABLE );
     if (nFlags & FileViewFlags::SHOW_ONLYTITLE)
     {
-        long pTabs[] = { 2, 20, 600 };
-        SetTabs(&pTabs[0], MapUnit::MapPixel);
+        long aTabPositions[] = { 20, 600 };
+        SetTabs(SAL_N_ELEMENTS(aTabPositions), aTabPositions, MapUnit::MapPixel);
 
         mpHeaderBar->InsertItem(COLUMN_TITLE, SvtResId(STR_SVT_FILEVIEW_COLUMN_TITLE), 600, nBits | HeaderBarItemBits::UPARROW);
     }
     else
     {
-        long pTabs[] = { 5, 20, 180, 320, 400, 600 };
-        SetTabs(&pTabs[0], MapUnit::MapPixel);
+        long aTabPositions[] = { 20, 180, 320, 400, 600 };
+        SetTabs(SAL_N_ELEMENTS(aTabPositions), aTabPositions, MapUnit::MapPixel);
         SetTabJustify(2, AdjustRight); // column "Size"
 
         mpHeaderBar->InsertItem(COLUMN_TITLE, SvtResId(STR_SVT_FILEVIEW_COLUMN_TITLE), 180, nBits | HeaderBarItemBits::UPARROW);
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
index 9a804adb162b..6d6b9c1528d7 100644
--- a/svtools/source/contnr/svtabbx.cxx
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -113,24 +113,19 @@ void SvTabListBox::dispose()
     SvTreeListBox::dispose();
 }
 
-void SvTabListBox::SetTabs(const long* pTabs, MapUnit eMapUnit)
+void SvTabListBox::SetTabs(sal_uInt16 nTabs, long const pTabPositions[], MapUnit eMapUnit)
 {
-    DBG_ASSERT(pTabs,"SetTabs:NULL-Ptr");
-    if( !pTabs )
-        return;
-
     delete [] pTabList;
-    sal_uInt16 nCount = static_cast<sal_uInt16>(*pTabs);
+    sal_uInt16 nCount = nTabs;
     pTabList = new SvLBoxTab[ nCount ];
     nTabCount = nCount;
 
     MapMode aMMSource( eMapUnit );
     MapMode aMMDest( MapUnit::MapPixel );
 
-    pTabs++;
-    for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++, pTabs++ )
+    for( sal_uInt16 nIdx = 0; nIdx < nCount; nIdx++, pTabPositions++ )
     {
-        Size aSize( *pTabs, 0 );
+        Size aSize( *pTabPositions, 0 );
         aSize = LogicToLogic( aSize, &aMMSource, &aMMDest );
         long nNewTab = aSize.Width();
         pTabList[nIdx].SetPos( nNewTab );
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index be1e113c70c3..1e32dbf43ac3 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -431,8 +431,8 @@ void SvxTPView::dispose()
 
 void SvxTPView::InsertWriterHeader()
 {
-    const long pTabs[] = { 4 /* Length of rest of the array */, 10, 20, 70, 120 };
-    m_pViewData->SetTabs(pTabs);
+    const long aTabPositions[] = { 10, 20, 70, 120 };
+    m_pViewData->SetTabs(SAL_N_ELEMENTS(aTabPositions), aTabPositions);
 
     OUString aStrTab('\t');
     OUString aString = get<FixedText>("action")->GetText()
@@ -448,8 +448,8 @@ void SvxTPView::InsertWriterHeader()
 
 void SvxTPView::InsertCalcHeader()
 {
-    const long pTabs[] = { 5 /* Length of rest of the array */, 10, 65, 120, 170, 220 };
-    m_pViewData->SetTabs(pTabs);
+    const long aTabPositions[] = { 10, 65, 120, 170, 220 };
+    m_pViewData->SetTabs(SAL_N_ELEMENTS(aTabPositions), aTabPositions);
 
     OUString aStrTab('\t');
     OUString aString = get<FixedText>("action")->GetText()
diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx
index 040afecf3b37..b3be3f22f2e5 100644
--- a/svx/source/dialog/docrecovery.cxx
+++ b/svx/source/dialog/docrecovery.cxx
@@ -860,8 +860,8 @@ RecoveryDialog::RecoveryDialog(vcl::Window* pParent, RecoveryCore* pCore)
     pFileListLBContainer->set_height_request(aSize.Height());
     m_pFileListLB = VclPtr<RecovDocList>::Create(*pFileListLBContainer);
 
-    static long nTabs[] = { 2, 0, 40*RECOV_CONTROLWIDTH/100 };
-    m_pFileListLB->SetTabs( &nTabs[0] );
+    static long aTabPositions[] = { 0, 40*RECOV_CONTROLWIDTH/100 };
+    m_pFileListLB->SetTabs( SAL_N_ELEMENTS(aTabPositions), aTabPositions );
     m_pFileListLB->InsertHeaderEntry(get<FixedText>("nameft")->GetText() + "\t" + get<FixedText>("statusft")->GetText());
 
     PluginProgress* pProgress   = new PluginProgress(m_pProgrParent, pCore->getComponentContext());
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 3afc291316e1..cdaabee98f10 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -2887,8 +2887,8 @@ namespace svxform
         pNamespacesListContainer->set_height_request(aControlSize.Height());
         m_pNamespacesList = VclPtr<SvSimpleTable>::Create(*pNamespacesListContainer, 0);
 
-        static long aStaticTabs[]= { 3, 0, 35, 200 };
-        m_pNamespacesList->SvSimpleTable::SetTabs( aStaticTabs );
+        static long aTabPositions[]= { 0, 35, 200 };
+        m_pNamespacesList->SvSimpleTable::SetTabs( SAL_N_ELEMENTS(aTabPositions), aTabPositions );
         OUString sHeader = get<FixedText>("prefix")->GetText();
         sHeader += "\t";
         sHeader += get<FixedText>("url")->GetText();
diff --git a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
index cc160da590ae..0be78a576402 100644
--- a/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
+++ b/svx/source/unodialogs/textconversiondlgs/chinese_dictionarydialog.cxx
@@ -367,8 +367,8 @@ void DictionaryList::setColSizes()
     long nPos3 = nWidth - nWidth3;
     long nRemainder = nWidth - (nWidth1 + nWidth2 + nWidth3);
 
-    long aStaticTabs[] = { 3, 0, nWidth1 + (nRemainder/2), nPos3 };
-    SvSimpleTable::SetTabs(aStaticTabs, MapUnit::MapPixel);
+    long aTabPositions[] = { 0, nWidth1 + (nRemainder/2), nPos3 };
+    SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aTabPositions), aTabPositions, MapUnit::MapPixel);
 }
 
 void DictionaryList::Resize()
@@ -410,8 +410,8 @@ void DictionaryList::init(const Reference< linguistic2::XConversionDictionary>&
     rHeaderBar.InsertItem( 2, aColumn2, nWidth2, nBits );
     rHeaderBar.InsertItem( 3, aColumn3, nWidth3, nBits );
 
-    long pTabs[] = { 3, 0, nWidth1, nWidth1 + nWidth2 };
-    SetTabs( &pTabs[0], MapUnit::MapPixel );
+    long aTabPositions[] = { 0, nWidth1, nWidth1 + nWidth2 };
+    SetTabs( SAL_N_ELEMENTS(aTabPositions), aTabPositions, MapUnit::MapPixel );
 }
 
 void ChineseDictionaryDialog::initDictionaryControl(DictionaryList *pList,
diff --git a/sw/source/ui/chrdlg/swuiccoll.cxx b/sw/source/ui/chrdlg/swuiccoll.cxx
index de20be28544d..5767642ac6d9 100644
--- a/sw/source/ui/chrdlg/swuiccoll.cxx
+++ b/sw/source/ui/chrdlg/swuiccoll.cxx
@@ -46,7 +46,7 @@ const sal_uInt16 SwCondCollPage::m_aPageRg[] = {
 
 // Warning! This table is indicated directly in code (0, 1, ...)
 static long nTabs[] =
-    {   2, // Number of Tabs
+    {
         0, 100
     };
 
@@ -92,7 +92,7 @@ SwCondCollPage::SwCondCollPage(vcl::Window *pParent, const SfxItemSet &rSet)
 
     m_pTbLinks->SetStyle(m_pTbLinks->GetStyle()|WB_HSCROLL|WB_CLIPCHILDREN);
     m_pTbLinks->SetSelectionMode( SelectionMode::Single );
-    m_pTbLinks->SetTabs( &nTabs[0] );
+    m_pTbLinks->SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
     m_pTbLinks->Resize();  // OS: Hack for the right selection
     m_pTbLinks->SetSpaceBetweenEntries( 0 );
 
diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx
index 3fa3c3a262c8..7c9f56525e29 100644
--- a/sw/source/ui/dbui/addresslistdialog.cxx
+++ b/sw/source/ui/dbui/addresslistdialog.cxx
@@ -155,9 +155,9 @@ void SwAddrSourceLB::setColSizes()
 
     long nWidth = rHB.GetSizePixel().Width();
 
-    long nTabs[] = { 2, 0, nWidth/2 };
+    long nTabs[] = { 0, nWidth/2 };
 
-    SvSimpleTable::SetTabs(&nTabs[0], MapUnit::MapPixel);
+    SvSimpleTable::SetTabs(SAL_N_ELEMENTS(nTabs), nTabs, MapUnit::MapPixel);
 }
 
 SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent)
diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx
index 6f1176f6cbdf..7f841e2ba7ae 100644
--- a/sw/source/ui/dbui/mmoutputtypepage.cxx
+++ b/sw/source/ui/dbui/mmoutputtypepage.cxx
@@ -274,10 +274,10 @@ SwSendMailDialog::SwSendMailDialog(vcl::Window *pParent, SwMailMergeConfigItem&
                             nPos2,
                             HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER );
 
-    static long nTabs[] = {2, 0, nPos1};
+    static long nTabs[] = {0, nPos1};
     m_pStatus->SetStyle( m_pStatus->GetStyle() | WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP );
     m_pStatus->SetSelectionMode( SelectionMode::Single );
-    m_pStatus->SetTabs(&nTabs[0], MapUnit::MapPixel);
+    m_pStatus->SetTabs(SAL_N_ELEMENTS(nTabs), nTabs, MapUnit::MapPixel);
     m_pStatus->SetSpaceBetweenEntries(3);
 
     m_pPaused->Show(false);
diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx
index 2849d57e306a..f376d78696bd 100644
--- a/sw/source/ui/dbui/selectdbtabledialog.cxx
+++ b/sw/source/ui/dbui/selectdbtabledialog.cxx
@@ -80,13 +80,8 @@ void SwAddressTable::setColSizes()
     long nWidth = rHB.GetSizePixel().Width();
     nWidth /= 2;
 
-    long nTabs_Impl[3];
-
-    nTabs_Impl[0] = 2;
-    nTabs_Impl[1] = 0;
-    nTabs_Impl[2] = nWidth;
-
-    SvSimpleTable::SetTabs(&nTabs_Impl[0], MapUnit::MapPixel);
+    long nTabs[2] = { 0, nWidth };
+    SvSimpleTable::SetTabs(SAL_N_ELEMENTS(nTabs), nTabs, MapUnit::MapPixel);
 }
 
 SwSelectDBTableDialog::SwSelectDBTableDialog(vcl::Window* pParent,
@@ -105,8 +100,8 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(vcl::Window* pParent,
     pHeaderTreeContainer->set_width_request(aSize.Width());
     pHeaderTreeContainer->set_height_request(aSize.Height());
     m_pTable = VclPtr<SwAddressTable>::Create(*pHeaderTreeContainer);
-    long const aStaticTabs[]= { 2, 0, 0 };
-    m_pTable->SetTabs( aStaticTabs );
+    long const aStaticTabs[]= { 0, 0 };
+    m_pTable->SetTabs( SAL_N_ELEMENTS(aStaticTabs), aStaticTabs );
     m_pTable->InsertHeaderItem(1, m_sName );
     m_pTable->InsertHeaderItem(2, m_sType );
 
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index ed3cb92c6772..426ec4c3db2d 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -611,14 +611,11 @@ void SwIndexTreeLB::setColSizes()
     nWidth /= 14;
     nWidth--;
 
-    long nTabs_Impl[MAXLEVEL+2];
-
-    nTabs_Impl[0] = MAXLEVEL+1;
-    nTabs_Impl[1] = 3 * nWidth;
-
+    long nTabs[MAXLEVEL+1];
+    nTabs[0] = 3 * nWidth;
     for(sal_uInt16 i = 1; i <= MAXLEVEL; ++i)
-        nTabs_Impl[i+1] = nTabs_Impl[i] + nWidth;
-    SvSimpleTable::SetTabs(&nTabs_Impl[0], MapUnit::MapPixel);
+        nTabs[i] = nTabs[i-1] + nWidth;
+    SvSimpleTable::SetTabs(SAL_N_ELEMENTS(nTabs), nTabs, MapUnit::MapPixel);
 }
 
 class SwAddStylesDlg_Impl : public SfxModalDialog
diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 9a7bd9472710..309892627b47 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -349,9 +349,9 @@ void SwInsertBookmarkDlg::dispose()
 BookmarkTable::BookmarkTable(SvSimpleTableContainer& rParent) :
     SvSimpleTable(rParent, 0)
 {
-    static long nTabs[] = {3, 0, 40, 150};
+    static long nTabs[] = {0, 40, 150};
 
-    SetTabs(nTabs, MapUnit::MapPixel);
+    SetTabs(SAL_N_ELEMENTS(nTabs), nTabs, MapUnit::MapPixel);
     SetSelectionMode(SelectionMode::Multiple);
     InsertHeaderEntry(SwResId(STR_PAGE));
     InsertHeaderEntry(SwResId(STR_BOOKMARK_NAME));
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 4c84074f2e7e..dc957cb7650c 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -63,12 +63,9 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(vcl::Window * pParent,
     m_pGroupTLB->set_width_request(nWidth);
     m_pGroupTLB->set_height_request(GetTextHeight() * 10);
 
-    long nTabs[] =
-    {   2, // Number of Tabs
-        0, nAppFontUnits
-    };
+    long nTabs[] = {  0, nAppFontUnits };
 
-    m_pGroupTLB->SetTabs( &nTabs[0] );
+    m_pGroupTLB->SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
     m_pGroupTLB->SetSelectHdl(LINK(this, SwGlossaryGroupDlg, SelectHdl));
     m_pGroupTLB->GetModel()->SetSortMode(SortAscending);
     m_pNewPB->SetClickHdl(LINK(this, SwGlossaryGroupDlg, NewHdl));
diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx
index 5454dbdb26b8..2defc8e6a406 100644
--- a/xmlsecurity/source/dialogs/certificatechooser.cxx
+++ b/xmlsecurity/source/dialogs/certificatechooser.cxx
@@ -56,8 +56,8 @@ CertificateChooser::CertificateChooser(vcl::Window* _pParent,
     pSignatures->set_height_request(aControlSize.Height());
 
     m_pCertLB = VclPtr<SvSimpleTable>::Create(*pSignatures);
-    static long nTabs[] = { 5, 0, 20*nControlWidth/100, 50*nControlWidth/100, 60*nControlWidth/100, 70*nControlWidth/100  };
-    m_pCertLB->SetTabs( &nTabs[0] );
+    static long nTabs[] = { 0, 20*nControlWidth/100, 50*nControlWidth/100, 60*nControlWidth/100, 70*nControlWidth/100  };
+    m_pCertLB->SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
     m_pCertLB->InsertHeaderEntry(get<FixedText>("issuedto")->GetText() + "\t" + get<FixedText>("issuedby")->GetText()
         + "\t" + get<FixedText>("type")->GetText() + "\t" + get<FixedText>("expiration")->GetText()
         + "\t" + get<FixedText>("usage")->GetText());
diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx
index 4f206d256118..0f2d0a399c60 100644
--- a/xmlsecurity/source/dialogs/certificateviewer.cxx
+++ b/xmlsecurity/source/dialogs/certificateviewer.cxx
@@ -249,8 +249,8 @@ CertificateViewerDetailsTP::CertificateViewerDetailsTP( vcl::Window* _pParent, C
 
     constexpr int DLGS_WIDTH = 287;
     constexpr int CS_LB_WIDTH = (DLGS_WIDTH - RSC_SP_DLG_INNERBORDER_RIGHT) - RSC_SP_DLG_INNERBORDER_LEFT;
-    static long nTabs[] = { 2, 0, 30*CS_LB_WIDTH/100 };
-    m_pElementsLB->SetTabs( &nTabs[ 0 ] );
+    static long nTabs[] = { 0, 30*CS_LB_WIDTH/100 };
+    m_pElementsLB->SetTabs( SAL_N_ELEMENTS(nTabs), nTabs );
     m_pElementsLB->InsertHeaderEntry( XsResId( STR_HEADERBAR ) );
 
     // fill list box
diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
index aad24e69a544..d3c6d2d6c92d 100644
--- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
@@ -141,8 +141,8 @@ DigitalSignaturesDialog::DigitalSignaturesDialog(
 
     m_pSignaturesLB = VclPtr<SvSimpleTable>::Create(*pSignatures);
     // Give the first column 6 percent, try to distribute the rest equally.
-    static long aTabs[] = { 6, 0, 6*nControlWidth/100, 25*nControlWidth/100, 44*nControlWidth/100, 62*nControlWidth/100, 81*nControlWidth/100 };
-    m_pSignaturesLB->SetTabs(aTabs);
+    static long aTabs[] = { 0, 6*nControlWidth/100, 25*nControlWidth/100, 44*nControlWidth/100, 62*nControlWidth/100, 81*nControlWidth/100 };
+    m_pSignaturesLB->SetTabs(SAL_N_ELEMENTS(aTabs), aTabs);
 
     m_pSignaturesLB->InsertHeaderEntry("\t" + get<FixedText>("signed")->GetText() + "\t"
                + get<FixedText>("issued")->GetText() + "\t" + get<FixedText>("date")->GetText() + "\t"
diff --git a/xmlsecurity/source/dialogs/macrosecurity.cxx b/xmlsecurity/source/dialogs/macrosecurity.cxx
index 41c597754294..91f14846d37f 100644
--- a/xmlsecurity/source/dialogs/macrosecurity.cxx
+++ b/xmlsecurity/source/dialogs/macrosecurity.cxx
@@ -348,8 +348,8 @@ public:
         if (isInitialLayout(this))
         {
             const long nControlWidth = GetSizePixel().Width();
-            long aTabLocs[] = { 3, 0, 35*nControlWidth/100, 70*nControlWidth/100 };
-            SvSimpleTable::SetTabs(aTabLocs, MapUnit::MapPixel);
+            long aTabLocs[] = { 0, 35*nControlWidth/100, 70*nControlWidth/100 };
+            SvSimpleTable::SetTabs(SAL_N_ELEMENTS(aTabLocs), aTabLocs, MapUnit::MapPixel);
         }
     }
 };
@@ -368,8 +368,8 @@ MacroSecurityTrustedSourcesTP::MacroSecurityTrustedSourcesTP(vcl::Window* _pPare
 
     SvSimpleTableContainer *pCertificates = get<SvSimpleTableContainer>("certificates");
     m_pTrustCertLB.reset(VclPtr<TrustCertLB>::Create(*pCertificates));
-    static long aTabs[] = { 3, 0, 0, 0 };
-    m_pTrustCertLB->SetTabs( aTabs );
+    static long aTabs[] = { 0, 0, 0 };
+    m_pTrustCertLB->SetTabs( SAL_N_ELEMENTS(aTabs), aTabs );
 
     m_pTrustCertLB->InsertHeaderEntry(get<FixedText>("to")->GetText() + "\t"
         +  get<FixedText>("by")->GetText() + "\t" + get<FixedText>("date")->GetText());


More information about the Libreoffice-commits mailing list