summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorAritz Erkiaga <aerkiaga3@gmail.com>2021-03-25 09:25:27 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-21 09:55:36 +0200
commitc8598f28db8ef5ab5f695cf1af645bb43dbc264d (patch)
tree6cbd9328749473089ec4f8eeefe5e0737049b048 /sw
parent9431984f8d39a4d7fb9428138ecc6971c212c122 (diff)
tdf#138556 Don’t add Open Values to stock chart types 1 and 3
A new function was defined, XdataInterpreter::getChartTypeSpecificData. Being 100% chart-type-agnostic when retrieving chart data is impossible; candlestick charts can have different numbers of sequences per series, and this information is not present in any other chart type. Change-Id: I0f54b09202c42667331b083d54d90e4ceee81083 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113075 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/Module_sw.mk1
-rw-r--r--sw/UITest_sw_chart.mk12
-rw-r--r--sw/qa/uitest/chart/tdf138556.py55
3 files changed, 68 insertions, 0 deletions
diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk
index ec80078eadff..5a955659d661 100644
--- a/sw/Module_sw.mk
+++ b/sw/Module_sw.mk
@@ -180,6 +180,7 @@ $(eval $(call gb_Module_add_uicheck_targets,sw,\
UITest_writer_tests6 \
UITest_writer_tests7 \
UITest_sw_table \
+ UITest_sw_chart \
UITest_sw_findBar \
UITest_sw_findReplace \
UITest_sw_findSimilarity \
diff --git a/sw/UITest_sw_chart.mk b/sw/UITest_sw_chart.mk
new file mode 100644
index 000000000000..35846a418ad6
--- /dev/null
+++ b/sw/UITest_sw_chart.mk
@@ -0,0 +1,12 @@
+# 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/.
+#
+
+$(eval $(call gb_UITest_UITest,sw_chart))
+
+$(eval $(call gb_UITest_add_modules,sw_chart,$(SRCDIR)/sw/qa/uitest,\
+ chart/ \
+))
diff --git a/sw/qa/uitest/chart/tdf138556.py b/sw/qa/uitest/chart/tdf138556.py
new file mode 100644
index 000000000000..4a7f325c8df4
--- /dev/null
+++ b/sw/qa/uitest/chart/tdf138556.py
@@ -0,0 +1,55 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-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/.
+#
+
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict
+from uitest.debug import sleep
+
+class tdf138556( UITestCase ):
+
+ def test_stock_chart13_insert_series( self ):
+ #Start LibreOffice Writer
+ xDocument = self.ui_test.create_doc_in_start_center( "writer" )
+ xMainTop = self.xUITest.getTopFocusWindow()
+
+ #Insert Chart
+ self.xUITest.executeCommand( ".uno:InsertObjectChart" )
+ xChartMainTop = self.xUITest.getTopFocusWindow()
+ xChartMain = xChartMainTop.getChild( "chart_window" )
+ xChart = xChartMain.getChild( "CID/Page=" )
+
+ #Change Chart Type to Stock 1
+ #TODO: test other subtypes
+ self.ui_test.execute_dialog_through_action( xChart, "COMMAND",
+ mkPropertyValues({ "COMMAND" : "DiagramType" }))
+ xDialog = self.xUITest.getTopFocusWindow()
+ xChartType = xDialog.getChild( "charttype" )
+ xStockType = xChartType.getChild( "8" )
+ xStockType.executeAction( "SELECT", tuple())
+ xOKBtn = xDialog.getChild( "ok" )
+ self.ui_test.close_dialog_through_button( xOKBtn )
+
+ #Insert Data Series
+ self.ui_test.execute_dialog_through_action( xChart, "COMMAND",
+ mkPropertyValues({ "COMMAND" : "DiagramData" }))
+ xDialog = self.xUITest.getTopFocusWindow()
+ xToolbar = xDialog.getChild( "toolbar" )
+ xToolbar.executeAction( "CLICK", mkPropertyValues({ "POS" : "1" }))
+ xOKBtn = xDialog.getChild( "close" )
+ self.ui_test.close_dialog_through_button( xOKBtn )
+
+ #Check Number of Sequences
+ xDocument = self.ui_test.get_component()
+ nSequences = len( xDocument.FirstDiagram.
+ CoordinateSystems[0].ChartTypes[0].DataSeries[0].DataSequences )
+ self.assertEqual( nSequences, 3 )
+
+ self.ui_test.close_doc()