Commit Graph

77 Commits

Author SHA1 Message Date
Nikolay Sivov 1d5c9defb1 riched20: Remove New() allocation macro.
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2021-09-30 21:24:21 +02:00
Huw Davies da50829128 riched20: Pass para ptrs to the various para selection functions.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-28 09:53:39 +01:00
Fabian Maurer 4600169fd4 riched20: Properly handle \0 inside rtf input.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=43630
Signed-off-by: Fabian Maurer <dark.shadow4@web.de>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-11-09 21:08:09 +01:00
Michael Stefaniuc 90aea35b9e riched20: Use the ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-09-11 11:12:08 +02:00
Michael Stefaniuc f002aec139 riched20: Avoid an ARRAY_SIZE-like macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-10 10:36:49 +02:00
Huw Davies 17b7cde00e riched20: The background colour is set using \highlight.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-06-05 19:48:47 +02:00
Huw Davies 880b45ffb0 riched20: Implement parsing of the paragraph numbering destination.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-07 13:12:06 +02:00
Huw Davies da7c4f9753 riched20: Add handling for a few more special characters.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-01 01:50:13 +09:00
Huw Davies 372a16af63 riched20: Don't apply paragraph formatting until the end of paragraph.
Specifically this means that if the final paragraph does not end in
a trailing \par, then new formatting is not applied to that paragraph.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-03-01 01:50:13 +09:00
Huw Davies 2d23a95c96 riched20: Add support for the \shppict destination.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-10-28 22:31:27 +09:00
Frédéric Delanoy 2e5cb7aac8 Assorted spelling/grammar fixes. 2014-04-30 18:34:20 +02:00
Frédéric Delanoy 5f88ba5b61 riched20: Use BOOL type where appropriate. 2014-03-19 11:33:22 +01:00
Austin English 0776a76eef riched20: Remove duplicate declaration. 2014-02-11 19:19:13 +01:00
Huw Davies 368f9123c9 riched20: Flush the output buffer before a codepage change. 2012-12-05 20:23:51 +01:00
Michael Stefaniuc fc3e2ba954 riched20: Don't print the function name twice in ERR/WARN.
The ERR/WARN macros already print the function name.
2010-02-04 13:39:28 +01:00
Marcus Meissner c848e4ee86 riched20: Check for NULL in rtf reader (Coverity). 2009-12-03 10:21:44 +01:00
Dylan Smith c6cf567706 richedit: Properly restore style after end of rtf group.
Rich text files have groupings of text, where styles are pushed onto
the stack when encountering a start of the group, then popped at the
end of the group.  This was being handled improperly before, because a
single styleChanged flag was being stored to keep track of whether the
style needed to be restored at the end of a group. This fails to work
properly since the single flag isn't keeping track of all the levels
of the stack, so some styles are not restored properly.
2009-07-20 12:18:43 +02:00
Dylan Smith dde41d5c13 richedit: Handle missing colours in rtf colour table.
When a colour table entry is empty, then the default colour is used.
For an incomplete colour table entry 0 is used for the missing colours.

Previously the -1 value used internally for missing colours was being
converted into white, where it should be using the default colour that
is normally black.

This bug could be seen by loading the following rich text into wordpad:
{\rtf{\colortbl;;}\cf1 text}
2009-07-17 15:40:35 +02:00
Francois Gouget e5f5bd1153 riched20: RTFPeekToken(), RTFExpandStyle() and RTFHexToChar() are unused so remove them. 2009-05-26 14:25:06 +02:00
Francois Gouget 1914d256a6 riched20: RTF{G,S}et{In,Out}putName() are unused so remove them as well as the corresponding _RTF_Info fields. 2009-05-26 14:10:46 +02:00
Dylan Smith 78a7ea5a39 richedit: Properly handle lack of semicolon after font name in rtf.
This was partially handled by ungetting the end group token (i.e. '}')
so that it was read again at the proper place.  Unfortunately there is a
read hook that maintains a stackTop variable, which is decremented when
receiving this end group token.  Therefore stackTop would get
decremented twice, and the rich text file would end prematurely.

This is fixed by incrementing the stackTop variable to compensate for it
being decremented twice.
2009-03-24 10:27:34 +01:00
Michael Stefaniuc d1a7e41b71 riched20: Remove superfluous pointer casts. 2009-01-30 11:45:23 +01:00
Marcus Meissner a09621b00f riched20: Handle more missing allocs gracefully (Coverity). 2009-01-29 12:45:23 +01:00
Marcus Meissner 605a40e477 riched20: Handle NULL fp more gracefully (Coverity). 2009-01-29 12:45:15 +01:00
Marcus Meissner 9eb4c73ae3 riched20: Handle cp NULL more gracefully (Coverity). 2009-01-29 12:45:07 +01:00
Marcus Meissner 3d8fd826e1 riched20: Exit the loop instead of crashing (Coverity). 2009-01-29 12:45:00 +01:00
Andrew Talbot b53d7d3295 riched20: Declare some functions static. 2009-01-19 13:36:26 +01:00
Andrew Talbot affc6e029c riched20: Sign-compare warnings fix. 2008-11-06 11:09:41 +01:00
Michael Stefaniuc 9f92f6bc10 riched20: Do not cast NULL. 2008-11-03 13:38:58 +01:00
Dylan Smith e6c3a2beee richedit: Unsigned cast char to avoid EOF equality. 2008-10-06 13:06:38 +02:00
Dylan Smith fab258022e richedit: Fixed bugs in handling unterminated nested tables in RTF. 2008-09-12 11:55:43 +02:00
Dylan Smith 0d8e9e622f richedit: Make sure the nested tables' RTF properties are not skipped. 2008-09-12 11:55:30 +02:00
Dylan Smith 9a7d475db8 richedit: Avoid acting on control words in skipped RTF groups.
Previously the control words in skipped groups were being processed by
the read hook on the RTF parser.  By moving this code into the class
callbacks for the parser, the skipped groups actually remain skipped.
2008-09-11 12:38:20 +02:00
Dylan Smith 421c5b0e02 richedit: Borders are now drawn for tables and nested tables. 2008-08-18 17:15:57 +02:00
Dylan Smith 59195ed2ec richedit: Added in support for streaming in and out nested tables. 2008-08-18 14:34:35 +02:00
Dylan Smith 11c8039699 richedit: Use tabstops to store cell positions. 2008-08-05 14:09:37 +02:00
Dylan Smith ee6b6f338e richedit: Fixed mistake that didn't cause a bug.
The check to see if the dwOutputBuffer is full was performed incorrectly
in RTFPutUnicodeString, however, this mistake was actually harmless
since it would just cause an extra loop that does nothing, then the
check would work properly with the variable fit equal to 0.
2008-06-27 11:09:02 +02:00
Dylan Smith 632015dc62 richedit: Set error codes and stop parsing for some rtf syntax errors.
Checks were added for hexadecimal values that did not have valid
characters, and for EOF received before the final closing brace of the
rich text stream.  The error values were tested on richedit versions 1,
2, 3 & 4.1, and they were all the same for these cases.
2008-06-27 11:08:33 +02:00
Alex Villacís Lasso 4047df0f56 richedit: Flip the big switch and encode actual CR and LF into end-of-paragraph runs.
Document remaining uses of bEmulateVersion10 and other checks for CRLF in editor.c.
Make RTF reader emit a \r or a \r\n according to emulation, not a \n, which breaks streaming tests.
Remove todo_wine from a bunch of riched32 tests that now succeed.
2008-04-29 14:55:15 +02:00
Eric Pouech 4a01ddca25 richedit: Allow reading an enhanced metafile from an RTF stream. 2008-03-17 14:38:57 +01:00
Eric Pouech 0c2c43d39b richedit: Correctly set the pitch and family for a font when reading an RTF stream. 2008-03-17 14:36:30 +01:00
Eric Pouech a64c22c8b1 richedit: Store shift-enter (keyboard) and \line (rtf) as end of row (and emit \line while saving in RTF). 2008-03-17 14:34:44 +01:00
Dmitry Timoshkov 5a6e0ea46f riched20: Remove a redundant parameter from trace. 2007-12-20 12:17:26 +01:00
Michael Stefaniuc 0a92e10640 riched20: Remove the RTFAlloc() wrapper around heap_alloc(). 2007-12-08 19:55:26 +01:00
Michael Stefaniuc 4210cafc04 riched20: Rename the wrappers around HeapAlloc() &Co to use the new standard naming. 2007-12-08 19:54:58 +01:00
Andrew Talbot da68f3943f riched20: Constify some variables. 2007-08-15 10:41:21 +02:00
Michael Stefaniuc 0152ec0375 janitorial: Remove superfluous casts of void pointers to other pointer types. 2007-06-27 12:53:50 +02:00
Matt Finnicum 306013d4e5 riched20: Remove excessive traces from reader.c. 2007-01-25 11:06:28 +01:00
Mike McCormack 5b670b68f2 riched20: Simplify an array size calculation. 2006-11-21 12:16:10 +01:00
Mike McCormack b5c031b160 riched20: Initialize and free the RTF lookup table in DllMain to avoid memory leaks. 2006-11-02 12:24:55 +01:00