Commit Graph

94 Commits

Author SHA1 Message Date
Huw Davies b2c812e3a3 riched20: Use cell ptrs in the rtf writing code.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-22 22:02:03 +02:00
Huw Davies 4a30e0601e riched20: Pass paragraph ptrs to the paragraph property writers.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-20 22:54:02 +02:00
Huw Davies 0033253777 riched20: Pass run ptrs to the font and colour table writer function.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-20 22:54:02 +02:00
Huw Davies db6c554909 richedit: Use the correct ptr to the cell.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-19 14:58:47 +02:00
Huw Davies 1bda5913fc riched20: Use ME_Paragraph ptrs in a few of the table functions.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2020-10-09 16:21:33 +02:00
Alexandre Julliard a6d57b0add riched20: Build with msvcrt.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-19 11:22:47 +02: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
Jactry Zeng 0154b59c7e riched20: Save reobj in linked list.
Signed-off-by: Jactry Zeng <jzeng@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-04-16 10:20:13 +02:00
Michael Stefaniuc 965dc38175 riched20: Get rid of the ALLOC_OBJ 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-02-05 10:08:40 +01:00
Michael Stefaniuc 7153b5593e riched20: Get rid of the FREE_OBJ() 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-02-05 10:08:38 +01: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 d4b1938cfb riched20: Only write out non-default pattern colours.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-21 13:58:13 +02:00
Huw Davies 5f3772a730 riched20: Don't compare the colours if the old and new states are both auto.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-04-05 16:40:37 +02:00
Huw Davies 6bcf4d6037 riched20: Add linefeeds after the colortbl and generator groups.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-03 13:23:18 +01:00
Huw Davies 8b79854d70 riched20: Remove a hack that should be longer be needed.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-03 13:23:10 +01:00
Huw Davies 3d291dd7ee riched20: Write the char format for the end-of-paragraph marker.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2017-03-03 13:23:04 +01:00
Huw Davies 6e97ddc930 riched20: Remove unnecessary spaces before carriage returns.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-14 14:28:22 +02:00
Huw Davies a25c6f64b5 riched20: Remove the question marks from the generator string.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-14 14:28:22 +02:00
Huw Davies ee68e100b4 riched20: Simplify call to ME_StreamOutRTFParaProps().
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-14 14:28:21 +02:00
Huw Davies 452c9a7124 riched20: Incrementally update the character format.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-14 14:28:21 +02:00
Huw Davies aa57db38dd riched20: Fix the interaction between CFE_UNDERLINE and bUnderlineType.
The effect specifies whether underlining is turned on, while bUnderlineType
indicates the type of underlining.

Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-14 14:28:21 +02:00
Huw Davies c69e60efbc riched20: Emit RTF for paragraph numbering.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-12 16:57:00 +02:00
Huw Davies 3e9a31ed26 riched20: Add a helper to find a colour in the colour table.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-12 16:56:57 +02:00
Huw Davies 48c0c6648b riched20: Add a helper to find a font in the font table.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-12 16:56:55 +02:00
Huw Davies 074fafab65 riched20: Add any paragraph numbering fonts to the font table.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-12 16:56:51 +02:00
Huw Davies a06dcd46bb riched20: Move the check for cell border colours into the same loop as the other colours.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-11 16:59:32 +02:00
Huw Davies b8e55779fe riched20: Add a helper to add a colour to the colour table.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-11 16:59:31 +02:00
Huw Davies 6ee979c7e6 riched20: Add a helper to add a font to the font table.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-11 16:59:31 +02:00
Huw Davies 1e1ee175f0 riched20: Don't emit default values.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-11 16:59:31 +02:00
Huw Davies 8739f450ce riched20: Don't emit paragraph props if they're the same as the previous paragraph's.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-11 16:59:31 +02:00
Huw Davies 58a48aa79b riched20: Allow selecting the final end-of-paragraph when using the right arrow key.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-10-04 14:54:38 +02:00
Huw Davies b3b5c25628 riched20: Embed PARAFORMAT2 in the paragraph struct rather than its ptr.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-09-29 22:40:18 +09:00
Huw Davies 3d1d65bc2c riched20: Add an option to constrain the run search to the current para.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-07-04 17:32:09 +09:00
Huw Davies 8477dcf909 riched20: Add support for saving enhanced metafiles.
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2016-06-07 22:04:47 +09:00
Jactry Zeng dc6b2853f5 riched20: Set pStream->written in ME_StreamOutFlush.
Superseded patch 115907.

ChangeLog:
- Add tests.

Signed-off-by: Jactry Zeng <jzeng@codeweavers.com>
Signed-off-by: Huw Davies <huw@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2015-11-06 19:22:43 +09:00
Huw Davies 17f273360a riched20: Append a final \par when writing the whole buffer. 2015-06-09 14:47:30 +09:00
Huw Davies 2a5886974d riched20: Don't resend a partial chunk to the edit stream callback.
It's basically used as a boolean to terminate the writing process
if it's set to zero.
2015-03-17 23:55:16 +09:00
Vincent Povirk d04d1c1736 riched20: Use \ulnone instead of \ul0 for no underline. 2013-08-20 11:50:14 +02:00
Sergey Guralnik 8849885f73 riched20: Fix richtext copy/paste to OOffice. 2013-05-01 11:16:27 +02:00
Huw Davies a20d42de15 riched20: Always write out the color table. 2013-03-25 14:09:41 +01:00
Huw Davies 86f077b163 riched20: Add an explicit run length member and use it rather than accessing the string length. 2013-01-31 16:32:12 +01:00
Huw Davies 27578f8bb6 riched20: Add a helper to retrieve the run text. 2013-01-30 17:19:31 +01:00
André Hentschel 34f74fdc71 riched20: Remove duplicate operand in expression (coverity). 2012-11-05 11:11:53 +01:00
Francois Gouget 8dd66bc927 riched20: Avoid hardcoding the Unicode string literal lengths. 2011-12-16 17:40:38 +01:00
Maarten Lankhorst 1e758c5e8c riched20: Do not call callback when no data needs to be flushed. 2011-02-09 13:49:03 -06:00
Dylan Smith be3073fce1 richedit: Fix streaming rtf with table at the start of the text.
The first paragraph was being handled just by ME_StreamOutParaProps,
but subsequent paragraphs would check if the paragraph was starting or
ending a table. So I moved the code to check for tables into
ME_StreamOutParaProps.
2010-07-19 14:38:16 +02:00
Dylan Smith e2f6b1d83d richedit: Don't break when streaming out a table, just continue.
This is a regression caused by commit
54b53b6018 which change the code to use
if statements instead of a switch, so the break statement should have
been changed to a continue statement.
2010-07-19 14:38:16 +02:00
Dylan Smith 54b53b6018 richedit: Use ME_Cursor instead of offsets for stream out functions. 2009-08-13 15:35:28 +02:00
Dylan Smith 32dcd3bbe1 richedit: Created functions to move between runs and track paragraphs.
Plenty of places in the code find following or preceding runs, then
afterwards find the paragraph from the run.  This is inefficient because
the same linked list is used for both runs and paragraphs, so changes in
paragraphs can be detected while returning the next or previous run.
2009-08-12 17:35:24 +02:00
Dylan Smith 46b84aed4a richedit: Added function to get selection cursors in order.
Previously the only convenient way to get the start and end of the
selection was through offsets, which eventually need to get converted
back into items in the linked list storing the text.  The new function
will help with eliminating these inefficiencies.
2009-08-12 17:29:30 +02:00