summaryrefslogtreecommitdiff
path: root/sw/qa/extras/uiwriter/uiwriter.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-11-20 16:44:21 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-11-20 16:57:49 +0100
commit01fc08c0b5c57fef8ad3755672f4266d85e849a5 (patch)
tree9f1a7f71281feae7e9be344a94371495f1a77338 /sw/qa/extras/uiwriter/uiwriter.cxx
parent3d601cfa4b63580b5a0d18044b5792894d54089f (diff)
fdo#85554 SwXShape: fix getting ZOrder property when doc contains TextBoxes
Change-Id: I9b6b83f0f6d627bb14a880a19769ee70564cf52b
Diffstat (limited to 'sw/qa/extras/uiwriter/uiwriter.cxx')
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index d79b6b352d25..2ed5298f6aa0 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -56,6 +56,7 @@ public:
void testChineseConversionNonChineseText();
void testChineseConversionTraditionalToSimplified();
void testChineseConversionSimplifiedToTraditional();
+ void testFdo85554();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -78,6 +79,7 @@ public:
CPPUNIT_TEST(testChineseConversionNonChineseText);
CPPUNIT_TEST(testChineseConversionTraditionalToSimplified);
CPPUNIT_TEST(testChineseConversionSimplifiedToTraditional);
+ CPPUNIT_TEST(testFdo85554);
CPPUNIT_TEST_SUITE_END();
@@ -561,6 +563,29 @@ void SwUiWriterTest::testChineseConversionSimplifiedToTraditional()
}
+void SwUiWriterTest::testFdo85554()
+{
+ // Load the document, it contains one shape with a textbox.
+ load("/sw/qa/extras/uiwriter/data/", "fdo85554.odt");
+
+ // Add a second shape to the document.
+ uno::Reference<css::lang::XMultiServiceFactory> xFactory(mxComponent, uno::UNO_QUERY);
+ uno::Reference<drawing::XShape> xShape(xFactory->createInstance("com.sun.star.drawing.RectangleShape"), uno::UNO_QUERY);
+ xShape->setSize(awt::Size(10000, 10000));
+ xShape->setPosition(awt::Point(1000, 1000));
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<drawing::XDrawPage> xDrawPage = xDrawPageSupplier->getDrawPage();
+ xDrawPage->add(xShape);
+
+ // Save it and load it back.
+ reload("writer8", "fdo85554.odt");
+
+ xDrawPageSupplier.set(mxComponent, uno::UNO_QUERY);
+ xDrawPage = xDrawPageSupplier->getDrawPage();
+ // This was 1, we lost a shape on export.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2), xDrawPage->getCount());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();