sc/source/ui/dbgui/pvfundlg.cxx | 18 +++--------------- sc/source/ui/inc/pvfundlg.hxx | 1 - 2 files changed, 3 insertions(+), 16 deletions(-)
New commits: commit 0b645cf5696be172104b546e4225cb90b27693ce Author: Dennis Francis <dennis.fran...@collabora.com> AuthorDate: Mon Sep 11 17:49:32 2023 +0530 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Sep 13 10:03:21 2023 +0200 tdf#157192: sc:pivot allow sort by selection in non-manual mode Otherwise it is currently impossible to sort a field by its data summarization values. The RadioClickHdl is now doing nothing hence is removed with this change. Change-Id: I76064ce05e5b996ad96f596524be351708ef35e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156747 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.fran...@collabora.com> (cherry picked from commit b8f6f91f476f1c3f93bb44265381305f6f02b161) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156870 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sc/source/ui/dbgui/pvfundlg.cxx b/sc/source/ui/dbgui/pvfundlg.cxx index f74bb4b7391d..7f97e2576795 100644 --- a/sc/source/ui/dbgui/pvfundlg.cxx +++ b/sc/source/ui/dbgui/pvfundlg.cxx @@ -703,9 +703,11 @@ void ScDPSubtotalOptDlg::FillLabelData( ScDPLabelData& rLabelData ) const { rLabelData.maSortInfo.Field = ScDPUtil::createDuplicateDimensionName(aFieldName.maName, aFieldName.mnDupCount); - rLabelData.maSortInfo.IsAscending = m_xRbSortAsc->get_active(); } + if (rLabelData.maSortInfo.Mode != DataPilotFieldSortMode::MANUAL) + rLabelData.maSortInfo.IsAscending = m_xRbSortAsc->get_active(); + // *** LAYOUT MODE *** rLabelData.maLayoutInfo.LayoutMode = ToDataPilotFieldLayoutMode(m_xLbLayout->get_active()); @@ -769,11 +771,6 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayou } m_xLbSortBy->set_active(nSortPos); - // sorting mode - m_xRbSortAsc->connect_toggled( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) ); - m_xRbSortDesc->connect_toggled( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) ); - m_xRbSortMan->connect_toggled( LINK( this, ScDPSubtotalOptDlg, RadioClickHdl ) ); - weld::RadioButton* pRBtn = nullptr; switch( nSortMode ) { @@ -785,7 +782,6 @@ void ScDPSubtotalOptDlg::Init( const ScDPNameVec& rDataFields, bool bEnableLayou pRBtn = maLabelData.maSortInfo.IsAscending ? m_xRbSortAsc.get() : m_xRbSortDesc.get(); } pRBtn->set_active(true); - RadioClickHdl(*pRBtn); // *** LAYOUT MODE *** @@ -879,14 +875,6 @@ IMPL_LINK(ScDPSubtotalOptDlg, ButtonClicked, weld::Button&, rButton, void) response(RET_CANCEL); } -IMPL_LINK(ScDPSubtotalOptDlg, RadioClickHdl, weld::Toggleable&, rBtn, void) -{ - if (!rBtn.get_active()) - return; - - m_xLbSortBy->set_sensitive(m_xRbSortMan->get_active()); -} - IMPL_LINK(ScDPSubtotalOptDlg, CheckHdl, weld::Toggleable&, rCBox, void) { if (&rCBox == m_xCbShow.get()) diff --git a/sc/source/ui/inc/pvfundlg.hxx b/sc/source/ui/inc/pvfundlg.hxx index f5f140c54cdf..146048cfedbf 100644 --- a/sc/source/ui/inc/pvfundlg.hxx +++ b/sc/source/ui/inc/pvfundlg.hxx @@ -150,7 +150,6 @@ private: /** Searches for a listbox entry, starts search at specified position. */ sal_Int32 FindListBoxEntry( const weld::ComboBox& rLBox, std::u16string_view rEntry, sal_Int32 nStartPos ) const; - DECL_LINK( RadioClickHdl, weld::Toggleable&, void ); DECL_LINK( CheckHdl, weld::Toggleable&, void ); DECL_LINK( SelectHdl, weld::ComboBox&, void ); DECL_LINK( ButtonClicked, weld::Button&, void );