[Libreoffice-commits] core.git: 28 commits - chart2/AllLangResTarget_chartcontroller.mk chart2/Library_chartcontroller.mk chart2/Library_chartcore.mk chart2/source icon-themes/galaxy include/oox include/svx include/xmloff offapi/com offapi/UnoApi_offapi.mk oox/source sc/source xmloff/Library_xo.mk xmloff/source

Tomaž Vajngerl quikee at gmail.com
Wed Jul 3 12:49:16 PDT 2013


 chart2/AllLangResTarget_chartcontroller.mk                               |    2 
 chart2/Library_chartcontroller.mk                                        |    1 
 chart2/Library_chartcore.mk                                              |    2 
 chart2/source/chartcore.component                                        |    8 
 chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx  |   22 
 chart2/source/controller/dialogs/Bitmaps.hrc                             |   12 
 chart2/source/controller/dialogs/Bitmaps.src                             |   14 
 chart2/source/controller/dialogs/Strings_Statistic.src                   |    8 
 chart2/source/controller/dialogs/dlg_InsertTrendline.cxx                 |  106 ---
 chart2/source/controller/dialogs/dlg_InsertTrendline.hrc                 |   25 
 chart2/source/controller/dialogs/dlg_InsertTrendline.src                 |   40 -
 chart2/source/controller/dialogs/res_Trendline.cxx                       |  240 ++++++--
 chart2/source/controller/dialogs/res_Trendline.hxx                       |   26 
 chart2/source/controller/dialogs/res_Trendline_IDs.hrc                   |   38 -
 chart2/source/controller/dialogs/res_Trendline_tmpl.hrc                  |  117 ----
 chart2/source/controller/dialogs/tp_Trendline.cxx                        |    2 
 chart2/source/controller/dialogs/tp_Trendline.hrc                        |   52 +
 chart2/source/controller/dialogs/tp_Trendline.src                        |  198 +++++++
 chart2/source/controller/inc/HelpIds.hrc                                 |    2 
 chart2/source/controller/inc/dlg_InsertTrendline.hxx                     |   62 --
 chart2/source/controller/itemsetwrapper/RegressionCurveItemConverter.cxx |  273 +++++++++-
 chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx      |  247 ++++++++-
 chart2/source/controller/main/ChartController.cxx                        |  209 +++----
 chart2/source/controller/main/ChartController_Insert.cxx                 |  130 +---
 chart2/source/controller/main/ChartController_Tools.cxx                  |   75 +-
 chart2/source/controller/main/ChartController_Window.cxx                 |  177 +++---
 chart2/source/controller/main/ControllerCommandDispatch.cxx              |   27 
 chart2/source/inc/LinearRegressionCurveCalculator.hxx                    |   41 -
 chart2/source/inc/MovingAverageRegressionCurveCalculator.hxx             |   68 ++
 chart2/source/inc/PolynomialRegressionCurveCalculator.hxx                |   67 ++
 chart2/source/inc/RegressionCurveCalculator.hxx                          |   64 +-
 chart2/source/inc/RegressionCurveHelper.hxx                              |   81 +-
 chart2/source/inc/Strings.hrc                                            |    2 
 chart2/source/inc/chartview/ChartSfxItemIds.hxx                          |   18 
 chart2/source/tools/LinearRegressionCurveCalculator.cxx                  |  114 ----
 chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx           |  110 ++++
 chart2/source/tools/PolynomialRegressionCurveCalculator.cxx              |  201 +++++++
 chart2/source/tools/RegressionCurveCalculator.cxx                        |   30 -
 chart2/source/tools/RegressionCurveHelper.cxx                            |  120 ++--
 chart2/source/tools/RegressionCurveModel.cxx                             |  118 ++++
 chart2/source/tools/RegressionCurveModel.hxx                             |   44 +
 chart2/source/tools/_serviceregistration_tools.cxx                       |   16 
 chart2/source/tools/gauss.hxx                                            |  166 ++++++
 chart2/source/view/charttypes/VSeriesPlotter.cxx                         |  108 ++-
 chart2/source/view/inc/VDataSeries.hxx                                   |    2 
 chart2/source/view/main/ChartItemPool.cxx                                |   16 
 chart2/source/view/main/VDataSeries.cxx                                  |   27 
 icon-themes/galaxy/chart2/res/regavg.png                                 |binary
 icon-themes/galaxy/chart2/res/regpoly.png                                |binary
 include/oox/export/chartexport.hxx                                       |    1 
 include/svx/chrtitem.hxx                                                 |    6 
 include/xmloff/xmltoken.hxx                                              |   13 
 offapi/UnoApi_offapi.mk                                                  |    2 
 offapi/com/sun/star/chart/ChartRegressionCurveType.idl                   |    7 
 offapi/com/sun/star/chart2/MovingAverageRegressionCurve.idl              |   38 +
 offapi/com/sun/star/chart2/PolynomialRegressionCurve.idl                 |   38 +
 offapi/com/sun/star/chart2/XRegressionCurveCalculator.idl                |    8 
 oox/source/drawingml/chart/seriesconverter.cxx                           |   42 +
 oox/source/export/chartexport.cxx                                        |  139 +++++
 oox/source/token/properties.txt                                          |    8 
 sc/source/filter/excel/xechart.cxx                                       |   33 +
 sc/source/filter/excel/xichart.cxx                                       |   29 +
 sc/source/filter/inc/xlchart.hxx                                         |    6 
 xmloff/Library_xo.mk                                                     |    1 
 xmloff/source/chart/PropertyMap.hxx                                      |   31 -
 xmloff/source/chart/PropertyMaps.cxx                                     |   60 +-
 xmloff/source/chart/SchXMLChartContext.cxx                               |   15 
 xmloff/source/chart/SchXMLChartContext.hxx                               |    1 
 xmloff/source/chart/SchXMLExport.cxx                                     |  193 +++----
 xmloff/source/chart/SchXMLPlotAreaContext.cxx                            |  128 ----
 xmloff/source/chart/SchXMLPlotAreaContext.hxx                            |   28 -
 xmloff/source/chart/SchXMLRegressionCurveObjectContext.cxx               |  207 +++++++
 xmloff/source/chart/SchXMLRegressionCurveObjectContext.hxx               |   88 +++
 xmloff/source/chart/SchXMLSeries2Context.cxx                             |  114 +++-
 xmloff/source/chart/SchXMLSeries2Context.hxx                             |    9 
 xmloff/source/chart/transporttypes.hxx                                   |   36 -
 xmloff/source/core/xmltoken.cxx                                          |   14 
 77 files changed, 3398 insertions(+), 1425 deletions(-)

New commits:
commit 9c22f181ac19fc9a45dd9eb4f8e34d454575f671
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Wed Jul 3 21:42:39 2013 +0200

    Remove "None" Regression curve option and related files and code.
    
    Change-Id: I38dde3854c08eecfe76d9f329ff2c0fa66449a58

diff --git a/chart2/AllLangResTarget_chartcontroller.mk b/chart2/AllLangResTarget_chartcontroller.mk
index 006266a..8e6d852 100644
--- a/chart2/AllLangResTarget_chartcontroller.mk
+++ b/chart2/AllLangResTarget_chartcontroller.mk
@@ -79,7 +79,6 @@ $(eval $(call gb_SrsTarget_add_templates,chart2/res,\
     chart2/source/controller/dialogs/res_LegendPosition_tmpl.hrc \
     chart2/source/controller/dialogs/res_SecondaryAxisCheckBoxes_tmpl.hrc \
     chart2/source/controller/dialogs/res_Titlesx_tmpl.hrc \
-    chart2/source/controller/dialogs/res_Trendline_tmpl.hrc \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx
index 75f08dc..62c61ae 100644
--- a/chart2/source/controller/dialogs/res_Trendline.cxx
+++ b/chart2/source/controller/dialogs/res_Trendline.cxx
@@ -19,7 +19,7 @@
 
 
 #include "res_Trendline.hxx"
-#include "res_Trendline_IDs.hrc"
+#include "tp_Trendline.hrc"
 #include "ResId.hxx"
 #include "Strings.hrc"
 #include "Bitmaps.hrc"
@@ -58,10 +58,9 @@ namespace
 namespace chart
 {
 
-TrendlineResources::TrendlineResources( Window * pParent, const SfxItemSet& rInAttrs, bool bNoneAvailable ) :
+TrendlineResources::TrendlineResources( Window * pParent, const SfxItemSet& rInAttrs ) :
         m_aFLType( pParent, SchResId( FL_TYPE )),
 
-        m_aRBNone(          pParent, SchResId( RB_NONE              )),
         m_aRBLinear(        pParent, SchResId( RB_LINEAR            )),
         m_aRBLogarithmic(   pParent, SchResId( RB_LOGARITHMIC       )),
         m_aRBExponential(   pParent, SchResId( RB_EXPONENTIAL       )),
@@ -69,7 +68,6 @@ TrendlineResources::TrendlineResources( Window * pParent, const SfxItemSet& rInA
         m_aRBPolynomial(    pParent, SchResId( RB_POLYNOMIAL        )),
         m_aRBMovingAverage( pParent, SchResId( RB_MOVING_AVERAGE    )),
 
-        m_aFINone(          pParent, SchResId( FI_NONE              )),
         m_aFILinear(        pParent, SchResId( FI_LINEAR            )),
         m_aFILogarithmic(   pParent, SchResId( FI_LOGARITHMIC       )),
         m_aFIExponential(   pParent, SchResId( FI_EXPONENTIAL       )),
@@ -93,17 +91,11 @@ TrendlineResources::TrendlineResources( Window * pParent, const SfxItemSet& rInA
         m_aCBShowEquation(         pParent, SchResId( CB_SHOW_EQUATION          )),
         m_aCBShowCorrelationCoeff( pParent, SchResId( CB_SHOW_CORRELATION_COEFF )),
 
-        m_eTrendLineType( CHREGRESS_NONE ),
-        m_bNoneAvailable( bNoneAvailable ),
+        m_eTrendLineType( CHREGRESS_LINEAR ),
         m_bTrendLineUnique( true )
 {
     FillValueSets();
 
-    if( m_bNoneAvailable )
-        m_aRBNone.SetClickHdl( LINK(this, TrendlineResources, SelectTrendLine ));
-    else
-        m_aRBNone.Hide();
-
     m_aRBLinear.SetClickHdl( LINK(this, TrendlineResources, SelectTrendLine ));
     m_aRBLogarithmic.SetClickHdl( LINK(this, TrendlineResources, SelectTrendLine ));
     m_aRBExponential.SetClickHdl( LINK(this, TrendlineResources, SelectTrendLine ));
@@ -125,7 +117,6 @@ long TrendlineResources::adjustControlSizes()
 {
     // calculate right edge
     std::vector< long > aControlRightEdges;
-    aControlRightEdges.push_back( lcl_getRightEdge( m_aRBNone ));
     aControlRightEdges.push_back( lcl_getRightEdge( m_aRBLinear ));
     aControlRightEdges.push_back( lcl_getRightEdge( m_aRBLogarithmic ));
     aControlRightEdges.push_back( lcl_getRightEdge( m_aRBExponential ));
@@ -143,8 +134,6 @@ long TrendlineResources::adjustControlSizes()
     aControlRightEdges.push_back( lcl_getRightEdge( m_aCBShowEquation ));
     aControlRightEdges.push_back( lcl_getRightEdge( m_aCBShowCorrelationCoeff ));
 
-
-    lcl_AdjustControlSize( m_aRBNone );
     lcl_AdjustControlSize( m_aRBLinear );
     lcl_AdjustControlSize( m_aRBLogarithmic );
     lcl_AdjustControlSize( m_aRBExponential );
@@ -193,11 +182,6 @@ IMPL_LINK( TrendlineResources, SelectTrendLine, RadioButton *, pRadioButton )
         m_eTrendLineType = CHREGRESS_POLYNOMIAL;
     else if( pRadioButton == &m_aRBMovingAverage )
         m_eTrendLineType = CHREGRESS_MOVING_AVERAGE;
-    else if( pRadioButton == &m_aRBNone )
-    {
-        OSL_ASSERT( m_bNoneAvailable );
-        m_eTrendLineType = CHREGRESS_NONE;
-    }
     m_bTrendLineUnique = true;
 
     UpdateControlStates();
@@ -331,9 +315,7 @@ void TrendlineResources::Reset( const SfxItemSet& rInAttrs )
             case CHREGRESS_MOVING_AVERAGE :
                 m_aRBMovingAverage.Check();
                 break;
-            case CHREGRESS_NONE:
-                OSL_ASSERT( m_bNoneAvailable );
-                m_aRBNone.Check();
+            default:
                 break;
         }
     }
@@ -373,8 +355,6 @@ sal_Bool TrendlineResources::FillItemSet(SfxItemSet& rOutAttrs) const
 
 void TrendlineResources::FillValueSets()
 {
-    if( m_bNoneAvailable )
-        m_aFINone.SetImage(     Image( SchResId( BMP_REGRESSION_NONE            ) ) );
     m_aFILinear.SetImage(       Image( SchResId( BMP_REGRESSION_LINEAR          ) ) );
     m_aFILogarithmic.SetImage(  Image( SchResId( BMP_REGRESSION_LOG             ) ) );
     m_aFIExponential.SetImage(  Image( SchResId( BMP_REGRESSION_EXP             ) ) );
@@ -385,12 +365,6 @@ void TrendlineResources::FillValueSets()
 
 void TrendlineResources::UpdateControlStates()
 {
-    if( m_bNoneAvailable )
-    {
-        bool bEnableEquationControls = !m_bTrendLineUnique || (m_eTrendLineType != CHREGRESS_NONE);
-        m_aCBShowEquation.Enable( bEnableEquationControls );
-        m_aCBShowCorrelationCoeff.Enable( bEnableEquationControls );
-    }
 }
 
 } //  namespace chart
diff --git a/chart2/source/controller/dialogs/res_Trendline.hxx b/chart2/source/controller/dialogs/res_Trendline.hxx
index 1ff8ca0..3592862 100644
--- a/chart2/source/controller/dialogs/res_Trendline.hxx
+++ b/chart2/source/controller/dialogs/res_Trendline.hxx
@@ -32,7 +32,7 @@ namespace chart
 class TrendlineResources
 {
 public:
-    TrendlineResources( Window* pParent, const SfxItemSet& rInAttrs, bool bNoneAvailable );
+    TrendlineResources( Window* pParent, const SfxItemSet& rInAttrs );
     virtual ~TrendlineResources();
 
     void Reset(const SfxItemSet& rInAttrs);
@@ -44,7 +44,7 @@ public:
 
 private:
     FixedLine m_aFLType;
-    RadioButton m_aRBNone;
+
     RadioButton m_aRBLinear;
     RadioButton m_aRBLogarithmic;
     RadioButton m_aRBExponential;
@@ -52,7 +52,6 @@ private:
     RadioButton m_aRBPolynomial;
     RadioButton m_aRBMovingAverage;
 
-    FixedImage  m_aFINone;
     FixedImage  m_aFILinear;
     FixedImage  m_aFILogarithmic;
     FixedImage  m_aFIExponential;
@@ -81,7 +80,6 @@ private:
 
     SvxChartRegress     m_eTrendLineType;
 
-    bool                m_bNoneAvailable;
     bool                m_bTrendLineUnique;
 
     void UpdateControlStates();
diff --git a/chart2/source/controller/dialogs/res_Trendline_tmpl.hrc b/chart2/source/controller/dialogs/res_Trendline_tmpl.hrc
deleted file mode 100644
index ff6498c..0000000
--- a/chart2/source/controller/dialogs/res_Trendline_tmpl.hrc
+++ /dev/null
@@ -1,235 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef _CHART2_RESOURCE_TRENDLINE_HXX
-#define _CHART2_RESOURCE_TRENDLINE_HXX
-
-#include "res_Trendline_IDs.hrc"
-#include "HelpIds.hrc"
-
-#define RESOURCE_TRENDLINE(availablewidth, yoffset) \
-FixedLine FL_TYPE \
-{ \
-    Pos = MAP_APPFONT( 6 ,6  ); \
-    Size = MAP_APPFONT( availablewidth - 12 ,8 ); \
-    Text[ en-US ] = "Regression Type"; \
-}; \
-RadioButton RB_NONE \
-{ \
-    HelpId = HID_SCH_TRENDLINE_RB_NONE; \
-    Pos = MAP_APPFONT( 29, 22  ); \
-    Size = MAP_APPFONT( 100, 10 ); \
-    Text[ en-US ] = "~None"; \
-}; \
-RadioButton RB_LINEAR \
-{ \
-    HelpId = HID_SCH_TRENDLINE_RB_LINEAR; \
-    Pos = MAP_APPFONT( 29, 22 + yoffset ); \
-    Size = MAP_APPFONT( 100, 10 ); \
-    Text[ en-US ] = "~Linear"; \
-}; \
-RadioButton RB_LOGARITHMIC \
-{ \
-    HelpId = HID_SCH_TRENDLINE_RB_LOGARITHMIC; \
-    Pos = MAP_APPFONT( 29, 44  + yoffset ); \
-    Size = MAP_APPFONT( 100, 10 ); \
-    Text[ en-US ] = "L~ogarithmic"; \
-}; \
-RadioButton RB_EXPONENTIAL \
-{ \
-    HelpId = HID_SCH_TRENDLINE_RB_EXPONENTIAL; \
-    Pos = MAP_APPFONT( 29, 66 + yoffset  ); \
-    Size = MAP_APPFONT( 100, 10 ); \
-    Text[ en-US ] = "E~xponential"; \
-}; \
-RadioButton RB_POWER \
-{ \
-    HelpId = HID_SCH_TRENDLINE_RB_POWER; \
-    Pos = MAP_APPFONT( 29, 88 + yoffset ); \
-    Size = MAP_APPFONT( 100, 10 ); \
-    Text[ en-US ] = "~Power"; \
-}; \
-RadioButton RB_POLYNOMIAL \
-{ \
-    Pos = MAP_APPFONT( 130, 22 + yoffset ); \
-    Size = MAP_APPFONT( 70, 10 ); \
-    Text[ en-US ] = "~Polynomial"; \
-}; \
-RadioButton RB_MOVING_AVERAGE \
-{ \
-    Pos = MAP_APPFONT( 130, 66 + yoffset ); \
-    Size = MAP_APPFONT( 70, 10 ); \
-    Text[ en-US ] = "~Moving Average"; \
-}; \
-FixedImage FI_NONE \
-{ \
-    Pos = MAP_APPFONT( 10, 18 ); \
-    Size = MAP_APPFONT( 18, 18 ); \
-}; \
-FixedImage FI_LINEAR \
-{ \
-    Pos = MAP_APPFONT( 10, 18 + yoffset ); \
-    Size = MAP_APPFONT( 18, 18 ); \
-}; \
-FixedImage FI_LOGARITHMIC \
-{ \
-    Pos = MAP_APPFONT( 10, 40 + yoffset ); \
-    Size = MAP_APPFONT( 18, 18 ); \
-}; \
-FixedImage FI_EXPONENTIAL \
-{ \
-    Pos = MAP_APPFONT( 10, 62 + yoffset ); \
-    Size = MAP_APPFONT( 18, 18 ); \
-}; \
-FixedImage FI_POWER \
-{ \
-    Pos = MAP_APPFONT( 10, 84 + yoffset ); \
-    Size = MAP_APPFONT( 18, 18 ); \
-}; \
-FixedImage FI_POLYNOMIAL \
-{ \
-    Pos = MAP_APPFONT( 110, 18 + yoffset ); \
-    Size = MAP_APPFONT( 18, 18 ); \
-}; \
-FixedImage FI_MOVING_AVERAGE \
-{ \
-    Pos = MAP_APPFONT( 110, 62 + yoffset ); \
-    Size = MAP_APPFONT( 18, 18 ); \
-}; \
-FixedText FT_DEGREE \
-{ \
-    Pos = MAP_APPFONT ( 110, 44 + yoffset  ) ; \
-    Size = MAP_APPFONT ( 20 , 12 ) ; \
-    Text [ en-US ] = "Degree"; \
-}; \
-NumericField NF_DEGREE \
-{ \
-    Border = TRUE ; \
-    Pos = MAP_APPFONT ( 132, 42 + yoffset  ) ; \
-    Size = MAP_APPFONT ( 28 , 12 ) ; \
-    TabStop = TRUE ; \
-    Repeat = TRUE ; \
-    Spin = TRUE ; \
-    StrictFormat = TRUE ; \
-    SpinSize = 1 ; \
-    Minimum = 2 ; \
-    Maximum = 100 ; \
-}; \
-FixedText FT_PERIOD \
-{ \
-    Pos = MAP_APPFONT ( 110, 88 + yoffset  ) ; \
-    Size = MAP_APPFONT ( 20 , 12 ) ; \
-    Text [ en-US ] = "Period"; \
-}; \
-NumericField NF_PERIOD \
-{ \
-    Border = TRUE ; \
-    Pos = MAP_APPFONT ( 132, 86 + yoffset  ) ; \
-    Size = MAP_APPFONT ( 28 , 12 ) ; \
-    TabStop = TRUE ; \
-    Repeat = TRUE ; \
-    Spin = TRUE ; \
-    StrictFormat = TRUE ; \
-    SpinSize = 1 ; \
-    Minimum = 2 ; \
-    Maximum = 100 ; \
-}; \
-FixedLine FL_EQUATION \
-{ \
-    Pos = MAP_APPFONT( 6, 108 + yoffset ); \
-    Size = MAP_APPFONT( availablewidth - 12, 8 ); \
-    Text[ en-US ] = "Options"; \
-}; \
-FixedText FT_EXTRAPOLATE_FORWARD \
-{ \
-    Pos = MAP_APPFONT ( 10, 120 + yoffset  ) ; \
-    Size = MAP_APPFONT ( 70 , 12 ) ; \
-    Text [ en-US ] = "Extrapolate ~forward"; \
-}; \
-NumericField NF_EXTRAPOLATE_FORWARD \
-{ \
-    Border = TRUE ; \
-    Pos = MAP_APPFONT ( 80, 118 + yoffset  ) ; \
-    Size = MAP_APPFONT ( 40 , 12 ) ; \
-    TabStop = TRUE ; \
-    Repeat = TRUE ; \
-    Spin = TRUE ; \
-    StrictFormat = TRUE ; \
-    SpinSize = 50 ; \
-    Minimum = 0 ; \
-    Maximum = 10000 ; \
-    DecimalDigits = 2 ; \
-}; \
-FixedText FT_EXTRAPOLATE_BACKWARD \
-{ \
-    Pos = MAP_APPFONT ( 10, 134 + yoffset  ) ; \
-    Size = MAP_APPFONT ( 70 , 12 ) ; \
-    Text [ en-US ] = "Extrapolate ~backward"; \
-}; \
-NumericField NF_EXTRAPOLATE_BACKWARD \
-{ \
-    Border = TRUE ; \
-    Pos = MAP_APPFONT ( 80, 132 + yoffset  ) ; \
-    Size = MAP_APPFONT ( 40 , 12 ) ; \
-    TabStop = TRUE ; \
-    Repeat = TRUE ; \
-    Spin = TRUE ; \
-    StrictFormat = TRUE ; \
-    SpinSize = 50 ; \
-    Minimum = 0 ; \
-    Maximum = 10000 ; \
-    DecimalDigits = 2 ; \
-}; \
-CheckBox CB_SET_INTERCEPT \
-{ \
-    HelpId = HID_SCH_TRENDLINE_SHOW_EQUATION; \
-    Pos = MAP_APPFONT( 10, 148 + yoffset ); \
-    Size = MAP_APPFONT( 60, 12 ); \
-    TabStop = TRUE; \
-    Text[ en-US ] = "Force ~intercept"; \
-}; \
-NumericField NF_INTERCEPT_VALUE \
-{ \
-    Border = TRUE ; \
-    Pos = MAP_APPFONT ( 80, 146 + yoffset  ) ; \
-    Size = MAP_APPFONT ( 40 , 12 ) ; \
-    TabStop = TRUE ; \
-    Spin = TRUE ; \
-    SpinSize = 1000 ; \
-    DecimalDigits = 4 ; \
-}; \
-CheckBox CB_SHOW_EQUATION \
-{ \
-    HelpId = HID_SCH_TRENDLINE_SHOW_EQUATION; \
-    Pos = MAP_APPFONT( 10, 162 + yoffset ); \
-    Size = MAP_APPFONT( availablewidth - 20, 10 ); \
-    TabStop = TRUE; \
-    Text[ en-US ] = "Show ~equation"; \
-}; \
-CheckBox CB_SHOW_CORRELATION_COEFF \
-{ \
-    HelpId = HID_SCH_TRENDLINE_SHOW_R_SQUARED; \
-    Pos = MAP_APPFONT( 10, 176 + yoffset ); \
-    Size = MAP_APPFONT( availablewidth - 20, 10 ); \
-    TabStop = TRUE; \
-    Text[ en-US ] = "Show ~coefficient of determination (R²)"; \
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/tp_Trendline.cxx b/chart2/source/controller/dialogs/tp_Trendline.cxx
index 8c0a787..448fe85 100644
--- a/chart2/source/controller/dialogs/tp_Trendline.cxx
+++ b/chart2/source/controller/dialogs/tp_Trendline.cxx
@@ -29,7 +29,7 @@ namespace chart
 
 TrendlineTabPage::TrendlineTabPage( Window* pParent, const SfxItemSet& rInAttrs ) :
         SfxTabPage( pParent, SchResId( TP_TRENDLINE ), rInAttrs ),
-        m_aTrendlineResources( this, rInAttrs, false )
+        m_aTrendlineResources( this, rInAttrs )
 {
     FreeResource();
 }
diff --git a/chart2/source/controller/dialogs/res_Trendline_IDs.hrc b/chart2/source/controller/dialogs/tp_Trendline.hrc
similarity index 97%
rename from chart2/source/controller/dialogs/res_Trendline_IDs.hrc
rename to chart2/source/controller/dialogs/tp_Trendline.hrc
index cb9e8d8..5ecfb77db 100644
--- a/chart2/source/controller/dialogs/res_Trendline_IDs.hrc
+++ b/chart2/source/controller/dialogs/tp_Trendline.hrc
@@ -20,7 +20,6 @@
 #define FL_TYPE 1
 #define FL_EQUATION 2
 
-#define FI_NONE 1
 #define FI_LINEAR 2
 #define FI_LOGARITHMIC 3
 #define FI_EXPONENTIAL 4
@@ -39,7 +38,6 @@
 #define FT_EXTRAPOLATE_FORWARD 3
 #define FT_EXTRAPOLATE_BACKWARD 4
 
-#define RB_NONE 1
 #define RB_LINEAR 2
 #define RB_LOGARITHMIC 3
 #define RB_EXPONENTIAL 4
diff --git a/chart2/source/controller/dialogs/tp_Trendline.src b/chart2/source/controller/dialogs/tp_Trendline.src
index 37a7082..2ed7dea 100644
--- a/chart2/source/controller/dialogs/tp_Trendline.src
+++ b/chart2/source/controller/dialogs/tp_Trendline.src
@@ -18,7 +18,7 @@
  */
 #include "HelpIds.hrc"
 #include "TabPages.hrc"
-#include "res_Trendline.hrc"
+#include "tp_Trendline.hrc"
 
 TabPage TP_TRENDLINE
 {
@@ -26,7 +26,201 @@ TabPage TP_TRENDLINE
     Hide = TRUE ;
     SVLook = TRUE ;
     Size = MAP_APPFONT ( TP_WIDTH , TP_HEIGHT ) ;
-    RESOURCE_TRENDLINE( 260 - 12, 0 )
+
+    FixedLine FL_TYPE
+    {
+        Pos = MAP_APPFONT( 6 ,6  );
+        Size = MAP_APPFONT( 248 - 12 ,8 );
+        Text[ en-US ] = "Regression Type";
+    };
+    RadioButton RB_LINEAR
+    {
+        HelpId = HID_SCH_TRENDLINE_RB_LINEAR;
+        Pos = MAP_APPFONT( 29, 22 );
+        Size = MAP_APPFONT( 100, 10 );
+        Text[ en-US ] = "~Linear";
+    };
+    RadioButton RB_LOGARITHMIC
+    {
+        HelpId = HID_SCH_TRENDLINE_RB_LOGARITHMIC;
+        Pos = MAP_APPFONT( 29, 44 );
+        Size = MAP_APPFONT( 100, 10 );
+        Text[ en-US ] = "L~ogarithmic";
+    };
+    RadioButton RB_EXPONENTIAL
+    {
+        HelpId = HID_SCH_TRENDLINE_RB_EXPONENTIAL;
+        Pos = MAP_APPFONT( 29, 66 );
+        Size = MAP_APPFONT( 100, 10 );
+        Text[ en-US ] = "E~xponential";
+    };
+    RadioButton RB_POWER
+    {
+        HelpId = HID_SCH_TRENDLINE_RB_POWER;
+        Pos = MAP_APPFONT( 29, 88 );
+        Size = MAP_APPFONT( 100, 10 );
+        Text[ en-US ] = "~Power";
+    };
+    RadioButton RB_POLYNOMIAL
+    {
+        Pos = MAP_APPFONT( 130, 22 );
+        Size = MAP_APPFONT( 70, 10 );
+        Text[ en-US ] = "~Polynomial";
+    };
+    RadioButton RB_MOVING_AVERAGE
+    {
+        Pos = MAP_APPFONT( 130, 66 );
+        Size = MAP_APPFONT( 70, 10 );
+        Text[ en-US ] = "~Moving Average";
+    };
+    FixedImage FI_LINEAR
+    {
+        Pos = MAP_APPFONT( 10, 18 );
+        Size = MAP_APPFONT( 18, 18 );
+    };
+    FixedImage FI_LOGARITHMIC
+    {
+        Pos = MAP_APPFONT( 10, 40 );
+        Size = MAP_APPFONT( 18, 18 );
+    };
+    FixedImage FI_EXPONENTIAL
+    {
+        Pos = MAP_APPFONT( 10, 62 );
+        Size = MAP_APPFONT( 18, 18 );
+    };
+    FixedImage FI_POWER
+    {
+        Pos = MAP_APPFONT( 10, 84 );
+        Size = MAP_APPFONT( 18, 18 );
+    };
+    FixedImage FI_POLYNOMIAL
+    {
+        Pos = MAP_APPFONT( 110, 18 );
+        Size = MAP_APPFONT( 18, 18 );
+    };
+    FixedImage FI_MOVING_AVERAGE
+    {
+        Pos = MAP_APPFONT( 110, 62 );
+        Size = MAP_APPFONT( 18, 18 );
+    };
+    FixedText FT_DEGREE
+    {
+        Pos = MAP_APPFONT ( 110, 44 ) ;
+        Size = MAP_APPFONT ( 20 , 12 ) ;
+        Text [ en-US ] = "Degree";
+    };
+    NumericField NF_DEGREE
+    {
+        Border = TRUE ;
+        Pos = MAP_APPFONT ( 132, 42 ) ;
+        Size = MAP_APPFONT ( 28 , 12 ) ;
+        TabStop = TRUE ;
+        Repeat = TRUE ;
+        Spin = TRUE ;
+        StrictFormat = TRUE ;
+        SpinSize = 1 ;
+        Minimum = 2 ;
+        Maximum = 100 ;
+    };
+    FixedText FT_PERIOD
+    {
+        Pos = MAP_APPFONT ( 110, 88 ) ;
+        Size = MAP_APPFONT ( 20 , 12 ) ;
+        Text [ en-US ] = "Period";
+    };
+    NumericField NF_PERIOD
+    {
+        Border = TRUE ;
+        Pos = MAP_APPFONT ( 132, 86 ) ;
+        Size = MAP_APPFONT ( 28 , 12 ) ;
+        TabStop = TRUE ;
+        Repeat = TRUE ;
+        Spin = TRUE ;
+        StrictFormat = TRUE ;
+        SpinSize = 1 ;
+        Minimum = 2 ;
+        Maximum = 100 ;
+    };
+    FixedLine FL_EQUATION
+    {
+        Pos = MAP_APPFONT( 6, 108 );
+        Size = MAP_APPFONT( 248 - 12, 8 );
+        Text[ en-US ] = "Options";
+    };
+    FixedText FT_EXTRAPOLATE_FORWARD
+    {
+        Pos = MAP_APPFONT ( 10, 120 ) ;
+        Size = MAP_APPFONT ( 70 , 12 ) ;
+        Text [ en-US ] = "Extrapolate ~forward";
+    };
+    NumericField NF_EXTRAPOLATE_FORWARD
+    {
+        Border = TRUE ;
+        Pos = MAP_APPFONT ( 80, 118 ) ;
+        Size = MAP_APPFONT ( 40 , 12 ) ;
+        TabStop = TRUE ;
+        Repeat = TRUE ;
+        Spin = TRUE ;
+        StrictFormat = TRUE ;
+        SpinSize = 50 ;
+        Minimum = 0 ;
+        Maximum = 10000 ;
+        DecimalDigits = 2 ;
+    };
+    FixedText FT_EXTRAPOLATE_BACKWARD
+    {
+        Pos = MAP_APPFONT ( 10, 134 ) ;
+        Size = MAP_APPFONT ( 70 , 12 ) ;
+        Text [ en-US ] = "Extrapolate ~backward";
+    };
+    NumericField NF_EXTRAPOLATE_BACKWARD
+    {
+        Border = TRUE ;
+        Pos = MAP_APPFONT ( 80, 132 ) ;
+        Size = MAP_APPFONT ( 40 , 12 ) ;
+        TabStop = TRUE ;
+        Repeat = TRUE ;
+        Spin = TRUE ;
+        StrictFormat = TRUE ;
+        SpinSize = 50 ;
+        Minimum = 0 ;
+        Maximum = 10000 ;
+        DecimalDigits = 2 ;
+    };
+    CheckBox CB_SET_INTERCEPT
+    {
+        HelpId = HID_SCH_TRENDLINE_SHOW_EQUATION;
+        Pos = MAP_APPFONT( 10, 148 );
+        Size = MAP_APPFONT( 60, 12 );
+        TabStop = TRUE;
+        Text[ en-US ] = "Force ~intercept";
+    };
+    NumericField NF_INTERCEPT_VALUE
+    {
+        Border = TRUE ;
+        Pos = MAP_APPFONT ( 80, 146 ) ;
+        Size = MAP_APPFONT ( 40 , 12 ) ;
+        TabStop = TRUE ;
+        Spin = TRUE ;
+        SpinSize = 1000 ;
+        DecimalDigits = 4 ;
+    };
+    CheckBox CB_SHOW_EQUATION
+    {
+        HelpId = HID_SCH_TRENDLINE_SHOW_EQUATION;
+        Pos = MAP_APPFONT( 10, 162 );
+        Size = MAP_APPFONT( 248 - 20, 10 );
+        TabStop = TRUE;
+        Text[ en-US ] = "Show ~equation";
+    };
+    CheckBox CB_SHOW_CORRELATION_COEFF
+    {
+        HelpId = HID_SCH_TRENDLINE_SHOW_R_SQUARED;
+        Pos = MAP_APPFONT( 10, 176 );
+        Size = MAP_APPFONT( 248 - 20, 10 );
+        TabStop = TRUE;
+        Text[ en-US ] = "Show ~coefficient of determination (R²)";
+    };
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit b412ee7b238bd420296c4d7714b28c57d31c113a
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Wed Jul 3 18:35:11 2013 +0200

    Fix bad merge of CharController_Window
    
    Change-Id: I6d947d90f0505c29b4e301bc1ff30216aa0ed476

diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index 3591180..208bf0a 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -1129,9 +1129,7 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
                     }
 
                     if( bHasDataLabelsAtSeries )
-                        lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatDataLabels" );
-                    //if( xTrendline.is() )
-                    //    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatTrendline" );
+                        lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatDataLabels" );
                     if( bHasEquation )
                         lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendlineEquation" );
                     if( xMeanValue.is() )
@@ -1144,12 +1142,9 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
                     xPopupMenu->insertSeparator( -1 );
 
                     if( !bHasDataLabelsAtSeries )
-                        lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertDataLabels" );
+                        lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertDataLabels" );
 
-                    //if( !xTrendline.is() )
-                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendline" );
-                    //else if( !bHasEquation )
-                    //lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendlineEquation" );
+                    lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendline" );
 
                     if( !xMeanValue.is() )
                         lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertMeanValue" );
@@ -1157,12 +1152,8 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
                         lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertXErrorBars" );
                     if( !bHasYErrorBars )
                         lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertYErrorBars" );
-
-
                     if( bHasDataLabelsAtSeries || ( bHasDataLabelsAtPoints && bHasFormattedDataPointsOtherThanSelected ) )
-                        lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteDataLabels" );
-                    //if( xTrendline.is() )
-                    //    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteTrendline" );
+                        lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteDataLabels" );
                     if( bHasEquation )
                         lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendlineEquation" );
                     if( xMeanValue.is() )
@@ -1193,13 +1184,13 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
                 }
                 else if( OBJECTTYPE_DATA_CURVE == eObjectType )
                 {
-                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteTrendline" );
-                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatTrendlineEquation" );
-                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendlineEquation" );
-                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendlineEquationAndR2" );
-                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertR2Value" );
-                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteTrendlineEquation" );
-                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteR2Value" );
+                    lcl_insertMenuCommand( xPopupMenu,  nUniqueId++, ".uno:DeleteTrendline" );
+                    lcl_insertMenuCommand( xPopupMenu,  nUniqueId++, ".uno:FormatTrendlineEquation" );
+                    lcl_insertMenuCommand( xPopupMenu,  nUniqueId++, ".uno:InsertTrendlineEquation" );
+                    lcl_insertMenuCommand( xPopupMenu,  nUniqueId++, ".uno:InsertTrendlineEquationAndR2" );
+                    lcl_insertMenuCommand( xPopupMenu,  nUniqueId++, ".uno:InsertR2Value" );
+                    lcl_insertMenuCommand( xPopupMenu,  nUniqueId++, ".uno:DeleteTrendlineEquation" );
+                    lcl_insertMenuCommand( xPopupMenu,  nUniqueId++, ".uno:DeleteR2Value" );
                 }
                 else if( OBJECTTYPE_DATA_CURVE_EQUATION == eObjectType )
                 {
commit 9408a1d008487cbeafd2dc4705eda2fae9547aab
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Tue Jul 2 21:01:36 2013 +0200

    Draw MeanValue in chart bounds, smarter define no. of curve points.
    
    Change-Id: Ida8006af7f2771ee5f2c425d5c72df4cdba827b5

diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index e1f1fe1..6a9a62a 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -966,22 +966,26 @@ void VSeriesPlotter::createErrorBar_Y( const drawing::Position3D& rUnscaledLogic
 void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries& rVDataSeries,
                             const uno::Reference< drawing::XShapes >& xTarget,
                             const uno::Reference< drawing::XShapes >& xEquationTarget,
-                            bool bMaySkipPointsInRegressionCalculation )
+                            bool bMaySkipPoints )
 {
     if(m_nDimension!=2)
         return;
-    uno::Reference< XRegressionCurveContainer > xRegressionContainer(
-                rVDataSeries.getModel(), uno::UNO_QUERY );
-    if(!xRegressionContainer.is())
+    uno::Reference< XRegressionCurveContainer > xContainer( rVDataSeries.getModel(), uno::UNO_QUERY );
+    if(!xContainer.is())
         return;
 
-    uno::Sequence< uno::Reference< XRegressionCurve > > aCurveList =
-        xRegressionContainer->getRegressionCurves();
+    uno::Sequence< uno::Reference< XRegressionCurve > > aCurveList = xContainer->getRegressionCurves();
 
     for(sal_Int32 nN=0; nN<aCurveList.getLength(); nN++)
     {
+        uno::Reference< XRegressionCurveCalculator > xCalculator( aCurveList[nN]->getCalculator() );
+        if( !xCalculator.is())
+            continue;
+
         uno::Reference< beans::XPropertySet > xProperties( aCurveList[nN], uno::UNO_QUERY );
 
+        bool bAverageLine = RegressionCurveHelper::isMeanValueLine( aCurveList[nN] );
+
         sal_Int32 aDegree = 2;
         sal_Int32 aPeriod = 2;
         double aExtrapolateForward = 0.0;
@@ -989,7 +993,7 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries& rVDataSeries,
         sal_Bool aForceIntercept = false;
         double aInterceptValue = 0.0;
 
-        if ( xProperties.is() )
+        if ( xProperties.is() && !bAverageLine )
         {
             xProperties->getPropertyValue( "PolynomialDegree") >>= aDegree;
             xProperties->getPropertyValue( "MovingAveragePeriod") >>= aPeriod;
@@ -1000,29 +1004,40 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries& rVDataSeries,
                 xProperties->getPropertyValue( "InterceptValue") >>= aInterceptValue;
         }
 
-        uno::Reference< XRegressionCurveCalculator > xRegressionCurveCalculator( aCurveList[nN]->getCalculator() );
-
-        if( ! xRegressionCurveCalculator.is())
-            continue;
-
         double fMinX;
         double fMaxX;
 
-        rVDataSeries.getMinMaxXValue(fMinX, fMaxX);
-        fMaxX += aExtrapolateForward;
-        fMinX -= aExtrapolateBackward;
+        double fChartMinX = m_pPosHelper->getLogicMinX();
+        double fChartMaxX = m_pPosHelper->getLogicMaxX();
 
-        xRegressionCurveCalculator->setRegressionProperties(aDegree, aForceIntercept, aInterceptValue, aPeriod);
-        xRegressionCurveCalculator->recalculateRegression( rVDataSeries.getAllX(), rVDataSeries.getAllY() );
+        double fPointScale = 1.0;
+
+        if( bAverageLine )
+        {
+            fMinX = fChartMinX;
+            fMaxX = fChartMaxX;
+        }
+        else
+        {
+            rVDataSeries.getMinMaxXValue(fMinX, fMaxX);
+            fMaxX += aExtrapolateForward;
+            fMinX -= aExtrapolateBackward;
+
+            fPointScale = (fMaxX - fMinX) / (fChartMaxX - fChartMinX);
+        }
+
+        xCalculator->setRegressionProperties(aDegree, aForceIntercept, aInterceptValue, aPeriod);
+        xCalculator->recalculateRegression( rVDataSeries.getAllX(), rVDataSeries.getAllY() );
+
+        sal_Int32 nPointCount = 100 * fPointScale;
 
-        sal_Int32 nRegressionPointCount = 100; //@todo find a more optimal solution if more complicated curve types are introduced
         drawing::PolyPolygonShape3D aRegressionPoly;
         aRegressionPoly.SequenceX.realloc(1);
         aRegressionPoly.SequenceY.realloc(1);
         aRegressionPoly.SequenceZ.realloc(1);
-        aRegressionPoly.SequenceX[0].realloc(nRegressionPointCount);
-        aRegressionPoly.SequenceY[0].realloc(nRegressionPointCount);
-        aRegressionPoly.SequenceZ[0].realloc(nRegressionPointCount);
+        aRegressionPoly.SequenceX[0].realloc(nPointCount);
+        aRegressionPoly.SequenceY[0].realloc(nPointCount);
+        aRegressionPoly.SequenceZ[0].realloc(nPointCount);
         sal_Int32 nRealPointCount=0;
 
         std::vector< ExplicitScaleData > aScales( m_pPosHelper->getScales());
@@ -1035,16 +1050,15 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries& rVDataSeries,
         }
 
         uno::Sequence< geometry::RealPoint2D > aCalculatedPoints(
-            xRegressionCurveCalculator->getCurveValues(
-                fMinX, fMaxX, nRegressionPointCount, xScalingX, xScalingY, bMaySkipPointsInRegressionCalculation ));
-        nRegressionPointCount = aCalculatedPoints.getLength();
-        bool bAverageLine = RegressionCurveHelper::isMeanValueLine( aCurveList[nN] );
+            xCalculator->getCurveValues(
+                            fMinX, fMaxX, nPointCount,
+                            xScalingX, xScalingY, bMaySkipPoints ));
 
-        for(sal_Int32 nP=0; nP<nRegressionPointCount; nP++)
+        for(sal_Int32 nP=0; nP<aCalculatedPoints.getLength(); nP++)
         {
             double fLogicX = aCalculatedPoints[nP].X;
             double fLogicY = aCalculatedPoints[nP].Y;
-            double fLogicZ = 0.0;//dummy
+            double fLogicZ = 0.0; //dummy
 
             // fdo#51656: don't scale mean value lines
             if(!bAverageLine)
@@ -1089,7 +1103,7 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries& rVDataSeries,
         {
             createRegressionCurveEquationShapes(
                 rVDataSeries.getDataCurveEquationCID( nN ),
-                xEquationProperties, xEquationTarget, xRegressionCurveCalculator,
+                xEquationProperties, xEquationTarget, xCalculator,
                 aDefaultPos );
         }
     }
commit 95314b1fd4ccca11276ebd11aa2f47b9d436d29e
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Tue Jul 2 18:38:45 2013 +0200

    Fix problem with intercept = 0.0
    
    Change-Id: Ieeea09d9f93a4405ec6c33c1a646b0940d5d17a2

diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 9114381..e1f1fe1 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -987,8 +987,7 @@ void VSeriesPlotter::createRegressionCurvesShapes( VDataSeries& rVDataSeries,
         double aExtrapolateForward = 0.0;
         double aExtrapolateBackward = 0.0;
         sal_Bool aForceIntercept = false;
-        double aInterceptValue;
-        rtl::math::setNan(&aInterceptValue);
+        double aInterceptValue = 0.0;
 
         if ( xProperties.is() )
         {
commit 362635961a254f80581b31ba7d6957dc111d3515
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Mon Jul 1 22:32:35 2013 +0200

    Remove InsertTrendlineDialog as it is not used anymore.
    
    Change-Id: I58dbdc416254e631f33784bb2a2cf124e69fc69a

diff --git a/chart2/AllLangResTarget_chartcontroller.mk b/chart2/AllLangResTarget_chartcontroller.mk
index 0da17b2..006266a 100644
--- a/chart2/AllLangResTarget_chartcontroller.mk
+++ b/chart2/AllLangResTarget_chartcontroller.mk
@@ -37,7 +37,6 @@ $(eval $(call gb_SrsTarget_add_files,chart2/res,\
     chart2/source/controller/dialogs/dlg_InsertErrorBars.src \
     chart2/source/controller/dialogs/dlg_InsertLegend.src \
     chart2/source/controller/dialogs/dlg_InsertTitle.src \
-    chart2/source/controller/dialogs/dlg_InsertTrendline.src \
     chart2/source/controller/dialogs/dlg_ObjectProperties.src \
     chart2/source/controller/dialogs/dlg_ShapeFont.src \
     chart2/source/controller/dialogs/dlg_ShapeParagraph.src \
diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk
index 45e4266..e90f716 100644
--- a/chart2/Library_chartcontroller.mk
+++ b/chart2/Library_chartcontroller.mk
@@ -98,7 +98,6 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
     chart2/source/controller/dialogs/dlg_InsertErrorBars \
     chart2/source/controller/dialogs/dlg_InsertLegend \
     chart2/source/controller/dialogs/dlg_InsertTitle \
-    chart2/source/controller/dialogs/dlg_InsertTrendline \
     chart2/source/controller/dialogs/dlg_NumberFormat \
     chart2/source/controller/dialogs/dlg_ObjectProperties \
     chart2/source/controller/dialogs/dlg_ShapeFont \
diff --git a/chart2/source/controller/dialogs/dlg_InsertTrendline.cxx b/chart2/source/controller/dialogs/dlg_InsertTrendline.cxx
deleted file mode 100644
index a00e424..0000000
--- a/chart2/source/controller/dialogs/dlg_InsertTrendline.cxx
+++ /dev/null
@@ -1,106 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-#include "dlg_InsertTrendline.hxx"
-#include "dlg_InsertTrendline.hrc"
-#include "res_Trendline.hxx"
-#include "ResourceIds.hrc"
-#include "ResId.hxx"
-#include "Strings.hrc"
-#include "chartview/ExplicitValueProvider.hxx"
-#include "ChartModelHelper.hxx"
-#include "ObjectIdentifier.hxx"
-#include "DiagramHelper.hxx"
-#include "AxisHelper.hxx"
-#include "ObjectNameProvider.hxx"
-#include <com/sun/star/chart2/XAxis.hpp>
-#include <com/sun/star/chart2/XDiagram.hpp>
-
-#include <svtools/controldims.hrc>
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::chart2;
-
-namespace
-{
-void lcl_SetControlXPos( Control & rControl, long nPosPixel )
-{
-    Point aPos( rControl.GetPosPixel());
-    aPos.setX( nPosPixel );
-    rControl.SetPosPixel( aPos );
-}
-} // anonymous namespace
-
-//.............................................................................
-namespace chart
-{
-//.............................................................................
-
-InsertTrendlineDialog::InsertTrendlineDialog( Window* pParent, const SfxItemSet& rMyAttrs ) :
-        ModalDialog( pParent, SchResId( DLG_DATA_TRENDLINE )),
-        rInAttrs( rMyAttrs ),
-        aBtnOK( this, SchResId( BTN_OK )),
-        aBtnCancel( this, SchResId( BTN_CANCEL )),
-        aBtnHelp( this, SchResId( BTN_HELP )),
-        m_apTrendlineResources( new TrendlineResources( this, rInAttrs, true ))
-{
-    FreeResource();
-    this->SetText( ObjectNameProvider::getName_ObjectForAllSeries( OBJECTTYPE_DATA_CURVE ) );
-}
-
-InsertTrendlineDialog::~InsertTrendlineDialog()
-{
-}
-
-void InsertTrendlineDialog::adjustSize()
-{
-    long nControlsRightEdge = m_apTrendlineResources->adjustControlSizes();
-    long nButtonXPos = nControlsRightEdge +
-        LogicToPixel( Size( RSC_SP_CTRL_X, 10 ), MapMode( MAP_APPFONT )).getWidth();
-    lcl_SetControlXPos( aBtnOK, nButtonXPos );
-    lcl_SetControlXPos( aBtnCancel, nButtonXPos );
-    lcl_SetControlXPos( aBtnHelp, nButtonXPos );
-
-    Size aDialogSize( GetSizePixel());
-    aDialogSize.setWidth(
-        nControlsRightEdge +
-        LogicToPixel( Size( RSC_SP_CTRL_X + RSC_CD_PUSHBUTTON_WIDTH + RSC_SP_DLG_INNERBORDER_RIGHT, 0 ),
-                      MapMode( MAP_APPFONT )).getWidth());
-    SetSizePixel( aDialogSize );
-}
-
-void InsertTrendlineDialog::FillItemSet(SfxItemSet& rOutAttrs)
-{
-    m_apTrendlineResources->FillItemSet(rOutAttrs);
-}
-
-void InsertTrendlineDialog::DataChanged( const DataChangedEvent& rDCEvt )
-{
-    ModalDialog::DataChanged( rDCEvt );
-
-    if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
-        m_apTrendlineResources->FillValueSets();
-}
-
-//.............................................................................
-} //namespace chart
-//.............................................................................
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/dlg_InsertTrendline.hrc b/chart2/source/controller/dialogs/dlg_InsertTrendline.hrc
deleted file mode 100644
index fd728a0..0000000
--- a/chart2/source/controller/dialogs/dlg_InsertTrendline.hrc
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#include "ResourceIds.hrc"
-
-#define BTN_OK 1
-#define BTN_CANCEL 1
-#define BTN_HELP 1
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/dlg_InsertTrendline.src b/chart2/source/controller/dialogs/dlg_InsertTrendline.src
deleted file mode 100644
index 2b8b621..0000000
--- a/chart2/source/controller/dialogs/dlg_InsertTrendline.src
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include "dlg_InsertTrendline.hrc"
-#include "HelpIds.hrc"
-#include "CommonResources.hrc"
-#include "res_Trendline.hrc"
-
-// is only an initial size, will be calculated to contain all controls
-#define DLG_DATA_TRENDLINE_RES_WIDTH   130
-#define DLG_DATA_TRENDLINE_ADD_TO_RES   62
-
-ModalDialog DLG_DATA_TRENDLINE
-{
-    HelpID = HID_INSERT_STATISTICS ;
-    OutputSize = TRUE ;
-    SVLook = TRUE ;
-    Size = MAP_APPFONT( DLG_DATA_TRENDLINE_RES_WIDTH + DLG_DATA_TRENDLINE_ADD_TO_RES, 220 );
-    Moveable = TRUE ;
-    BUTTONS_OK_CANCEL_HELP_STACKED( DLG_DATA_TRENDLINE_RES_WIDTH + DLG_DATA_TRENDLINE_ADD_TO_RES )
-    RESOURCE_TRENDLINE( DLG_DATA_TRENDLINE_RES_WIDTH, 22 )
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/dialogs/res_Trendline.cxx b/chart2/source/controller/dialogs/res_Trendline.cxx
index 316282c..75f08dc 100644
--- a/chart2/source/controller/dialogs/res_Trendline.cxx
+++ b/chart2/source/controller/dialogs/res_Trendline.cxx
@@ -18,7 +18,6 @@
  */
 
 
-#include "dlg_InsertTrendline.hrc"
 #include "res_Trendline.hxx"
 #include "res_Trendline_IDs.hrc"
 #include "ResId.hxx"
diff --git a/chart2/source/controller/inc/dlg_InsertTrendline.hxx b/chart2/source/controller/inc/dlg_InsertTrendline.hxx
deleted file mode 100644
index 2b07684..0000000
--- a/chart2/source/controller/inc/dlg_InsertTrendline.hxx
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef _CHART2_DLG_INSERT_TRENDLINE_HXX
-#define _CHART2_DLG_INSERT_TRENDLINE_HXX
-
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <svl/itemset.hxx>
-#include <memory>
-
-//.............................................................................
-namespace chart
-{
-//.............................................................................
-
-class TrendlineResources;
-class InsertTrendlineDialog : public ModalDialog
-{
-public:
-    InsertTrendlineDialog( Window* pParent, const SfxItemSet& rMyAttrs );
-    virtual ~InsertTrendlineDialog();
-
-    void FillItemSet( SfxItemSet& rOutAttrs );
-    virtual void DataChanged( const DataChangedEvent& rDCEvt );
-
-    // sets the size so that all control texts fit. Has to be done after
-    // complete construction of the dialog
-    void adjustSize();
-
-private:
-    const SfxItemSet & rInAttrs;
-
-    OKButton          aBtnOK;
-    CancelButton      aBtnCancel;
-    HelpButton        aBtnHelp;
-
-    ::std::auto_ptr< TrendlineResources >    m_apTrendlineResources;
-};
-
-//.............................................................................
-} //namespace chart
-//.............................................................................
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 9b882db..08c4610 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -22,7 +22,6 @@
 #include "dlg_InsertAxis_Grid.hxx"
 #include "dlg_InsertDataLabel.hxx"
 #include "dlg_InsertLegend.hxx"
-#include "dlg_InsertTrendline.hxx"
 #include "dlg_InsertErrorBars.hxx"
 #include "dlg_InsertTitle.hxx"
 #include "dlg_ObjectProperties.hxx"
commit b0fbaa6fa28df570e8179f166fe0547892b2dbc7
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Mon Jul 1 22:16:15 2013 +0200

    Adding multiple trendlines with menu item Insert>Trend Lines..
    
    Menu item "Insert>Trend Lines.." allowed adding trendlines for all
    data series at the same time. As we can now have more trendlines
    per one data series this becomes cumbersome so only allow to add
    a trend line when data series is selected or known.
    
    Change-Id: I676876f389d00d3fbe668d429f0f98bd8c8d4d3d

diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx
index 86123f8..9b882db 100644
--- a/chart2/source/controller/main/ChartController_Insert.cxx
+++ b/chart2/source/controller/main/ChartController_Insert.cxx
@@ -363,48 +363,15 @@ void ChartController::executeDispatch_InsertMenu_MeanValues()
 
 void ChartController::executeDispatch_InsertMenu_Trendlines()
 {
-    //if a series is selected insert only for that series:
-    uno::Reference< chart2::XDataSeries > xSeries(
-        ObjectIdentifier::getDataSeriesForCID( m_aSelection.getSelectedCID(), getModel() ), uno::UNO_QUERY );
-    if( xSeries.is())
-    {
-        executeDispatch_InsertTrendline();
-        return;
-    }
-
-    UndoGuard aUndoGuard(
-        ActionDescriptionProvider::createDescription(
-            ActionDescriptionProvider::INSERT, ObjectNameProvider::getName_ObjectForAllSeries( OBJECTTYPE_DATA_CURVE ) ),
-        m_xUndoManager );
-
-    try
-    {
-        wrapper::AllSeriesStatisticsConverter aItemConverter(
-            getModel(), m_pDrawModelWrapper->GetItemPool() );
-        SfxItemSet aItemSet = aItemConverter.CreateEmptyItemSet();
-        aItemConverter.FillItemSet( aItemSet );
+    OUString aCID = m_aSelection.getSelectedCID();
 
-        //prepare and open dialog
-        SolarMutexGuard aGuard;
-        InsertTrendlineDialog aDialog( m_pChartWindow, aItemSet );
-        aDialog.adjustSize();
+    uno::Reference< chart2::XDataSeries > xSeries(
+        ObjectIdentifier::getDataSeriesForCID( aCID, getModel() ), uno::UNO_QUERY );
 
-        if( aDialog.Execute() == RET_OK )
-        {
-            SfxItemSet aOutItemSet = aItemConverter.CreateEmptyItemSet();
-            aDialog.FillItemSet( aOutItemSet );
+    if( !xSeries.is() )
+        return;
 
-            // lock controllers till end of block
-            ControllerLockGuard aCLGuard( getModel() );
-            bool bChanged = aItemConverter.ApplyItemSet( aOutItemSet );//model should be changed now
-            if( bChanged )
-                aUndoGuard.commit();
-        }
-    }
-    catch(const uno::RuntimeException& e)
-    {
-        ASSERT_EXCEPTION( e );
-    }
+    executeDispatch_InsertTrendline();
 }
 
 void ChartController::executeDispatch_InsertTrendline()
@@ -420,14 +387,12 @@ void ChartController::executeDispatch_InsertTrendline()
             ActionDescriptionProvider::INSERT, String( SchResId( STR_OBJECT_CURVE ))),
         m_xUndoManager );
 
-    // add a linear curve
     uno::Reference< chart2::XRegressionCurve > xCurve =
         RegressionCurveHelper::addRegressionCurve(
             RegressionCurveHelper::REGRESSION_TYPE_LINEAR,
             xRegressionCurveContainer,
             m_xCC );
 
-    // get an appropriate item converter
     uno::Reference< beans::XPropertySet > xProperties( xCurve, uno::UNO_QUERY );
 
     if( !xProperties.is())
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index 6731998..abb74fc 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -117,6 +117,7 @@ struct ControllerState
     bool bMayMoveSeriesBackward;
 
     // trendlines
+    bool bMayAddMenuTrendline;
     bool bMayAddTrendline;
     bool bMayAddTrendlineEquation;
     bool bMayAddR2Value;
@@ -147,6 +148,7 @@ ControllerState::ControllerState() :
         bIsFormateableObjectSelected(false),
         bMayMoveSeriesForward( false ),
         bMayMoveSeriesBackward( false ),
+        bMayAddMenuTrendline( false ),
         bMayAddTrendline( false ),
         bMayAddTrendlineEquation( false ),
         bMayAddR2Value( false ),
@@ -208,6 +210,7 @@ void ControllerState::update(
             xGivenDataSeries,
             MOVE_SERIES_BACKWARD );
 
+        bMayAddMenuTrendline = false;
         bMayAddTrendline = false;
         bMayAddTrendlineEquation = false;
         bMayAddR2Value = false;
@@ -229,6 +232,7 @@ void ControllerState::update(
         {
             if( xGivenDataSeries.is())
             {
+                bMayAddMenuTrendline = true;
                 sal_Int32 nDimensionCount = DiagramHelper::getDimension( xDiagram );
                 uno::Reference< chart2::XChartType > xFirstChartType(
                     DataSeriesHelper::getChartTypeOfSeries( xGivenDataSeries, xDiagram ));
@@ -237,11 +241,9 @@ void ControllerState::update(
                 if( (OBJECTTYPE_DATA_SERIES == aObjectType || OBJECTTYPE_DATA_POINT == aObjectType)
                     && ChartTypeHelper::isSupportingRegressionProperties( xFirstChartType, nDimensionCount ))
                 {
-                    uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt(
-                        xGivenDataSeries, uno::UNO_QUERY );
+                    uno::Reference< chart2::XRegressionCurveContainer > xRegCurveCnt( xGivenDataSeries, uno::UNO_QUERY );
                     if( xRegCurveCnt.is())
                     {
-                        uno::Reference< chart2::XRegressionCurve > xRegCurve( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) );
                         // Trendline
                         bMayAddTrendline = true;
 
@@ -578,7 +580,7 @@ void ControllerCommandDispatch::updateCommandAvailability()
     m_aCommandAvailability[ ".uno:InsertMenuDataLabels" ] = bIsWritable;
     m_aCommandAvailability[ ".uno:InsertRemoveAxes" ] = m_aCommandAvailability[ ".uno:InsertMenuAxes" ] = bIsWritable && m_apModelState->bSupportsAxes;
     m_aCommandAvailability[ ".uno:InsertMenuGrids" ] = bIsWritable && m_apModelState->bSupportsAxes;
-    m_aCommandAvailability[ ".uno:InsertMenuTrendlines" ] = bIsWritable && m_apModelState->bSupportsStatistics;
+    m_aCommandAvailability[ ".uno:InsertMenuTrendlines" ] = bIsWritable && m_apModelState->bSupportsStatistics && m_apControllerState->bMayAddMenuTrendline;
     m_aCommandAvailability[ ".uno:InsertMenuMeanValues" ] = bIsWritable && m_apModelState->bSupportsStatistics;
     m_aCommandAvailability[ ".uno:InsertMenuXErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics;
     m_aCommandAvailability[ ".uno:InsertMenuYErrorBars" ] = bIsWritable && m_apModelState->bSupportsStatistics;
commit 0a21c4faea3a444a3b6c5a7561754c73310fb77c
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Mon Jul 1 19:30:49 2013 +0200

    use sal_Int32 instead of int in PolynomialRegressionCurveCalculator
    
    Change-Id: Icc3ffdda71482d1a716ea99e6cf8410bc2e39aa0

diff --git a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
index 0d3d4d1..50de7d3 100644
--- a/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/PolynomialRegressionCurveCalculator.cxx
@@ -48,14 +48,14 @@ void SAL_CALL PolynomialRegressionCurveCalculator::recalculateRegression(
     RegressionCalculationHelper::tDoubleVectorPair aValues(
         RegressionCalculationHelper::cleanup( aXValues, aYValues, RegressionCalculationHelper::isValid()));
 
-    int aNoElements = mForceIntercept ? mDegree : mDegree + 1;
-    int aNumberOfPowers = 2 * aNoElements - 1;
+    sal_Int32 aNoElements = mForceIntercept ? mDegree : mDegree + 1;
+    sal_Int32 aNumberOfPowers = 2 * aNoElements - 1;
 
     std::vector<double> aPowers;
     aPowers.resize(aNumberOfPowers, 0.0);
 
-    int aNoColumns = aNoElements;
-    int aNoRows    = aNoElements + 1;
+    sal_Int32 aNoColumns = aNoElements;
+    sal_Int32 aNoRows    = aNoElements + 1;
 
     std::vector<double> aMatrix;
     aMatrix.resize(aNoColumns * aNoRows, 0.0);
@@ -69,7 +69,7 @@ void SAL_CALL PolynomialRegressionCurveCalculator::recalculateRegression(
         double x = aValues.first[i];
         double y = aValues.second[i];
 
-        for (int j = 0; j < aNumberOfPowers; j++)
+        for (sal_Int32 j = 0; j < aNumberOfPowers; j++)
         {
             if (mForceIntercept)
                 aPowers[j] += std::pow(x, j + 2);
@@ -77,7 +77,7 @@ void SAL_CALL PolynomialRegressionCurveCalculator::recalculateRegression(
                 aPowers[j] += std::pow(x, j);
         }
 
-        for (int j = 0; j < aNoElements; j++)
+        for (sal_Int32 j = 0; j < aNoElements; j++)
         {
             if (mForceIntercept)
                 aMatrix[j * aNoRows + aNoElements] += std::pow(x, j + 1) * ( y - mInterceptValue );
@@ -90,9 +90,9 @@ void SAL_CALL PolynomialRegressionCurveCalculator::recalculateRegression(
 
     yAverage = yAverage / aNoValues;
 
-    for (int y = 0; y < aNoElements; y++)
+    for (sal_Int32 y = 0; y < aNoElements; y++)
     {
-        for (int x = 0; x < aNoElements; x++)
+        for (sal_Int32 x = 0; x < aNoElements; x++)
         {
             aMatrix[y * aNoRows + x] = aPowers[y + x];
         }
@@ -166,8 +166,8 @@ OUString PolynomialRegressionCurveCalculator::ImplGetRepresentation(
 {
     OUStringBuffer aBuf( "f(x) = ");
 
-    int aLastIndex = mResult.size() - 1;
-    for (int i = aLastIndex; i >= 0; i--)
+    sal_Int32 aLastIndex = mResult.size() - 1;
+    for (sal_Int32 i = aLastIndex; i >= 0; i--)
     {
         double aValue = mResult[i];
         if (aValue == 0.0)
commit 28293399e263a64299cfadafdfaf2817bc505713
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Sun Jun 30 23:14:06 2013 +0200

    Linear curve is polyinomial curve with degree = 1
    
    Change-Id: I3785afc7b18ab3f742e4ecc0e299baafc2bd6614

diff --git a/chart2/source/inc/LinearRegressionCurveCalculator.hxx b/chart2/source/inc/LinearRegressionCurveCalculator.hxx
index c2cc880..79c6d5d 100644
--- a/chart2/source/inc/LinearRegressionCurveCalculator.hxx
+++ b/chart2/source/inc/LinearRegressionCurveCalculator.hxx
@@ -20,44 +20,33 @@
 #define CHART2_LINEARREGRESSIONCURVECALCULATOR_HXX
 
 #include "RegressionCurveCalculator.hxx"
+#include "PolynomialRegressionCurveCalculator.hxx"
 
 namespace chart
 {
 
-class LinearRegressionCurveCalculator :
-        public RegressionCurveCalculator
+class LinearRegressionCurveCalculator : public PolynomialRegressionCurveCalculator
 {
 public:
     LinearRegressionCurveCalculator();
     virtual ~LinearRegressionCurveCalculator();
 
-protected:
-    virtual OUString ImplGetRepresentation(
-        const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >& xNumFormatter,
-        ::sal_Int32 nNumberFormatKey ) const;
-
 private:
-    // ____ XRegressionCurveCalculator ____
-    virtual void SAL_CALL recalculateRegression(
-        const ::com::sun::star::uno::Sequence< double >& aXValues,
-        const ::com::sun::star::uno::Sequence< double >& aYValues )
-        throw (::com::sun::star::uno::RuntimeException);
-    virtual double SAL_CALL getCurveValue( double x )
-        throw (::com::sun::star::lang::IllegalArgumentException,
-               ::com::sun::star::uno::RuntimeException);
-    virtual ::com::sun::star::uno::Sequence< ::com::sun::star::geometry::RealPoint2D > SAL_CALL getCurveValues(
+    virtual void SAL_CALL setRegressionProperties(
+        sal_Int32 aDegree,
+        sal_Bool  aForceIntercept,
+        double    aInterceptValue,
+        sal_Int32 aPeriod);
+
+    virtual com::sun::star::uno::Sequence< com::sun::star::geometry::RealPoint2D > SAL_CALL getCurveValues(
         double min,
         double max,
-        ::sal_Int32 nPointCount,
-        const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling >& xScalingX,
-        const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XScaling >& xScalingY,
-        ::sal_Bool bMaySkipPointsInCalculation )
-        throw (::com::sun::star::lang::IllegalArgumentException,
-               ::com::sun::star::uno::RuntimeException);
-
-    // formula is: f(x) = m_fSlope * x + m_fIntercept
-    double m_fSlope;
-    double m_fIntercept;
+        sal_Int32 nPointCount,
+        const com::sun::star::uno::Reference< com::sun::star::chart2::XScaling >& xScalingX,
+        const com::sun::star::uno::Reference< com::sun::star::chart2::XScaling >& xScalingY,
+        sal_Bool bMaySkipPointsInCalculation )
+        throw (com::sun::star::lang::IllegalArgumentException,
+               com::sun::star::uno::RuntimeException);
 };
 
 } //  namespace chart
diff --git a/chart2/source/inc/PolynomialRegressionCurveCalculator.hxx b/chart2/source/inc/PolynomialRegressionCurveCalculator.hxx
index 803abb6..e3b43a2 100644
--- a/chart2/source/inc/PolynomialRegressionCurveCalculator.hxx
+++ b/chart2/source/inc/PolynomialRegressionCurveCalculator.hxx
@@ -36,6 +36,10 @@ protected:
         const com::sun::star::uno::Reference< com::sun::star::util::XNumberFormatter >& xNumFormatter,
         sal_Int32 nNumberFormatKey ) const;
 
+    virtual double SAL_CALL getCurveValue( double x )
+        throw (com::sun::star::lang::IllegalArgumentException,
+               com::sun::star::uno::RuntimeException);
+
 private:
     // ____ XRegressionCurveCalculator ____
     virtual void SAL_CALL recalculateRegression(
@@ -43,11 +47,7 @@ private:
         const com::sun::star::uno::Sequence< double >& aYValues )
         throw (com::sun::star::uno::RuntimeException);
 
-    virtual double SAL_CALL getCurveValue( double x )
-        throw (com::sun::star::lang::IllegalArgumentException,
-               com::sun::star::uno::RuntimeException);
-
-    virtual ::com::sun::star::uno::Sequence< com::sun::star::geometry::RealPoint2D > SAL_CALL getCurveValues(
+    virtual com::sun::star::uno::Sequence< com::sun::star::geometry::RealPoint2D > SAL_CALL getCurveValues(
         double min,
         double max,
         sal_Int32 nPointCount,
diff --git a/chart2/source/tools/LinearRegressionCurveCalculator.cxx b/chart2/source/tools/LinearRegressionCurveCalculator.cxx
index 5b388ee..07c19a4 100644
--- a/chart2/source/tools/LinearRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/LinearRegressionCurveCalculator.cxx
@@ -31,69 +31,23 @@ namespace chart
 {
 
 LinearRegressionCurveCalculator::LinearRegressionCurveCalculator() :
-        m_fSlope( 0.0 ),
-        m_fIntercept( 0.0 )
-{
-    ::rtl::math::setNan( & m_fSlope );
-    ::rtl::math::setNan( & m_fIntercept );
-}
+    PolynomialRegressionCurveCalculator()
+{}
 
 LinearRegressionCurveCalculator::~LinearRegressionCurveCalculator()
 {}
 
-// ____ XRegressionCurveCalculator ____
-void SAL_CALL LinearRegressionCurveCalculator::recalculateRegression(
-    const uno::Sequence< double >& aXValues,
-    const uno::Sequence< double >& aYValues )
-    throw (uno::RuntimeException)
+void LinearRegressionCurveCalculator::setRegressionProperties(
+        sal_Int32 /*aDegree*/,
+        sal_Bool  aForceIntercept,
+        double    aInterceptValue,
+        sal_Int32 aPeriod)
 {
-    RegressionCalculationHelper::tDoubleVectorPair aValues(
-        RegressionCalculationHelper::cleanup(
-            aXValues, aYValues,
-            RegressionCalculationHelper::isValid()));
-
-    const size_t nMax = aValues.first.size();
-    if( nMax == 0 )
-    {
-        ::rtl::math::setNan( & m_fSlope );
-        ::rtl::math::setNan( & m_fIntercept );
-        ::rtl::math::setNan( & m_fCorrelationCoeffitient );
-        return;
-    }
-
-    const double fN = static_cast< double >( nMax );
-    double fSumX = 0.0, fSumY = 0.0, fSumXSq = 0.0, fSumYSq = 0.0, fSumXY = 0.0;
-    for( size_t i = 0; i < nMax; ++i )
-    {
-        fSumX   += aValues.first[i];
-        fSumY   += aValues.second[i];
-        fSumXSq += aValues.first[i]  * aValues.first[i];
-        fSumYSq += aValues.second[i] * aValues.second[i];
-        fSumXY  += aValues.first[i]  * aValues.second[i];
-    }
-
-    m_fSlope = (fN * fSumXY - fSumX * fSumY) / ( fN * fSumXSq - fSumX * fSumX );
-    m_fIntercept = (fSumY - m_fSlope * fSumX) / fN;
-
-    m_fCorrelationCoeffitient = ( fN * fSumXY - fSumX * fSumY ) /
-        sqrt( ( fN * fSumXSq - fSumX * fSumX ) *
-              ( fN * fSumYSq - fSumY * fSumY ) );
-}
-
-double SAL_CALL LinearRegressionCurveCalculator::getCurveValue( double x )
-    throw (lang::IllegalArgumentException,
-           uno::RuntimeException)
-{
-    double fResult;
-    ::rtl::math::setNan( & fResult );
-
-    if( ! ( ::rtl::math::isNan( m_fSlope ) ||
-            ::rtl::math::isNan( m_fIntercept )))
-    {
-        fResult = m_fSlope * x + m_fIntercept;
-    }
-
-    return fResult;
+    PolynomialRegressionCurveCalculator::setRegressionProperties(
+                                            1,
+                                            aForceIntercept,
+                                            aInterceptValue,
+                                            aPeriod);
 }
 
 uno::Sequence< geometry::RealPoint2D > SAL_CALL LinearRegressionCurveCalculator::getCurveValues(
@@ -120,50 +74,6 @@ uno::Sequence< geometry::RealPoint2D > SAL_CALL LinearRegressionCurveCalculator:
     return RegressionCurveCalculator::getCurveValues( min, max, nPointCount, xScalingX, xScalingY, bMaySkipPointsInCalculation );
 }
 
-OUString LinearRegressionCurveCalculator::ImplGetRepresentation(
-    const uno::Reference< util::XNumberFormatter >& xNumFormatter,
-    ::sal_Int32 nNumberFormatKey ) const
-{
-    OUStringBuffer aBuf( "f(x) = ");
-
-    bool bHaveSlope = false;
-
-    if( m_fSlope != 0.0 )
-    {
-        if( ::rtl::math::approxEqual( fabs( m_fSlope ), 1.0 ))
-        {
-            if( m_fSlope < 0 )
-                aBuf.append( UC_MINUS_SIGN );
-        }
-        else
-            aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fSlope ));
-        aBuf.append( sal_Unicode( 'x' ));
-        bHaveSlope = true;
-    }
-
-    if( bHaveSlope )
-    {
-        if( m_fIntercept < 0.0 )
-        {
-            aBuf.append( UC_SPACE );
-            aBuf.append( UC_MINUS_SIGN );
-            aBuf.append( UC_SPACE );
-            aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, fabs( m_fIntercept )));
-        }
-        else if( m_fIntercept > 0.0 )
-        {
-            aBuf.appendAscii( RTL_CONSTASCII_STRINGPARAM( " + " ));
-            aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fIntercept ));
-        }
-    }
-    else
-    {
-        aBuf.append( getFormattedString( xNumFormatter, nNumberFormatKey, m_fIntercept ));
-    }
-
-    return aBuf.makeStringAndClear();
-}
-
 } //  namespace chart
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 7302c4f649827f70b116be266be76ae6f864b11f
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Sun Jun 30 22:27:07 2013 +0200

    Change series and trendline pop-up to support more trendlines.
    
    Conflicts:
    	chart2/source/controller/main/ChartController_Window.cxx
    
    Change-Id: I70eb06d74670f54fa3792723711e9f73700f12ba

diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 6150401..8e84ce5 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1301,7 +1301,7 @@ void SAL_CALL ChartController::executeDispatch_ChartType()
 
 void SAL_CALL ChartController::executeDispatch_SourceData()
 {
-git gr    //convert properties to ItemSet
+    //convert properties to ItemSet
     uno::Reference< XChartDocument >   xChartDoc( getModel(), uno::UNO_QUERY );
     OSL_ENSURE( xChartDoc.is(), "Invalid XChartDocument" );
     if( !xChartDoc.is())
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index c148313..3591180 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -228,10 +228,13 @@ const short HITPIX=2; //hit-tolerance in pixel
 //-----------------------------------------------------------------
 // awt::XWindow
 //-----------------------------------------------------------------
-    void SAL_CALL ChartController
-::setPosSize( sal_Int32 X, sal_Int32 Y
-            , sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::setPosSize(
+    sal_Int32 X,
+    sal_Int32 Y,
+    sal_Int32 Width,
+    sal_Int32 Height,
+    sal_Int16 Flags )
+        throw (uno::RuntimeException)
 {
     SolarMutexGuard aGuard;
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -250,9 +253,11 @@ const short HITPIX=2; //hit-tolerance in pixel
             sal_Int32 nScaleXDenominator = aModelPageSize.Width;
             sal_Int32 nScaleYNumerator = aLogicSize.Height();
             sal_Int32 nScaleYDenominator = aModelPageSize.Height;
-            MapMode aNewMapMode( MAP_100TH_MM, Point(0,0)
-            , Fraction(nScaleXNumerator,nScaleXDenominator)
-            , Fraction(nScaleYNumerator,nScaleYDenominator) );
+            MapMode aNewMapMode(
+                        MAP_100TH_MM,
+                        Point(0,0),
+                        Fraction(nScaleXNumerator, nScaleXDenominator),
+                        Fraction(nScaleYNumerator, nScaleYDenominator) );
             m_pChartWindow->SetMapMode(aNewMapMode);
             m_pChartWindow->setPosSizePixel( X, Y, Width, Height, Flags );
 
@@ -289,12 +294,11 @@ const short HITPIX=2; //hit-tolerance in pixel
     }
 }
 
-    awt::Rectangle SAL_CALL ChartController
-::getPosSize()
-            throw (uno::RuntimeException)
+awt::Rectangle SAL_CALL ChartController::getPosSize()
+    throw (uno::RuntimeException)
 {
     //@todo
-    awt::Rectangle aRet(0,0,0,0);
+    awt::Rectangle aRet(0, 0, 0, 0);
 
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
     if(xWindow.is())
@@ -303,9 +307,8 @@ const short HITPIX=2; //hit-tolerance in pixel
     return aRet;
 }
 
-    void SAL_CALL ChartController
-::setVisible( sal_Bool Visible )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::setVisible( sal_Bool Visible )
+    throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -314,9 +317,8 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->setVisible( Visible );
 }
 
-    void SAL_CALL ChartController
-::setEnable( sal_Bool Enable )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::setEnable( sal_Bool Enable )
+    throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -325,8 +327,8 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->setEnable( Enable );
 }
 
-    void SAL_CALL ChartController
-::setFocus()    throw (uno::RuntimeException)
+void SAL_CALL ChartController::setFocus()
+    throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -335,10 +337,9 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->setFocus();
 }
 
-    void SAL_CALL ChartController
-::addWindowListener( const uno::Reference<
-            awt::XWindowListener >& xListener )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::addWindowListener(
+    const uno::Reference< awt::XWindowListener >& xListener )
+        throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -347,10 +348,9 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->addWindowListener( xListener );
 }
 
-    void SAL_CALL ChartController
-::removeWindowListener( const uno::Reference<
-            awt::XWindowListener >& xListener )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::removeWindowListener(
+    const uno::Reference< awt::XWindowListener >& xListener )
+        throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -359,10 +359,9 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->removeWindowListener( xListener );
 }
 
-    void SAL_CALL ChartController
-::addFocusListener( const uno::Reference<
-            awt::XFocusListener >& xListener )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::addFocusListener(
+    const uno::Reference< awt::XFocusListener >& xListener )
+        throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -371,10 +370,9 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->addFocusListener( xListener );
 }
 
-    void SAL_CALL ChartController
-::removeFocusListener( const uno::Reference<
-            awt::XFocusListener >& xListener )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::removeFocusListener(
+    const uno::Reference< awt::XFocusListener >& xListener )
+        throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -383,10 +381,9 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->removeFocusListener( xListener );
 }
 
-    void SAL_CALL ChartController
-::addKeyListener( const uno::Reference<
-            awt::XKeyListener >& xListener )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::addKeyListener(
+    const uno::Reference< awt::XKeyListener >& xListener )
+        throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -395,10 +392,9 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->addKeyListener( xListener );
 }
 
-    void SAL_CALL ChartController
-::removeKeyListener( const uno::Reference<
-            awt::XKeyListener >& xListener )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::removeKeyListener(
+    const uno::Reference< awt::XKeyListener >& xListener )
+        throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -407,10 +403,9 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->removeKeyListener( xListener );
 }
 
-    void SAL_CALL ChartController
-::addMouseListener( const uno::Reference<
-            awt::XMouseListener >& xListener )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::addMouseListener(
+    const uno::Reference< awt::XMouseListener >& xListener )
+        throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -419,10 +414,9 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->addMouseListener( xListener );
 }
 
-    void SAL_CALL ChartController
-::removeMouseListener( const uno::Reference<
-            awt::XMouseListener >& xListener )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::removeMouseListener(
+    const uno::Reference< awt::XMouseListener >& xListener )
+        throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -431,10 +425,9 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->removeMouseListener( xListener );
 }
 
-    void SAL_CALL ChartController
-::addMouseMotionListener( const uno::Reference<
-            awt::XMouseMotionListener >& xListener )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::addMouseMotionListener(
+    const uno::Reference< awt::XMouseMotionListener >& xListener )
+        throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -443,10 +436,9 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->addMouseMotionListener( xListener );
 }
 
-    void SAL_CALL ChartController
-::removeMouseMotionListener( const uno::Reference<
-            awt::XMouseMotionListener >& xListener )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::removeMouseMotionListener(
+    const uno::Reference< awt::XMouseMotionListener >& xListener )
+        throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -455,10 +447,9 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->removeMouseMotionListener( xListener );
 }
 
-    void SAL_CALL ChartController
-::addPaintListener( const uno::Reference<
-            awt::XPaintListener >& xListener )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::addPaintListener(
+    const uno::Reference< awt::XPaintListener >& xListener )
+        throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -467,10 +458,9 @@ const short HITPIX=2; //hit-tolerance in pixel
         xWindow->addPaintListener( xListener );
 }
 
-    void SAL_CALL ChartController
-::removePaintListener( const uno::Reference<
-            awt::XPaintListener >& xListener )
-            throw (uno::RuntimeException)
+void SAL_CALL ChartController::removePaintListener(
+    const uno::Reference< awt::XPaintListener >& xListener )
+        throw (uno::RuntimeException)
 {
     //@todo
     uno::Reference<awt::XWindow> xWindow = m_xViewWindow;
@@ -506,7 +496,7 @@ void ChartController::execute_Paint( const Rectangle& rRect )
         uno::Reference< beans::XPropertySet > xProp( m_xChartView, uno::UNO_QUERY );
         if( xProp.is() )
         {
-            awt::Size aResolution(1000,1000);
+            awt::Size aResolution(1000, 1000);
             {
                 SolarMutexGuard aGuard;
                 if( m_pChartWindow )
@@ -582,9 +572,12 @@ IMPL_LINK_NOARG(ChartController, DoubleClickWaitingHdl)
         if( m_pChartWindow )
         {
             Window::PointerState aPointerState( m_pChartWindow->GetPointerState() );
-            MouseEvent aMouseEvent( aPointerState.maPos,1/*nClicks*/,
-                                    0/*nMode*/, static_cast< sal_uInt16 >( aPointerState.mnState )/*nButtons*/,
-                                    0/*nModifier*/ );
+            MouseEvent aMouseEvent(
+                            aPointerState.maPos,
+                            1/*nClicks*/,
+                            0/*nMode*/,
+                            static_cast< sal_uInt16 >( aPointerState.mnState )/*nButtons*/,
+                            0/*nModifier*/ );
             impl_SetMousePointer( aMouseEvent );
         }
     }
@@ -686,8 +679,11 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
             return;
         }
 
-        m_aSelection.adaptSelectionToNewPos( aMPos, pDrawViewWrapper
-            , rMEvt.IsRight(), m_bWaitingForDoubleClick );
+        m_aSelection.adaptSelectionToNewPos(
+                        aMPos,
+                        pDrawViewWrapper,
+                        rMEvt.IsRight(),
+                        m_bWaitingForDoubleClick );
 
         if( !m_aSelection.isRotateableObjectSelected( getModel() ) )
         {
@@ -698,7 +694,7 @@ void ChartController::execute_MouseButtonDown( const MouseEvent& rMEvt )
         m_aSelection.applySelection(pDrawViewWrapper);
     }
     if( m_aSelection.isDragableObjectSelected()
-         && !rMEvt.IsRight() )
+        && !rMEvt.IsRight() )
     {
         //start drag
         sal_uInt16  nDrgLog = (sal_uInt16)m_pChartWindow->PixelToLogic(Size(DRGPIX,0)).Width();
@@ -758,12 +754,11 @@ void ChartController::execute_MouseMove( const MouseEvent& rMEvt )
 
     impl_SetMousePointer( rMEvt );
 }
+
 void ChartController::execute_Tracking( const TrackingEvent& /* rTEvt */ )
 {
 }
 
-//-----------------
-
 void ChartController::execute_MouseButtonUp( const MouseEvent& rMEvt )
 {
     ControllerLockGuard aCLGuard( getModel() );
@@ -970,10 +965,12 @@ void ChartController::execute_Resize()
     if(m_pChartWindow)
         m_pChartWindow->Invalidate();
 }
+
 void ChartController::execute_Activate()
 {
     ///// pDrawViewWrapper->SetEditMode(sal_True);
 }
+
 void ChartController::execute_Deactivate()
 {
     /*
@@ -981,9 +978,11 @@ void ChartController::execute_Deactivate()
     this->ReleaseMouse();
     */
 }
+
 void ChartController::execute_GetFocus()
 {
 }
+
 void ChartController::execute_LoseFocus()
 {
     //this->ReleaseMouse();
@@ -1130,9 +1129,9 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
                     }
 
                     if( bHasDataLabelsAtSeries )
-                        lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatDataLabels" );
-                    if( xTrendline.is() )
-                        lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendline" );
+                        lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatDataLabels" );
+                    //if( xTrendline.is() )
+                    //    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatTrendline" );
                     if( bHasEquation )
                         lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendlineEquation" );
                     if( xMeanValue.is() )
@@ -1145,11 +1144,13 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
                     xPopupMenu->insertSeparator( -1 );
 
                     if( !bHasDataLabelsAtSeries )
-                        lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertDataLabels" );
-                    if( !xTrendline.is() )
-                        lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendline" );
-                    else if( !bHasEquation )
-                        lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendlineEquation" );
+                        lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertDataLabels" );
+
+                    //if( !xTrendline.is() )
+                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendline" );
+                    //else if( !bHasEquation )
+                    //lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendlineEquation" );
+
                     if( !xMeanValue.is() )
                         lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertMeanValue" );
                     if( !bHasXErrorBars )
@@ -1159,9 +1160,9 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
 
 
                     if( bHasDataLabelsAtSeries || ( bHasDataLabelsAtPoints && bHasFormattedDataPointsOtherThanSelected ) )
-                        lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteDataLabels" );
-                    if( xTrendline.is() )
-                        lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendline" );
+                        lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteDataLabels" );
+                    //if( xTrendline.is() )
+                    //    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteTrendline" );
                     if( bHasEquation )
                         lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendlineEquation" );
                     if( xMeanValue.is() )
@@ -1192,12 +1193,13 @@ void ChartController::execute_Command( const CommandEvent& rCEvt )
                 }
                 else if( OBJECTTYPE_DATA_CURVE == eObjectType )
                 {
-                    lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:FormatTrendlineEquation" );
-                    lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendlineEquation" );
-                    lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertTrendlineEquationAndR2" );
-                    lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:InsertR2Value" );
-                    lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteTrendlineEquation" );
-                    lcl_insertMenuCommand( xPopupMenu, nUniqueId++, ".uno:DeleteR2Value" );
+                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteTrendline" );
+                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:FormatTrendlineEquation" );
+                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendlineEquation" );
+                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertTrendlineEquationAndR2" );
+                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:InsertR2Value" );
+                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteTrendlineEquation" );
+                    lcl_insertMenuCommand( xPopupMenu, xMenuEx, nUniqueId++, ".uno:DeleteR2Value" );
                 }
                 else if( OBJECTTYPE_DATA_CURVE_EQUATION == eObjectType )
                 {
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index f4c1669..6731998 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -242,12 +242,12 @@ void ControllerState::update(
                     if( xRegCurveCnt.is())
                     {
                         uno::Reference< chart2::XRegressionCurve > xRegCurve( RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegCurveCnt ) );
-                        bMayFormatTrendline = bMayDeleteTrendline = xRegCurve.is();
+                        // Trendline
+                        bMayAddTrendline = true;
+
+                        // Mean Value
                         bMayFormatMeanValue = bMayDeleteMeanValue = RegressionCurveHelper::hasMeanValueLine( xRegCurveCnt );
-                        bMayAddTrendline = ! bMayDeleteTrendline;
                         bMayAddMeanValue = ! bMayDeleteMeanValue;
-                        bMayFormatTrendlineEquation = bMayDeleteTrendlineEquation = RegressionCurveHelper::hasEquation( xRegCurve );
-                        bMayAddTrendlineEquation = !bMayDeleteTrendlineEquation;
                     }
                 }
 
@@ -275,8 +275,11 @@ void ControllerState::update(
             if( aObjectType == OBJECTTYPE_DATA_CURVE )
             {
                 bMayFormatTrendline = true;
+                bMayDeleteTrendline = true;
                 uno::Reference< chart2::XRegressionCurve > xRegCurve(
                     ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ), uno::UNO_QUERY );
+
+                // Trendline Equation
                 bMayFormatTrendlineEquation = bMayDeleteTrendlineEquation = RegressionCurveHelper::hasEquation( xRegCurve );
                 bMayAddTrendlineEquation = !bMayDeleteTrendlineEquation;
             }
@@ -286,10 +289,10 @@ void ControllerState::update(
                 bool bHasR2Value = false;
                 try
                 {
-                    uno::Reference< beans::XPropertySet > xEqProp(
+                    uno::Reference< beans::XPropertySet > xEquationProperties(
                         ObjectIdentifier::getObjectPropertySet( aSelObjCID, xModel ), uno::UNO_QUERY );
-                    if( xEqProp.is())
-                        xEqProp->getPropertyValue( "ShowCorrelationCoefficient" ) >>= bHasR2Value;
+                    if( xEquationProperties.is() )
+                        xEquationProperties->getPropertyValue( "ShowCorrelationCoefficient" ) >>= bHasR2Value;
                 }
                 catch(const uno::RuntimeException& e)
                 {
commit 01fc2a65b210d8521be3ba8f39116785e17e3063
Author: Tomaž Vajngerl <quikee at gmail.com>
Date:   Sun Jun 30 21:14:30 2013 +0200

    Cleanup ChartController
    
    Change-Id: Ife0289003afe8f10db7ce3f6d9207087a5ac8e76

diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index a98803a..6150401 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -98,26 +98,26 @@ DBG_NAME(ChartController)
 // ChartController Constructor and Destructor
 //-----------------------------------------------------------------
 
-ChartController::ChartController(uno::Reference<uno::XComponentContext> const & xContext)
-    : m_aLifeTimeManager( NULL )
-    , m_bSuspended( sal_False )
-    , m_bCanClose( sal_True )
-    , m_xCC(xContext) //@todo is it allowed to hold this context??
-    , m_xFrame( NULL )
-    , m_aModelMutex()
-    , m_aModel( NULL, m_aModelMutex )
-    , m_pChartWindow( NULL )
-    , m_xViewWindow()
-    , m_xChartView()
-    , m_pDrawModelWrapper()
-    , m_pDrawViewWrapper(NULL)
-    , m_eDragMode(SDRDRAG_MOVE)
-    , m_bWaitingForDoubleClick(false)
-    , m_bWaitingForMouseUp(false)
-    , m_bConnectingToView(false)
-    , m_xUndoManager( 0 )
-    , m_aDispatchContainer( m_xCC, this )
-    , m_eDrawMode( CHARTDRAW_SELECT )
+ChartController::ChartController(uno::Reference<uno::XComponentContext> const & xContext) :
+    m_aLifeTimeManager( NULL ),
+    m_bSuspended( sal_False ),
+    m_bCanClose( sal_True ),
+    m_xCC(xContext), //@todo is it allowed to hold this context??
+    m_xFrame( NULL ),
+    m_aModelMutex(),
+    m_aModel( NULL, m_aModelMutex ),
+    m_pChartWindow( NULL ),
+    m_xViewWindow(),
+    m_xChartView(),
+    m_pDrawModelWrapper(),
+    m_pDrawViewWrapper(NULL),
+    m_eDragMode(SDRDRAG_MOVE),
+    m_bWaitingForDoubleClick(false),
+    m_bWaitingForMouseUp(false),
+    m_bConnectingToView(false),
+    m_xUndoManager( 0 ),
+    m_aDispatchContainer( m_xCC, this ),
+    m_eDrawMode( CHARTDRAW_SELECT )
 {
     DBG_CTOR(ChartController,NULL);
     m_aDoubleClickTimer.SetTimeoutHdl( LINK( this, ChartController, DoubleClickWaitingHdl ) );
@@ -151,11 +151,11 @@ void ChartController::RefCountable::release()
 
 //-----------------------------------------------------------------
 
-ChartController::TheModel::TheModel( const uno::Reference< frame::XModel > & xModel )
-    : m_xModel( xModel )
-    , m_xCloseable( NULL )
-    , m_bOwnership( sal_True )
-    , m_bOwnershipIsWellKnown( sal_False )
+ChartController::TheModel::TheModel( const uno::Reference< frame::XModel > & xModel ) :
+    m_xModel( xModel ),
+    m_xCloseable( NULL ),
+    m_bOwnership( sal_True ),
+    m_bOwnershipIsWellKnown( sal_False )
 {
     m_xCloseable =
         uno::Reference< util::XCloseable >( xModel, uno::UNO_QUERY );
@@ -256,24 +256,25 @@ void ChartController::TheModel::tryTermination()
 
 //-----------------------------------------------------------------
 
-ChartController::TheModelRef::TheModelRef( TheModel* pTheModel, ::osl::Mutex& rMutex )
-        : m_pTheModel(pTheModel), m_rModelMutex(rMutex)
+ChartController::TheModelRef::TheModelRef( TheModel* pTheModel, osl::Mutex& rMutex ) :
+    m_pTheModel(pTheModel),
+    m_rModelMutex(rMutex)
 {
-    ::osl::Guard< ::osl::Mutex > aGuard( m_rModelMutex );
+    osl::Guard< osl::Mutex > aGuard( m_rModelMutex );
     if(m_pTheModel)
         m_pTheModel->acquire();
 }
-ChartController::TheModelRef::TheModelRef( const TheModelRef& rTheModel, ::osl::Mutex& rMutex )
-        : m_rModelMutex(rMutex)
+ChartController::TheModelRef::TheModelRef( const TheModelRef& rTheModel, ::osl::Mutex& rMutex ) :
+    m_rModelMutex(rMutex)
 {
-    ::osl::Guard< ::osl::Mutex > aGuard( m_rModelMutex );
+    osl::Guard< osl::Mutex > aGuard( m_rModelMutex );
     m_pTheModel=rTheModel.operator->();
     if(m_pTheModel)
         m_pTheModel->acquire();
 }
 ChartController::TheModelRef& ChartController::TheModelRef::operator=(TheModel* pTheModel)
 {
-    ::osl::Guard< ::osl::Mutex > aGuard( m_rModelMutex );
+    osl::Guard< osl::Mutex > aGuard( m_rModelMutex );
     if(m_pTheModel==pTheModel)
         return *this;
     if(m_pTheModel)
@@ -285,7 +286,7 @@ ChartController::TheModelRef& ChartController::TheModelRef::operator=(TheModel*
 }
 ChartController::TheModelRef& ChartController::TheModelRef::operator=(const TheModelRef& rTheModel)
 {
-    ::osl::Guard< ::osl::Mutex > aGuard( m_rModelMutex );
+    osl::Guard< osl::Mutex > aGuard( m_rModelMutex );
     TheModel* pNew=rTheModel.operator->();
     if(m_pTheModel==pNew)
         return *this;
@@ -298,7 +299,7 @@ ChartController::TheModelRef& ChartController::TheModelRef::operator=(const TheM
 }
 ChartController::TheModelRef::~TheModelRef()
 {
-    ::osl::Guard< ::osl::Mutex > aGuard( m_rModelMutex );
+    osl::Guard< osl::Mutex > aGuard( m_rModelMutex );
     if(m_pTheModel)
         m_pTheModel->release();
 }
@@ -312,8 +313,7 @@ sal_Bool ChartController::TheModelRef::is() const
 // private methods
 //-----------------------------------------------------------------
 
-    sal_Bool ChartController
-::impl_isDisposedOrSuspended() const
+sal_Bool ChartController::impl_isDisposedOrSuspended() const
 {
     if( m_aLifeTimeManager.impl_isDisposed() )
         return sal_True;
@@ -332,8 +332,7 @@ sal_Bool ChartController::TheModelRef::is() const
 
 APPHELPER_XSERVICEINFO_IMPL(ChartController,CHART_CONTROLLER_SERVICE_IMPLEMENTATION_NAME)
 
-    uno::Sequence< OUString > ChartController
-::getSupportedServiceNames_Static()
+uno::Sequence< OUString > ChartController::getSupportedServiceNames_Static()
 {
     uno::Sequence< OUString > aSNS( 2 );
     aSNS.getArray()[ 0 ] = CHART_CONTROLLER_SERVICE_NAME;
@@ -346,8 +345,8 @@ APPHELPER_XSERVICEINFO_IMPL(ChartController,CHART_CONTROLLER_SERVICE_IMPLEMENTAT
 // XController
 //-----------------------------------------------------------------
 
-        void SAL_CALL ChartController
-::attachFrame( const uno::Reference<frame::XFrame>& xFrame )
+void SAL_CALL ChartController::attachFrame(
+    const uno::Reference<frame::XFrame>& xFrame )
         throw(uno::RuntimeException)
 {
     SolarMutexGuard aGuard;
@@ -608,8 +607,8 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo
     return sal_True;
 }
 
-        uno::Reference< frame::XFrame > SAL_CALL ChartController
-::getFrame()    throw(uno::RuntimeException)
+uno::Reference< frame::XFrame > SAL_CALL ChartController::getFrame()
+    throw(uno::RuntimeException)
 {
     //provides access to owner frame of this controller
     //return the frame containing this controller
@@ -617,8 +616,8 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo
     return m_xFrame;
 }
 
-        uno::Reference< frame::XModel > SAL_CALL ChartController
-::getModel()    throw(uno::RuntimeException)
+uno::Reference< frame::XModel > SAL_CALL ChartController::getModel()
+    throw(uno::RuntimeException)
 {
     //provides access to currently attached model
     //returns the currently attached model
@@ -631,8 +630,8 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo
     return uno::Reference< frame::XModel > ();
 }
 
-        uno::Any SAL_CALL ChartController
-::getViewData() throw(uno::RuntimeException)
+uno::Any SAL_CALL ChartController::getViewData()
+    throw(uno::RuntimeException)
 {
     //provides access to current view status
     //set of data that can be used to restore the current view status at later time
@@ -649,8 +648,8 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo
     return aRet;
 }
 
-        void SAL_CALL ChartController
-::restoreViewData( const uno::Any& /* Value */ )
+void SAL_CALL ChartController::restoreViewData(
+    const uno::Any& /* Value */ )
         throw(uno::RuntimeException)
 {
     //restores the view status using the data gotten from a previous call to XController::getViewData()
@@ -662,9 +661,8 @@ sal_Bool SAL_CALL ChartController::attachModel( const uno::Reference< frame::XMo
     //// @todo integrate specialized implementation
 }
 
-        sal_Bool SAL_CALL ChartController
-::suspend( sal_Bool bSuspend )
-        throw(uno::RuntimeException)
+sal_Bool SAL_CALL ChartController::suspend( sal_Bool bSuspend )
+    throw(uno::RuntimeException)
 {
     //is called to prepare the controller for closing the view
     //bSuspend==true: force the controller to suspend his work
@@ -709,6 +707,7 @@ void ChartController::impl_createDrawViewController()
         }
     }
 }
+
 void ChartController::impl_deleteDrawViewController()
 {
     if( m_pDrawViewWrapper )
@@ -724,8 +723,8 @@ void ChartController::impl_deleteDrawViewController()
 // XComponent (base of XController)
 //-----------------------------------------------------------------
 
-        void SAL_CALL ChartController
-::dispose() throw(uno::RuntimeException)
+void SAL_CALL ChartController::dispose()
+    throw(uno::RuntimeException)
 {
     try
     {
@@ -824,8 +823,8 @@ void ChartController::impl_deleteDrawViewController()
     }
  }
 
-        void SAL_CALL ChartController
-::addEventListener( const uno::Reference<lang::XEventListener>& xListener )
+void SAL_CALL ChartController::addEventListener(
+    const uno::Reference<lang::XEventListener>& xListener )
         throw(uno::RuntimeException)
 {
     SolarMutexGuard aGuard;
@@ -836,9 +835,8 @@ void ChartController::impl_deleteDrawViewController()
     m_aLifeTimeManager.m_aListenerContainer.addInterface( ::getCppuType((const uno::Reference< lang::XEventListener >*)0), xListener );
 }
 
-        void SAL_CALL ChartController
-::removeEventListener( const uno::Reference<
-        lang::XEventListener>& xListener )
+void SAL_CALL ChartController::removeEventListener(
+    const uno::Reference<lang::XEventListener>& xListener )
         throw(uno::RuntimeException)
 {
     SolarMutexGuard aGuard;
@@ -853,8 +851,9 @@ void ChartController::impl_deleteDrawViewController()
 //-----------------------------------------------------------------
 // util::XCloseListener
 //-----------------------------------------------------------------
-        void SAL_CALL ChartController
-::queryClosing( const lang::EventObject& rSource, sal_Bool bGetsOwnership )
+void SAL_CALL ChartController::queryClosing(
+    const lang::EventObject& rSource,
+    sal_Bool bGetsOwnership )
         throw(util::CloseVetoException, uno::RuntimeException)
 {
     //do not use the m_aControllerMutex here because this call is not allowed to block
@@ -885,8 +884,8 @@ void ChartController::impl_deleteDrawViewController()
     }
 }
 
-        void SAL_CALL ChartController
-::notifyClosing( const lang::EventObject& rSource )
+void SAL_CALL ChartController::notifyClosing(
+    const lang::EventObject& rSource )
         throw(uno::RuntimeException)
 {
     //Listener should deregister himself and relaese all references to the closing object.
@@ -915,7 +914,8 @@ void ChartController::impl_deleteDrawViewController()
     }
 }
 
-bool ChartController::impl_releaseThisModel( const uno::Reference< uno::XInterface > & xModel )
+bool ChartController::impl_releaseThisModel(
+    const uno::Reference< uno::XInterface > & xModel )
 {
     bool bReleaseModel = sal_False;
     {
@@ -935,8 +935,8 @@ bool ChartController::impl_releaseThisModel( const uno::Reference< uno::XInterfa
 //-----------------------------------------------------------------
 // util::XEventListener (base of XCloseListener)
 //-----------------------------------------------------------------
-        void SAL_CALL ChartController
-::disposing( const lang::EventObject& rSource )
+void SAL_CALL ChartController::disposing(
+    const lang::EventObject& rSource )
         throw(uno::RuntimeException)
 {
     if( !impl_releaseThisModel( rSource.Source ))
@@ -946,8 +946,11 @@ bool ChartController::impl_releaseThisModel( const uno::Reference< uno::XInterfa
     }
 }
 
-void SAL_CALL ChartController::layoutEvent( const lang::EventObject& aSource, ::sal_Int16 eLayoutEvent, const uno::Any& /* aInfo */ )
-    throw (uno::RuntimeException)
+void SAL_CALL ChartController::layoutEvent(
+    const lang::EventObject& aSource,
+    sal_Int16 eLayoutEvent,
+    const uno::Any& /* aInfo */ )
+        throw (uno::RuntimeException)
 {
     if( eLayoutEvent == frame::LayoutManagerEvents::MERGEDMENUBAR )
     {
@@ -967,6 +970,7 @@ void SAL_CALL ChartController::layoutEvent( const lang::EventObject& aSource, ::
 
 namespace
 {
+
 bool lcl_isFormatObjectCommand( const OString& aCommand )
 {
     if(    aCommand == "MainTitle"
@@ -1022,13 +1026,15 @@ bool lcl_isFormatObjectCommand( const OString& aCommand )
     // else
     return false;
 }
+
 } // anonymous namespace
 
-        uno::Reference<frame::XDispatch> SAL_CALL ChartController
-::queryDispatch( const util::URL& rURL
-        , const OUString& rTargetFrameName
-        , sal_Int32 /* nSearchFlags */)
-        throw(uno::RuntimeException)
+uno::Reference<frame::XDispatch> SAL_CALL
+    ChartController::queryDispatch(
+        const util::URL& rURL,
+        const OUString& rTargetFrameName,
+        sal_Int32 /* nSearchFlags */)
+            throw(uno::RuntimeException)
 {
     if ( !m_aLifeTimeManager.impl_isDisposed() && getModel().is() )
     {
@@ -1038,10 +1044,10 @@ bool lcl_isFormatObjectCommand( const OString& aCommand )
     return uno::Reference< frame::XDispatch > ();
 }
 
-        uno::Sequence<uno::Reference<frame::XDispatch > >   ChartController

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list