[Libreoffice] [PUSHED] Preserve RTF \'00 sequences (NUL) in strings

Caolán McNamara caolanm at redhat.com
Tue Jul 19 06:51:38 PDT 2011


On Tue, 2011-07-19 at 22:18 +1000, Troy Rollo wrote:
> On Tuesday 19 July 2011, Caolán McNamara wrote:
> > Well, this'll work I guess, and I'm minded to push it, but why ;-) Is
> > there a concrete bug this fixes ?
> 
> Yes, but it is a little obscure. If you take the attached ODT file, save it as 
> an RTF, and then load the RTF, the prefix to the paragraph number will be 
> wrong ("\x05(" instead of "(["). With the patch, it works. The problem is that 
> in this file, the leveltext field in the number format is (correctly) exported 
> to RTF as follows:
> 
>       \'05([\'00])

Ahhh, gotcha. Indeed, nice catch. Looks good to me, and gives the
expected results. Pushed. Can you confirm the patch is under our
preferred LGPLv3+/MPLv1.1 combo ?

C.

As an aside we should check if the rtl::O[U]StringBuffer append's with a
0 character actually do append a 0 to the end of a already null
terminated string so the ugliness can go away if/when the conversion
train hits that code.



More information about the LibreOffice mailing list