summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2005-07-25 17:35:25 +0000
committerOwen Taylor <otaylor@src.gnome.org>2005-07-25 17:35:25 +0000
commitbdf40e33d65bb6408cb5ab91712175a0f04ae17b (patch)
treecda5a2a66eabdb4297d38e575faab85efc3e9b9d
parent030411be6b45c80fe136c0a1d069ff2e2599b7fe (diff)
downloadpango-bdf40e33d65bb6408cb5ab91712175a0f04ae17b.tar.gz
Always set line->resolved_dir to one of LTR or RTL. (#171439, Reported by
2005-07-25 Owen Taylor <otaylor@redhat.com> * pango/pango-layout.c (line_set_resolved_dir): Always set line->resolved_dir to one of LTR or RTL. (#171439, Reported by Chris Blizzard)
-rw-r--r--ChangeLog6
-rw-r--r--ChangeLog.pre-1-106
-rw-r--r--pango/pango-layout.c29
3 files changed, 38 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1d7fb359..be93105f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-07-25 Owen Taylor <otaylor@redhat.com>
+
+ * pango/pango-layout.c (line_set_resolved_dir): Always set
+ line->resolved_dir to one of LTR or RTL. (#171439, Reported
+ by Chris Blizzard)
+
2005-07-25 Tor Lillqvist <tml@novell.com>
* configure.in
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index 1d7fb359..be93105f 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,9 @@
+2005-07-25 Owen Taylor <otaylor@redhat.com>
+
+ * pango/pango-layout.c (line_set_resolved_dir): Always set
+ line->resolved_dir to one of LTR or RTL. (#171439, Reported
+ by Chris Blizzard)
+
2005-07-25 Tor Lillqvist <tml@novell.com>
* configure.in
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 3b924b8a..96a2f042 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -2924,6 +2924,29 @@ process_item (PangoLayout *layout,
}
}
+/* The resolved direction for the line is always one
+ * of LTR/RTL; not a week or neutral directions
+ */
+static void
+line_set_resolved_dir (PangoLayoutLine *line,
+ PangoDirection direction)
+{
+ switch (direction)
+ {
+ case PANGO_DIRECTION_LTR:
+ case PANGO_DIRECTION_TTB_RTL:
+ case PANGO_DIRECTION_WEAK_LTR:
+ case PANGO_DIRECTION_NEUTRAL:
+ line->resolved_dir = PANGO_DIRECTION_LTR;
+ break;
+ case PANGO_DIRECTION_RTL:
+ case PANGO_DIRECTION_WEAK_RTL:
+ case PANGO_DIRECTION_TTB_LTR:
+ line->resolved_dir = PANGO_DIRECTION_RTL;
+ break;
+ }
+}
+
static void
process_line (PangoLayout *layout,
ParaBreakState *state)
@@ -2938,7 +2961,7 @@ process_line (PangoLayout *layout,
line = pango_layout_line_new (layout);
line->start_index = state->line_start_index;
line->is_paragraph_start = state->first_line;
- line->resolved_dir = state->base_dir;
+ line_set_resolved_dir (line, state->base_dir);
if (layout->ellipsize != PANGO_ELLIPSIZE_NONE)
state->remaining_width = -1;
@@ -3264,8 +3287,8 @@ pango_layout_check_lines (PangoLayout *layout)
empty_line = pango_layout_line_new (layout);
empty_line->start_index = start - layout->text;
- empty_line->is_paragraph_start = TRUE;
- empty_line->resolved_dir = base_dir;
+ empty_line->is_paragraph_start = TRUE;
+ line_set_resolved_dir (empty_line, base_dir);
layout->lines = g_slist_prepend (layout->lines,
empty_line);