summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga991@gmail.com>2020-10-27 21:19:36 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2020-11-30 12:32:46 +0100
commit1aacd856ab0cf7217e2435c2e8c84d2e00963cb2 (patch)
tree9117725b6409fc53880c4c6625ab81b88ea72d38 /chart2
parentd5e786d78d2f72a39f02746d6e0faa04da72c60a (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> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106853 Tested-by: Jenkins
Diffstat (limited to 'chart2')
-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 483a862fee1c..67f0d31197d2 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