sw/source/ui/misc/bookmark.cxx  |    2 ++
 vcl/source/app/salvtables.cxx   |    4 ++--
 vcl/source/treelist/svtabbx.cxx |    6 +-----
 3 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit d6114ed001160f7e5d5607d96f572a484473c571
Author:     Jan Rheinländer <[email protected]>
AuthorDate: Sun Feb 2 21:23:14 2025 +0100
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Mar 8 12:18:35 2025 +0100

    Fix bug in SalInstanceTreeView::columns_autosize()
    
    SvTreeListBox::getPreferredDimensions() returns widths, not positions
    Bug can be reproduced by adding a line to BookmarkTable::InsertBookmark()
    Unit test fails unless patch 180450 is applied as well
    
    Change-Id: Iafa9ca02968d4ec3dce95ef5242396c3ce5d4c7f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181017
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/sw/source/ui/misc/bookmark.cxx b/sw/source/ui/misc/bookmark.cxx
index 2ff680e033ff..aa2387140bb5 100644
--- a/sw/source/ui/misc/bookmark.cxx
+++ b/sw/source/ui/misc/bookmark.cxx
@@ -548,6 +548,8 @@ void BookmarkTable::InsertBookmark(SwWrtShell& rSh, 
sw::mark::MarkBase* const pM
     m_xControl->set_text(nRow, sBookmarkNodeText, 2);
     m_xControl->set_text(nRow, sHidden, 3);
     m_xControl->set_text(nRow, sHideCondition, 4);
+
+    m_xControl->columns_autosize();
 }
 
 std::unique_ptr<weld::TreeIter> BookmarkTable::GetRowByBookmarkName(const 
OUString& sName)
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index c9c4d2891eda..602d8bf41a3b 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -3926,8 +3926,8 @@ void SalInstanceTreeView::columns_autosize()
     {
         std::vector<int> aColWidths;
         aColWidths.push_back(aWidths[1] + aWidths[0]);
-        for (size_t i = 2; i < aWidths.size() - 1; ++i)
-            aColWidths.push_back(aWidths[i] - aWidths[i - 1]);
+        for (size_t i = 2; i < aWidths.size(); ++i)
+            aColWidths.push_back(aWidths[i]);
         set_column_fixed_widths(aColWidths);
     }
 }
diff --git a/vcl/source/treelist/svtabbx.cxx b/vcl/source/treelist/svtabbx.cxx
index 23b4dbe00864..64c5632dd8c3 100644
--- a/vcl/source/treelist/svtabbx.cxx
+++ b/vcl/source/treelist/svtabbx.cxx
@@ -47,8 +47,6 @@
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::accessibility;
 
-constexpr SvLBoxTabFlags MYTABMASK = SvLBoxTabFlags::ADJUST_FLAGS | 
SvLBoxTabFlags::FORCE;
-
 namespace {
     OString lcl_extractPngString(const BitmapEx& rImage)
     {
@@ -289,10 +287,8 @@ void SvTabListBox::SetTabs(const std::vector<tools::Long>& 
rTabPositions, MapUni
         aSize = LogicToLogic( aSize, &aMMSource, &aMMDest );
         tools::Long nNewTab = aSize.Width();
         mvTabList[nIdx].SetPos( nNewTab );
-        mvTabList[nIdx].nFlags &= MYTABMASK;
     }
-    // by default, 1st one is editable, others not; override with 
set_column_editables
-    mvTabList[0].nFlags |= SvLBoxTabFlags::EDITABLE;
+
     SvTreeListBox::nTreeFlags |= SvTreeFlags::RECALCTABS;
     if( IsUpdateMode() )
         Invalidate();

Reply via email to