Commit Graph

139 Commits (8aa64e358054c069a649e5df83a07d2b8dfea6e6)

Author SHA1 Message Date
Huw Davies 7a0a4ce7ab riched20: Add uniscribe support. 2014-01-15 15:20:52 +01:00
Huw Davies 674e2cfd24 riched20: Fix an (incorrect) compiler warning. 2013-04-17 14:26:18 +02:00
Huw Davies 5ddfc36cc0 riched20: Add a visual vs logical order flag to the character to position mapping routines. 2013-04-17 14:26:09 +02:00
Huw Davies 635614b5ea riched20: Move the password string hack to just before it's used. 2013-02-15 17:52:11 +01:00
Huw Davies a4378f44aa riched20: Move the range clamping to the helper now that the range isn't used later on. 2013-02-15 17:52:08 +01:00
Huw Davies 79278497d3 riched20: Move underline drawing to a common function. 2013-02-15 17:52:02 +01:00
Huw Davies ab6bb56988 riched20: Simplify selection painting by drawing a selected run twice with appropriate clipping. 2013-02-14 17:35:24 +01:00
Huw Davies d528e76076 riched20: Use the point from char helpers to calculate the selection rectangle. 2013-02-14 17:35:20 +01:00
Huw Davies 2a6f99efcc riched20: The string len parameter is no longer necessary. 2013-02-14 17:35:06 +01:00
Huw Davies 530c546a3f riched20: Remove the special case tab handling now that we handle that in draw_space. 2013-02-14 17:35:00 +01:00
Huw Davies 4cbe94f42a riched20: Move the white space painting operations to a common function. 2013-02-14 17:34:57 +01:00
Huw Davies 4178de89ef riched20: Move text color determination to a helper function. 2013-02-14 17:34:48 +01:00
Huw Davies 681a9e1de6 riched20: Move y offset calculation to a helper function. 2013-02-14 17:34:41 +01:00
Huw Davies c2c5121d19 riched20: Move underline pen creation to a helper function. 2013-02-14 17:34:31 +01:00
Huw Davies 82c8e567fb riched20: Pass the run to the text drawing routine. 2013-02-14 17:34:23 +01:00
Huw Davies 941775e311 riched20: The run width is always passed so we don't need to calculate it again. 2013-02-14 17:34:13 +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
Dylan Smith 10d800b6b8 richedit: Invalidate a range of paragraphs without marking them. 2012-05-18 18:10:27 +02:00
Dylan Smith 2ebfd01b51 richedit: Remove some unused structure fields. 2012-05-14 12:04:24 +02:00
Dylan Smith 1f8cbe1645 richedit: Avoid scanning all text for paragraphs to invalidate. 2012-05-09 11:55:58 +02:00
Dylan Smith 18fa3287f6 richedit: Remove always FALSE parameter from ME_PaintContent. 2012-05-08 09:42:16 +02:00
Michael Stefaniuc 51998b929a riched20: Drop the WINE_ prefix from a FIXME. 2012-03-12 10:11:16 +01:00
Thomas Faber 28cb0b683e riched20: Constify some ME_Context pointer parameters. 2011-10-24 19:37:08 +02:00
Thomas Faber 73876d6ccd riched20: Fix uninitialized variable usage. 2011-08-22 17:15:02 +02:00
Frédéric Delanoy 7e309601f3 dlls: Assorted spelling fixes. 2011-08-03 14:15:50 +02:00
Dylan Smith 4c174fc845 richedit: Removed unused run flags values.
The only place MERF_SKIPPED was in debug code, and MERF_CALCBYWRAP was only
used to clear this unused flag value, so I got rid of both of them.
2010-07-29 10:28:29 +02:00
Dylan Smith dfa80b35b0 richedit: Invalidate without calling UpdateWindow in many cases. 2010-07-29 10:28:00 +02:00
Dylan Smith 328a3f1d8c richedit: EN_UPDATE notification is sent on WM_PAINT. 2010-07-29 10:27:30 +02:00
Dylan Smith dcbc22b985 richedit: Send EN_SELCHANGE after wrapping but before EN_CHANGE.
The call to ME_SendSelChange cannot be done in ME_CommitUndo like it was
before, because it must be done after wrapping.  Native richedit controls
send EN_CHANGE first, which is sent in ME_UpdateRepaint, so
ME_SendSelChange must be before this notification in ME_UpdateRepaint.
2010-05-19 11:17:55 +02:00
Dylan Smith 1f2575ba7c richedit: Documented paragraph border widths are in points not pixels.
The border widths documented by msdn are in points which are 72 dpi, which
is not equivalent to pixels (normally 96 dpi). I pre-converted all the
border widths to 96 dpi resolution since this avoids needed to store
fractions, and often avoids the need for convertion to the displays
resolution.
2010-03-01 11:32:18 +01:00
Dylan Smith 535afbd3aa richedit: Move function ME_GetParaLineSpace to make it static. 2010-02-10 11:32:31 +01: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 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
Dylan Smith e364a4406a richedit: Added missing return to ME_EnsureVisible.
The missing return was to prevent automatic vertically scrolling when
style for it is not set, but is set for the horizontal scrollbar. I
initially missed this by testing with no autoscrolling on either
scrollbar.
2009-07-21 10:47:13 +02:00
Dylan Smith f59e41e8d5 richedit: Keep scrollbars hidden without WS_HSCROLL & WS_VSCROLL. 2009-07-17 12:37:17 +02:00
Dylan Smith 140fee1790 richedit: Prevent autoscrolling without ES_AUTO[VH]SCROLL style.
When the richedit control is created without the ES_AUTOHSCROLL or the
ES_AUTOVSCROLL, then scrolling isn't done automatically when moving the
cursor with the arrow keys, drag selecting with the mouse, or even from
using the EM_SCROLLCARET (based on testing using a modified version of
wordpad).
2009-07-17 11:22:07 +02:00
Dylan Smith 5f51221d9c richedit: Fixed scrollbar visiblility calculation after SetScrollInfo.
The scrollbar visibility can be changed from SetScrollRange or
SetScrollInfo, but the visiblity that is a result of these calls are
not consistent with the calculation made by richedit controls to
decide whether to show or hide the scrollbars.
2009-02-24 16:57:28 +01:00
Dylan Smith a0466e2c0e richedit: Don't show vertical scrollbar for single line controls.
The vertical scrollbar is not shown when the ES_MULTILINE style isn't
used, unless ES_DISBALENOSCROLL is also used.
2009-02-24 16:57:28 +01: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 5f15de0690 richedit: Removed ME_StrLen and ME_StrVLen field access functions.
These functions were probably previously needed because of some wierd
special handling of backspace characters, but currently there is no
reason why the nLen field can't be accessed directly.

Having to functions that just access the string length field just causes
slightly more effort for someone to look at the code, because they need
to enter the function to find out what it actually is doing.
2009-02-09 13:05:13 +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 ea9e062b6c richedit: Removed unnecessary calls to ME_WrapMarkedParagraphs.
These calls to ME_WrapMarkedParagraphs never do anything, and don't make
sense to be called in these places. These places are for ME_MoveCaret,
and ME_ArrowHome, which both don't involve any text being modified, and
all (direct and indirect) calls to these functions are done after the
text has already been wrapped.
2009-02-06 14:50:27 +01:00
Marcus Meissner 43eb9ab9d7 riched20: rcUpdate cannot be NULL in ME_PaintContent (Coverity). 2009-01-28 12:30:43 +01:00
Dylan Smith a051a23119 richedit: Suppress scrollbar if missing WS_[VH]SCROLL style.
If the scrollbar style isn't initially used, then the scrollbar should
be shown.  Otherwise this can be a problem when the horizontal scrollbar
is shown for a single line richedit control, since it will cover all the
text (See bug 12088).
2009-01-28 12:11:44 +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 94146a72ad richedit: Removed some unused invalidation code.
The ME_InvalidateFromOfs and ME_QueueInvalidateFromCursor functions are
never called, and the nInvalidOfs variable had its value set but never
used.
2009-01-22 15:28:22 +01:00
Dylan Smith 902afbc65b richedit: Prevented using NULL hwnd for certain operations.
Certain operations will simply not be done for windowless richedit
controls, such as WM_PAINT which isn't done for windowless richedit
controls since ITextServices provides a TxDraw method.
2009-01-21 11:55:03 +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
Dylan Smith 89f88a49a4 richedit: Store an internal copy of the window style flags. 2009-01-16 12:35:28 +01:00