- Add patch for RH bug #161885.
This commit is contained in:
parent
af848a0cf8
commit
13b7ded0c9
117
evolution-2.8.0-indic-cursor-movement.patch
Normal file
117
evolution-2.8.0-indic-cursor-movement.patch
Normal file
@ -0,0 +1,117 @@
|
||||
--- evolution-2.8.0/widgets/text/e-text.c.indic-cursor-movement 2006-09-13 14:53:39.000000000 -0400
|
||||
+++ evolution-2.8.0/widgets/text/e-text.c 2006-09-13 14:53:48.000000000 -0400
|
||||
@@ -2876,6 +2876,76 @@
|
||||
}
|
||||
}
|
||||
|
||||
+
|
||||
+
|
||||
+/* direction = TRUE (move forward), FALSE (move backward)
|
||||
+ Any error shall return length(text->text) or 0 or text->selection_end (as deemed fit) */
|
||||
+static int
|
||||
+_get_updated_position (EText *text, gboolean direction)
|
||||
+{
|
||||
+ PangoLogAttr *log_attrs = NULL;
|
||||
+ gint n_attrs;
|
||||
+ char *p = NULL;
|
||||
+ gint new_pos = 0;
|
||||
+ gint length = 0;
|
||||
+
|
||||
+ /* Basic sanity test, return whatever position we are currently at. */
|
||||
+ g_return_val_if_fail (text->layout != NULL, text->selection_end);
|
||||
+
|
||||
+ length = g_utf8_strlen (text->text, -1);
|
||||
+
|
||||
+ /* length checks to make sure we are not wandering off into nonexistant memory... */
|
||||
+ if((text->selection_end >= length) && (TRUE == direction)) /* forward */
|
||||
+ return length;
|
||||
+ /* checking for -ve value wont hurt! */
|
||||
+ if((text->selection_end <= 0) && (FALSE == direction)) /* backward */
|
||||
+ return 0;
|
||||
+
|
||||
+ /* check for validness of full text->text */
|
||||
+ if(!g_utf8_validate(text->text, -1, NULL))
|
||||
+ return text->selection_end;
|
||||
+
|
||||
+ /* get layout's PangoLogAttr to facilitate moving when moving across grapheme cluster as in indic langs */
|
||||
+ pango_layout_get_log_attrs (text->layout, &log_attrs, &n_attrs);
|
||||
+
|
||||
+ /* Fetch the current char index in the line & keep moving
|
||||
+ forward until we can display cursor */
|
||||
+ p = g_utf8_offset_to_pointer (text->text, text->selection_end);
|
||||
+
|
||||
+ new_pos = text->selection_end;
|
||||
+ while(1)
|
||||
+ {
|
||||
+ /* check before moving forward/backwards if we have more chars to move or not */
|
||||
+ if(TRUE == direction)
|
||||
+ p = g_utf8_next_char (p);
|
||||
+ else
|
||||
+ p = g_utf8_prev_char (p);
|
||||
+
|
||||
+ /* validate the new string & return with original position if check fails */
|
||||
+ if(!g_utf8_validate (p, -1, NULL))
|
||||
+ break; /* will return old value of new_pos */
|
||||
+
|
||||
+ new_pos = g_utf8_pointer_to_offset (text->text, p);
|
||||
+
|
||||
+ /* if is_cursor_position is set, cursor can appear in front of character.
|
||||
+ i.e. this is a grapheme boundary AND make some sanity checks */
|
||||
+ if((new_pos >=0) && (new_pos < n_attrs) && (log_attrs[new_pos].is_cursor_position))
|
||||
+ break;
|
||||
+ else if((new_pos < 0) || (new_pos >= n_attrs))
|
||||
+ {
|
||||
+ new_pos = text->selection_end;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if(log_attrs)
|
||||
+ g_free(log_attrs);
|
||||
+
|
||||
+ return new_pos;
|
||||
+}
|
||||
+
|
||||
+
|
||||
+
|
||||
static int
|
||||
_get_position(EText *text, ETextEventProcessorCommand *command)
|
||||
{
|
||||
@@ -2951,15 +3021,14 @@
|
||||
if (text->selection_end >= length)
|
||||
new_pos = length;
|
||||
else
|
||||
- new_pos = text->selection_end + 1;
|
||||
-
|
||||
+ new_pos = _get_updated_position(text, TRUE); /* get updated position to display cursor */
|
||||
+
|
||||
break;
|
||||
|
||||
case E_TEP_BACKWARD_CHARACTER:
|
||||
new_pos = 0;
|
||||
- if (text->selection_end >= 1) {
|
||||
- new_pos = text->selection_end - 1;
|
||||
- }
|
||||
+ if (text->selection_end >= 1)
|
||||
+ new_pos = _get_updated_position(text, FALSE); /* get updated position to display cursor */
|
||||
|
||||
break;
|
||||
|
||||
@@ -3341,6 +3410,7 @@
|
||||
if (!text->layout)
|
||||
create_layout (text);
|
||||
|
||||
+ /* We move cursor only if scroll is TRUE */
|
||||
if (scroll && !text->button_down) {
|
||||
/* XXX do we really need the @trailing logic here? if
|
||||
we don't we can scrap the loop and just use
|
||||
@@ -3349,7 +3419,9 @@
|
||||
int selection_index;
|
||||
PangoLayoutIter *iter = pango_layout_get_iter (text->layout);
|
||||
|
||||
+ /* check if we are using selection_start or selection_end for moving? */
|
||||
selection_index = use_start ? text->selection_start : text->selection_end;
|
||||
+
|
||||
/* convert to a byte index */
|
||||
selection_index = g_utf8_offset_to_pointer (text->text, selection_index) - text->text;
|
||||
|
@ -45,7 +45,7 @@
|
||||
|
||||
Name: evolution
|
||||
Version: 2.8.0
|
||||
Release: 2%{?dist}
|
||||
Release: 3%{?dist}
|
||||
License: GPL
|
||||
Group: Applications/Productivity
|
||||
Summary: GNOME's next-generation groupware suite
|
||||
@ -121,6 +121,9 @@ Patch30: evolution-2.8.0-fix-missing-declarations.patch
|
||||
# RH bug #201307 / Gnome.org bug #350565
|
||||
Patch31: evolution-2.8.0-search-on-folder-change.patch
|
||||
|
||||
# RH bug #161885 / Gnome.org bug #309166
|
||||
Patch32: evolution-2.8.0-indic-cursor-movement.patch
|
||||
|
||||
### Dependencies ###
|
||||
|
||||
Requires: ORBit2 >= %{orbit2_version}
|
||||
@ -254,6 +257,7 @@ Development files needed for building things which link against evolution.
|
||||
%patch29 -p1 -b .chain-finalize
|
||||
%patch30 -p1 -b .fix-missing-declarations
|
||||
%patch31 -p1 -b .search-on-folder-change
|
||||
%patch32 -p1 -b .indic-cursor-movement
|
||||
|
||||
mkdir -p krb5-fakeprefix/include
|
||||
mkdir -p krb5-fakeprefix/lib
|
||||
@ -644,6 +648,9 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_libdir}/evolution/%{evo_major}/libmenus.so
|
||||
|
||||
%changelog
|
||||
* Wed Sep 13 2006 Matthew Barnes <mbarnes@redhat.com> - 2.8.0-3.fc6
|
||||
- Add patch for RH bug #161885.
|
||||
|
||||
* Wed Sep 13 2006 Matthew Barnes <mbarnes@redhat.com> - 2.8.0-2.fc6
|
||||
- Add patch for RH bug #201307.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user