summaryrefslogtreecommitdiff
path: root/chart2/qa/extras
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2020-10-27 21:19:36 +0100
committerLászló Németh <nemeth@numbertext.org>2020-11-27 13:09:33 +0100
commit71b66b0039819f38c935b4eb5d5951ceaf6e8468 (patch)
treeeab56b348ec04845057e0fb65e4e7db5d59bcc31 /chart2/qa/extras
parent5951a867b87cbb88886968c1e2059f2cf461d11c (diff)
tdf#138307 Chart import: fix lost custom shape text
Do not set empty text to SdrOutliner, if it is already set. Note: Also fix the missing custom shape problem in tdf#72776 and tdf#93641. The wrong position (X:0, Y:0) of these shapes is another problem. Regression from commit 6f62a5c4ee2c1b7654c7fcaa618fb495e0d32f0a (tdf#128985: ODP: Style text directions revert to RTL on save and re-open) Change-Id: I07d8cb12836daf15db347f6bb19c17ed9373189e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104909 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'chart2/qa/extras')
-rw-r--r--chart2/qa/extras/chart2export.cxx20
-rw-r--r--chart2/qa/extras/chart2import.cxx2
-rw-r--r--chart2/qa/extras/data/ods/tdf72776.odsbin0 -> 14798 bytes
3 files changed, 19 insertions, 3 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index a39b36234862..d92e06cdc01c 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -184,6 +184,7 @@ public:
void testTdf137917();
void testTdf138204();
void testTdf138181();
+ void testCustomShapeText();
CPPUNIT_TEST_SUITE(Chart2ExportTest);
CPPUNIT_TEST(testErrorBarXLSX);
@@ -330,6 +331,7 @@ public:
CPPUNIT_TEST(testTdf137917);
CPPUNIT_TEST(testTdf138204);
CPPUNIT_TEST(testTdf138181);
+ CPPUNIT_TEST(testCustomShapeText);
CPPUNIT_TEST_SUITE_END();
@@ -3016,7 +3018,7 @@ void Chart2ExportTest::testTdf138181()
{
load("/chart2/qa/extras/data/xlsx/", "piechart_deleted_legendentry.xlsx");
Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
- UNO_QUERY_THROW);
+ UNO_QUERY_THROW);
Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
Reference<drawing::XShapes> xShapes(xDrawPage->getByIndex(0), UNO_QUERY_THROW);
@@ -3038,6 +3040,22 @@ void Chart2ExportTest::testTdf138181()
CPPUNIT_ASSERT(xLegendEntry3.is());
}
+void Chart2ExportTest::testCustomShapeText()
+{
+ load("/chart2/qa/extras/data/ods/", "tdf72776.ods");
+ reload("calc8");
+ Reference<chart::XChartDocument> xChartDoc(getChartDocFromSheet(0, mxComponent),
+ UNO_QUERY_THROW);
+ // test that the text of custom shape exists inside the chart
+ Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(xChartDoc, UNO_QUERY_THROW);
+ Reference<drawing::XDrawPage> xDrawPage(xDrawPageSupplier->getDrawPage(), UNO_SET_THROW);
+ Reference<drawing::XShape> xCustomShape(xDrawPage->getByIndex(1), UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xCustomShape.is());
+
+ Reference< text::XText > xRange(xCustomShape, uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(!xRange->getString().isEmpty());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 490b2ce2698d..cb8c08c0697e 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -30,8 +30,6 @@
#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
#include <com/sun/star/text/XTextRange.hpp>
-#include <com/sun/star/text/XText.hpp>
-#include <com/sun/star/text/XTextCursor.hpp>
#include <iterator>
#include <com/sun/star/util/Color.hpp>
diff --git a/chart2/qa/extras/data/ods/tdf72776.ods b/chart2/qa/extras/data/ods/tdf72776.ods
new file mode 100644
index 000000000000..4ddad64a5ef5
--- /dev/null
+++ b/chart2/qa/extras/data/ods/tdf72776.ods
Binary files differ