[Libreoffice-commits] core.git: 2 commits - sw/qa
Miklos Vajna
vmiklos at suse.cz
Mon May 13 03:19:36 PDT 2013
sw/qa/extras/inc/swmodeltestbase.hxx | 12 ++++++++++++
sw/qa/extras/rtfimport/rtfimport.cxx | 11 -----------
sw/qa/extras/ww8import/data/n816593.doc |binary
sw/qa/extras/ww8import/data/n816603.doc |binary
sw/qa/extras/ww8import/ww8import.cxx | 23 ++++++++++++++++++++++-
5 files changed, 34 insertions(+), 12 deletions(-)
New commits:
commit 26ce47baf1dc7ccc965d00142ef8fd6ee2367f22
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Mon May 13 12:07:54 2013 +0200
bnc#816593 WW8 import testcase
This always worked, but I almost broke it with
8fe8bd6c3b5b1a539b7370f8c457fa69c061d2de.
Change-Id: I6b7817830da23afea758d1eb90395aeb01e32f67
diff --git a/sw/qa/extras/ww8import/data/n816593.doc b/sw/qa/extras/ww8import/data/n816593.doc
new file mode 100644
index 0000000..71cb9c4
Binary files /dev/null and b/sw/qa/extras/ww8import/data/n816593.doc differ
diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx
index 157fa09..d924ef3 100644
--- a/sw/qa/extras/ww8import/ww8import.cxx
+++ b/sw/qa/extras/ww8import/ww8import.cxx
@@ -31,6 +31,7 @@ public:
void testFdo59530();
void testI120158();
void testN816603();
+ void testN816593();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -55,6 +56,7 @@ void Test::run()
{"fdo59530.doc", &Test::testFdo59530},
{"i120158.doc", &Test::testI120158},
{"n816603.doc", &Test::testN816603},
+ {"n816593.doc", &Test::testN816593},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -260,6 +262,15 @@ void Test::testN816603()
CPPUNIT_ASSERT(getPages() > 1);
}
+void Test::testN816593()
+{
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xIndexAccess(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ // Make sure that even if we import the two tables as non-floating, we
+ // still consider them different, and not merge them.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xIndexAccess->getCount());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
commit 95d8fa0bcd3996b22af3736f439971f419e41255
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Mon May 13 11:58:11 2013 +0200
bnc#816603 testcase
Make sure that at least full-page-width multi-page floating tables are
imported on multiple pages.
Change-Id: Ifb974d50c50b1495634ac2652a3ae46235bb5f52
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index fc8682d..3f0fab8 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -10,9 +10,11 @@
#include <com/sun/star/container/XContentEnumerationAccess.hpp>
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
+#include <com/sun/star/text/XPageCursor.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/text/XTextTable.hpp>
+#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
#include <com/sun/star/table/XCell.hpp>
#include <test/bootstrapfixture.hxx>
@@ -312,6 +314,16 @@ protected:
}
}
+ /// Get page count.
+ int getPages()
+ {
+ uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
+ uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
+ xCursor->jumpToLastPage();
+ return xCursor->getPage();
+ }
+
uno::Reference<lang::XComponent> mxComponent;
xmlBufferPtr mpXmlBuffer;
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 8f3e113..f8c8a2f 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<text::XTextRange> xTextRange = uno::Reference<text::XTextRange>())
{
@@ -285,15 +283,6 @@ void Test::run()
}
}
-int Test::getPages()
-{
- uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
- uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xModel->getCurrentController(), uno::UNO_QUERY);
- uno::Reference<text::XPageCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY);
- xCursor->jumpToLastPage();
- return xCursor->getPage();
-}
-
void Test::testFdo45553()
{
uno::Reference<text::XTextDocument> 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 0000000..9186f62
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 645dbe8..157fa09 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();
More information about the Libreoffice-commits
mailing list