Kaydet (Commit) eaa13b8b authored tarafından Laurent Balland-Poirier's avatar Laurent Balland-Poirier Kaydeden (comit) Tomaž Vajngerl

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/6815Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
Tested-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst aa2cc950
......@@ -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: */
......@@ -71,6 +71,7 @@ private:
void UpdateControlStates();
DECL_LINK( SelectTrendLine, RadioButton * );
DECL_LINK( ChangeNumericField, NumericField *);
};
} // namespace chart
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment