[Libreoffice-commits] core.git: sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Fri Jun 20 04:13:45 PDT 2014
sw/qa/extras/rtfimport/data/column-break.rtf | 1 +
sw/qa/extras/rtfimport/rtfimport.cxx | 6 ++++++
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 1 +
3 files changed, 8 insertions(+)
New commits:
commit 3ea80a46860f7fe510b206845b56daad1e2d1c56
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Jun 20 12:52:03 2014 +0200
RTF import: handle column break at the very start of the document
Change-Id: Ib7d166bf1b1e5d5216d822b2b0396aa4dc535c6f
diff --git a/sw/qa/extras/rtfimport/data/column-break.rtf b/sw/qa/extras/rtfimport/data/column-break.rtf
new file mode 100644
index 0000000..185fcd0
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/column-break.rtf
@@ -0,0 +1 @@
+{\rtf1\cols2\column hello\par}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 3dec26e..d834fb8 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1759,6 +1759,12 @@ DECLARE_RTFIMPORT_TEST(testFontOverride, "font-override.rtf")
CPPUNIT_ASSERT_EQUAL(OUString("Arial"), getProperty<OUString>(getRun(getParagraph(1), 1), "CharFontName"));
}
+DECLARE_RTFIMPORT_TEST(testColumnBreak, "column-break.rtf")
+{
+ // Column break at the very start of the document was ignored.
+ CPPUNIT_ASSERT_EQUAL(style::BreakType_COLUMN_BEFORE, getProperty<style::BreakType>(getParagraph(2), "BreakType"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 3a7ebfb..1be8c91 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2243,6 +2243,7 @@ int RTFDocumentImpl::dispatchSymbol(RTFKeyword nKeyword)
if (pNum.get() && pNum->getInt() > 1)
bColumns = true;
}
+ checkFirstRun();
if (bColumns)
{
sal_uInt8 sBreak[] = { 0xe };
More information about the Libreoffice-commits
mailing list