chart2/source/controller/dialogs/Strings.src                       |    6 -
 chart2/source/controller/main/ChartController.cxx                  |    4 
 chart2/source/controller/main/ChartController.hxx                  |    1 
 chart2/source/controller/main/ChartController_Tools.cxx            |   55 
+++++++++-
 chart2/source/controller/main/ControllerCommandDispatch.cxx        |    2 
 chart2/source/inc/Strings.hrc                                      |    2 
 chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx     |    3 
 chart2/uiconfig/toolbar/toolbar.xml                                |    3 
 officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu |    4 
 9 files changed, 70 insertions(+), 10 deletions(-)

New commits:
commit b5d481e2b96e2124021e6f80d2543a5904dad026
Author: Tomaž Vajngerl <qui...@gmail.com>
Date:   Thu Jul 4 20:16:26 2013 +0200

    fdo#66422 Vertical grid toolbar button - choice major/minor/off
    
    Added toolbar button for vertical grid. Icon was already prepared.
    Changed the button behavior for vertical and horizontal grid button
    from just on -> off to cycle through major -> major&minor -> off.
    
    Change-Id: I147fc97ab43db31f08a2e98f7b68422fb168f042

diff --git a/chart2/source/controller/dialogs/Strings.src 
b/chart2/source/controller/dialogs/Strings.src
index f971eae..1aae59a 100644
--- a/chart2/source/controller/dialogs/Strings.src
+++ b/chart2/source/controller/dialogs/Strings.src
@@ -465,7 +465,11 @@ String STR_ACTION_TOGGLE_LEGEND
 };
 String STR_ACTION_TOGGLE_GRID_HORZ
 {
-    Text [ en-US ] = "Horizontal grid on/off" ;
+    Text [ en-US ] = "Horizontal grid major/major&minor/off" ;
+};
+String STR_ACTION_TOGGLE_GRID_VERTICAL
+{
+    Text [ en-US ] = "Vertical grid major/major&minor/off" ;
 };
 String STR_ACTION_SCALE_TEXT
 {
diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index 8e84ce5..e10133c 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1214,6 +1214,8 @@ void SAL_CALL ChartController::dispatch(
         this->executeDispatch_ToggleLegend();
     else if( aCommand == "ToggleGridHorizontal" )
         this->executeDispatch_ToggleGridHorizontal();
+    else if( aCommand == "ToggleGridVertical" )
+        this->executeDispatch_ToggleGridVertical();
     else if( aCommand == "ScaleText" )
         this->executeDispatch_ScaleText();
     else if( aCommand == "StatusBarVisible" )
@@ -1546,7 +1548,7 @@ void ChartController::impl_initializeAccessible( const 
uno::Reference< lang::XIn
         ( "InsertAxis" )           ( "DeleteAxis" )           ( 
"InsertAxisTitle" )
 
         // toolbar commands
-        ( "ToggleGridHorizontal" )( "ToggleLegend" )         ( "ScaleText" )
+        ( "ToggleGridHorizontal" ) ( "ToggleGridVertical" ) ( "ToggleLegend" ) 
        ( "ScaleText" )
         ( "NewArrangement" )     ( "Update" )
         ( "DefaultColors" )      ( "BarWidth" )             ( "NumberOfLines" )
         ( "ArrangeRow" )
diff --git a/chart2/source/controller/main/ChartController.hxx 
b/chart2/source/controller/main/ChartController.hxx
index c3e98b0..442fa8e 100644
--- a/chart2/source/controller/main/ChartController.hxx
+++ b/chart2/source/controller/main/ChartController.hxx
@@ -667,6 +667,7 @@ private:
     bool                executeDispatch_Delete();
     void                executeDispatch_ToggleLegend();
     void                executeDispatch_ToggleGridHorizontal();
+    void                executeDispatch_ToggleGridVertical();
 
     void impl_ShapeControllerDispatch( const ::com::sun::star::util::URL& rURL,
         const ::com::sun::star::uno::Sequence< 
::com::sun::star::beans::PropertyValue >& rArgs );
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx 
b/chart2/source/controller/main/ChartController_Tools.cxx
index 6244943..1d8591d 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -887,17 +887,64 @@ void 
ChartController::executeDispatch_ToggleGridHorizontal()
         sal_Int32 nCooSysIndex = 0;
         bool bIsMainGrid = true;
 
-        bool bHasMainYGrid = AxisHelper::isGridShown( nDimensionIndex, 
nCooSysIndex, bIsMainGrid, xDiagram );
+        bool bHasMajorYGrid = AxisHelper::isGridShown( nDimensionIndex, 
nCooSysIndex, true,  xDiagram );
+        bool bHasMinorYGrid = AxisHelper::isGridShown( nDimensionIndex, 
nCooSysIndex, false, xDiagram );
 
-        if( bHasMainYGrid )
-            AxisHelper::hideGrid( nDimensionIndex, nCooSysIndex, bIsMainGrid, 
xDiagram );
+        if( bHasMajorYGrid )
+        {
+            if ( bHasMinorYGrid )
+            {
+                AxisHelper::hideGrid( nDimensionIndex, nCooSysIndex, true,  
xDiagram );
+                AxisHelper::hideGrid( nDimensionIndex, nCooSysIndex, false, 
xDiagram );
+            }
+            else
+            {
+                AxisHelper::showGrid( nDimensionIndex, nCooSysIndex, false, 
xDiagram, m_xCC );
+            }
+        }
+        else
+        {
+            AxisHelper::showGrid( nDimensionIndex, nCooSysIndex, true, 
xDiagram, m_xCC );
+        }
+        aUndoGuard.commit();
+    }
+}
+
+void ChartController::executeDispatch_ToggleGridVertical()
+{
+    Reference< frame::XModel > xModel( getModel() );
+    UndoGuard aUndoGuard = UndoGuard(
+        String( SchResId( STR_ACTION_TOGGLE_GRID_VERTICAL )), m_xUndoManager );
+    Reference< chart2::XDiagram > xDiagram( ChartModelHelper::findDiagram( 
getModel() ));
+    if( xDiagram.is())
+    {
+        sal_Int32 nDimensionIndex = 0;
+        sal_Int32 nCooSysIndex = 0;
+
+        bool bHasMajorXGrid = AxisHelper::isGridShown( nDimensionIndex, 
nCooSysIndex, true,  xDiagram );
+        bool bHasMinorXGrid = AxisHelper::isGridShown( nDimensionIndex, 
nCooSysIndex, false, xDiagram );
+        if( bHasMajorXGrid )
+        {
+            if (bHasMinorXGrid)
+            {
+                AxisHelper::hideGrid( nDimensionIndex, nCooSysIndex, true,  
xDiagram );
+                AxisHelper::hideGrid( nDimensionIndex, nCooSysIndex, false, 
xDiagram );
+            }
+            else
+            {
+                AxisHelper::showGrid( nDimensionIndex, nCooSysIndex, false, 
xDiagram, m_xCC );
+            }
+        }
         else
-            AxisHelper::showGrid( nDimensionIndex, nCooSysIndex, bIsMainGrid, 
xDiagram, m_xCC );
+        {
+            AxisHelper::showGrid( nDimensionIndex, nCooSysIndex, true, 
xDiagram, m_xCC );
+        }
 
         aUndoGuard.commit();
     }
 }
 
+
 void ChartController::impl_ShapeControllerDispatch( const util::URL& rURL, 
const Sequence< beans::PropertyValue >& rArgs )
 {
     Reference< frame::XDispatch > xDispatch( 
m_aDispatchContainer.getShapeController() );
diff --git a/chart2/source/controller/main/ControllerCommandDispatch.cxx 
b/chart2/source/controller/main/ControllerCommandDispatch.cxx
index abb74fc..1022716 100644
--- a/chart2/source/controller/main/ControllerCommandDispatch.cxx
+++ b/chart2/source/controller/main/ControllerCommandDispatch.cxx
@@ -561,6 +561,8 @@ void ControllerCommandDispatch::updateCommandAvailability()
     // toolbar commands
     m_aCommandAvailability[ ".uno:ToggleGridHorizontal" ] = bIsWritable;
     m_aCommandArguments[ ".uno:ToggleGridHorizontal" ] = uno::makeAny( 
m_apModelState->bHasMainYGrid );
+    m_aCommandAvailability[ ".uno:ToggleGridVertical" ] = bIsWritable;
+    m_aCommandArguments[ ".uno:ToggleGridVertical" ] = uno::makeAny( 
m_apModelState->bHasMainXGrid );
 
     m_aCommandAvailability[ ".uno:ToggleLegend" ] = bIsWritable;
     m_aCommandArguments[ ".uno:ToggleLegend" ] = uno::makeAny( 
m_apModelState->bHasLegend );
diff --git a/chart2/source/inc/Strings.hrc b/chart2/source/inc/Strings.hrc
index 8ce4c29..eb696a5 100644
--- a/chart2/source/inc/Strings.hrc
+++ b/chart2/source/inc/Strings.hrc
@@ -23,7 +23,6 @@
 #include <svl/solar.hrc>
 
 //next free is 297
-//single free: 139
 
 //-----------------------------------------------------------------------------
 //chart types
@@ -256,6 +255,7 @@
 #define STR_ACTION_EDIT_3D_VIEW             (RID_APP_START + 80)
 #define STR_ACTION_TOGGLE_LEGEND            (RID_APP_START + 83)
 #define STR_ACTION_TOGGLE_GRID_HORZ         (RID_APP_START + 86)
+#define STR_ACTION_TOGGLE_GRID_VERTICAL     (RID_APP_START + 139)
 #define STR_ACTION_SCALE_TEXT               (RID_APP_START + 93)
 #define STR_ACTION_REARRANGE_CHART          (RID_APP_START + 94)
 #define STR_ACTION_EDIT_TEXT                (RID_APP_START + 95)
diff --git a/chart2/uiconfig/toolbar/toolbar.xml 
b/chart2/uiconfig/toolbar/toolbar.xml
index c134850..862f5cf 100644
--- a/chart2/uiconfig/toolbar/toolbar.xml
+++ b/chart2/uiconfig/toolbar/toolbar.xml
@@ -25,8 +25,9 @@
  <toolbar:toolbaritem xlink:href=".uno:DiagramData" toolbar:text=""/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:ToggleGridHorizontal" toolbar:text=""/>
+ <toolbar:toolbaritem xlink:href=".uno:ToggleGridVertical" toolbar:text=""/>
  <toolbar:toolbaritem xlink:href=".uno:ToggleLegend" toolbar:text=""/>
  <toolbar:toolbaritem xlink:href=".uno:ScaleText" toolbar:text=""/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:NewArrangement" toolbar:text=""/>
-</toolbar:toolbar>
\ No newline at end of file
+</toolbar:toolbar>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu
index 9e21e57..48b6b65 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/ChartCommands.xcu
@@ -493,7 +493,7 @@
       </node>
       <node oor:name=".uno:ToggleGridHorizontal" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
-          <value xml:lang="en-US">Horizontal Grid On/Off</value>
+          <value xml:lang="en-US">Horizontal Grid 
Major/Major&amp;Minor/Off</value>
         </prop>
         <prop oor:name="Properties" oor:type="xs:int">
           <value>1</value>
@@ -547,7 +547,7 @@
       </node>
       <node oor:name=".uno:ToggleGridVertical" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
-          <value xml:lang="en-US">Vertical Grid On/Off</value>
+          <value xml:lang="en-US">Vertical Grid 
Major/Major&amp;Minor/Off</value>
         </prop>
         <prop oor:name="Properties" oor:type="xs:int">
           <value>1</value>
commit d1472c78b6a166e54eb0c87ce3671d4d9bddd747
Author: Tomaž Vajngerl <qui...@gmail.com>
Date:   Thu Jul 4 20:05:29 2013 +0200

    Clear values before calculation of moving average curve.
    
    Change-Id: Ic645195c0fc50a55bb0842fc378a3f329ea2d210

diff --git a/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx 
b/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx
index 1157cbe..22d72e4 100644
--- a/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx
+++ b/chart2/source/tools/MovingAverageRegressionCurveCalculator.cxx
@@ -52,6 +52,9 @@ void SAL_CALL 
MovingAverageRegressionCurveCalculator::recalculateRegression(
 
     const size_t aSize = aValues.first.size();
 
+    aYList.clear();
+    aXList.clear();
+
     for( size_t i = mPeriod - 1; i < aSize; ++i )
     {
         double yAvg;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to