sw/qa/extras/rtfimport/data/fdo82512.rtf | 10 ++++++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 6 ++++++ writerfilter/source/dmapper/DomainMapper.cxx | 8 ++++++++ 3 files changed, 24 insertions(+)
New commits: commit dcb37dcebcde6188eb58ef7d8d34d08fea4badb8 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Sat Nov 1 22:00:46 2014 +0100 fdo#82512 RTF import: fix position of column break Change-Id: Ib0f39c4af7cc32d0f4491f13ea207d90a449a47d diff --git a/sw/qa/extras/rtfimport/data/fdo82512.rtf b/sw/qa/extras/rtfimport/data/fdo82512.rtf new file mode 100644 index 0000000..925cc4b --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo82512.rtf @@ -0,0 +1,10 @@ +{\rtf1\ansi\deff0 +\cols2\colsx709 +\pard\plain +{First col\par}{ +\column +\par +\par +Second col\par +} +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 90ae2ef..6639948 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2007,6 +2007,12 @@ DECLARE_RTFIMPORT_TEST(testFdo82076, "fdo82076.rtf") CPPUNIT_ASSERT_EQUAL(OUString("Footnote"), getProperty<OUString>(getRun(getParagraphOfText(1, xCell->getText()), 2), "TextPortionType")); } +DECLARE_RTFIMPORT_TEST(testFdo82512, "fdo82512.rtf") +{ + // This was style::BreakType_NONE, column break was before the 3rd paragraph, not before the 2nd one. + 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/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index a06935d..1491440 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2798,8 +2798,16 @@ void DomainMapper::lcl_text(const sal_uInt8 * data_, size_t len) m_pImpl->getTableManager().text(data_, len); return; case 0x0d: + { + PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH); + if (pContext && m_pImpl->isBreakDeferred(COLUMN_BREAK)) + { + pContext->Insert(PROP_BREAK_TYPE, uno::makeAny(style::BreakType_COLUMN_BEFORE)); + m_pImpl->clearDeferredBreak(COLUMN_BREAK); + } m_pImpl->finishParagraph(m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH)); return; + } case 0x13: m_pImpl->PushFieldContext(); return; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits