summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2013-02-20 11:04:16 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-02-25 08:52:17 +0000
commitfd155af5369e3ec782c768f54781658d210e375c (patch)
treef8f018093c046b224d8f97da8f53de9fc247f946 /sw/qa/extras/ooxmlimport/ooxmlimport.cxx
parentf0cc8071aa5e9c058f6bf1a1144d84c5252987a7 (diff)
n#779642: Fixed floating tables import in writerfilter
(cherry picked from commit d0cde9640b52ccfbb28ed1f65bba0927afd7b69b) Change-Id: Id60a08811f238db505d51b0e1381427a8f5df9cf Reviewed-on: https://gerrit.libreoffice.org/2307 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'sw/qa/extras/ooxmlimport/ooxmlimport.cxx')
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index bb5e4e7667e7..69dc0cbfc779 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -1066,8 +1066,23 @@ void Test::testFineTableDash()
void Test::testN779642()
{
uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+
+ // First problem: check that we have 2 tables, nesting caused the
+ // creation of outer one to fail
uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTables->getCount());
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong number of imported tables", sal_Int32(2), xTables->getCount());
+
+ // Second problem: check that the outer table is in a frame, at the bottom of the page
+ uno::Reference<text::XTextTable> xTextTable(xTextTablesSupplier->getTextTables()->getByName("Table2"), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xAnchor(xTextTable->getAnchor(), uno::UNO_QUERY);
+ uno::Any aFrame = xAnchor->getPropertyValue("TextFrame");
+ uno::Reference<beans::XPropertySet> xFrame;
+ aFrame >>= xFrame;
+ sal_Int16 nValue;
+ xFrame->getPropertyValue("VertOrient") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation", nValue, text::VertOrientation::BOTTOM);
+ xFrame->getPropertyValue("VertOrientRelation") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong vertical orientation relation", nValue, text::RelOrientation::PAGE_PRINT_AREA);
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);