Commit Graph

49 Commits

Author SHA1 Message Date
Dylan Smith 10d800b6b8 richedit: Invalidate a range of paragraphs without marking them. 2012-05-18 18:10:27 +02:00
Marcus Meissner 2ae0d40c8f riched20: Adjusted shift by 8 bits to 16 bits (Coverity). 2011-05-06 14:23:45 +02:00
Dylan Smith 2da0d8e933 richedit: Use ME_Cursor instead of offsets for ME_SetCharFormat.
The test that succeeded from this change was as a result of allowing the
end of the character format change be specified using NULL as the rest
of the text.  Before, the end paragraph run at the end of the text was
not being set for this case, when all the text was supposed to have its
character format changed.
2009-08-12 17:35:50 +02:00
Dylan Smith ecb6c2169c richedit: Store paragraph in cursors.
This prevents some needless searching for the start of the paragraph
from a run stored in a cursor.  Usually a pointer to the paragraph is
already available when the cursor is set anyway.
2009-02-10 12:59:09 +01:00
Dylan Smith 5c91d5356e richedit: Avoided searching for adjacent paragraphs through runs.
When finding an adjacent paragraph, the next_para and prev_para pointers
should be used because they are direct pointers, a constant time
operation.  Instead I found some places in the code that searched through
the general linked list to get to an adjacent paragraph, which is a linear
time operation, depending on the number of rows and runs in between
paragraphs.
2009-02-06 14:54:01 +01:00
Dylan Smith 5d74f58382 richedit: Actually store end of line string for end paragraph runs.
Previously a count of the carraige returns and line feeds were stored
for end of paragraph runs, and a paragraph sign was stored as the actual
string.  This was causing many special cases where the length of the
run needed to be determined differently if the run was or wasn't an
end of paragraph run.

There wasn't any use for storing the paragraph sign unless some drawing
code gets commented out to allow the end paragraphs to be shown,
therefore I changed the code to store the actual string that gets
retrieved by WM_GETTEXT.
2009-01-28 12:11:36 +01:00
Dylan Smith 05c788ac6f richedit: Used ITextHost methods to avoid using window handle directly.
The methods in ITextHost are mostly thin wrappers around functions that
take a handle to a window as their first parameter.  This patch just
uses the wrapper functions provided by ITextHost instead of using the
functions that require a handle to a window that the editor might now
have (for windowless richedit controls).
2009-01-21 11:54:43 +01:00
Michael Stefaniuc 273dbe4619 riched20: Fix a typo (stray address of operator). 2009-01-16 16:34:46 +01:00
Dylan Smith f73a34647f richedit: Respect the cbSize field on EM_GETPARAFORMAT.
EM_GETPARAFORMAT previously would overwrite the cbSize field with the
size of PARAFORMAT2, would read past the end of the struct, and might
indicate that PARAFORMAT2 fields are valid using the mask regardless
of the value of cbSize.
2009-01-16 12:57:10 +01:00
Dylan Smith 1181bb762f richedit: Prevent copying PARAFORMAT2 fields from PARAFORMAT struct.
If a EM_SETPARAFORMAT message is sent to the richedit control with bits
in the dwMask field that correspond to PARAFORMAT2 fields, then these
fields should be ignored.  Instead data was copied from outside of the
structure.
2009-01-16 12:56:57 +01:00
Andrew Talbot d287e88691 riched20: Declare some functions static. 2009-01-14 12:40:40 +01:00
Dylan Smith 8089d980d1 richedit: Set bEmulateVersion10 initially to avoid retroactive changes.
Previously the WM_NCCREATE was handled by the as if it was always for
later versions, then the window proc for version 1.0 would make
appropriate changes afterwards.  Instead both versions should call the
same function (e.g. ME_MakeEditor) and provide the value for
bEmulateVersion10 to make the code clearer.
2009-01-12 14:40:11 +01:00
Michael Stefaniuc 90024d03b2 riched20: Remove superflous casts. 2008-11-04 11:26:12 +01:00
Dylan Smith 3df78710a9 richedit: Make sure border properties are saved for undo/redo.
Previously the paragraph and cell border properties were lost when
deleting the text, then undoing the deletion. This would cause tables
to lose the colour and width of the table border.
2008-10-01 11:39:56 -05:00
Dylan Smith 0843768919 richedit: Enter at the end of a table row appends a new row. 2008-09-12 11:55:14 +02:00
Dylan Smith ddc107bd26 richedit: Added support for changing cell border colours. 2008-08-18 17:15:57 +02:00
Dylan Smith a382e35600 richedit: EM_[SG]ETPARAFORMAT returned the wrong value.
The values returned by EM_SETPARAFORMAT and EM_GETPARAFORMAT previously
indicated an error, and the included tests shows that Windows behaves as
documented.
2008-08-18 17:15:57 +02:00
Dylan Smith 300db3765f richedit: Each cell can contain multiple paragraphs in msftedit. 2008-08-18 14:34:11 +02:00
Dylan Smith 4e56a3cda9 richedit: Joined paragraph format depends on number of characters deleted. 2008-08-05 14:09:37 +02:00
Dylan Smith 11c8039699 richedit: Use tabstops to store cell positions. 2008-08-05 14:09:37 +02:00
Dylan Smith 12bc51ca26 richedit: Fixed 2 minor paragraph format effect errors.
In ME_SetParaFormat the wEffects that were being set needed to be set
rather than the dwMask.
2008-07-09 11:31:22 +02:00
Dylan Smith 8172d69e8f richedit: Set the default paragraph format consistently.
I created a function to set the default paragraph format to ensure
consistency when this is done.  This initial paragraph format is also
now more consistent with native richedit controls.  The dwMask value
always appears to have the same value when retrieved from the native
richedit controls, so all the mask values are now initialized when the
PARAFORMAT2 structure is created.
2008-07-09 11:31:22 +02:00
Dylan Smith aba425eb70 richedit: PFE_TABLE flag is now used instead of private bTable value.
The PARAFORMAT structure has a bit in wEffects to indicate whether the
paragraph is a table or not, so this should be used instead of a private
bTable value, since this structure can be retrieved with EM_GETPARAFORMAT.
2008-07-09 11:31:21 +02:00
Dylan Smith 60757ca6d5 richedit: Corrected the conversion used for the initial font size.
The LOGFONT's lfHeight member is in logical units, and is being used to
set the yHeight member of CHARFORMAT2 which is supposed to be in twips.
2008-06-26 21:18:02 +02:00
Dylan Smith 1840a5bcad richedit: Prevented NULL value from being used to avoid a page fault. 2008-06-26 21:15:33 +02:00
Alex Villacís Lasso 8d37388fe7 richedit: Fixups to move over to reliance on CR and LF counters.
Text streamout now honors CR and LF counters.
Tests to pin down required EM_STREAMOUT behavior.
2008-04-29 14:54:05 +02:00
Alex Villacís Lasso d47f66191e richedit: Add support for encoding number of CR and LF contained within a line break. 2008-04-29 14:53:46 +02:00
Eric Pouech 5d36c47e1f richedit: Fixed object leaks generated by context creation & destruction. 2008-03-17 14:37:58 +01:00
Eric Pouech 9c6c9d63a2 richedit: Use the FW_ constants instead of the raw values. 2008-03-17 14:36:57 +01:00
Eric Pouech 34a4f9227a richedit: Assign equivalent structures instead of copying them. 2008-03-17 14:35:40 +01:00
Eric Pouech 39aa3beaf2 richedit: Simplify first para style handling by creating a context. 2008-01-02 13:58:09 +01:00
Eric Pouech f4fd063101 richedit: Enforce usage of paraformat2 fields instead of homegrown ones for paragraphs. 2008-01-02 13:52:10 +01:00
Eric Pouech 0e8c087561 richedit: Properly copying the paraformat2 structure for paragraphs. 2008-01-02 13:51:49 +01:00
Eric Pouech 8f60c8c46e richedit: Now dumping all fields from the paraformat2 structure. 2008-01-02 13:50:38 +01:00
Eric Pouech 566912dc3b richedit: Correctly initialize the paraformat structure. 2008-01-02 13:50:04 +01:00
Eric Pouech 6b591ef23a richedit: Extend the usage of underlinetype from charformat2 in richedit. 2008-01-02 13:48:11 +01:00
Eric Pouech 8d0799a741 richedit: Fully initialize the first style. 2008-01-02 13:46:53 +01:00
Andrew Talbot ed93ed9a08 riched20: Constify some variables. 2007-08-14 13:28:05 +02:00
Krzysztof Foltman bad844d0a9 riched20: New, clean, simple selection repaint logic - should fix all outstanding refresh issues. 2006-08-07 19:59:58 +02:00
Jonathan Ernst 360a3f9142 Update the address of the Free Software Foundation. 2006-05-23 14:11:13 +02:00
Phil Krylov 4e796854af riched20: Allow inheriting table cell definitions from previous table row.
Allow inheriting of table cell definitions from a previous table row
when the current table row does not contain a \trowd, only an \intbl.
2006-04-12 11:17:25 +02:00
Phil Krylov 08bf7180f3 riched20: Initial support for simple tables. 2006-02-04 17:01:01 +01:00
Dmitry Timoshkov 57a579ffcd Make more arrays const. 2006-01-24 14:00:32 +01:00
Phil Krylov d82af6f711 riched20: Speed up text insertion.
Optimized reading large texts into RichEdit to be an O(n) order
algorythm instead of O(n^2) by removing extraneous conversions of
character offsets to run offsets.
2006-01-10 12:10:49 +01:00
Phil Krylov 84bb372239 Added emulation of RichEdit 1.0 behaviour when the 1.0 window class is
being used. This emulation (introduced in M$ RichEdit 3.0) counts
paragraph endings as 2 characters (CR+LF) instead of 1 (CR).
2005-07-21 10:33:32 +00:00
Krzysztof Foltman 13578c8602 - removed trailing spaces from some files
- tab support
- indent support
2005-04-16 10:48:35 +00:00
Krzysztof Foltman f089de1f4d - RTF reader doesn't use RichEdit messages anymore (which saves on
unnecessary repaints)
- added unicode character support to RTF import (like: \u12345 ?)
- small fixes
- fixed whitespace identification bug
- removed drawing of paragraph marks
- improved stub implementations for IRichEditOle
2005-03-17 10:23:40 +00:00
Krzysztof Foltman 89075fb429 The meaning of the rewrap flag got inverted (MEPF_REWRAP instead of
MEPF_WRAPPED) for consistency.
Major code cleanups in rewrap/repaint code, leading to "smarter"
behaviour wrt repainting selections.
2005-03-09 11:48:59 +00:00
Krzysztof Foltman d488f3f1de Initial implementation of riched20. 2005-03-05 11:19:14 +00:00