[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - 2 commits - chart2/source

Laurent Balland-Poirier laurent.balland-poirier at laposte.net
Sat Nov 30 14:33:28 PST 2013


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

New commits:
commit 1fee10725dbd62e78fd3ae14f0bd7872eabff3f9
Author: Laurent Balland-Poirier <laurent.balland-poirier at laposte.net>
Date:   Sun Nov 24 22:38:04 2013 +0100

    fdo#40315 Improve UI for moving average trendline
    
    If moving average trendline is selected, show equation is
    uncheked, and all options disable
    
    Change-Id: Ic25c09b8c8410a12ac9f14cb0ba7833f304053ee
    Reviewed-on: https://gerrit.libreoffice.org/6796
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>
    Tested-by: Tomaž Vajngerl <quikee at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/6856

diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx
index 9c08a21..db83486 100644
--- a/chart2/source/controller/dialogs/res_Trendline.cxx
+++ b/chart2/source/controller/dialogs/res_Trendline.cxx
@@ -282,6 +282,18 @@ void TrendlineResources::FillValueSets()
 
 void TrendlineResources::UpdateControlStates()
 {
+    bool bMovingAverage = ( m_eTrendLineType == CHREGRESS_MOVING_AVERAGE );
+    m_pNF_ExtrapolateForward->Enable(!bMovingAverage);
+    m_pNF_ExtrapolateBackward->Enable(!bMovingAverage);
+    m_pCB_SetIntercept->Enable(!bMovingAverage);
+    m_pNF_InterceptValue->Enable(!bMovingAverage);
+    if(bMovingAverage)
+    {
+        m_pCB_ShowEquation->SetState( STATE_NOCHECK );
+        m_pCB_ShowCorrelationCoeff->SetState( STATE_NOCHECK );
+    }
+    m_pCB_ShowEquation->Enable(!bMovingAverage);
+    m_pCB_ShowCorrelationCoeff->Enable(!bMovingAverage);
 }
 
 IMPL_LINK( TrendlineResources, ChangeNumericField, NumericField *, pNumericField)
commit 78f227e1371ef4d11bc98e2116a3b95bb881b020
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>
    Reviewed-on: https://gerrit.libreoffice.org/6855

diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx
index f8ba0fa..9c08a21 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 0c12d71..9795774 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


More information about the Libreoffice-commits mailing list