[Libreoffice-commits] core.git: chart2/source

Laurent Balland-Poirier laurent.balland-poirier at laposte.net
Tue Nov 26 22:09:53 PST 2013


 chart2/source/controller/dialogs/res_Trendline.cxx |   46 ++++++++++++++++++---
 chart2/source/controller/dialogs/res_Trendline.hxx |    1 
 2 files changed, 41 insertions(+), 6 deletions(-)

New commits:
commit eaa13b8b63f91ce432eea216a9c3afd54bac62a5
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date:   Sun Nov 24 22:11:56 2013 +0100

    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 at gmail.com>
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx
index 36a79db..76be297 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 7aacb08..8dd2e2e 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


More information about the Libreoffice-commits mailing list