include/vcl/toolkit/treelistbox.hxx |    2 ++
 vcl/source/treelist/svtabbx.cxx     |   21 ++-------------------
 2 files changed, 4 insertions(+), 19 deletions(-)

New commits:
commit bc518885c17ee392a1d9af5c2c9542e819fe2451
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Feb 10 10:31:41 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Feb 10 14:05:52 2025 +0100

    vcl: Replace use of MYTABMASK in SvTabListBox::SetTabAlignCenter
    
    Seeing
    
        constexpr SvLBoxTabFlags MYTABMASK =
            SvLBoxTabFlags::ADJUST_RIGHT | SvLBoxTabFlags::ADJUST_LEFT | 
SvLBoxTabFlags::ADJUST_CENTER | SvLBoxTabFlags::FORCE;
    
    , it is not particularly obvious what the idea behind that
    set of flags is.
    
    Introduce SvLBoxTabFlags::ADJUST_FLAGS for the adjustment
    flags and use that one in SvTabListBox::SetTabAlignCenter instead,
    where the purpose is to clear existing alignment flags before setting
    SvLBoxTabFlags::ADJUST_CENTER.
    
    Explicitly clearing SvLBoxTabFlags::FORCE (as happened
    before) isn't necessary because that flag is explicitly
    set afterwards (so it doesn't make any difference whether
    or not it is cleared first).
    
    Change-Id: Ib26e103185c4a79cae97c8ef38b99a02c66c6368
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181339
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/include/vcl/toolkit/treelistbox.hxx 
b/include/vcl/toolkit/treelistbox.hxx
index 78db5bcc2231..0ef5b218f045 100644
--- a/include/vcl/toolkit/treelistbox.hxx
+++ b/include/vcl/toolkit/treelistbox.hxx
@@ -71,6 +71,8 @@ enum class SvLBoxTabFlags
                                // (on which Abo 
Tabpage/Extras/Option/Customize, etc. rely on)
                                // The first tab's position corresponds 
precisely to the Flags set
                                // and column widths
+
+    ADJUST_FLAGS = ADJUST_RIGHT | ADJUST_LEFT | ADJUST_CENTER,
 };
 namespace o3tl
 {
diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index 5350e0a5b12c..721ffb1cb452 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -47,8 +47,7 @@
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::accessibility;
 
-constexpr SvLBoxTabFlags MYTABMASK =
-    SvLBoxTabFlags::ADJUST_RIGHT | SvLBoxTabFlags::ADJUST_LEFT | 
SvLBoxTabFlags::ADJUST_CENTER | SvLBoxTabFlags::FORCE;
+constexpr SvLBoxTabFlags MYTABMASK = SvLBoxTabFlags::ADJUST_FLAGS | 
SvLBoxTabFlags::FORCE;
 
 namespace {
     OString lcl_extractPngString(const BitmapEx& rImage)
@@ -497,7 +496,7 @@ void SvTabListBox::SetTabAlignCenter(sal_uInt16 nTab)
         return;
     SvLBoxTab& rTab = mvTabList[ nTab ];
     SvLBoxTabFlags nFlags = rTab.nFlags;
-    nFlags &= ~MYTABMASK;
+    nFlags &= ~SvLBoxTabFlags::ADJUST_FLAGS;
     // see SvLBoxTab::CalcOffset for force, which only matters for centering
     nFlags |= SvLBoxTabFlags::ADJUST_CENTER | SvLBoxTabFlags::FORCE;
     rTab.nFlags = nFlags;
commit e441a7e9908ff4538dacc4580fd44c771d954acd
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Mon Feb 10 10:21:21 2025 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Mon Feb 10 14:05:43 2025 +0100

    vcl: Drop commented code in SvTabListBox::SetTabs
    
    This has been commented ever since
    
        commit 8ab086b6cc054501bfbf7ef6fa509c393691e860
        Author: Jens-Heiner Rechtien <h...@openoffice.org>
        Date:   Mon Sep 18 16:07:07 2000 +0000
    
            initial import
    
    It's also unclear what `ButtonsOnRoot` in the comment refers
    to, as `git grep ButtonsOnRoot` doesn't give any results,
    nor did the above commit include it anywhere except for this comment.
    
    Change-Id: I86e3421d05ffe87ce86bd11fae2383b74de696e9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181338
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>
    Tested-by: Jenkins

diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index b2a1a4319891..5350e0a5b12c 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -226,22 +226,6 @@ void SvTabListBox::SetTabs()
     // fluff up the list with additional tabs and adjust the rightmost tab
     // of the tree listbox.
 
-    // Picking the rightmost tab.
-    // HACK for the explorer! If ViewParent != 0, the first tab of the tree
-    // listbox is calculated by the tree listbox itself! This behavior is
-    // necessary for ButtonsOnRoot, as the explorer does not know in this
-    // case, which additional offset it needs to add to the tabs in this mode
-    // -- the tree listbox knows that, though!
-    /*
-    if( !pViewParent )
-    {
-    SvLBoxTab* pFirstTab = (SvLBoxTab*)aTabs.GetObject( aTabs.Count()-1 );
-    pFirstTab->SetPos( pTabList[0].GetPos() );
-    pFirstTab->nFlags &= ~MYTABMASK;
-    pFirstTab->nFlags |= pTabList[0].nFlags;
-    }
-    */
-
     // the 1st column (index 1 or 2 depending on button flags) is always set
     // editable by SvTreeListBox::SetTabs(),
     // which prevents setting a different column to editable as the first

Reply via email to