From 8a30ba573470d59dbb0501b488f8a655b015ffd2 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Sun, 16 Nov 2014 12:12:43 +0100 Subject: fdo#83204 RTF import: handle \pard after \bkmkstart Change-Id: I4f5f0f653f2ce7782ec1d1fc5ef550a21a9c1d35 --- sw/qa/extras/rtfimport/data/fdo83204.rtf | 9 +++++++++ sw/qa/extras/rtfimport/rtfimport.cxx | 6 ++++++ writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2 ++ 3 files changed, 17 insertions(+) create mode 100644 sw/qa/extras/rtfimport/data/fdo83204.rtf diff --git a/sw/qa/extras/rtfimport/data/fdo83204.rtf b/sw/qa/extras/rtfimport/data/fdo83204.rtf new file mode 100644 index 000000000000..39d89b0303e2 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo83204.rtf @@ -0,0 +1,9 @@ +{\rtf1 +{\stylesheet +{Normal;} +{\s1 heading 1;} +} +{\*\bkmkstart titlebookmark} +\pard\s1 Title\par +{\*\bkmkend titlebookmark} +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 54334b3c900a..6ad14b06ef77 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -2076,6 +2076,12 @@ DECLARE_RTFIMPORT_TEST(testUnbalancedColumns, "unbalanced-columns.rtf") CPPUNIT_ASSERT_EQUAL(true, getProperty(xTextSections->getByIndex(0), "DontBalanceTextColumns")); } +DECLARE_RTFIMPORT_TEST(testFdo83204, "fdo83204.rtf") +{ + // This was Standard, \sN was ignored after \bkmkstart and \pard. + CPPUNIT_ASSERT_EQUAL(OUString("Heading 1"), getProperty(getParagraph(1), "ParaStyleName")); +} + 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 c3211115261f..e51e23376262 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -2958,6 +2958,8 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword) m_aStates.top().nCurrentStyleIndex = -1; } } + // Need to send paragraph properties again, if there will be any. + m_bNeedPap = true; break; case RTF_SECTD: { -- cgit v1.2.3