Commit Graph

413 Commits (68c6f58e6ef8ed6ee0c5f10d65ec7ed125125ea9)

Author SHA1 Message Date
Amine Khaldi 4b7795a943 riched20: Add a missing break. 2011-02-23 19:23:38 +01:00
Dylan Smith d43cddcc83 richedit: Clear non-default style when changing to plain text mode.
Although the text must be empty for the mode to change to plain text
mode, there still may be a non-default style for the temporary insert
style and style for the end of text run.
2011-01-12 11:32:19 +01:00
Dylan Smith ad056fe7d7 richedit: Check for bits instead of equality in EM_SETCHARFORMAT.
There are unsupported flags documented on MSDN which would cause problems
for the equality checks used in EM_SETCHARFORMAT.  Also, to handle a
combined set of flags they must be checked for in the right order.
2010-07-30 11:36:01 +02:00
Dylan Smith 16d7890426 richedit: Don't change text mode with undo or redo stack. 2010-07-30 11:36:01 +02:00
Dylan Smith 75eef41881 richedit: Return correct values when EM_SETTEXTMODE fails.
The checks for the text length and invalid parameters needed to be swapped,
and the code could be easily simplified.
2010-07-30 11:36:01 +02:00
Dylan Smith dfa80b35b0 richedit: Invalidate without calling UpdateWindow in many cases. 2010-07-29 10:28:00 +02:00
Dylan Smith 1964e603fd richedit: Remove redundant commit and repaint in ME_StreamInText.
ME_StreamInText is only used in one function, ME_StreamIn, which always
calls ME_CommitUndo and ME_UpdateRepaint after calling this function.
2010-07-29 10:27:38 +02:00
Dylan Smith 328a3f1d8c richedit: EN_UPDATE notification is sent on WM_PAINT. 2010-07-29 10:27:30 +02:00
Austin Lund 61e5fec020 riched20: Process messages which arrive before WM_NCCREATE. 2010-07-08 17:33:25 +02:00
Dylan Smith 6072a69d38 richedit: Keep default char format on WM_SETFONT in plain text mode. 2010-06-07 15:27:52 +02:00
Dylan Smith 3f1d3e0ea1 richedit: Simplify redundant code in WM_IME_COMPOSITION. 2010-05-24 11:30:23 +02:00
Dylan Smith e809bc887d richedit: Commit undo items after modifications in WM_IME_COMPOSITION.
ME_InsertTextFromCursor could previously follow the ME_CommitUndo call
leaving uncommitted changes which would cause improper grouping of commits,
or an assertion failure.
2010-05-24 11:30:12 +02:00
Dylan Smith fb7d6b783e richedit: Missing HeapFree in WM_IME_COMPOSITION. (Smatch).
ME_InsertTextFromCursor copies the string passed into it rather than making
taking ownership of it.
2010-05-24 11:30:06 +02:00
Dylan Smith d312d4e33c richedit: Revert commit that caused a regression. (Bug 22758).
Revert commit 049cf5aca0
richedit: Avoid notifying parent window in improper state.

The commit was meant to fix a problem caused by ME_SendSelChange being
called in ME_SendSelChange, but moving the calls to ME_CommitUndo caused
a regression. So this patch reverts the previous commit, and my
following patch will instead fix the bug by moving the call to
ME_SendSelChange out of ME_CommitUndo.
2010-05-19 11:17:55 +02:00
Michael Stefaniuc cf13e8a390 riched20: Avoid using long. 2010-05-17 12:42:33 +02:00
Dylan Smith 049cf5aca0 richedit: Avoid notifying parent window in improper state.
ME_CommitUndo and ME_CommitCoalescingUndo call ME_SendSelChange, which
may notify the parent window that the selection has changed, therefore
should generally be called after wrapping the text. Otherwise, the parent
window may send a message to the editor and cause an assertion failure.
2010-05-17 12:42:31 +02:00
Gerald Pfeifer 6dd4b071cc riched20: Remove variable pCell which is not really used from ME_StreamIn. 2010-05-10 10:11:34 +02:00
Michael Stefaniuc d3bc43b5ed Grammar fixes "is doesn't" => "doesn't". 2010-01-11 11:33:59 -06:00
Michael Stefaniuc 3b45ababfb riched20: Remove some explicit LPARAM/WPARAM casts. 2009-12-28 12:27:13 +01:00
Huw Davies 8808fccd57 riched20: Initialise window size.
Found by Valgrind.
2009-12-16 12:42:40 +01:00
Huw Davies d4383b4498 riched20: Initialise the style flags.
Found by Valgrind.
2009-12-15 16:09:12 +01:00
Huw Davies d88c47fccb riched20: Fix a memory leak.
Found by Valgrind.
2009-12-14 12:04:05 +01:00
Eric Pouech 38df8cfb04 richedit: When inserting an OLE object from an RTF stream, don't force update as the stream is not fully read. 2009-11-09 20:02:03 +01:00
Sergey Khodych 12a417de8a riched20: Implement handling of WM_KEYDOWN VK_TAB in the dialog mode. 2009-10-13 12:38:58 +02:00
Sergey Khodych a50ca4ace0 riched20: Implement handling of WM_KEYDOWN VK_ESCAPE in the dialog mode. 2009-10-13 12:38:54 +02:00
Sergey Khodych 8fb119ba8b riched20: Implement handling of WM_KEYDOWN VK_RETURN in the dialog mode. 2009-10-13 12:38:49 +02:00
Sergey Khodych 851c33ddd9 riched20: Enable the dialog mode after receiving WM_GETDLGCODE message. 2009-10-13 12:38:44 +02:00
Dylan Smith 3fe20bdc7e richedit: Handle to parent window is cached.
The parent window for the richedit control on creation is the one that
receives notify messages, even after the parent has been changed using
SetParent.
2009-09-30 17:41:06 +02:00
Dylan Smith 0342ab0df1 richedit: Use ITextHost interface in ME_LinkNotify.
Using the ITextHost interface allows this notification to be received
for windowless richedit controls.  Windowed richedit conrols have an
ITextHost implementation that will fill in hwndFrom and idFrom, but
these should probably be initialized to 0 for windowless richedit
controls.
2009-09-28 12:54:16 +02:00
Dylan Smith 99b37b2376 richedit: Silence fixme for WM_STYLECHANGING & WM_STYLECHANGED. 2009-09-24 15:15:09 +02:00
Dylan Smith 989bdd1579 richedit: Use ME_MoveCursorChars in ME_FindText to find relative offset.
When a previous character needed to be found, it is simpler to move
existing cursor rather than retravese the linked list to find the offset
again.
2009-08-13 15:35:37 +02:00
Dylan Smith bd4704280d richedit: Replace offsets arg with ME_Cursor for ME_InternalDeleteText.
Offsets are still used within the function, but this patch reduces the
use of it at the entry to the function.
2009-08-13 15:35:17 +02:00
Dylan Smith 02228ee176 richedit: Use ME_Cursor instead of offsets for ME_CharFromPos. 2009-08-13 15:35:01 +02:00
Dylan Smith a69ef26599 richedit: Use ME_Cursor instead of offsets for copying text. 2009-08-13 15:34:54 +02:00
Dylan Smith 60a72583f4 richedit: Use ME_Cursor instead of offsets for ME_UpdateLinkAttribute. 2009-08-13 15:34:47 +02:00
Dylan Smith c92bb271b7 richedit: Use ME_Cursor instead of offsets for ME_GetTextRange. 2009-08-12 17:35:55 +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 ade37203a5 richedit: Use ME_Cursor instead of offsets for ME_GetCharFormat.
Prevent extra conversions from character offset to ME_Cursor.
2009-08-12 17:35:42 +02:00
Dylan Smith 2bc726930f richedit: Add helpers for setting cursor to start/end of text. 2009-08-12 17:35:30 +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 0362b1b087 richedit: Improve efficiency of ME_IsCandidateAnURL.
The code was previously getting the same text in the loop from the
editor, and it was converting each of the prefixes to compare against
for each URL candidate.
2009-08-12 17:34:44 +02:00
Dylan Smith 82e102107c richedit: ME_GetTextW must use source and destination lengths.
Before a single length was used for the number of characters to retrieve
from the text, and to keep track of the size of the buffer.  These are
not equivalent, since there is a possible end of line conversion.
2009-08-12 17:32:16 +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
Dylan Smith be0fb1ef5d richedit: Make the ME_GetCursorOfs function more flexible.
This function will make it easier to work with ME_Cursor objects, which
should be used in a lot of places instead of character offsets (which
often require seeking through the linked lists to perform operations
with).
2009-08-12 17:29:20 +02:00
Dylan Smith 114a64ce5d richedit: Added missing style releases.
Style objects are referenced counted in richedit controls, so I tried to
make sure styles were released properly.  This can be checked using with
the all_refs global reference count to see if everything is cleaned up.
2009-08-10 17:10:34 +02:00
Dylan Smith 71cb069246 richedit: Use richedit class string macros from public headers. 2009-08-10 17:10:14 +02:00
Dylan Smith 05c730fd4c richedit: Prevent using uninitialized nAvailWidth in initialization. 2009-08-03 16:00:34 +02:00
Dylan Smith c4b023b1b6 richedit: Prevent buffer overflows in WM_GETTEXT.
The application AutoGK was getting the length of the text with
WM_GETTEXTLENGTH to allocate an appropriate buffer size, but then
claimed the buffer was twice the size when sending WM_GETTEXTEX.  This
caused the memcpy call to overflow the actual buffer since the count
is based on the size of the buffer alone, regardless of the amount of
text retrieved.
2009-08-03 16:00:16 +02:00
Dylan Smith 3d89e29155 richedit: Handle NULL buffer or 0 buffer length in ME_GetTextEx.
ME_GetTextEx directly handles EM_GETTEXTEX, and previously a NULL buffer
would be dereferenced, and a 0 buffer length would cause nCount an
underflow in the nCount value which would allow a buffer overflow to
occur.
2009-08-03 15:59:57 +02:00
Dylan Smith 0deb3d04ed richedit: Scrollinfo stored as 16-bit values externally.
The application Blitzin2 was sending WM_VSCROLL messages to the
richedit control directly, when normally this message is supposed to
be a notification sent after the scrollinfo is set.  Native richedit
controls always use the 16-bit value passed to this message to set the
scroll position for SB_THUMBPOSITION, rather than trying to find a
32-bit value through GetScrollInfo like I had previously done.
2009-07-22 11:08:33 +02:00