Aric Stewart : user32: While calculating lines, discard uniscribe data for non-visible lines.

Alexandre Julliard julliard at winehq.org
Thu Apr 5 12:31:47 CDT 2012


Module: wine
Branch: master
Commit: 4ad945337fe396925f751d6de4c7b97035f055a1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4ad945337fe396925f751d6de4c7b97035f055a1

Author: Aric Stewart <aric at codeweavers.com>
Date:   Fri Mar 30 11:46:34 2012 -0500

user32: While calculating lines, discard uniscribe data for non-visible lines.

---

 dlls/user32/edit.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/dlls/user32/edit.c b/dlls/user32/edit.c
index ab87418..316df2a 100644
--- a/dlls/user32/edit.c
+++ b/dlls/user32/edit.c
@@ -476,6 +476,12 @@ static SCRIPT_STRING_ANALYSIS EDIT_UpdateUniscribeData(EDITSTATE *es, HDC dc, IN
 	}
 }
 
+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);
+}
+
 /*********************************************************************
  *
  *	EDIT_BuildLineDefs_ML
@@ -496,6 +502,7 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta
 	INT line_count = es->line_count;
 	INT orig_net_length;
 	RECT rc;
+	INT vlc;
 
 	if (istart == iend && delta == 0)
 		return;
@@ -536,6 +543,7 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta
 
 	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)
 		{
@@ -726,6 +734,11 @@ static void EDIT_BuildLineDefs_ML(EDITSTATE *es, INT istart, INT iend, INT delta
 		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);
@@ -1460,13 +1473,6 @@ static void EDIT_SL_InvalidateText(EDITSTATE *es, INT start, INT end)
 		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);
-}
-
 /*********************************************************************
  *
  *	EDIT_ML_InvalidateText




More information about the wine-cvs mailing list