Commit graph

26 commits

Author SHA1 Message Date
Javier Amor García e5f15f69df RTFHandler: protect against CR and bad hexadecimal sequence
In RTF is possible to specify characters with the sequence \'XX being
XX an hexadecimal number.
With this changeset we guard against incorrect hexadecimal numbers which
will be ignored.

The other change added is to ignore carriadge returns in plain text.
2016-02-01 16:55:20 +01:00
Javier Amor García 8e80b57d31 RTFHandler: support charsets in plain text
Allow to switch charset in RTF plain text parts.
2016-02-01 11:48:15 +01:00
Javier Amor García a0b15d0c8c Test for [RTFHandler parseFontTable]
This changeset includes changes in relevant classes to make
them easier to test.
2015-12-09 20:02:55 +01:00
Javier Amor García 94d4da6e1e Reimplemented [RTFHandler parse] to have an unambiguous decoding of control words
[RTFHandler parseFontTable] reimplemented on the same line.
2015-11-27 17:49:01 +01:00
Javier Amor García 2f63542e07 Fixed problem with ascii chars that had different unicode value
Also cleaned a bit the parse loop
2015-11-27 17:49:01 +01:00
Javier Amor García 3155bd0172 Fixed bug which created unnecesary font tags 2015-11-27 17:34:08 +01:00
Javier Amor García 2518b37e32 Fixed RTF support for unicode characters greater than 32767 2015-11-27 17:34:08 +01:00
Javier Amor García 8e3e4a5445 Added RTF escapes parsing 2015-11-27 17:34:07 +01:00
Javier Amor García 01dcf3d6c8 Fixed activation of characters sets in [RTFHandler parse] 2015-11-27 17:34:07 +01:00
Javier Amor García fa4d3a0e20 Reimplementation of [RTFHandler parseFontTable] 2015-11-27 17:34:06 +01:00
Ludovic Marcotte f2b5f5917b Fixed dot notation 2015-04-27 15:02:00 -04:00
Jesús García Sáez 637ac1e98a oc-rtf: no color table definition
Be able to parse rtf files without color table defined
\colortbl
2015-03-18 18:06:49 +01:00
Jesús García Sáez 6e00274988 oc-rtf: safe parse ignoring content
Be able to parse safely \*\xxxxx control words with \binXXXX
elements inside it (before final })
2015-03-12 17:13:17 +01:00
Jesús García Sáez f9550b9181 oc: several uninitialized variables 2015-01-19 15:35:44 +01:00
Jesús García Sáez 501ee79766 oc-rtf: fix parse \pict tag with \bin data 2014-12-23 11:14:54 +01:00
Enrique J. Hernández Blasco 258444bb93 oc-rtf: Be more resilient to spaces while parsing font tables
This avoids to crash on this example:

  \f0\fibi \fcharset0
   -------^

Or:

  \f0 \fibi\fcharset0
   --^

Take into account that I found lots of RTF documents with this format:

  \f0\fbidi \froman\fcharset0
  \f0\froman\fprq2 \fcharset0

Which are not unsupported by this handler.
2014-11-19 17:12:30 +01:00
Enrique J. Hernández Blasco 75ce59d010 oc-rtf: Fix current position to match where _bytes pointer is
This avoids to have extra unknown bytes at the end of the RTF document
as _len would have been reached but _current_pos had incorrect less value.
2014-11-19 17:12:29 +01:00
Enrique J. Hernández Blasco cbfcd54858 oc-rtf: Use what RTF Spec 1.9.1 for control words
This reverts 7581c0a.
2014-11-19 17:12:29 +01:00
Jesús García Sáez 05578bfcb6 oc-rtf: control words can also have a space before next tag
This was causing to parse a single space as an empty control
word with length 0, which was the source of several crashes.

Example:

  \f0\fbidi \fcharset0
   --------^

font index is 0, font family is bidi but when parsing charset we were
assuming control word was '' instead of 'charset0'.

This only fixes the crashes, the parseFontTable function works quite
awful right now.
2014-11-19 17:12:28 +01:00
Jesús García Sáez 5ee8cb3a3f oc-rtf: check valid font name when generating <font> tag 2014-11-19 17:12:27 +01:00
Jesús García Sáez 4e3a242f2f oc-rtf: Don't crash when we don't know the specified font 2014-11-19 17:12:27 +01:00
Ludovic Marcotte 99d38417cc Fix for bug #2354 2013-09-25 13:51:42 -04:00
Ludovic Marcotte cd4abe4b5b Fix for bug 2398 2013-09-06 13:48:44 -04:00
Ludovic Marcotte 9d9a434fdc Avoid crashing when reading fcs crap. 2013-06-20 15:44:35 -04:00
Ludovic Marcotte 6a8e6cd762 Fixed the GNUmakfile and const's for charset tables. 2013-03-28 08:32:00 -04:00
Ludovic Marcotte 663351029a Replaced unrtf by our own RTF to HTML converter.
Faster, thread safe, a hell lot cleaner.
2013-03-26 19:32:08 -04:00