summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2023-09-11 17:49:32 +0530
committerDennis Francis <dennis.francis@collabora.com>2023-09-12 16:12:18 +0200
commitb8f6f91f476f1c3f93bb44265381305f6f02b161 (patch)
tree23498811ff1cfee402a37f647becf8cd4cdeb583
parent43677cb0d95de06bea0f08e87ccfa3230dc8bd6b (diff)
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.francis@collabora.com>
-rw-r--r--sc/source/ui/dbgui/pvfundlg.cxx18
-rw-r--r--sc/source/ui/inc/pvfundlg.hxx1
2 files changed, 3 insertions, 16 deletions
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 );