summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-08-02 21:44:02 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-08-02 21:44:02 +0200
commitc3657be928732f1b3b3b238f625de304a90a1ae1 (patch)
tree9f90b1bcee3c6e5c4c03ff0a167297235f38ea04
parent82e91af894fd257a7a197da487a5faecd7db90ca (diff)
fdo#80742 RTF filter: import RTF_OUTLINELEVEL
Change-Id: I49d94bd72af610e88128cd405e4786d2e9ba65ed
-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 e9cf28d1aec0..b36f96d1dcee 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1880,6 +1880,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 f2c0ae4f73cf..bd9d98005246 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -4525,6 +4525,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) << "'");