From f03cb8214a2b1b3de8d93c1a19319ecc82e4b21d Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 5 Mar 2024 12:46:42 +0100 Subject: [PATCH] tdf#99969: chart2_uichart: Add unittest Change-Id: Iddf64e07b4f6ee6913965b294d8a41904d2fc558 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164418 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- chart2/qa/extras/data/ods/tdf99969.ods | Bin 0 -> 14472 bytes chart2/qa/extras/uichart.cxx | 75 +++++++++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 chart2/qa/extras/data/ods/tdf99969.ods diff --git a/chart2/qa/extras/data/ods/tdf99969.ods b/chart2/qa/extras/data/ods/tdf99969.ods new file mode 100644 index 0000000000000000000000000000000000000000..f30212ec73b4ab18cab13219e0972304ba99e10c GIT binary patch literal 14472 zcmbVz1wb9i(k|{E2of9;EI7e~1b26rgS%^RcXxLW!GatlxVyUrclQUocmHJf?(X~F zE0{UcbEdxO)6-pFO?9=j7&rtv2nY-aNTOS{u%8)QFbxO@$jkP83dG#l9AM{c1<YR%exF= zK|o$MtY=JlBYSgQ3ms!KTUxt64r#0`41=U4g%IIz;GQo*6cOf^ef|VKZ%;7b&-<7p zG5`n&IEb{kyZ{0e1TiKeB@Hzd4HM)0_sn$Uob)7IOw^1FtXv;iSlKzqSjAY_`Pl@- z7(OX*ipz6JD)V!E_{1$B!pp(K!y_gnE+PC$OjJ}rNLEx@N=#N>LS9WlLQqy%R8@>m zQ%YD#Qb|cxQbn3yLsm>nMM_RqPEKA;UQJa^UPe=1Rb53vT}@qF-9%nhUrkd_MZ;27 z%UVjuL{{HSOBbM_Z>j*WfBuQe29D}xZU%BZhN_ar8d7?S(z>d0dRl5m3i8HEnx>l4 zMyjety6TSl%6fYGdH`d9k*Ntl*T~Sw)EHoDW@cb&XJ+kWXKrL=W$9{bW^H3*WA9?` z{Mp6c*4^2`)y-Ya!cWWEOV8F<&pFt{-pA6(&(t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P4bHFB_P@nx`5T;H zsqUX~UdZmJT>TBse^KA>V1L-IUv26O`TZ0o`hTE8X)(xW0}KL!@%-odJlS)_@KX9e D7rWAf literal 0 HcmV?d00001 diff --git a/chart2/qa/extras/uichart.cxx b/chart2/qa/extras/uichart.cxx index 2638367c8506..e2f3d9a9d0b3 100644 --- a/chart2/qa/extras/uichart.cxx +++ b/chart2/qa/extras/uichart.cxx @@ -104,6 +104,81 @@ void Chart2UiChartTest::testCopyPasteToNewSheet(uno::Reference xChartDoc(getChartCompFromSheet(0, 0, mxComponent), + uno::UNO_QUERY_THROW); + sal_Int32 nColumns = 2; + sal_Int32 nRows = 6; + 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", nColumns, + aExpectedColumnDescriptions.getLength()); + + uno::Sequence aExpectedRowDescriptions = xChartData->getRowDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in origin file", nRows, + aExpectedRowDescriptions.getLength()); + + Sequence> aExpectedData = xChartData->getData(); + + dispatchCommand(mxComponent, ".uno:GoToCell", + { comphelper::makePropertyValue("ToPoint", uno::Any(OUString("C2:L25"))) }); + + dispatchCommand(mxComponent, ".uno:Copy", {}); + + // create a new document + load("private:factory/scalc"); + + dispatchCommand(mxComponent, ".uno:Paste", {}); + + 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_MESSAGE("Incorrect number of columns in destination file", nColumns, + aColumnDesc.getLength()); + for (sal_Int32 i = 0; i < nColumns; ++i) + { + // Without the fix in place, this test would have failed with + // - Expected: ABC + // - Actual : + // - Incorrect description in column: 0 + OString sMessage("Incorrect description in column: " + OString::number(i)); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), aExpectedColumnDescriptions[i], + aColumnDesc[i]); + } + + Sequence aRowDesc = xDataArray->getRowDescriptions(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect number of rows in destination file", nRows, + aRowDesc.getLength()); + for (sal_Int32 i = 0; i < nRows; ++i) + { + OString sMessage("Incorrect description in row: " + OString::number(i)); + CPPUNIT_ASSERT_EQUAL_MESSAGE(sMessage.getStr(), aExpectedRowDescriptions[i], aRowDesc[i]); + } + + Sequence> aData = xDataArray->getData(); + + for (sal_Int32 nRowIdx = 0; nRowIdx < nRows; ++nRowIdx) + { + for (sal_Int32 nColIdx = 0; nColIdx < nColumns; ++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_EQUAL_MESSAGE(sMessage.getStr(), nExpected, nValue); + } + } +} + CPPUNIT_TEST_FIXTURE(Chart2UiChartTest, testTdf120348) { loadFromFile(u"ods/tdf120348.ods");