[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/source sw/uiconfig
sw/source/ui/index/cnttab.cxx| 25 + sw/uiconfig/swriter/ui/assignstylesdialog.ui |3 +-- 2 files changed, 26 insertions(+), 2 deletions(-) New commits: commit 47e9c7d433e7f23019ea4ae68e08d82ae9c7e3e3 Author: Caolán McNamara AuthorDate: Thu Jul 21 09:06:19 2022 +0100 Commit: Adolfo Jayme Barrientos CommitDate: Sat Jul 23 14:11:43 2022 +0200 Resolves: tdf#148743 TOC->Edit Index->Assign Styles; Styles aren't sorted Change-Id: I1ec804d315f487d7bd1138681ab8e8ae60f21a52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137192 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 1aac737639b9..f73c234784f0 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -485,6 +485,7 @@ class SwAddStylesDlg_Impl : public SfxDialogController DECL_LINK(KeyInput, const KeyEvent&, bool); DECL_LINK(TreeSizeAllocHdl, const Size&, void); DECL_LINK(RadioToggleOnHdl, const weld::TreeView::iter_col&, void); +DECL_LINK(HeaderBarClick, int, void); public: SwAddStylesDlg_Impl(weld::Window* pParent, SwWrtShell const & rWrtSh, OUString rStringArr[]); @@ -508,6 +509,7 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(weld::Window* pParent, m_xHeaderTree->connect_size_allocate(LINK(this, SwAddStylesDlg_Impl, TreeSizeAllocHdl)); m_xHeaderTree->enable_toggle_buttons(weld::ColumnToggleType::Radio); m_xHeaderTree->connect_toggled(LINK(this, SwAddStylesDlg_Impl, RadioToggleOnHdl)); +m_xHeaderTree->connect_column_clicked(LINK(this, SwAddStylesDlg_Impl, HeaderBarClick)); std::vector aWidths { @@ -579,11 +581,34 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(weld::Window* pParent, } } } + m_xHeaderTree->make_sorted(); +m_xHeaderTree->set_sort_column(0); +m_xHeaderTree->set_sort_order(true); +m_xHeaderTree->set_sort_indicator(TRISTATE_TRUE, 0); + m_xHeaderTree->select(0); m_xHeaderTree->connect_key_release(LINK(this, SwAddStylesDlg_Impl, KeyInput)); } +IMPL_LINK(SwAddStylesDlg_Impl, HeaderBarClick, int, nColumn, void) +{ +bool bSortAtoZ = m_xHeaderTree->get_sort_order(); + +//set new arrow positions in headerbar +if (nColumn == m_xHeaderTree->get_sort_column()) +{ +bSortAtoZ = !bSortAtoZ; +m_xHeaderTree->set_sort_order(bSortAtoZ); +} + +if (nColumn != -1) +{ +//sort lists +m_xHeaderTree->set_sort_indicator(bSortAtoZ ? TRISTATE_TRUE : TRISTATE_FALSE, nColumn); +} +} + IMPL_LINK(SwAddStylesDlg_Impl, TreeSizeAllocHdl, const Size&, rSize, void) { auto nWidth = rSize.Width() - Application::GetSettings().GetStyleSettings().GetScrollBarSize(); diff --git a/sw/uiconfig/swriter/ui/assignstylesdialog.ui b/sw/uiconfig/swriter/ui/assignstylesdialog.ui index f3d53261511b..a5a412c35c86 100644 --- a/sw/uiconfig/swriter/ui/assignstylesdialog.ui +++ b/sw/uiconfig/swriter/ui/assignstylesdialog.ui @@ -266,11 +266,10 @@ +True True 6 Style -True -0
[Libreoffice-commits] core.git: Branch 'libreoffice-7-4' - sw/source sw/uiconfig
sw/source/ui/envelp/label1.cxx| 15 +++ sw/uiconfig/swriter/ui/labeldialog.ui | 44 -- 2 files changed, 4 insertions(+), 55 deletions(-) New commits: commit 7ab4918280eb0f06025f23530878de6a67bbdea7 Author: Julien Nabet AuthorDate: Thu Jun 9 21:40:57 2022 +0200 Commit: Xisco Fauli CommitDate: Mon Jun 13 15:37:16 2022 +0200 tdf#148978: Business Cards in Writer dont show database + remove "medium" tab since its goal is exactly what "label" tab does. So now "label" tab is common for "File - New - Business Cards" and "File - New - Labels" Change-Id: I9c7f4e74d7cbc0ffa8ee146a0ef39c87ff5261e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135566 Tested-by: Jenkins Reviewed-by: Julien Nabet (cherry picked from commit 7a7afd3ae5d44677791924a1450d42b7fcf9b82b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135703 Reviewed-by: Xisco Fauli diff --git a/sw/source/ui/envelp/label1.cxx b/sw/source/ui/envelp/label1.cxx index 6d34ea2132de..cee92d24cb28 100644 --- a/sw/source/ui/envelp/label1.cxx +++ b/sw/source/ui/envelp/label1.cxx @@ -76,12 +76,9 @@ void SwLabDlg::PageCreated(const OString , SfxTabPage ) { if (rId == "labels") { -if (m_bLabel) -{ -static_cast()->SetDBManager(pDBManager); -static_cast()->InitDatabaseBox(); -} -else +static_cast()->SetDBManager(pDBManager); +static_cast()->InitDatabaseBox(); +if (!m_bLabel) static_cast()->SetToBusinessCard(); } else if (rId == "options") @@ -137,19 +134,16 @@ SwLabDlg::SwLabDlg(weld::Window* pParent, const SfxItemSet& rSet, AddTabPage("format", SwLabFormatPage::Create, nullptr); AddTabPage("options", SwLabPrtPage::Create, nullptr); +AddTabPage("labels", SwLabPage::Create, nullptr); m_sBusinessCardDlg = SwResId(STR_BUSINESS_CARDS); if (m_bLabel) { RemoveTabPage("business"); RemoveTabPage("private"); -RemoveTabPage("medium"); -AddTabPage("labels", SwLabPage::Create, nullptr); } else { -RemoveTabPage("labels"); -AddTabPage("medium", SwLabPage::Create, nullptr); AddTabPage("business", SwBusinessDataPage::Create, nullptr ); AddTabPage("private", SwPrivateDataPage::Create, nullptr); m_xDialog->set_title(m_sBusinessCardDlg); @@ -275,7 +269,6 @@ void SwLabPage::SetToBusinessCard() m_xSheetButton->set_help_id(HID_BUSINESS_FMT_PAGE_SHEET); m_xMakeBox->set_help_id(HID_BUSINESS_FMT_PAGE_BRAND); m_xTypeBox->set_help_id(HID_BUSINESS_FMT_PAGE_TYPE); -m_xAddressFrame->hide(); }; IMPL_LINK_NOARG(SwLabPage, AddrHdl, weld::Toggleable&, void) diff --git a/sw/uiconfig/swriter/ui/labeldialog.ui b/sw/uiconfig/swriter/ui/labeldialog.ui index c29d3d2fb193..ad4f72944e62 100644 --- a/sw/uiconfig/swriter/ui/labeldialog.ui +++ b/sw/uiconfig/swriter/ui/labeldialog.ui @@ -100,50 +100,6 @@ True True True - - - -True -False - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -True -False -Medium - - -False - -