summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2013-11-24 22:11:56 +0100
committerTomaž Vajngerl <quikee@gmail.com>2013-11-30 16:33:04 -0600
commit78f227e1371ef4d11bc98e2116a3b95bb881b020 (patch)
treec9b6f7a58316ab0c8560ab82948e724d902a5dbc
parent642df5d716f858f1f6b3d6219132c3323032975a (diff)
fdo#35712 fdo#40315 fdo#40314 Autoselect trendline type
Modification of Degree or Period select trendline type Modification of Intercept select option Change-Id: If3a212c381061e831ee4411c8e17fbaf8ca12895 Reviewed-on: https://gerrit.libreoffice.org/6815 Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> Tested-by: Tomaž Vajngerl <quikee@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/6855
-rw-r--r--chart2/source/controller/dialogs/res_Trendline.cxx46
-rw-r--r--chart2/source/controller/dialogs/res_Trendline.hxx1
2 files changed, 41 insertions, 6 deletions
diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx
index f8ba0fa7aa3b..9c08a21f234a 100644
--- a/chart2/source/controller/dialogs/res_Trendline.cxx
+++ b/chart2/source/controller/dialogs/res_Trendline.cxx
@@ -58,12 +58,18 @@ TrendlineResources::TrendlineResources( Window * pParent, const SfxItemSet& rInA
((SfxTabPage*)pParent)->get(m_pFI_MovingAverage,"imageMovingAverage");
FillValueSets();
- m_pRB_Linear->SetClickHdl( LINK(this, TrendlineResources, SelectTrendLine ));
- m_pRB_Logarithmic->SetClickHdl( LINK(this, TrendlineResources, SelectTrendLine ));
- m_pRB_Exponential->SetClickHdl( LINK(this, TrendlineResources, SelectTrendLine ));
- m_pRB_Power->SetClickHdl( LINK(this, TrendlineResources, SelectTrendLine ));
- m_pRB_Polynomial->SetClickHdl( LINK(this, TrendlineResources, SelectTrendLine ));
- m_pRB_MovingAverage->SetClickHdl( LINK(this, TrendlineResources, SelectTrendLine ));
+ Link aLink = LINK(this, TrendlineResources, SelectTrendLine );
+ m_pRB_Linear->SetClickHdl( aLink );
+ m_pRB_Logarithmic->SetClickHdl( aLink );
+ m_pRB_Exponential->SetClickHdl( aLink );
+ m_pRB_Power->SetClickHdl( aLink );
+ m_pRB_Polynomial->SetClickHdl( aLink );
+ m_pRB_MovingAverage->SetClickHdl( aLink );
+
+ aLink = LINK(this, TrendlineResources, ChangeNumericField );
+ m_pNF_Degree->SetModifyHdl( aLink );
+ m_pNF_Period->SetModifyHdl( aLink );
+ m_pNF_InterceptValue->SetModifyHdl( aLink );
m_pNF_ExtrapolateForward->SetMin( SAL_MIN_INT64 );
m_pNF_ExtrapolateForward->SetMax( SAL_MAX_INT64 );
@@ -278,6 +284,34 @@ void TrendlineResources::UpdateControlStates()
{
}
+IMPL_LINK( TrendlineResources, ChangeNumericField, NumericField *, pNumericField)
+{
+ if( pNumericField == m_pNF_Degree )
+ {
+ if( !m_pRB_Polynomial->IsChecked() )
+ {
+ m_pRB_Polynomial->Check();
+ SelectTrendLine(m_pRB_Polynomial);
+ }
+ }
+ else if( pNumericField == m_pNF_Period )
+ {
+ if( !m_pRB_MovingAverage->IsChecked() )
+ {
+ m_pRB_MovingAverage->Check();
+ SelectTrendLine(m_pRB_MovingAverage);
+ }
+ }
+ else if( pNumericField == m_pNF_InterceptValue )
+ {
+ if( !m_pCB_SetIntercept->IsChecked() )
+ m_pCB_SetIntercept->Check();
+ }
+ UpdateControlStates();
+
+ return 0;
+}
+
} // namespace chart
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/res_Trendline.hxx b/chart2/source/controller/dialogs/res_Trendline.hxx
index 0c12d71c53ae..9795774bdb19 100644
--- a/chart2/source/controller/dialogs/res_Trendline.hxx
+++ b/chart2/source/controller/dialogs/res_Trendline.hxx
@@ -70,6 +70,7 @@ private:
void UpdateControlStates();
DECL_LINK( SelectTrendLine, RadioButton * );
+ DECL_LINK( ChangeNumericField, NumericField *);
};
} // namespace chart