summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-07-17 14:59:19 +0200
committerAndras Timar <andras.timar@collabora.com>2014-11-23 14:32:28 +0100
commit5ad64c2a86a081c42f32ee247c2787db0a89c1de (patch)
tree7404d375ba4cfbfa44dbb77f0741bc7e3162ab85 /sw
parentd3bfbe6d3c5fd074c8ab14bfd82e2ea6a15a9dcc (diff)
fdo#84645 RTF import: set DontBalanceTextColumns=true for the last section ...
... if it has multiple columns. See commit d185204737031955c56a24356ed003d342548434 (DOCX import: set DontBalanceTextColumns=true for the last section, 2014-07-17) for the DOCX equivalent of this problem; this just adapts the RTF tokenizer to dmapper. (cherry picked from commit d185204737031955c56a24356ed003d342548434) (cherry picked from commit f4bb73164a51ec83fe1d5975b1232d35f8a9e88a) Change-Id: Ib30f9b386e204b8b2987832ab17ee0cc53b3f0bc Reviewed-on: https://gerrit.libreoffice.org/12462 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/extras/ooxmlimport/data/unbalanced-columns.docxbin0 -> 12820 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx8
-rw-r--r--sw/qa/extras/rtfimport/data/unbalanced-columns.rtf5
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx8
4 files changed, 21 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/unbalanced-columns.docx b/sw/qa/extras/ooxmlimport/data/unbalanced-columns.docx
new file mode 100755
index 000000000000..da6f93f760ae
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/unbalanced-columns.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 900a25ee478c..008200958116 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2395,6 +2395,14 @@ DECLARE_OOXMLIMPORT_TEST(testBnc821804, "bnc821804.docx")
CPPUNIT_ASSERT_EQUAL(false,getProperty<bool>(getRun(getParagraph(10), 3), "IsStart"));
}
+DECLARE_OOXMLIMPORT_TEST(testUnbalancedColumns, "unbalanced-columns.docx")
+{
+ uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY);
+ // This was false, last section was balanced, but it's unbalanced in Word.
+ CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTextSections->getByIndex(2), "DontBalanceTextColumns"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/extras/rtfimport/data/unbalanced-columns.rtf b/sw/qa/extras/rtfimport/data/unbalanced-columns.rtf
new file mode 100644
index 000000000000..aa57e382dc33
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/unbalanced-columns.rtf
@@ -0,0 +1,5 @@
+{\rtf1
+\cols2
+\pard\plain First paragraph.\par
+Second paragraph.\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 1214051dc7aa..8a6c6daa4edf 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -2009,6 +2009,14 @@ DECLARE_RTFIMPORT_TEST(testFdo82512, "fdo82512.rtf")
CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType"));
}
+DECLARE_RTFIMPORT_TEST(testUnbalancedColumns, "unbalanced-columns.rtf")
+{
+ uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTextSections(xTextSectionsSupplier->getTextSections(), uno::UNO_QUERY);
+ // This was false, last section was balanced, but it's unbalanced in Word.
+ CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xTextSections->getByIndex(0), "DontBalanceTextColumns"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */