summaryrefslogtreecommitdiff
path: root/chart2
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-27 00:09:29 -0600
commiteaa13b8b63f91ce432eea216a9c3afd54bac62a5 (patch)
tree78486127edaafd8f9fda67453876120cf19c2b0c /chart2
parentaa2cc9505b476d2170913e1d4dc41313449fe996 (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>
Diffstat (limited to 'chart2')
-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 36a79db13b14..76be2972618e 100644
--- a/chart2/source/controller/dialogs/res_Trendline.cxx
+++ b/chart2/source/controller/dialogs/res_Trendline.cxx
@@ -61,12 +61,18 @@ TrendlineResources::TrendlineResources( Window * pParent, const SfxItemSet& rInA
pTabPage->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 );
@@ -306,6 +312,34 @@ void TrendlineResources::UpdateControlStates()
m_pCB_ShowCorrelationCoeff->Enable(!bMovingAverage);
}
+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 7aacb0810602..8dd2e2e37a32 100644
--- a/chart2/source/controller/dialogs/res_Trendline.hxx
+++ b/chart2/source/controller/dialogs/res_Trendline.hxx
@@ -71,6 +71,7 @@ private:
void UpdateControlStates();
DECL_LINK( SelectTrendLine, RadioButton * );
+ DECL_LINK( ChangeNumericField, NumericField *);
};
} // namespace chart