sc/source/ui/cctrl/TableStylesBox.cxx | 15 ++++++++++++++- sc/source/ui/sidebar/DatabasePropertyPanel.cxx | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-)
New commits: commit c0bc2753eda7c9f92bf63e2d5f8646acc6957a8c Author: Balazs Varga <[email protected]> AuthorDate: Thu Feb 5 14:18:23 2026 +0100 Commit: Balazs Varga <[email protected]> CommitDate: Fri Feb 6 12:25:29 2026 +0100 Table Style: fix ooxml import of custom table style name not shows up and not selected in the Table Style listbox. Change-Id: Idf38b6f767db1a6e6a59b36b3a561d599080582f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198755 Reviewed-by: Balazs Varga <[email protected]> Tested-by: Jenkins (cherry picked from commit 7b0f4975eb44ddcc69a79295884de71a97a89146) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198794 Tested-by: Jenkins CollaboraOffice <[email protected]> diff --git a/sc/source/ui/cctrl/TableStylesBox.cxx b/sc/source/ui/cctrl/TableStylesBox.cxx index f7a9b06ac6a3..ee9f3ab7fe8a 100644 --- a/sc/source/ui/cctrl/TableStylesBox.cxx +++ b/sc/source/ui/cctrl/TableStylesBox.cxx @@ -73,7 +73,20 @@ void TableStylesBox::Update(const ScDatabaseSettingItem* pItem) m_xChkBandedRows->set_active(pItem->HasStripedRows()); m_xChkBandedColumns->set_active(pItem->HasStripedCols()); m_xChkFilterButtons->set_active(pItem->HasShowFilters()); - m_xCmbStyle->set_active_id(pItem->GetStyleID()); + + const OUString& rName = pItem->GetStyleID(); + if (!rName.isEmpty()) + { + int nPos = m_xCmbStyle->find_id(rName); + if (nPos == -1) + { + m_xCmbStyle->insert(0, rName); + m_xCmbStyle->set_id(0, rName); + nPos = 0; + } + + m_xCmbStyle->set_active(nPos); + } } IMPL_LINK_NOARG(TableStylesBox, ToggleHdl, weld::Toggleable&, void) diff --git a/sc/source/ui/sidebar/DatabasePropertyPanel.cxx b/sc/source/ui/sidebar/DatabasePropertyPanel.cxx index 359699e783a0..9c8dbb90aad1 100644 --- a/sc/source/ui/sidebar/DatabasePropertyPanel.cxx +++ b/sc/source/ui/sidebar/DatabasePropertyPanel.cxx @@ -121,7 +121,20 @@ void ScDatabasePropertyPanel::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState eSt m_xChkBandedRows->set_active(pItem->HasStripedRows()); m_xChkBandedColumns->set_active(pItem->HasStripedCols()); m_xChkFilterButtons->set_active(pItem->HasShowFilters()); - m_xCmbStyle->set_active_id(pItem->GetStyleID()); + + const OUString& rName = pItem->GetStyleID(); + if (!rName.isEmpty()) + { + int nPos = m_xCmbStyle->find_id(rName); + if (nPos == -1) + { + m_xCmbStyle->insert(0, rName); + m_xCmbStyle->set_id(0, rName); + nPos = 0; + } + + m_xCmbStyle->set_active(nPos); + } } break; }
