summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-08-02 21:44:02 +0200
committerMichael Stahl <mstahl@redhat.com>2014-08-04 12:52:57 +0000
commit6ce5eaf63f2bcc3f61abd20bbf84751c3ba4741e (patch)
tree05ec4922da777b7036909cde5fd2cc37520d722f
parent0eb715086898543fb09addb6cd68526120f81f73 (diff)
fdo#80742 RTF filter: import RTF_OUTLINELEVEL
(cherry picked from commit c3657be928732f1b3b3b238f625de304a90a1ae1) Change-Id: I49d94bd72af610e88128cd405e4786d2e9ba65ed Reviewed-on: https://gerrit.libreoffice.org/10727 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--sw/qa/extras/rtfimport/data/fdo80742.rtf6
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx7
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx3
3 files changed, 16 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo80742.rtf b/sw/qa/extras/rtfimport/data/fdo80742.rtf
new file mode 100644
index 000000000000..6055d13da0c1
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo80742.rtf
@@ -0,0 +1,6 @@
+{\rtf1
+{\stylesheet
+{\s13\outlinelevel1 Heading 2;}
+}
+\pard\s13\plain hello\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 5ed5d3621a68..21458df40380 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1813,6 +1813,13 @@ DECLARE_RTFIMPORT_TEST(testOleInline, "ole-inline.rtf")
CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AS_CHARACTER, getProperty<text::TextContentAnchorType>(getShape(1), "AnchorType"));
}
+DECLARE_RTFIMPORT_TEST(testFdo80742, "fdo80742.rtf")
+{
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("ParagraphStyles")->getByName("Heading 2"), uno::UNO_QUERY);
+ // This was 0, outline level was body text.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty<sal_Int32>(xPropertySet, "OutlineLevel"));
+}
+
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 5823b7042bb1..19172761c0fa 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -4550,6 +4550,9 @@ int RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam)
case RTF_RIN:
lcl_putNestedAttribute(m_aStates.top().aParagraphSprms, NS_ooxml::LN_CT_PPrBase_ind, NS_ooxml::LN_CT_Ind_end, pIntValue);
break;
+ case RTF_OUTLINELEVEL:
+ m_aStates.top().aParagraphSprms.set(NS_ooxml::LN_CT_PPrBase_outlineLvl, pIntValue);
+ break;
default:
{
SAL_INFO("writerfilter", "TODO handle value '" << lcl_RtfToString(nKeyword) << "'");