summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-09-20 18:04:13 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-09-20 18:04:13 +0000
commitb33aac5e1a4b762dab986756cbb5ba33a82ff228 (patch)
treef0df76d8398673d28643b9f33b50a300ef774252
parentbf7b59ca1b8df1624f81cc619d22682064371e40 (diff)
downloadpango-b33aac5e1a4b762dab986756cbb5ba33a82ff228.tar.gz
Fix various bugs, make more robust. (#151689)
Mon Sep 20 13:57:35 2004 Owen Taylor <otaylor@redhat.com> * modules/indic/mprefixups.c (indic_mprefixups_apply): Fix various bugs, make more robust. (#151689)
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.pre-1-105
-rw-r--r--ChangeLog.pre-1-65
-rw-r--r--ChangeLog.pre-1-85
-rw-r--r--modules/indic/mprefixups.c44
5 files changed, 37 insertions, 27 deletions
diff --git a/ChangeLog b/ChangeLog
index bf788f63..81ce6ca0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Mon Sep 20 13:57:35 2004 Owen Taylor <otaylor@redhat.com>
+
+ * modules/indic/mprefixups.c (indic_mprefixups_apply):
+ Fix various bugs, make more robust. (#151689)
+
Mon Sep 13 11:06:47 2004 Owen Taylor <otaylor@redhat.com>
* pango/ellipsize.c (init_state): Initialize
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index bf788f63..81ce6ca0 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,8 @@
+Mon Sep 20 13:57:35 2004 Owen Taylor <otaylor@redhat.com>
+
+ * modules/indic/mprefixups.c (indic_mprefixups_apply):
+ Fix various bugs, make more robust. (#151689)
+
Mon Sep 13 11:06:47 2004 Owen Taylor <otaylor@redhat.com>
* pango/ellipsize.c (init_state): Initialize
diff --git a/ChangeLog.pre-1-6 b/ChangeLog.pre-1-6
index bf788f63..81ce6ca0 100644
--- a/ChangeLog.pre-1-6
+++ b/ChangeLog.pre-1-6
@@ -1,3 +1,8 @@
+Mon Sep 20 13:57:35 2004 Owen Taylor <otaylor@redhat.com>
+
+ * modules/indic/mprefixups.c (indic_mprefixups_apply):
+ Fix various bugs, make more robust. (#151689)
+
Mon Sep 13 11:06:47 2004 Owen Taylor <otaylor@redhat.com>
* pango/ellipsize.c (init_state): Initialize
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index bf788f63..81ce6ca0 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -1,3 +1,8 @@
+Mon Sep 20 13:57:35 2004 Owen Taylor <otaylor@redhat.com>
+
+ * modules/indic/mprefixups.c (indic_mprefixups_apply):
+ Fix various bugs, make more robust. (#151689)
+
Mon Sep 13 11:06:47 2004 Owen Taylor <otaylor@redhat.com>
* pango/ellipsize.c (init_state): Initialize
diff --git a/modules/indic/mprefixups.c b/modules/indic/mprefixups.c
index 85ced566..a3a3d018 100644
--- a/modules/indic/mprefixups.c
+++ b/modules/indic/mprefixups.c
@@ -66,7 +66,10 @@ void indic_mprefixups_apply(MPreFixups *mprefixups, PangoOTBuffer *buffer)
for (fixup = 0; fixup < mprefixups->fFixupCount; fixup += 1) {
glong baseIndex = mprefixups->fFixupData[fixup].fBaseIndex;
glong mpreIndex = mprefixups->fFixupData[fixup].fMPreIndex;
- glong mpreLimit, mpreCount, moveCount, mpreDest;
+ glong baseGlyph = -1;
+ glong mpreGlyph = -1;
+ glong mpreLimit = -1;
+ glong mpreCount, moveCount, mpreDest;
glong i;
PangoOTGlyph *glyphs;
int n_glyphs;
@@ -74,48 +77,35 @@ void indic_mprefixups_apply(MPreFixups *mprefixups, PangoOTBuffer *buffer)
int *clusterSave;
/* determine post GSUB location of baseIndex and mpreIndex */
- gboolean no_base = TRUE;
pango_ot_buffer_get_glyphs (buffer, &glyphs, &n_glyphs);
for (i = 0; i < n_glyphs; i++) {
- if (glyphs[i].cluster == baseIndex) {
- baseIndex = i + 1;
- no_base = FALSE;
- }
- if (glyphs[i].cluster == mpreIndex)
- mpreIndex = i;
+ if (baseGlyph < 0 && glyphs[i].cluster == baseIndex)
+ baseGlyph = i;
+ if (glyphs[i].cluster == mpreIndex) {
+ if (mpreGlyph < 0)
+ mpreGlyph = i;
+ mpreLimit = i + 1;
+ }
}
- if (no_base)
- break;
-
- mpreLimit = mpreIndex + 1;
-
- while (glyphs[baseIndex].glyph == 0xFFFF || glyphs[baseIndex].glyph == 0xFFFE) {
- baseIndex -= 1;
- }
-
- while (glyphs[mpreLimit].glyph == 0xFFFF || glyphs[mpreLimit].glyph == 0xFFFE) {
- mpreLimit += 1;
- }
-
- if (mpreLimit == baseIndex) {
+ if (baseGlyph < 0 || mpreGlyph < 0 || mpreLimit >= baseGlyph) {
continue;
}
- mpreCount = mpreLimit - mpreIndex;
- moveCount = baseIndex - mpreLimit;
- mpreDest = baseIndex - mpreCount - 1;
+ mpreCount = mpreLimit - mpreGlyph;
+ moveCount = baseGlyph - mpreLimit;
+ mpreDest = baseGlyph - mpreCount;
mpreSave = g_new (PangoOTGlyph, mpreCount);
clusterSave = g_new (int, mpreCount);
for (i = 0; i < mpreCount; i += 1) {
- mpreSave[i] = glyphs[mpreIndex + i];
+ mpreSave[i] = glyphs[mpreGlyph + i];
}
for (i = 0; i < moveCount; i += 1) {
- glyphs[mpreIndex + i] = glyphs[mpreLimit + i];
+ glyphs[mpreGlyph + i] = glyphs[mpreLimit + i];
}
for (i = 0; i < mpreCount; i += 1) {