summaryrefslogtreecommitdiff
path: root/writerfilter/qa
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2021-07-21 20:43:53 +0200
committerRegina Henschel <rb.henschel@t-online.de>2021-07-23 18:05:01 +0200
commit17cfd3d3e2e6f807eb1faf07436c7e96e15157a7 (patch)
tree8c55447bc5752c5d56318a647418c026e2d99d25 /writerfilter/qa
parent9b09e862558caf1aa6c71b11c8f4b7f873c12b7a (diff)
tdf#143455 exclude diagram from pos and margin adaptions
The current implementation of diagram (SmartArt) uses a SdrGroupObj, but it is actually not a group of the diagram parts. Currently the group's object list contains only one, dummy object. Therefore it works not well with the code parts used for groups. Because we will have (hopefully) the tender 'Dynamic Diagram feature' I have done nothing on diagrams, but as workaround only excluded diagrams from these code parts. That way the rendering is same as in LO 7.1. This part of code needs to be touched again, when diagrams are implemented in a different way. Change-Id: Ife4bb495c96fb1dd57663f28409dc2bb456282ab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119344 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'writerfilter/qa')
-rw-r--r--writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx19
-rw-r--r--writerfilter/qa/cppunittests/dmapper/data/tdf143455_SmartArtPosition.docxbin0 -> 24753 bytes
2 files changed, 19 insertions, 0 deletions
diff --git a/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx b/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
index ffd14a4f2082..edd6e02ff8ea 100644
--- a/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
+++ b/writerfilter/qa/cppunittests/dmapper/GraphicImport.cxx
@@ -57,6 +57,25 @@ void Test::tearDown()
constexpr OUStringLiteral DATA_DIRECTORY = u"/writerfilter/qa/cppunittests/dmapper/data/";
+CPPUNIT_TEST_FIXTURE(Test, testTdf143455SmartArtPosition)
+{
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf143455_SmartArtPosition.docx";
+ getComponent() = loadFromDesktop(aURL);
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(getComponent(), uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ uno::Reference<beans::XPropertySet> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
+ // Without fix in place the group, which represents the SmartArt, was placed at the initializing
+ // position 0|0.
+ sal_Int32 nHoriPosition = 0;
+ xShape->getPropertyValue("HoriOrientPosition") >>= nHoriPosition;
+ // The test would have failed with Expected: 2858, Actual: 0
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2858), nHoriPosition);
+ sal_Int32 nVertPosition = 0;
+ xShape->getPropertyValue("VertOrientPosition") >>= nVertPosition;
+ // The test would have failed with Expected: 1588, Actual: 0
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1588), nVertPosition);
+}
+
CPPUNIT_TEST_FIXTURE(Test, testTdf143208wrapTight)
{
OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf143208_wrapTight.docx";
diff --git a/writerfilter/qa/cppunittests/dmapper/data/tdf143455_SmartArtPosition.docx b/writerfilter/qa/cppunittests/dmapper/data/tdf143455_SmartArtPosition.docx
new file mode 100644
index 000000000000..1b1881b1e9ef
--- /dev/null
+++ b/writerfilter/qa/cppunittests/dmapper/data/tdf143455_SmartArtPosition.docx
Binary files differ