tdf#95706: RTF import: tolerant font table parsing
commit8daac72b7a0b7cdf6eb520273829c0c0c15ddef5
authorVasily Melenchuk <vasily.melenchuk@cib.de>
Thu, 7 Apr 2022 17:59:08 +0000 (7 20:59 +0300)
committerXisco Fauli <xiscofauli@libreoffice.org>
Mon, 11 Apr 2022 09:53:51 +0000 (11 11:53 +0200)
treed47b5e7be734d551452d9f22f0021b69f88080db
parent8e467c88d0ba6e70159382676af55b8ef8d65d54
tdf#95706: RTF import: tolerant font table parsing

While font name in font table should end with semicolon
({\fonttbl{\f42 Arial;}}) it is not always true and
MS Word is tolerant to it: it still able to parse this
correctly. Seems LO also should not require strict spec
conformance.

So idea of font parsing is changed: instead of inserting
font on semicolon, it is done on next \fN or destination
end. All collected text to this moment is a font name.

Change-Id: I6b41951217442a71fd2ebbfc58a3fc79f6f913db
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132686
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 844be7358f1eec00094a55fa1fb4fadadb8cd1bf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132699
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
sw/qa/extras/rtfexport/data/tdf95706_2.rtf [new file with mode: 0644]
sw/qa/extras/rtfexport/rtfexport4.cxx
writerfilter/source/rtftok/rtfdispatchvalue.cxx
writerfilter/source/rtftok/rtfdocumentimpl.cxx
writerfilter/source/rtftok/rtfdocumentimpl.hxx