summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-11-16 12:12:43 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-11-16 12:37:03 +0100
commit8a30ba573470d59dbb0501b488f8a655b015ffd2 (patch)
treebe2cb13a3dc56000eaa10678b895e28617417834
parent7ae56e48e2a7473687657600eba7ead114983ea9 (diff)
fdo#83204 RTF import: handle \pard<para props> after \bkmkstart
Change-Id: I4f5f0f653f2ce7782ec1d1fc5ef550a21a9c1d35
-rw-r--r--sw/qa/extras/rtfimport/data/fdo83204.rtf9
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx6
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx2
3 files changed, 17 insertions, 0 deletions
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<bool>(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<OUString>(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:
{