[Libreoffice-commits] core.git: sw/qa writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Sat Aug 2 12:54:35 PDT 2014


 sw/qa/extras/rtfimport/data/fdo80742.rtf       |    6 ++++++
 sw/qa/extras/rtfimport/rtfimport.cxx           |    7 +++++++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    3 +++
 3 files changed, 16 insertions(+)

New commits:
commit c3657be928732f1b3b3b238f625de304a90a1ae1
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Aug 2 21:44:02 2014 +0200

    fdo#80742 RTF filter: import RTF_OUTLINELEVEL
    
    Change-Id: I49d94bd72af610e88128cd405e4786d2e9ba65ed

diff --git a/sw/qa/extras/rtfimport/data/fdo80742.rtf b/sw/qa/extras/rtfimport/data/fdo80742.rtf
new file mode 100644
index 0000000..6055d13
--- /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 e9cf28d..b36f96d 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 f2c0ae4..bd9d980 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) << "'");


More information about the Libreoffice-commits mailing list