https://bugs.documentfoundation.org/show_bug.cgi?id=105910
Bug ID: 105910
Summary: Allow defaults to be used as parameters for RTF
control words without explicit parameters
Product: LibreOffice
Version: Inherited From OOo
Hardware: All
OS: All
Status: UNCONFIRMED
Keywords: difficultyBeginner, easyHack, filter:rtf
Severity: normal
Priority: medium
Component: Writer
Assignee: libreoffice-bugs@lists.freedesktop.org
Reporter: mikekagan...@hotmail.com
CC: vmik...@collabora.co.uk
As stated in "Conventions of an RTF Reader" of RTF Specification v.1.9.1:
> If a parameter is needed and not specified, then a default value is used.
> The default value used depends on the control word. If the control word
> does not specify a default, then RTF readers should assume a default of 0
> except for the toggle control words (like \b), which have a default of 1
Before 2a49c656e7d7643f8e47f1bae43f5540e80c1bf3, any control word that requires
parameter behaved as if it had 0 as default.
Currently, RTFTokenizer::dispatchKeyword
(writerfilter/source/rtftok/rtftokenizer.cxx) ignores control words that need
parameters (CONTROL_VALUE) without parameter specified explicitly (except
\dibitmap).
This may cause different RTF import problems. It is not a regression, because
it didn't work properly in OOo.
The proposal is to extend RTFSymbol struct
(writerfilter/source/rtftok/rtfcontrolwords.hxx) to include a default value
(will be 0 for most), and specify actual defaults in aRTFControlWords
(writerfilter/source/rtftok/rtfcontrolwords.cxx). Then use the default as
parameter to RTFListener::dispatchValue in case when there's no explicit
parameter (bParam==false) in RTFTokenizer::dispatchKeyword.
The task requires C++ knowledge on beginner level, and careful reading of RTF
documentation:
https://download.microsoft.com/download/2/f/5/2f599e18-07ee-4ec5-a1e7-f4e6a9423592/Word2007RTFSpec9.docx
--
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs