summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-09-02 10:27:49 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-09-03 17:08:03 +0200
commit5e502cf754e7c08e098ba401610aef76b4244f1f (patch)
tree40f2756276826cc20a5091f778397dd0624bb7d2 /sw
parentfc01e55ded5b517307a28a9ac8c438ce9ea5f967 (diff)
bnc#816593 DOCX import: ignore page breaks in tables
(cherry picked from commit 7d3778e0ef9f54f3c8988f1b84d58e7002d6c625) Conflicts: writerfilter/source/dmapper/DomainMapper.cxx Change-Id: Ibb250148d41d1929fa17dd993bb71c93c0e09dcf Conflicts: writerfilter/source/dmapper/DomainMapper_Impl.cxx
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/extras/ooxmlimport/data/table-pagebreak.docxbin0 -> 10148 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx11
2 files changed, 11 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/table-pagebreak.docx b/sw/qa/extras/ooxmlimport/data/table-pagebreak.docx
new file mode 100755
index 000000000000..06ecf9535af1
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/table-pagebreak.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index e85a2286b735..4da8664e649f 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -133,6 +133,7 @@ public:
void testTableFloating();
void testTableAutoNested();
void testTableStyleParprop();
+ void testTablePagebreak();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -215,6 +216,7 @@ void Test::run()
{"table-floating.docx", &Test::testTableFloating},
{"table-auto-nested.docx", &Test::testTableAutoNested},
{"table-style-parprop.docx", &Test::testTableStyleParprop},
+ {"table-pagebreak.docx", &Test::testTablePagebreak},
};
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
{
@@ -1349,6 +1351,15 @@ void Test::testTableStyleParprop()
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin"));
}
+void Test::testTablePagebreak()
+{
+ // Page break inside table: should be ignored (was style::BreakType_PAGE_BEFORE before).
+ CPPUNIT_ASSERT_EQUAL(style::BreakType_NONE, getProperty<style::BreakType>(getParagraphOrTable(2), "BreakType"));
+
+ // This one is outside the table: should not be ignored.
+ CPPUNIT_ASSERT_EQUAL(style::BreakType_PAGE_BEFORE, getProperty<style::BreakType>(getParagraph(3), "BreakType"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();