sw/qa/extras/rtfimport/data/tdf108951.rtf      |   38 +++++++++++++++++++++++++
 sw/qa/extras/rtfimport/rtfimport.cxx           |    9 +++++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    2 -
 3 files changed, 48 insertions(+), 1 deletion(-)

New commits:
commit d216e9c5a3d5097a21e10540532e8b81fed65039
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Mon Jul 24 22:45:34 2017 +0200

    tdf#108951 RTF import: fix missing custom bullet types
    
    Regression from commit f528f9499bd91b700c549575e88fa102cfffede9
    (tdf#106953 RTF import: fix missing paragraph left margin, 2017-05-16)
    where I fixed the parent of the ooxml::CT_NumPr_numId token at one
    place, but forgot to adapt RTFDocumentImpl::popState() accordingly.
    
    (cherry picked from commit 1e87e93132f808ab95eab932b36bfe40d3cc607a)
    
    Conflicts:
            sw/qa/extras/rtfimport/rtfimport.cxx
    
    Change-Id: Ibddd2486a50f284e11c2cd96339e7140b427aae1
    Reviewed-on: https://gerrit.libreoffice.org/40385
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sw/qa/extras/rtfimport/data/tdf108951.rtf 
b/sw/qa/extras/rtfimport/data/tdf108951.rtf
new file mode 100644
index 000000000000..d3b7f042dd8f
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf108951.rtf
@@ -0,0 +1,38 @@
+{\rtf1\ansi\ansicpg1252\deff0\deflang1033
+{\fonttbl
+{\f0\fnil\fcharset0\fprq0\fttruetype Times New Roman;}
+{\f1\fnil\fcharset0\fprq0\fttruetype NULL;}
+{\f2\fnil\fcharset0\fprq0\fttruetype Symbol;}
+{\f3\fnil\fcharset0\fprq0\fttruetype Dingbats;}
+{\f4\fnil\fcharset0\fprq0\fttruetype Arial;}
+{\f5\fnil\fcharset0\fprq0\fttruetype Courier New;}
+}
+{\stylesheet
+{\s15 Normal;}
+}
+{\*\listtable
+{\list\listtemplateid372490334\listsimple
+{\listlevel\levelnfc23\levelstartat0\levelspace0\levelfollow0\fi-431\li720
+{\leveltext\'01\'b7 ;}
+{\levelnumbers;}
+\f2}
+\listid616308743}
+{\list\listtemplateid1541166935\listsimple
+{\listlevel\levelnfc23\levelstartat0\levelspace0\levelfollow0\fi-431\li720
+{\leveltext\'01\'2d ;}
+{\levelnumbers;}
+\f0}
+\listid1601185492}
+}
+{\*\listoverridetable
+{\listoverride\listoverridecount0\listid616308743\ls1}
+{\listoverride\listoverridecount0\listid1601185492\ls2}
+}
+\pard\fi-431\li720\s15
+{\*\pn\pnql\pnstart0\pnlvlblt
+{\pntxtb -}
+}
+\ls2\ilvl0
+{\lang1033
+dashed}
+\par}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 4aa390a99884..bf8188db99d6 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -319,6 +319,15 @@ DECLARE_RTFIMPORT_TEST(testFdo47326, "fdo47326.rtf")
     CPPUNIT_ASSERT_EQUAL(19, getLength());
 }
 
+DECLARE_RTFIMPORT_TEST(testTdf108951, "tdf108951.rtf")
+{
+    // This test is import-only, as we assert the list ID, which is OK to
+    // re-order on export, but then this test would not pass anymore.
+
+    // \ls2 was imported as WWNum1.
+    CPPUNIT_ASSERT_EQUAL(OUString("WWNum2"), 
getProperty<OUString>(getParagraph(1), "NumberingStyleName"));
+}
+
 DECLARE_RTFIMPORT_TEST(testFdo47036, "fdo47036.rtf")
 {
     uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, 
uno::UNO_QUERY);
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx 
b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index c49ae29af150..1668d70f5c30 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2890,7 +2890,7 @@ RTFError RTFDocumentImpl::popState()
 
             // Use it
             putNestedSprm(m_aStates.top().aParagraphSprms, 
NS_ooxml::LN_CT_PPrBase_numPr, NS_ooxml::LN_CT_NumPr_ilvl, pIlvlValue);
-            putNestedSprm(m_aStates.top().aParagraphSprms, 
NS_ooxml::LN_CT_PPrBase_tabs, NS_ooxml::LN_CT_NumPr_numId, pIdValue);
+            putNestedSprm(m_aStates.top().aParagraphSprms, 
NS_ooxml::LN_CT_PPrBase_numPr, NS_ooxml::LN_CT_NumPr_numId, pIdValue);
         }
     }
     break;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to