[Libreoffice-commits] core.git: chart2/qa sc/qa

2023-05-05 Thread Xisco Fauli (via logerrit)
 chart2/qa/extras/uichart.cxx|   82 
 sc/qa/uitest/chart/copyPaste.py |   70 --
 2 files changed, 82 insertions(+), 70 deletions(-)

New commits:
commit 87cefcdce6a02044e61c3173777b4546f3ad39f6
Author: Xisco Fauli 
AuthorDate: Fri May 5 13:48:48 2023 +0200
Commit: Xisco Fauli 
CommitDate: Fri May 5 15:51:31 2023 +0200

chart2: move UItest to CppUnittest

Change-Id: I4c9a2f9488a031b497c3ef87bcec9c1413002e23
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151423
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/uitest/data/chartWithDotInSheetName.ods 
b/chart2/qa/extras/data/ods/chartWithDotInSheetName.ods
similarity index 100%
rename from sc/qa/uitest/data/chartWithDotInSheetName.ods
rename to chart2/qa/extras/data/ods/chartWithDotInSheetName.ods
diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx
index 1dfbfcba8b84..2f5aee857e80 100644
--- a/chart2/qa/extras/uichart.cxx
+++ b/chart2/qa/extras/uichart.cxx
@@ -257,6 +257,10 @@ CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf101894)
{ "Copy", uno::Any(true) } }));
 dispatchCommand(mxComponent, ".uno:Move", aArgs);
 
+uno::Reference xDoc(mxComponent, 
UNO_QUERY_THROW);
+uno::Reference xIA(xDoc->getSheets(), 
UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(static_cast(2), xIA->getCount());
+
 for (sal_Int32 sheetIndex = 0; sheetIndex < 2; ++sheetIndex)
 {
 uno::Reference xChartDoc2(
@@ -306,6 +310,84 @@ CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf101894)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testCopyPasteChartWithDotInSheetName)
+{
+loadFromURL(u"ods/chartWithDotInSheetName.ods");
+uno::Reference xChartDoc(getChartCompFromSheet(0, 
0, mxComponent),
+uno::UNO_QUERY_THROW);
+
+CPPUNIT_ASSERT(xChartDoc.is());
+uno::Reference xChartData(xChartDoc->getData(), 
uno::UNO_QUERY_THROW);
+
+uno::Sequence aExpectedColumnDescriptions = 
xChartData->getColumnDescriptions();
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin file",
+ static_cast(4),
+ aExpectedColumnDescriptions.getLength());
+
+uno::Sequence aExpectedRowDescriptions = 
xChartData->getRowDescriptions();
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file",
+ static_cast(7), 
aExpectedRowDescriptions.getLength());
+
+Sequence> aExpectedData = xChartData->getData();
+
+dispatchCommand(mxComponent, ".uno:SelectAll", {});
+dispatchCommand(mxComponent, ".uno:Copy", {});
+
+uno::Sequence aArgs(comphelper::InitPropertySequence(
+{ { "Name", uno::Any(OUString("NewTab")) }, { "Index", 
uno::Any(sal_uInt16(2)) } }));
+dispatchCommand(mxComponent, ".uno:Insert", aArgs);
+
+uno::Reference xDoc(mxComponent, 
UNO_QUERY_THROW);
+uno::Reference xIA(xDoc->getSheets(), 
UNO_QUERY_THROW);
+CPPUNIT_ASSERT_EQUAL(static_cast(2), xIA->getCount());
+
+dispatchCommand(mxComponent, ".uno:Paste", {});
+
+for (sal_Int32 sheetIndex = 0; sheetIndex < 2; ++sheetIndex)
+{
+uno::Reference xChartDoc2(
+getChartCompFromSheet(sheetIndex, 0, mxComponent), 
uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT(xChartDoc2.is());
+uno::Reference 
xChartData2(xChartDoc2->getData(),
+   
uno::UNO_QUERY_THROW);
+
+uno::Sequence aColumnDescriptions = 
xChartData2->getColumnDescriptions();
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin 
file",
+ static_cast(4), 
aColumnDescriptions.getLength());
+for (sal_Int32 i = 0; i < 4; ++i)
+{
+OString sMessage("Incorrect description in column: " + 
OString::number(i));
+CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), 
aExpectedColumnDescriptions[i],
+ aColumnDescriptions[i]);
+}
+
+uno::Sequence aRowDescriptions = 
xChartData2->getRowDescriptions();
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file",
+ static_cast(7), 
aRowDescriptions.getLength());
+for (sal_Int32 i = 0; i < 7; ++i)
+{
+OString sMessage("Incorrect description in row: " + 
OString::number(i));
+CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), 
aExpectedRowDescriptions[i],
+ aRowDescriptions[i]);
+}
+
+Sequence> aData = xChartData2->getData();
+
+for (sal_Int32 nRowIdx = 0; nRowIdx < 7; ++nRowIdx)
+{
+for (sal_Int32 nColIdx = 0; nColIdx < 4; ++nColIdx)
+{
+double nValue = aData[nRowIdx][nColIdx];
+ 

[Libreoffice-commits] core.git: chart2/qa sc/qa

2023-05-05 Thread Xisco Fauli (via logerrit)
 chart2/qa/extras/uichart.cxx |   76 +++
 sc/qa/uitest/chart2/tdf101894.py |   67 --
 2 files changed, 76 insertions(+), 67 deletions(-)

New commits:
commit 1d532b15472f42bda831c5404f78f92725e66e83
Author: Xisco Fauli 
AuthorDate: Thu May 4 14:06:14 2023 +0200
Commit: Xisco Fauli 
CommitDate: Fri May 5 12:43:18 2023 +0200

tdf#101894: chart2: move UItest to CppUnittest

Change-Id: I54d7376cb9b96164ed8c4526ef8f3a0502326f9d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151365
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/uitest/data/tdf101894.ods 
b/chart2/qa/extras/data/ods/tdf101894.ods
similarity index 100%
rename from sc/qa/uitest/data/tdf101894.ods
rename to chart2/qa/extras/data/ods/tdf101894.ods
diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx
index 23f2223af896..1dfbfcba8b84 100644
--- a/chart2/qa/extras/uichart.cxx
+++ b/chart2/qa/extras/uichart.cxx
@@ -230,6 +230,82 @@ CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf98690)
 CPPUNIT_ASSERT_EQUAL(static_cast(12), aSeriesList2.getLength());
 }
 
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf101894)
+{
+loadFromURL(u"ods/tdf101894.ods");
+uno::Reference xChartDoc(getChartCompFromSheet(0, 
0, mxComponent),
+uno::UNO_QUERY_THROW);
+
+CPPUNIT_ASSERT(xChartDoc.is());
+uno::Reference xChartData(xChartDoc->getData(), 
uno::UNO_QUERY_THROW);
+
+uno::Sequence aExpectedColumnDescriptions = 
xChartData->getColumnDescriptions();
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin file",
+ static_cast(12),
+ aExpectedColumnDescriptions.getLength());
+
+uno::Sequence aExpectedRowDescriptions = 
xChartData->getRowDescriptions();
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file",
+ static_cast(8), 
aExpectedRowDescriptions.getLength());
+
+Sequence> aExpectedData = xChartData->getData();
+
+// Create a copy of the sheet and move to the end
+uno::Sequence aArgs(
+comphelper::InitPropertySequence({ { "DocName", 
uno::Any(OUString("tdf101894")) },
+   { "Index", 
uno::Any(sal_uInt16(32767)) },
+   { "Copy", uno::Any(true) } }));
+dispatchCommand(mxComponent, ".uno:Move", aArgs);
+
+for (sal_Int32 sheetIndex = 0; sheetIndex < 2; ++sheetIndex)
+{
+uno::Reference xChartDoc2(
+getChartCompFromSheet(sheetIndex, 0, mxComponent), 
uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT(xChartDoc2.is());
+uno::Reference 
xChartData2(xChartDoc2->getData(),
+   
uno::UNO_QUERY_THROW);
+
+uno::Sequence aColumnDescriptions = 
xChartData2->getColumnDescriptions();
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of columns in origin 
file",
+ static_cast(12), 
aColumnDescriptions.getLength());
+for (sal_Int32 i = 0; i < 12; ++i)
+{
+OString sMessage("Incorrect description in column: " + 
OString::number(i));
+CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), 
aExpectedColumnDescriptions[i],
+ aColumnDescriptions[i]);
+}
+
+uno::Sequence aRowDescriptions = 
xChartData2->getRowDescriptions();
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file",
+ static_cast(8), 
aRowDescriptions.getLength());
+for (sal_Int32 i = 0; i < 8; ++i)
+{
+OString sMessage("Incorrect description in row: " + 
OString::number(i));
+CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), 
aExpectedRowDescriptions[i],
+ aRowDescriptions[i]);
+}
+
+Sequence> aData = xChartData2->getData();
+
+for (sal_Int32 nRowIdx = 0; nRowIdx < 8; ++nRowIdx)
+{
+for (sal_Int32 nColIdx = 0; nColIdx < 12; ++nColIdx)
+{
+double nValue = aData[nRowIdx][nColIdx];
+double nExpected = aExpectedData[nRowIdx][nColIdx];
+OString sMessage("Incorrect value in Col: " + 
OString::number(nColIdx)
+ + " Row: " + OString::number(nRowIdx));
+
+// Without the fix in place, this test would have failed with
+// - Expected: 1
+// - Actual  : 2.2250738585072e-308
+// - Incorrect value in Col: 0 Row: 0
+CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(sMessage.getStr(), 
nExpected, nValue, 1e-1);
+}
+}
+}
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff 

[Libreoffice-commits] core.git: chart2/qa sc/qa

2022-12-12 Thread Xisco Fauli (via logerrit)
 chart2/qa/extras/uichart.cxx   |   38 +
 sc/qa/uitest/chart/tdf98690.py |   42 -
 2 files changed, 38 insertions(+), 42 deletions(-)

New commits:
commit 0e5d89a149e86975e103270a0ff4e65776ff8f85
Author: Xisco Fauli 
AuthorDate: Mon Dec 12 17:27:12 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Dec 12 21:54:27 2022 +

tdf#98690: move UItest to CppUnittest

Change-Id: Icb1ccc4b3d5fc16264d7700201d3884cc935e5ab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144004
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/uitest/data/tdf98690.xlsx 
b/chart2/qa/extras/data/xlsx/tdf98690.xlsx
similarity index 100%
rename from sc/qa/uitest/data/tdf98690.xlsx
rename to chart2/qa/extras/data/xlsx/tdf98690.xlsx
diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx
index ec250f80bb27..877ea0ffac1e 100644
--- a/chart2/qa/extras/uichart.cxx
+++ b/chart2/qa/extras/uichart.cxx
@@ -201,6 +201,44 @@ CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf62057)
 testCopyPasteToNewSheet(xChartDoc, "Object 1", 2, 6);
 }
 
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf98690)
+{
+loadFromURL(u"xlsx/tdf98690.xlsx");
+uno::Reference xChartDoc(getChartCompFromSheet(0, 
0, mxComponent),
+uno::UNO_QUERY_THROW);
+
+CPPUNIT_ASSERT(xChartDoc.is());
+uno::Reference xChartData(xChartDoc->getData(), 
uno::UNO_QUERY_THROW);
+uno::Sequence aSeriesList = xChartData->getColumnDescriptions();
+CPPUNIT_ASSERT_EQUAL(static_cast(6), aSeriesList.getLength());
+
+uno::Sequence aPropertyValues = {
+comphelper::makePropertyValue("ToObject", OUString("Chart 2")),
+};
+dispatchCommand(mxComponent, ".uno:GoToObject", aPropertyValues);
+Scheduler::ProcessEventsToIdle();
+
+dispatchCommand(mxComponent, ".uno:Copy", {});
+Scheduler::ProcessEventsToIdle();
+
+// create a new document
+load("private:factory/scalc");
+
+dispatchCommand(mxComponent, ".uno:Paste", {});
+Scheduler::ProcessEventsToIdle();
+
+uno::Reference xChartDoc2(getChartCompFromSheet(0, 
0, mxComponent),
+ uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT(xChartDoc2.is());
+uno::Reference xChartData2(xChartDoc2->getData(), 
uno::UNO_QUERY_THROW);
+uno::Sequence aSeriesList2 = 
xChartData2->getColumnDescriptions();
+
+// Without the fix in place, this test would have failed with
+// - Expected: 12
+// - Actual  : 0
+CPPUNIT_ASSERT_EQUAL(static_cast(12), aSeriesList2.getLength());
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/uitest/chart/tdf98690.py b/sc/qa/uitest/chart/tdf98690.py
deleted file mode 100644
index 8cd6b82c0359..
--- a/sc/qa/uitest/chart/tdf98690.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# -*- 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 uitest.framework import UITestCase
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_url_for_data_file
-
-class tdf98690(UITestCase):
-
-  def test_tdf98690(self):
-with self.ui_test.load_file(get_url_for_data_file("tdf98690.xlsx")):
-xCalcDoc = self.xUITest.getTopFocusWindow()
-gridwin = xCalcDoc.getChild("grid_window")
-
-gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Chart 
2"}))
-
-self.xUITest.executeCommand(".uno:Copy")
-
-with self.ui_test.load_empty_file("calc") as calc_document:
-xCalcDoc = self.xUITest.getTopFocusWindow()
-gridwin = xCalcDoc.getChild("grid_window")
-
-self.xUITest.executeCommand(".uno:Paste")
-
-xData = calc_document.Sheets[0].Charts[0].getEmbeddedObject().Data
-
-aExpectedRowDescriptions = tuple(str(i) for i in range(1, 14))
-aExpectedColumnDescriptions = ('Column D Column D', 'cc_girder2', 
'Column S Column S',
-'Column S Column S', 'Column D Column D', 'clexrfdon', 'Column 
S Column S',
-'Column S Column S', 'Column D', 'clexrfdoff', 'Column S 
Column S', 'Column S Column S')
-
-# Without the fix in place, this test would have failed here,
-# since the pasted chart wouldn't have had any data
-self.assertEqual(aExpectedRowDescriptions, xData.RowDescriptions)
-self.assertEqual(aExpectedColumnDescriptions, xData.ColumnDescriptions)
-
-# vim: set shiftwidth=4 softtabstop=4 expandtab:


[Libreoffice-commits] core.git: chart2/qa sc/qa

2022-12-08 Thread Xisco Fauli (via logerrit)
 chart2/qa/extras/uichart.cxx   |   13 +
 sc/qa/uitest/chart/tdf62057.py |   56 -
 2 files changed, 13 insertions(+), 56 deletions(-)

New commits:
commit 2b8d5e8affe256b80a28cba67db56d2666ec31cc
Author: Xisco Fauli 
AuthorDate: Wed Dec 7 14:41:18 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Dec 8 09:06:19 2022 +

tdf#62057: move UItest to CppUnittest

Change-Id: I5be16135c563ed15acf45b93c59189531b832b37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143782
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/uitest/data/tdf62057.ods 
b/chart2/qa/extras/data/ods/tdf62057.ods
similarity index 100%
rename from sc/qa/uitest/data/tdf62057.ods
rename to chart2/qa/extras/data/ods/tdf62057.ods
diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx
index 391d5012a1b7..ec250f80bb27 100644
--- a/chart2/qa/extras/uichart.cxx
+++ b/chart2/qa/extras/uichart.cxx
@@ -188,6 +188,19 @@ CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf136011)
 testCopyPasteToNewSheet(xChartDoc2, "Object 2", 3, 9);
 }
 
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf62057)
+{
+loadFromURL(u"ods/tdf62057.ods");
+uno::Reference xChartDoc(getChartCompFromSheet(0, 
0, mxComponent),
+uno::UNO_QUERY_THROW);
+
+// Without the fix in place, this test would have failed with
+// - Expected: 2
+// - Actual  : 7
+// - Incorrect number of columns in destination file
+testCopyPasteToNewSheet(xChartDoc, "Object 1", 2, 6);
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/uitest/chart/tdf62057.py b/sc/qa/uitest/chart/tdf62057.py
deleted file mode 100644
index b11dd1c5dd92..
--- a/sc/qa/uitest/chart/tdf62057.py
+++ /dev/null
@@ -1,56 +0,0 @@
-# -*- 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 uitest.framework import UITestCase
-from libreoffice.calc.document import get_cell_by_position
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_url_for_data_file
-
-class tdf62057(UITestCase):
-
-  def test_tdf62057(self):
-with self.ui_test.load_file(get_url_for_data_file("tdf62057.ods")) as 
calc_doc:
-xCalcDoc = self.xUITest.getTopFocusWindow()
-gridwin = xCalcDoc.getChild("grid_window")
-
-
-xDataMatrix = []
-for column in range(1, 3):
-xColumn = []
-for row in range(0, 6):
-xColumn.append(round(get_cell_by_position(calc_doc, 0, column, 
row).getValue(), 5))
-xDataMatrix.append(xColumn)
-
-xRowDescriptions = []
-for row in range(0, 6):
-xRowDescriptions.append(get_cell_by_position(calc_doc, 0, 0, 
row).getString())
-
-gridwin.executeAction("SELECT", mkPropertyValues({"OBJECT": "Object 
1"}))
-
-self.xUITest.executeCommand(".uno:Copy")
-
-with self.ui_test.load_empty_file("calc") as calc_document:
-
-xCalcDoc = self.xUITest.getTopFocusWindow()
-gridwin = xCalcDoc.getChild("grid_window")
-
-self.xUITest.executeCommand(".uno:Paste")
-
-xData = calc_document.Sheets[0].Charts[0].getEmbeddedObject().Data
-
-xNewDataMatrix = []
-xNewDataMatrix.append([round(item[0], 5) for item in xData.Data])
-xNewDataMatrix.append([round(item[1], 5) for item in xData.Data])
-
-# Without the fix in place, this test would have failed with
-# AssertionError: Lists differ: ['10m', '11v', '12m', '13m', '14m', 
'15v'] != ['55.3796', '35.0989']
-self.assertEqual(xRowDescriptions, list(xData.RowDescriptions))
-
-self.assertEqual(xDataMatrix, xNewDataMatrix)
-
-# vim: set shiftwidth=4 softtabstop=4 expandtab:


[Libreoffice-commits] core.git: chart2/qa sc/qa

2022-12-07 Thread Xisco Fauli (via logerrit)
 chart2/qa/extras/uichart.cxx |   72 +++
 sc/qa/uitest/chart2/tdf136011.py |   51 ---
 2 files changed, 72 insertions(+), 51 deletions(-)

New commits:
commit 8e3258f7d62ec154f2d80af2f39028a4c40fa12f
Author: Xisco Fauli 
AuthorDate: Wed Dec 7 12:00:57 2022 +0100
Commit: Xisco Fauli 
CommitDate: Wed Dec 7 14:45:54 2022 +

tdf#136011: move UItest to CppUnittest

Change-Id: Id8ea0fcfef8598f163febe2aa2564b0ce9d0657f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143769
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/uitest/data/tdf136011.ods 
b/chart2/qa/extras/data/ods/tdf136011.ods
similarity index 100%
rename from sc/qa/uitest/data/tdf136011.ods
rename to chart2/qa/extras/data/ods/tdf136011.ods
diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx
index 2d70428a7547..a6f63fa5986d 100644
--- a/chart2/qa/extras/uichart.cxx
+++ b/chart2/qa/extras/uichart.cxx
@@ -197,6 +197,78 @@ CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf107097)
 }
 }
 
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf136011)
+{
+for (sal_Int32 nChart = 0; nChart < 2; ++nChart)
+{
+loadFromURL(u"ods/tdf136011.ods");
+uno::Reference xChartDoc(
+getChartCompFromSheet(0, nChart, mxComponent), 
uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT(xChartDoc.is());
+uno::Reference xChartData(xChartDoc->getData(),
+  
uno::UNO_QUERY_THROW);
+
+uno::Sequence aExpectedColumnDescriptions = 
xChartData->getColumnDescriptions();
+CPPUNIT_ASSERT_EQUAL(static_cast(3), 
aExpectedColumnDescriptions.getLength());
+
+uno::Sequence aExpectedRowDescriptions = 
xChartData->getRowDescriptions();
+CPPUNIT_ASSERT_EQUAL(static_cast(9), 
aExpectedRowDescriptions.getLength());
+
+Sequence> aExpectedData = xChartData->getData();
+CPPUNIT_ASSERT_EQUAL(static_cast(9), 
aExpectedData.getLength());
+
+uno::Sequence aPropertyValues = {
+comphelper::makePropertyValue("ToObject", "Object " + 
OUString::number(nChart + 1)),
+};
+dispatchCommand(mxComponent, ".uno:GoToObject", aPropertyValues);
+Scheduler::ProcessEventsToIdle();
+
+dispatchCommand(mxComponent, ".uno:Copy", {});
+Scheduler::ProcessEventsToIdle();
+
+// create a new document
+load("private:factory/scalc");
+
+dispatchCommand(mxComponent, ".uno:Paste", {});
+Scheduler::ProcessEventsToIdle();
+
+uno::Reference xChartDoc2 = 
getChartDocFromSheet(0, mxComponent);
+CPPUNIT_ASSERT(xChartDoc2.is());
+
+uno::Reference 
xDataArray(xChartDoc2->getDataProvider(),
+  UNO_QUERY_THROW);
+Sequence aColumnDesc = xDataArray->getColumnDescriptions();
+CPPUNIT_ASSERT_EQUAL(static_cast(3), 
aColumnDesc.getLength());
+for (size_t i = 0; i < 3; ++i)
+CPPUNIT_ASSERT_EQUAL(aExpectedColumnDescriptions[i], 
aColumnDesc[i]);
+
+Sequence aRowDesc = xDataArray->getRowDescriptions();
+CPPUNIT_ASSERT_EQUAL(static_cast(9), aRowDesc.getLength());
+
+// Without the fix in place, this test would have failed with
+// - Expected: Test 1 1
+// - Actual  : Test 1
+for (size_t i = 0; i < 9; ++i)
+CPPUNIT_ASSERT_EQUAL(aExpectedRowDescriptions[i], aRowDesc[i]);
+
+Sequence> aData = xDataArray->getData();
+CPPUNIT_ASSERT_EQUAL(static_cast(9), aData.getLength());
+
+for (sal_Int32 nRowIdx = 0; nRowIdx < 9; ++nRowIdx)
+{
+for (sal_Int32 nColIdx = 0; nColIdx < 3; ++nColIdx)
+{
+double nValue = aData[nRowIdx][nColIdx];
+double nExpected = aExpectedData[nRowIdx][nColIdx];
+OString sMessage("Incorrect value in Col: " + 
OString::number(nColIdx)
+ + " Row: " + OString::number(nRowIdx));
+
+CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(sMessage.getStr(), 
nExpected, nValue, 1e-1);
+}
+}
+}
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/uitest/chart2/tdf136011.py b/sc/qa/uitest/chart2/tdf136011.py
deleted file mode 100644
index a5ea560e5cbe..
--- a/sc/qa/uitest/chart2/tdf136011.py
+++ /dev/null
@@ -1,51 +0,0 @@
-# -*- 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 uitest.framework import UITestCase
-from uitest.uihelper.common import get_url_for_data_file
-
-from libreoffice.uno.propertyvalue import 

[Libreoffice-commits] core.git: chart2/qa sc/qa

2022-11-28 Thread Xisco Fauli (via logerrit)
 chart2/qa/extras/uichart.cxx |   64 +++
 sc/qa/uitest/chart2/tdf107097.py |   61 -
 2 files changed, 64 insertions(+), 61 deletions(-)

New commits:
commit e16daa6079f703c87e19904e7bb85e5fd9beac7c
Author: Xisco Fauli 
AuthorDate: Mon Nov 28 14:23:31 2022 +0100
Commit: Xisco Fauli 
CommitDate: Mon Nov 28 20:48:35 2022 +0100

tdf#107097: move UItest to CppUniTest

Change-Id: I81834b8316b19baad55122cc06a481d55fb6244a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143401
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/qa/uitest/data/tdf107097.ods 
b/chart2/qa/extras/data/ods/tdf107097.ods
similarity index 100%
rename from sc/qa/uitest/data/tdf107097.ods
rename to chart2/qa/extras/data/ods/tdf107097.ods
diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx
index 8bea8dbefef4..296677a7d046 100644
--- a/chart2/qa/extras/uichart.cxx
+++ b/chart2/qa/extras/uichart.cxx
@@ -133,6 +133,70 @@ CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf151091)
 CPPUNIT_ASSERT_EQUAL(aExpected[i], aSeriesList[i]);
 }
 
+CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf107097)
+{
+loadFromURL(u"ods/tdf107097.ods");
+uno::Reference 
xChartDoc(getPivotChartDocFromSheet(1, mxComponent),
+uno::UNO_QUERY_THROW);
+CPPUNIT_ASSERT(xChartDoc.is());
+uno::Reference xChartData(xChartDoc->getData(), 
uno::UNO_QUERY_THROW);
+
+uno::Sequence aExpectedColumnDescriptions = 
xChartData->getColumnDescriptions();
+CPPUNIT_ASSERT_EQUAL(static_cast(4), 
aExpectedColumnDescriptions.getLength());
+
+uno::Sequence aExpectedRowDescriptions = 
xChartData->getRowDescriptions();
+CPPUNIT_ASSERT_EQUAL(static_cast(12), 
aExpectedRowDescriptions.getLength());
+
+Sequence> aExpectedData = xChartData->getData();
+CPPUNIT_ASSERT_EQUAL(static_cast(12), 
aExpectedData.getLength());
+
+uno::Sequence aPropertyValues = {
+comphelper::makePropertyValue("ToObject", OUString("Object 1")),
+};
+dispatchCommand(mxComponent, ".uno:GoToObject", aPropertyValues);
+Scheduler::ProcessEventsToIdle();
+
+dispatchCommand(mxComponent, ".uno:Copy", {});
+Scheduler::ProcessEventsToIdle();
+
+// create a new document
+load("private:factory/scalc");
+
+dispatchCommand(mxComponent, ".uno:Paste", {});
+Scheduler::ProcessEventsToIdle();
+
+uno::Reference xChartDoc2 = 
getChartDocFromSheet(0, mxComponent);
+CPPUNIT_ASSERT(xChartDoc2.is());
+
+uno::Reference 
xDataArray(xChartDoc2->getDataProvider(),
+  UNO_QUERY_THROW);
+Sequence aColumnDesc = xDataArray->getColumnDescriptions();
+CPPUNIT_ASSERT_EQUAL(static_cast(4), aColumnDesc.getLength());
+for (size_t i = 0; i < 4; ++i)
+CPPUNIT_ASSERT_EQUAL(aExpectedColumnDescriptions[i], aColumnDesc[i]);
+
+Sequence aRowDesc = xDataArray->getRowDescriptions();
+CPPUNIT_ASSERT_EQUAL(static_cast(12), aRowDesc.getLength());
+for (size_t i = 0; i < 12; ++i)
+CPPUNIT_ASSERT_EQUAL(aExpectedRowDescriptions[i], aRowDesc[i]);
+
+Sequence> aData = xDataArray->getData();
+CPPUNIT_ASSERT_EQUAL(static_cast(12), aData.getLength());
+
+for (sal_Int32 nRowIdx = 0; nRowIdx < 12; ++nRowIdx)
+{
+for (sal_Int32 nColIdx = 0; nColIdx < 4; ++nColIdx)
+{
+double nValue = aData[nRowIdx][nColIdx];
+double nExpected = aExpectedData[nRowIdx][nColIdx];
+OString sMessage("Incorrect value in Col: " + 
OString::number(nColIdx)
+ + " Row: " + OString::number(nRowIdx));
+
+CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(sMessage.getStr(), nExpected, 
nValue, 1e-1);
+}
+}
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/uitest/chart2/tdf107097.py b/sc/qa/uitest/chart2/tdf107097.py
deleted file mode 100644
index 53ba438ecea5..
--- a/sc/qa/uitest/chart2/tdf107097.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- 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 uitest.framework import UITestCase
-from libreoffice.calc.document import get_cell_by_position
-from libreoffice.uno.propertyvalue import mkPropertyValues
-from uitest.uihelper.common import get_url_for_data_file
-
-# Test pivot chart is pasted correctly to a new document
-
-class tdf107097(UITestCase):
-
-  def test_tdf107097(self):
-with self.ui_test.load_file(get_url_for_data_file("tdf107097.ods")) as 
calc_doc:
-xCalcDoc = self.xUITest.getTopFocusWindow()
-gridwin = 

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

2022-01-27 Thread Mike Kaganski (via logerrit)
 chart2/qa/extras/xshape/data/reference/tdf90839-1.xml |  116 -
 chart2/qa/extras/xshape/data/reference/tdf90839-2.xml |  120 +-
 chart2/qa/extras/xshape/data/reference/tdf90839-3.xml |  120 +-
 sc/qa/unit/subsequent_filters_test2.cxx   |   24 +--
 sc/qa/unit/uicalc/uicalc.cxx  |4 
 sc/source/filter/excel/xetable.cxx|2 
 sc/source/filter/inc/unitconverter.hxx|   13 -
 sc/source/filter/oox/drawingbase.cxx  |4 
 sc/source/filter/oox/drawingfragment.cxx  |2 
 sc/source/filter/oox/pagesettings.cxx |   13 -
 sc/source/filter/oox/unitconverter.cxx|   33 +---
 sc/source/filter/oox/worksheethelper.cxx  |   25 +--
 12 files changed, 228 insertions(+), 248 deletions(-)

New commits:
commit 75036ee916046b9d1bfd705b368ffe94cc7cfa79
Author: Mike Kaganski 
AuthorDate: Thu Jan 27 09:18:41 2022 +0300
Commit: Mike Kaganski 
CommitDate: Thu Jan 27 15:12:48 2022 +0100

Simplify oox::xls::UnitConverter and its uses

Use o3tl::convert where it was used to convert between two fixed units.
Simplify cases where several conversions were performed in a row.
Use EMUs as UnitConverter base unit, to have simplest quotients and
increase accuracy.

Change-Id: I07c197dba470cfe289cef84e82b78547635cf9af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129016
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml 
b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
index eb48c3f7293d..b2dc41548810 100644
--- a/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
+++ b/chart2/qa/extras/xshape/data/reference/tdf90839-1.xml
@@ -1,6 +1,6 @@
 
 
- 
+ 
   
   
   
@@ -9,14 +9,14 @@
   
   
   
-   
+   


   
  
- 
+ 
   
-   
+   
 
 
 
@@ -25,12 +25,12 @@
 
 
 
- 
+ 
  
  
 

-   
+   
 
 
 
@@ -39,18 +39,18 @@
 
 
 
- 
+ 
  
  
 

-   
+   
 
- 
+ 
   
-   
+   
 
- 
+ 
   
   
   
@@ -59,25 +59,25 @@
   
   
   
-   
+   


   
  
 
 
- 
+ 
  
  
 

-   
+   
 
- 
+ 
   
-   
+   
 
- 
+ 
   
   
   
@@ -86,12 +86,12 @@
   
   
   
-   
+   


   
  
- 
+ 
   
   
   
@@ -100,12 +100,12 @@
   
   
   
-   
+   


   
  
- 
+ 
   
   
   
@@ -114,12 +114,12 @@
   
   
   
-   
+   


   
  
- 
+ 
   
   
   
@@ -128,12 +128,12 @@
   
   
   
-   
+   


   
  
- 
+ 
   
   
   
@@ -142,48 +142,48 @@
   
   
   
-   
+   


   
  
 
 
- 
+ 
  
  
 

   
   
-   
+   


   
  
 
 
- 
+ 
  
  
 

   
   
-   
+   


   
  
- 
+ 
   
-   
+   
 
- 
+ 
   
-   
+   
 
- 
+ 
   
   
   
@@ -192,21 +192,21 @@
   
   
   
-   
+   


   
  
 
 
- 
+ 
  
  
 

-   
+   
 
- 
+ 
   
   
   
@@ -215,21 +215,21 @@
   
   
   
-   
+   


   
  
 
 
-

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

2020-12-30 Thread Stephan Bergmann (via logerrit)
 chart2/qa/extras/chart2import.cxx |2 +-
 sc/qa/unit/scshapetest.cxx|6 +++---
 sc/qa/unit/subsequent_export-test.cxx |2 +-
 sc/source/filter/excel/xeextlst.cxx   |   10 +++---
 4 files changed, 12 insertions(+), 8 deletions(-)

New commits:
commit 84b08eaeb7b2e8a61ee0dab79cabae07e2209c3f
Author: Stephan Bergmann 
AuthorDate: Tue Dec 29 12:19:45 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Wed Dec 30 11:06:20 2020 +0100

loplugin:stringviewparam: operator +, redux

Change-Id: I0790e09f24512d7b205681127eb95ad7dc15a15f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108473
Reviewed-by: Mike Kaganski 
Tested-by: Stephan Bergmann 

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 272639ad069c..57c7227b49c1 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -2806,7 +2806,7 @@ void Chart2ImportTest::testTdfCustomShapePos()
 
 void Chart2ImportTest::testTdf121281()
 {
-load("/chart2/qa/extras/data/xlsx/", "incorrect_label_position.xlsx");
+load(u"/chart2/qa/extras/data/xlsx/", "incorrect_label_position.xlsx");
 Reference xChartDoc(getChartDocFromSheet(0, 
mxComponent),
UNO_QUERY_THROW);
 Reference xDrawPageSupplier(xChartDoc, 
UNO_QUERY_THROW);
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index d9fa04683ea6..727997a8c8c0 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -144,7 +144,7 @@ void ScShapeTest::testTdf137033_FlipHori_Resize()
 // Load a document, which has a rotated custom shape, which is horizontal 
flipped. Error was, that
 // if such shape was anchored "resize with cell", then after save and 
reload it was destorted.
 OUString aFileURL;
-createFileURL("tdf137033_FlipHoriRotCustomShape.ods", aFileURL);
+createFileURL(u"tdf137033_FlipHoriRotCustomShape.ods", aFileURL);
 uno::Reference xComponent = 
loadFromDesktop(aFileURL);
 CPPUNIT_ASSERT(xComponent.is());
 
@@ -203,7 +203,7 @@ void ScShapeTest::testTdf137033_RotShear_ResizeHide()
 
 // Load a document, which has a rotated and sheared shape, anchored to 
cell with resize.
 OUString aFileURL;
-createFileURL("tdf137033_RotShearResizeAnchor.ods", aFileURL);
+createFileURL(u"tdf137033_RotShearResizeAnchor.ods", aFileURL);
 uno::Reference xComponent = 
loadFromDesktop(aFileURL);
 CPPUNIT_ASSERT(xComponent.is());
 
@@ -278,7 +278,7 @@ void ScShapeTest::testTdf137033_RotShear_Hide()
 
 // Load a document, which has a rotated and sheared shape, anchored to 
cell, without resize.
 OUString aFileURL;
-createFileURL("tdf137033_RotShearCellAnchor.ods", aFileURL);
+createFileURL(u"tdf137033_RotShearCellAnchor.ods", aFileURL);
 uno::Reference xComponent = 
loadFromDesktop(aFileURL);
 CPPUNIT_ASSERT(xComponent.is());
 
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index f93f24b2688a..0261ea9f2dca 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -521,7 +521,7 @@ void ScExportTest::test()
 
 void ScExportTest::testExtCondFormatXLSX()
 {
-ScDocShellRef xShell = loadDoc("tdf139021.", FORMAT_XLSX);
+ScDocShellRef xShell = loadDoc(u"tdf139021.", FORMAT_XLSX);
 CPPUNIT_ASSERT(xShell.is());
 
 ScDocShellRef xDocSh = saveAndReload(&(*xShell), FORMAT_XLSX);
diff --git a/sc/source/filter/excel/xeextlst.cxx 
b/sc/source/filter/excel/xeextlst.cxx
index 1f4055aff5ea..972a9010b342 100644
--- a/sc/source/filter/excel/xeextlst.cxx
+++ b/sc/source/filter/excel/xeextlst.cxx
@@ -7,6 +7,10 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
+#include 
+
+#include 
+
 #include 
 #include 
 #include 
@@ -164,7 +168,7 @@ bool RequiresFixedFormula(ScConditionMode eMode)
 return false;
 }
 
-OString GetFixedFormula(ScConditionMode eMode, const ScAddress& rAddress, 
const OString& rText)
+OString GetFixedFormula(ScConditionMode eMode, const ScAddress& rAddress, 
std::string_view rText)
 {
 OStringBuffer aBuffer;
 XclXmlUtils::ToOString(aBuffer, rAddress);
@@ -176,9 +180,9 @@ OString GetFixedFormula(ScConditionMode eMode, const 
ScAddress& rAddress, const
 case ScConditionMode::EndsWith:
 return OString("RIGHT(" + aPos + ",LEN(" + rText + "))=\"" + rText + 
"\"");
 case ScConditionMode::ContainsText:
-return OString("NOT(ISERROR(SEARCH(" + rText + "," + aPos + ")))");
+return OString(OString::Concat("NOT(ISERROR(SEARCH(") + rText + "," + 
aPos + ")))");
 case ScConditionMode::NotContainsText:
-return OString("ISERROR(SEARCH(" + rText + "," + aPos + "))");
+return OString(OString::Concat("ISERROR(SEARCH(") + rText + "," + aPos 
+ "))");
 default:
 break;
 }
___
Libreoffice-commits mailing list

[Libreoffice-commits] core.git: chart2/qa sc/qa sd/qa sw/qa test/source

2019-04-11 Thread Mike Kaganski (via logerrit)
 chart2/qa/extras/chart2export.cxx |7 +--
 sc/qa/unit/subsequent_export-test.cxx |8 +---
 sd/qa/unit/export-tests-ooxml2.cxx|3 ++-
 sw/qa/extras/ooxmlexport/ooxmlexport3.cxx |   18 --
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx |   10 +++---
 sw/qa/extras/ooxmlexport/ooxmlexport5.cxx |3 ++-
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx |3 ++-
 sw/qa/extras/ooxmlexport/ooxmlexport9.cxx |2 +-
 test/source/xmltesttools.cxx  |3 +++
 9 files changed, 39 insertions(+), 18 deletions(-)

New commits:
commit f315fee54eee57e6e55e5fcacf2522534682c2ce
Author: Mike Kaganski 
AuthorDate: Wed Apr 10 15:18:07 2019 +0300
Commit: Mike Kaganski 
CommitDate: Thu Apr 11 08:25:58 2019 +0200

XmlTestTools::getXPath now asserts that non-empty attribute exists

It turns out that this change revealed unit tests written incorrectly
(and untested), or maybe which became broken (not testing) because of
some previous assertXPath change? They incorrectly used 3-arg form of
it to check node content equality to passed string, while in fact, an
attribute was looked for with that name, and its empty return tested
to match default empty 4th argument.

Change-Id: If24e18518543102d115a22a6282e4cca9cf694e2
Reviewed-on: https://gerrit.libreoffice.org/70581
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 6c769f0bbe63..b0cca5802f22 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -565,7 +565,10 @@ void Chart2ExportTest::testStockChart()
 
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:idx", "val", "1");
 assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:order", "val", "1");
-assertXPath(pXmlDoc, 
"/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:tx/c:strRef/c:strCache/c:pt/c:v",
 "Open");
+assertXPathContent(
+pXmlDoc,
+
"/c:chartSpace/c:chart/c:plotArea/c:stockChart/c:ser[1]/c:tx/c:strRef/c:strCache/c:pt/c:v",
+"Open");
 }
 
 void Chart2ExportTest::testBarChart()
@@ -721,7 +724,7 @@ void Chart2ExportTest::testDoughnutChart()
 xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML 
Text");
 CPPUNIT_ASSERT(pXmlDoc);
 
-assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart", 
"1");
+assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:doughnutChart");
 }
 
 void Chart2ExportTest::testDisplayUnits()
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index 76acc6b5c640..17158933ec34 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -717,10 +717,11 @@ void ScExportTest::testCommentExportXLSX()
 = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/comments1.xml");
 CPPUNIT_ASSERT(pComments);
 
-assertXPath(pComments, "/x:comments/x:authors/x:author[1]", "BAKO");
+assertXPathContent(pComments, "/x:comments/x:authors/x:author[1]", "BAKO");
 assertXPath(pComments, "/x:comments/x:authors/x:author", 1);
 
-assertXPath(pComments, 
"/x:comments/x:commentList/x:comment/x:text/x:r/x:t", "Komentarz");
+assertXPathContent(pComments, 
"/x:comments/x:commentList/x:comment/x:text/x:r/x:t",
+   "Komentarz");
 
 const xmlDocPtr pVmlDrawing
 = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/drawings/vmlDrawing1.vml");
@@ -758,7 +759,8 @@ void ScExportTest::testCommentExportXLSX_2_XLSX()
 = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/comments1.xml");
 CPPUNIT_ASSERT(pComments);
 
-assertXPath(pComments, 
"/x:comments/x:commentList/x:comment/x:text/x:r/x:t", "visible comment");
+assertXPathContent(pComments, 
"/x:comments/x:commentList/x:comment/x:text/x:r/x:t",
+   "visible comment");
 
 const xmlDocPtr pVmlDrawing
 = XPathHelper::parseExport(pXPathFile, m_xSFactory, 
"xl/drawings/vmlDrawing1.vml");
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx 
b/sd/qa/unit/export-tests-ooxml2.cxx
index 91929569f204..5b8f77f9a744 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -1374,7 +1374,8 @@ void SdOOXMLExportTest2::testSmartartRotation2()
 xDocShRef->DoClose();
 
 xmlDocPtr pXmlDocContent = parseExport(tempFile, "ppt/slides/slide1.xml");
-assertXPath(pXmlDocContent, 
"/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[3]/p:txBody/a:p/a:r/a:t", "Text");
+assertXPathContent(pXmlDocContent,
+   
"/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[3]/p:txBody/a:p/a:r/a:t", "Text");
 assertXPath(pXmlDocContent, 
"/p:sld/p:cSld/p:spTree/p:grpSp/p:sp[3]/p:txBody/a:bodyPr", "rot", "1080");
 double dX = getXPath(pXmlDocContent, 

[Libreoffice-commits] core.git: chart2/qa sc/qa sw/qa

2018-12-24 Thread Libreoffice Gerrit user
 chart2/qa/extras/xshape/chart2xshape.cxx  |   26 
 sc/qa/unit/subsequent_filters-test.cxx|   12 +++
 sw/qa/extras/ooxmlexport/ooxmlexport4.cxx |   32 ++
 3 files changed, 62 insertions(+), 8 deletions(-)

New commits:
commit 9520378e37b97b0a44130c86be482060465b479e
Author: Mike Kaganski 
AuthorDate: Mon Dec 24 14:32:20 2018 +0300
Commit: Mike Kaganski 
CommitDate: Mon Dec 24 13:39:39 2018 +0100

Fix CppunitTest_chart2_xshape failing with Display Scaling on Windows

See thread starting at
  
https://lists.freedesktop.org/archives/libreoffice/2018-December/081589.html

Regression from commit 7263d223ddf42cc39d10a501159c7b04ef48df96.
That change has made unit tests DPI-aware; and then some tests started
failing on systems with resolutions other than 96 DPI.
It has been suggested that the proper fix would be to do for Windows
what commit ada20402efa81273e03e46cbedc21f25b9daeeac did for macOS.
Another approach would be to fix all the tests to be DPI-aware.
I cannot do the first mentioned fix; so I have fixed testFDO74215 test
in sw_ooxmlexport4; and added DPI checks to the other failing tests in
chart2_xshape and sc_subsequent_filters_test to skip testing when using
non-default DPI. This is not ideal, of course, and conditionally skipped
tests need to be re-enabled unconditionally once a proper fix arrives.

Change-Id: I5c92cfe93ae65f53a8a180fcaec49231df377b8a
Reviewed-on: https://gerrit.libreoffice.org/65595
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/chart2/qa/extras/xshape/chart2xshape.cxx 
b/chart2/qa/extras/xshape/chart2xshape.cxx
index 8021990e0be3..19ed5bf40974 100644
--- a/chart2/qa/extras/xshape/chart2xshape.cxx
+++ b/chart2/qa/extras/xshape/chart2xshape.cxx
@@ -21,6 +21,8 @@
 
 #include 
 #include 
+#include 
+#include 
 
 #include 
 
@@ -121,6 +123,12 @@ void Chart2XShapeTest::testPropertyMappingBarChart()
 
 void Chart2XShapeTest::testPieChartLabels1()
 {
+// FIXME: the DPI check should be removed when either (1) the test is 
fixed to work with
+// non-default DPI; or (2) unit tests on Windows are made to use svp VCL 
plugin.
+if (Application::GetDefaultDevice()->GetDPIX() != 96
+|| Application::GetDefaultDevice()->GetDPIY() != 96)
+return;
+
 // inside placement for the best fit case
 load("chart2/qa/extras/xshape/data/xlsx/", "tdf90839-1.xlsx");
 compareAgainstReference("tdf90839-1.xml");
@@ -128,6 +136,12 @@ void Chart2XShapeTest::testPieChartLabels1()
 
 void Chart2XShapeTest::testPieChartLabels2()
 {
+// FIXME: the DPI check should be removed when either (1) the test is 
fixed to work with
+// non-default DPI; or (2) unit tests on Windows are made to use svp VCL 
plugin.
+if (Application::GetDefaultDevice()->GetDPIX() != 96
+|| Application::GetDefaultDevice()->GetDPIY() != 96)
+return;
+
 // text wrap: wrap all text labels except one
 load("chart2/qa/extras/xshape/data/xlsx/", "tdf90839-2.xlsx");
 compareAgainstReference("tdf90839-2.xml");
@@ -135,6 +149,12 @@ void Chart2XShapeTest::testPieChartLabels2()
 
 void Chart2XShapeTest::testPieChartLabels3()
 {
+// FIXME: the DPI check should be removed when either (1) the test is 
fixed to work with
+// non-default DPI; or (2) unit tests on Windows are made to use svp VCL 
plugin.
+if (Application::GetDefaultDevice()->GetDPIX() != 96
+|| Application::GetDefaultDevice()->GetDPIY() != 96)
+return;
+
 // text wrap: wrap no text label except one
 load("chart2/qa/extras/xshape/data/xlsx/", "tdf90839-3.xlsx");
 compareAgainstReference("tdf90839-3.xml");
@@ -142,6 +162,12 @@ void Chart2XShapeTest::testPieChartLabels3()
 
 void Chart2XShapeTest::testPieChartLabels4()
 {
+// FIXME: the DPI check should be removed when either (1) the test is 
fixed to work with
+// non-default DPI; or (2) unit tests on Windows are made to use svp VCL 
plugin.
+if (Application::GetDefaultDevice()->GetDPIX() != 96
+|| Application::GetDefaultDevice()->GetDPIY() != 96)
+return;
+
 // data value and percent value are centered horizontally
 load("chart2/qa/extras/xshape/data/ods/", "tdf90839-4.ods");
 compareAgainstReference("tdf90839-4.xml");
diff --git a/sc/qa/unit/subsequent_filters-test.cxx 
b/sc/qa/unit/subsequent_filters-test.cxx
index 0eaa0d83cb74..30e0548c2cde 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -2755,6 +2755,12 @@ void ScFiltersTest::testFormulaDependency()
 
 void ScFiltersTest::testMiscRowHeights()
 {
+// FIXME: the DPI check should be removed when either (1) the test is 
fixed to work with
+// non-default DPI; or (2) unit tests on Windows are made to use svp VCL 
plugin.
+if (Application::GetDefaultDevice()->GetDPIX() != 96
+|| 

[Libreoffice-commits] core.git: chart2/qa sc/qa sd/qa sw/qa vcl/qa

2018-06-01 Thread Andrea Gelmini
 0 files changed

New commits:
commit 319a6fb33c22156e83cebaf3447d7432beca8fb3
Author: Andrea Gelmini 
Date:   Mon May 28 11:08:28 2018 +0200

Removed executable permission on data files

chmod -x for odp, ods and so on

Change-Id: I74397d9b8e24575130d2776ed90f4cfc13e1f03c
Reviewed-on: https://gerrit.libreoffice.org/52570
Tested-by: Jenkins 
Reviewed-by: Thorsten Behrens 

diff --git a/chart2/qa/extras/chart2dump/data/axis_special_positioning.odp 
b/chart2/qa/extras/chart2dump/data/axis_special_positioning.odp
old mode 100755
new mode 100644
diff --git 
a/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_with_titles.ods 
b/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_with_titles.ods
old mode 100755
new mode 100644
diff --git 
a/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_without_titles.ods 
b/chart2/qa/extras/chart2dump/data/chartwall_auto_adjust_without_titles.ods
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/chartwall_custom_positioning.ods 
b/chart2/qa/extras/chart2dump/data/chartwall_custom_positioning.ods
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/column_chart_small_spacing.ods 
b/chart2/qa/extras/chart2dump/data/column_chart_small_spacing.ods
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/custom_legend_position.odp 
b/chart2/qa/extras/chart2dump/data/custom_legend_position.odp
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/default_formated_axis.odp 
b/chart2/qa/extras/chart2dump/data/default_formated_axis.odp
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/donut_chart.ods 
b/chart2/qa/extras/chart2dump/data/donut_chart.ods
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/exploded_pie_chart.ods 
b/chart2/qa/extras/chart2dump/data/exploded_pie_chart.ods
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/formated_axis_labels.odp 
b/chart2/qa/extras/chart2dump/data/formated_axis_labels.odp
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/formated_axis_lines.odp 
b/chart2/qa/extras/chart2dump/data/formated_axis_lines.odp
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/formated_grid_line.ods 
b/chart2/qa/extras/chart2dump/data/formated_grid_line.ods
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/horizontal_grid.ods 
b/chart2/qa/extras/chart2dump/data/horizontal_grid.ods
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/legend_on_bottom.odp 
b/chart2/qa/extras/chart2dump/data/legend_on_bottom.odp
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/legend_on_left_side.odp 
b/chart2/qa/extras/chart2dump/data/legend_on_left_side.odp
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/legend_on_right_side.odp 
b/chart2/qa/extras/chart2dump/data/legend_on_right_side.odp
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/legend_on_top.odp 
b/chart2/qa/extras/chart2dump/data/legend_on_top.odp
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/many_legend_entries.odp 
b/chart2/qa/extras/chart2dump/data/many_legend_entries.odp
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/minimal_legend_test.odp 
b/chart2/qa/extras/chart2dump/data/minimal_legend_test.odp
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/minor_grid.ods 
b/chart2/qa/extras/chart2dump/data/minor_grid.ods
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/multiple_categories.odp 
b/chart2/qa/extras/chart2dump/data/multiple_categories.odp
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/multiple_categories.ods 
b/chart2/qa/extras/chart2dump/data/multiple_categories.ods
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/normal_area_chart.ods 
b/chart2/qa/extras/chart2dump/data/normal_area_chart.ods
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/normal_bar_chart.ods 
b/chart2/qa/extras/chart2dump/data/normal_bar_chart.ods
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/normal_column_chart.ods 
b/chart2/qa/extras/chart2dump/data/normal_column_chart.ods
old mode 100755
new mode 100644
diff --git 
a/chart2/qa/extras/chart2dump/data/normal_line_chart_lines_and_points.ods 
b/chart2/qa/extras/chart2dump/data/normal_line_chart_lines_and_points.ods
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/normal_line_chart_lines_only.ods 
b/chart2/qa/extras/chart2dump/data/normal_line_chart_lines_only.ods
old mode 100755
new mode 100644
diff --git a/chart2/qa/extras/chart2dump/data/normal_line_chart_points_only.ods 

[Libreoffice-commits] core.git: chart2/qa sc/qa

2014-07-20 Thread David Tardon
 chart2/qa/extras/chart2export.cxx |2 +-
 sc/qa/unit/subsequent_export-test.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 8b273da280ad1502a17b72fde9ed8e5f44f0f710
Author: David Tardon dtar...@redhat.com
Date:   Sun Jul 20 16:17:53 2014 +0200

add SAL_OVERRIDE

Change-Id: I5c0f34f035765fcfd916b635ab18f5cb1bbcabb0

diff --git a/chart2/qa/extras/chart2export.cxx 
b/chart2/qa/extras/chart2export.cxx
index 44a3d66..b92e565 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -33,7 +33,7 @@ class Chart2ExportTest : public ChartTest, public XmlTestTools
 {
 protected:
 
-virtual void registerNamespaces(xmlXPathContextPtr pXmlXPathCtx);
+virtual void registerNamespaces(xmlXPathContextPtr pXmlXPathCtx) 
SAL_OVERRIDE;
 public:
 Chart2ExportTest() : ChartTest() {}
 void test();
diff --git a/sc/qa/unit/subsequent_export-test.cxx 
b/sc/qa/unit/subsequent_export-test.cxx
index 8215800..d1e1842 100644
--- a/sc/qa/unit/subsequent_export-test.cxx
+++ b/sc/qa/unit/subsequent_export-test.cxx
@@ -60,7 +60,7 @@ using namespace ::com::sun::star::uno;
 class ScExportTest : public ScBootstrapFixture, XmlTestTools
 {
 protected:
-virtual void registerNamespaces(xmlXPathContextPtr pXmlXPathCtx);
+virtual void registerNamespaces(xmlXPathContextPtr pXmlXPathCtx) 
SAL_OVERRIDE;
 public:
 ScExportTest();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits