Author: jimtabor
Date: Thu Sep 13 20:44:04 2012
New Revision: 57291
URL:
http://svn.reactos.org/svn/reactos?rev=57291&view=rev
Log:
[User32]
- Aric Stewart : While calculating lines, discard uniscribe data for non-visible lines.
- Nikolay Sivov : Release uniscribe data on Edit control destruction (valgrind).
- Sync Port wine.
- Someone needs to post a wine bug report due to the lack of support for Ctrl+Backspace.
Debug fixme was added. See bug 1419.
Modified:
trunk/reactos/win32ss/user/user32/controls/edit.c
Modified: trunk/reactos/win32ss/user/user32/controls/edit.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/contro…
==============================================================================
--- trunk/reactos/win32ss/user/user32/controls/edit.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/controls/edit.c [iso-8859-1] Thu Sep 13 20:44:04
2012
@@ -411,6 +411,12 @@
return line_def->ssa;
}
+static inline INT get_vertical_line_count(EDITSTATE *es)
+{
+ INT vlc = (es->format_rect.bottom - es->format_rect.top) / es->line_height;
+ return max(1,vlc);
+}
+
static SCRIPT_STRING_ANALYSIS EDIT_UpdateUniscribeData(EDITSTATE *es, HDC dc, INT line)
{
LINEDEF *line_def;
@@ -473,6 +479,7 @@
INT line_count = es->line_count;
INT orig_net_length;
RECT rc;
+ INT vlc;
if (istart == iend && delta == 0)
return;
@@ -513,6 +520,7 @@
fw = es->format_rect.right - es->format_rect.left;
current_position = es->text + current_line->index;
+ vlc = get_vertical_line_count(es);
do {
if (current_line != start_line)
{
@@ -696,6 +704,11 @@
es->text_width = max(es->text_width, current_line->width);
current_position += current_line->length;
previous_line = current_line;
+
+ /* Discard data for non-visible lines. It will be calculated as needed */
+ if ((line_index < es->y_offset) || (line_index > es->y_offset + vlc))
+ EDIT_InvalidateUniscribeData_linedef(current_line);
+
current_line = current_line->next;
line_index++;
} while (previous_line->ending != END_0);
@@ -1442,13 +1455,6 @@
EDIT_GetLineRect(es, 0, start, end, &line_rect);
if (IntersectRect(&rc, &line_rect, &es->format_rect))
EDIT_UpdateText(es, &rc, TRUE);
-}
-
-
-static inline INT get_vertical_line_count(EDITSTATE *es)
-{
- INT vlc = (es->format_rect.bottom - es->format_rect.top) / es->line_height;
- return max(1,vlc);
}
/*********************************************************************
@@ -3544,6 +3550,12 @@
if ((es->style & ES_MULTILINE) && EDIT_IsInsideDialog(es))
SendMessageW(es->hwndParent, WM_NEXTDLGCTL, shift, 0);
break;
+ case VK_BACK:
+ if (control)
+ {
+ FIXME("Ctrl+Backspace\n"); // See bug 1419.
+ }
+ break;
}
return TRUE;
}
@@ -4618,6 +4630,7 @@
pc = pp;
}
+ EDIT_InvalidateUniscribeData(es);
SetWindowLongPtrW( es->hwndSelf, 0, 0 );
HeapFree(GetProcessHeap(), 0, es->undo_text);
HeapFree(GetProcessHeap(), 0, es);