summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-09-03 11:52:51 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-09-03 17:17:21 +0200
commitd34ce87ddd17a66a074f47d11d8931e1d8594d64 (patch)
treeb929bbc45bd5b188739cc463f10b0618ac4559e6 /sw
parent5e502cf754e7c08e098ba401610aef76b4244f1f (diff)
fdo#68607 bnc#816593 DomainMapperTableHandler: don't always start a frame
This is a port of commit 8fe8bd6c3b5b1a539b7370f8c457fa69c061d2de "Related: fdo#61594 SwWW8ImplReader::StartApo: don't always start a frame" from the WW8 filter to the DOCX one. (regression from edc4861a68e0269b83b17e0ec57912a1ce4220ad) (cherry picked from commit 78d1f1c2835b9fae0f91ed771fc1d594c7817502) Change-Id: If1bb4a8a3786aacd618585cf859b57ce9be85c51
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/inc/swmodeltestbase.hxx12
-rw-r--r--sw/qa/extras/ooxmlimport/data/fdo68607.docxbin0 -> 36117 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx10
3 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx
index a4e821329aac..cf37f7f01f18 100644
--- a/sw/qa/extras/inc/swmodeltestbase.hxx
+++ b/sw/qa/extras/inc/swmodeltestbase.hxx
@@ -27,9 +27,11 @@
#include <com/sun/star/container/XContentEnumerationAccess.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>
@@ -248,6 +250,16 @@ protected:
return getProperty<OUString>(getProperty< uno::Reference<beans::XPropertySet> >(xFormula, "Model"), "Formula");
}
+ /// 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/ooxmlimport/data/fdo68607.docx b/sw/qa/extras/ooxmlimport/data/fdo68607.docx
new file mode 100644
index 000000000000..11f57064ce92
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/fdo68607.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 4da8664e649f..4d6733a59540 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -134,6 +134,7 @@ public:
void testTableAutoNested();
void testTableStyleParprop();
void testTablePagebreak();
+ void testFdo68607();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -217,6 +218,7 @@ void Test::run()
{"table-auto-nested.docx", &Test::testTableAutoNested},
{"table-style-parprop.docx", &Test::testTableStyleParprop},
{"table-pagebreak.docx", &Test::testTablePagebreak},
+ {"fdo68607.docx", &Test::testFdo68607},
};
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
{
@@ -1360,6 +1362,14 @@ void Test::testTablePagebreak()
CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, getProperty<style::BreakType>(getParagraph(3), "BreakType"));
}
+void Test::testFdo68607()
+{
+ // Bugdoc was 8 pages 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();