summaryrefslogtreecommitdiff
path: root/pango/pango-impl-utils.h
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2009-11-17 16:20:42 -0500
committerBehdad Esfahbod <behdad@behdad.org>2009-11-17 16:21:11 -0500
commit4ccabeffc20f899163bf610356871afb197e9bf8 (patch)
tree629478f89f68fc763f55cbc53bd8d1d25160c610 /pango/pango-impl-utils.h
parent718c533d28cb760e45c7b874420b14003445a9c1 (diff)
downloadpango-4ccabeffc20f899163bf610356871afb197e9bf8.tar.gz
Bug 596614 - Pango application receives SIGSEGV on pasting text with U+202E
Fixed all modules to reverse glyphs if run is rtl. Except for Hangul module. Fixed pango_shape() to detect that, warn, and reverse.
Diffstat (limited to 'pango/pango-impl-utils.h')
-rw-r--r--pango/pango-impl-utils.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/pango/pango-impl-utils.h b/pango/pango-impl-utils.h
index 3ef3a0c4..6d6c8ff2 100644
--- a/pango/pango-impl-utils.h
+++ b/pango/pango-impl-utils.h
@@ -150,7 +150,31 @@ pango_utf8_strlen (const gchar *p, gssize max)
return len;
}
+
+/* To be made public at some point */
+
+static G_GNUC_UNUSED void
+pango_glyph_string_reverse_range (PangoGlyphString *glyphs,
+ int start, int end)
+{
+ int i, j;
+
+ for (i = start, j = end - 1; i < j; i++, j--)
+ {
+ PangoGlyphInfo glyph_info;
+ gint log_cluster;
+
+ glyph_info = glyphs->glyphs[i];
+ glyphs->glyphs[i] = glyphs->glyphs[j];
+ glyphs->glyphs[j] = glyph_info;
+
+ log_cluster = glyphs->log_clusters[i];
+ glyphs->log_clusters[i] = glyphs->log_clusters[j];
+ glyphs->log_clusters[j] = log_cluster;
+ }
+}
+
+
G_END_DECLS
#endif /* __PANGO_IMPL_UTILS_H__ */
-