From 95d8fa0bcd3996b22af3736f439971f419e41255 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 13 May 2013 11:58:11 +0200 Subject: bnc#816603 testcase Make sure that at least full-page-width multi-page floating tables are imported on multiple pages. Change-Id: Ifb974d50c50b1495634ac2652a3ae46235bb5f52 --- sw/qa/extras/inc/swmodeltestbase.hxx | 12 ++++++++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 11 ----------- sw/qa/extras/ww8import/data/n816603.doc | Bin 0 -> 67072 bytes sw/qa/extras/ww8import/ww8import.cxx | 12 +++++++++++- 4 files changed, 23 insertions(+), 12 deletions(-) create mode 100644 sw/qa/extras/ww8import/data/n816603.doc (limited to 'sw/qa') diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index fc8682d39f1c..3f0fab8c8545 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -10,9 +10,11 @@ #include #include #include +#include #include #include #include +#include #include #include @@ -312,6 +314,16 @@ protected: } } + /// Get page count. + int getPages() + { + uno::Reference xModel(mxComponent, uno::UNO_QUERY); + uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); + uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); + xCursor->jumpToLastPage(); + return xCursor->getPage(); + } + uno::Reference mxComponent; xmlBufferPtr mpXmlBuffer; diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 8f3e113fbb90..f8c8a2fe3d09 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -143,8 +143,6 @@ public: private: void run(); - /// Get page count. - int getPages(); /// Copy&paste helper. void paste(OUString aFilename, uno::Reference xTextRange = uno::Reference()) { @@ -285,15 +283,6 @@ void Test::run() } } -int Test::getPages() -{ - uno::Reference xModel(mxComponent, uno::UNO_QUERY); - uno::Reference xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY); - uno::Reference xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); - xCursor->jumpToLastPage(); - return xCursor->getPage(); -} - void Test::testFdo45553() { uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); diff --git a/sw/qa/extras/ww8import/data/n816603.doc b/sw/qa/extras/ww8import/data/n816603.doc new file mode 100644 index 000000000000..9186f628ff06 Binary files /dev/null and b/sw/qa/extras/ww8import/data/n816603.doc differ diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index 645dbe805a8e..157fa09a2ef6 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -30,6 +30,7 @@ public: void testAllGapsWord(); void testFdo59530(); void testI120158(); + void testN816603(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -52,7 +53,8 @@ void Test::run() {"n757905.doc", &Test::testN757905}, {"all_gaps_word.doc", &Test::testAllGapsWord}, {"fdo59530.doc", &Test::testFdo59530}, - {"i120158.doc", &Test::testI120158} + {"i120158.doc", &Test::testI120158}, + {"n816603.doc", &Test::testN816603}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -250,6 +252,14 @@ void Test::testI120158() CPPUNIT_ASSERT(sFieldResult.endsWith("AM") || sFieldResult.endsWith("PM")); } +void Test::testN816603() +{ + // Bugdoc was 5 page in Word, 1 in Writer due to pointlessly wrapping the + // table in a frame. Exact layout may depend on fonts available, etc. -- + // but at least make sure that our table spans over multiple pages now. + CPPUNIT_ASSERT(getPages() > 1); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); -- cgit v1.2.3