[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sw/qa writerfilter/source

Michael Stahl mstahl at redhat.com
Mon Apr 10 14:23:13 UTC 2017


 sw/qa/extras/rtfimport/data/hexcrlf.rtf        |    6 ++++++
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |    6 ++++--
 2 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit fd93d09a5b6226a8297b5dd995301d514ec7b8ca
Author: Michael Stahl <mstahl at redhat.com>
Date:   Fri Apr 7 22:29:15 2017 +0200

    tdf#106692 writerfilter: RTF import: fix \'0d in \leveltext
    
    It's not a newline but yet another one of those bizarre RTF-encodings.
    
    (regression from 10e733908038407791f9c14af2a86417cc4a653c)
    
    Change-Id: I568050b031b95ac0b6ebfa1a0c39107e62f68bed
    (cherry picked from commit 69b7204164945cfed385d58e64592ce1b17937d7)
    Reviewed-on: https://gerrit.libreoffice.org/36284
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/qa/extras/rtfimport/data/hexcrlf.rtf b/sw/qa/extras/rtfimport/data/hexcrlf.rtf
index 7c7ed1a9b5f8..1aaa0839c7eb 100644
--- a/sw/qa/extras/rtfimport/data/hexcrlf.rtf
+++ b/sw/qa/extras/rtfimport/data/hexcrlf.rtf
@@ -1,4 +1,10 @@
 {\rtf1
+{\*\listtable
+{\list\listtemplateid1
+{\listlevel{\leveltext \'0d\'00.\'01.\'02.\'03.\'04.\'05.\'06}{\levelnumbers \'01\'03\'05\'07\'09\'0b\'0d}}
+{\listname Heading;}\listid1199164
+}}
+
 foo\'0dba
 r\'0abaz\'0d\'0aquux
 \par }
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 07ecb5fd5c2c..e1932c050847 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1116,8 +1116,10 @@ RTFError RTFDocumentImpl::resolveChars(char ch)
         if (!bSkipped)
         {
             // note: apparently \'0d\'0a is interpreted as 2 breaks, not 1
-            if (m_aStates.top().eDestination != Destination::DOCCOMM
-                && (ch == '\r' || ch == '\n'))
+            if ((ch == '\r' || ch == '\n')
+                    && m_aStates.top().eDestination != Destination::DOCCOMM
+                    && m_aStates.top().eDestination != Destination::LEVELNUMBERS
+                    && m_aStates.top().eDestination != Destination::LEVELTEXT)
             {
                 checkUnicode(/*bUnicode =*/ false, /*bHex =*/ true);
                 dispatchSymbol(RTF_PAR);


More information about the Libreoffice-commits mailing list