cui/source/customize/SvxToolbarConfigPage.cxx |   19 +++++++++++++++----
 cui/source/customize/cfg.cxx                  |    1 +
 2 files changed, 16 insertions(+), 4 deletions(-)

New commits:
commit e24aa1d0f692cb6d64c00353356b0731e9afbadc
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Jun 6 21:09:44 2025 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sat Jun 7 01:24:57 2025 +0200

    Resolves: tdf#146256 Base toolbar customization page displays wrong scope
    
    Customization for Base "Standard" toolbar is stored in document when
    the scope of "Base" appears to be selected in the UI.
    
    A regression from:
    
    commit ccb2b0078f07194befa61f1e3fd88e53ff236871
    CommitDate: Mon Mar 11 10:00:31 2019 +0100
    
        weld SvxMenuConfigPage/SvxToolbarConfigPage
    
    Change-Id: I18966e34ccd79c6eecb6e1b4c216caaef453f501
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186231
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index c40112f0daea..b1fb244d2060 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -1139,6 +1139,7 @@ void SvxConfigPage::Reset( const SfxItemSet* )
             {
                 OUString sId(weld::toId(pDocData));
                 m_xSaveInListBox->append(sId, aTitle);
+                nPos = m_xSaveInListBox->get_count() - 1;
             }
         }
 
commit c1cca4609fed192c3b309c2955b82c2c236b088f
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Fri Jun 6 21:07:37 2025 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sat Jun 7 01:24:48 2025 +0200

    Related: tdf#146256 select base's "standard" toolbar by default
    
    in the customize dialog. The other modules select "standard" by default,
    but base's "standard" toolbar has a different resource url than the
    others.
    
    Change-Id: I0f53691f83bcaf78a681a2862c595f61fdfb16dc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186230
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/cui/source/customize/SvxToolbarConfigPage.cxx 
b/cui/source/customize/SvxToolbarConfigPage.cxx
index 95afc2e12359..8e5197ea6a0e 100644
--- a/cui/source/customize/SvxToolbarConfigPage.cxx
+++ b/cui/source/customize/SvxToolbarConfigPage.cxx
@@ -41,6 +41,10 @@
 #include <dlgname.hxx>
 #include <comphelper/processfactory.hxx>
 
+static OUString GetDefaultToolbar() { return ITEM_TOOLBAR_URL + "standardbar"; 
}
+
+static OUString GetBaseDefaultToolbar() { return ITEM_TOOLBAR_URL + "toolbar"; 
}
+
 SvxToolbarConfigPage::SvxToolbarConfigPage(weld::Container* pPage,
                                            weld::DialogController* pController,
                                            const SfxItemSet& rSet)
@@ -102,8 +106,7 @@ SvxToolbarConfigPage::SvxToolbarConfigPage(weld::Container* 
pPage,
 
     // default toolbar to select is standardbar unless a different one
     // has been passed in
-    m_aURLToSelect = ITEM_TOOLBAR_URL;
-    m_aURLToSelect += "standardbar";
+    m_aURLToSelect = GetDefaultToolbar();
 
     const SfxPoolItem* pItem = rSet.GetItem(SID_CONFIG);
 
@@ -245,6 +248,12 @@ void SvxToolbarConfigPage::Init()
     sal_Int32 nCount = m_xTopLevelListBox->get_count();
     sal_Int32 nPos = nCount > 0 ? 0 : -1;
 
+    if (m_aURLToSelect == GetDefaultToolbar()
+        && m_aModuleId == "com.sun.star.sdb.OfficeDatabaseDocument")
+    {
+        m_aURLToSelect = GetBaseDefaultToolbar();
+    }
+
     if (!m_aURLToSelect.isEmpty())
     {
         for (sal_Int32 i = 0; i < nCount; ++i)
@@ -259,8 +268,10 @@ void SvxToolbarConfigPage::Init()
         }
 
         // in future select the default toolbar: Standard
-        m_aURLToSelect = ITEM_TOOLBAR_URL;
-        m_aURLToSelect += "standardbar";
+        if (m_aModuleId != "com.sun.star.sdb.OfficeDatabaseDocument")
+            m_aURLToSelect = GetDefaultToolbar();
+        else
+            m_aURLToSelect = GetBaseDefaultToolbar();
     }
 
     m_xTopLevelListBox->set_active(nPos);

Reply via email to