diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-06-16 18:27:34 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-06-16 18:34:09 +0200 |
commit | f0ed219c8f8c5c46e6244cc1bc0bb097b515574a (patch) | |
tree | 7a2c225d142062e5720785cda791bd53cc833241 /sw | |
parent | 040710161c507f6e4d0120cfb61d9d82bc6a0527 (diff) |
sw: move the textframe-table testcase from rtfimport to rtfexport
Change-Id: I7e9d26ec1f47d16e35e24fc4bd9482f5d899e79c
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfexport/data/textframe-table.rtf (renamed from sw/qa/extras/rtfimport/data/textframe-table.rtf) | 0 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 15 | ||||
-rw-r--r-- | sw/qa/extras/rtfimport/rtfimport.cxx | 15 |
3 files changed, 15 insertions, 15 deletions
diff --git a/sw/qa/extras/rtfimport/data/textframe-table.rtf b/sw/qa/extras/rtfexport/data/textframe-table.rtf index 8e07ea34fc0c..8e07ea34fc0c 100644 --- a/sw/qa/extras/rtfimport/data/textframe-table.rtf +++ b/sw/qa/extras/rtfexport/data/textframe-table.rtf diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 7de0a4bdf68a..0249426e2d8b 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -65,6 +65,7 @@ public: void testTextFrameBorders(); void testTextframeGradient(); void testRecordChanges(); + void testTextframeTable(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -119,6 +120,7 @@ void Test::run() {"textframe-borders.rtf", &Test::testTextFrameBorders}, {"textframe-gradient.rtf", &Test::testTextframeGradient}, {"record-changes.rtf", &Test::testRecordChanges}, + {"textframe-table.rtf", &Test::testTextframeTable}, }; // Don't test the first import of these, for some reason those tests fail const char* aBlacklist[] = { @@ -592,6 +594,19 @@ void Test::testRecordChanges() CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(mxComponent, "RecordChanges")); } +void Test::testTextframeTable() +{ + uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + uno::Reference<text::XTextRange> xTextRange(xDraws->getByIndex(0), uno::UNO_QUERY); + uno::Reference<text::XText> xText = xTextRange->getText(); + CPPUNIT_ASSERT_EQUAL(OUString("First para."), getParagraphOfText(1, xText)->getString()); + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2, xText), uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(OUString("A"), uno::Reference<text::XTextRange>(xTable->getCellByName("A1"), uno::UNO_QUERY)->getString()); + CPPUNIT_ASSERT_EQUAL(OUString("B"), uno::Reference<text::XTextRange>(xTable->getCellByName("B1"), uno::UNO_QUERY)->getString()); + CPPUNIT_ASSERT_EQUAL(OUString("Last para."), getParagraphOfText(3, xText)->getString()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 624b2b74273f..165a4f92dd07 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -142,7 +142,6 @@ public: void testPageBackground(); void testFdo62044(); void testPoshPosv(); - void testTextframeTable(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -272,7 +271,6 @@ void Test::run() {"page-background.rtf", &Test::testPageBackground}, {"fdo62044.rtf", &Test::testFdo62044}, {"posh-posv.rtf", &Test::testPoshPosv}, - {"textframe-table.rtf", &Test::testTextframeTable}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1286,19 +1284,6 @@ void Test::testPoshPosv() CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xDraws->getByIndex(0), "FrameIsAutomaticHeight")); } -void Test::testTextframeTable() -{ - uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); - uno::Reference<text::XTextRange> xTextRange(xDraws->getByIndex(0), uno::UNO_QUERY); - uno::Reference<text::XText> xText = xTextRange->getText(); - CPPUNIT_ASSERT_EQUAL(OUString("First para."), getParagraphOfText(1, xText)->getString()); - uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2, xText), uno::UNO_QUERY); - CPPUNIT_ASSERT_EQUAL(OUString("A"), uno::Reference<text::XTextRange>(xTable->getCellByName("A1"), uno::UNO_QUERY)->getString()); - CPPUNIT_ASSERT_EQUAL(OUString("B"), uno::Reference<text::XTextRange>(xTable->getCellByName("B1"), uno::UNO_QUERY)->getString()); - CPPUNIT_ASSERT_EQUAL(OUString("Last para."), getParagraphOfText(3, xText)->getString()); -} - CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |