summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2004-11-21 16:45:36 +0000
committerOwen Taylor <otaylor@src.gnome.org>2004-11-21 16:45:36 +0000
commit145e118d8d071e5836334a3ffacf22cf789e4257 (patch)
tree84b17ff8afca40011a5101711cd987c8ad3b8e3b
parenta74950580a02c579cef2f523a148e0f386d620b6 (diff)
downloadpango-145e118d8d071e5836334a3ffacf22cf789e4257.tar.gz
Return n+1 logical attributes not n logical attributes (#155912)
Sun Nov 21 11:40:03 2004 Owen Taylor <otaylor@redhat.com> * pango/pango-layout.c (pango_layout_get_log_attrs): Return n+1 logical attributes not n logical attributes (#155912)
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.pre-1-105
-rw-r--r--ChangeLog.pre-1-85
-rw-r--r--pango/pango-layout.c12
4 files changed, 22 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 1863f680..cfe92476 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Nov 21 11:40:03 2004 Owen Taylor <otaylor@redhat.com>
+
+ * pango/pango-layout.c (pango_layout_get_log_attrs): Return n+1
+ logical attributes not n logical attributes (#155912)
+
Sun Nov 21 10:52:03 2004 Owen Taylor <otaylor@redhat.com>
* pango/pango-context.c: Don't just call pango_fontset_get_metrics()
diff --git a/ChangeLog.pre-1-10 b/ChangeLog.pre-1-10
index 1863f680..cfe92476 100644
--- a/ChangeLog.pre-1-10
+++ b/ChangeLog.pre-1-10
@@ -1,3 +1,8 @@
+Sun Nov 21 11:40:03 2004 Owen Taylor <otaylor@redhat.com>
+
+ * pango/pango-layout.c (pango_layout_get_log_attrs): Return n+1
+ logical attributes not n logical attributes (#155912)
+
Sun Nov 21 10:52:03 2004 Owen Taylor <otaylor@redhat.com>
* pango/pango-context.c: Don't just call pango_fontset_get_metrics()
diff --git a/ChangeLog.pre-1-8 b/ChangeLog.pre-1-8
index 1863f680..cfe92476 100644
--- a/ChangeLog.pre-1-8
+++ b/ChangeLog.pre-1-8
@@ -1,3 +1,8 @@
+Sun Nov 21 11:40:03 2004 Owen Taylor <otaylor@redhat.com>
+
+ * pango/pango-layout.c (pango_layout_get_log_attrs): Return n+1
+ logical attributes not n logical attributes (#155912)
+
Sun Nov 21 10:52:03 2004 Owen Taylor <otaylor@redhat.com>
* pango/pango-context.c: Don't just call pango_fontset_get_metrics()
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index 5f846a78..97649f40 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -917,8 +917,10 @@ pango_layout_context_changed (PangoLayout *layout)
* @attrs: location to store a pointer to an array of logical attributes
* This value must be freed with g_free().
* @n_attrs: location to store the number of the attributes in the
- * array. (The stored value will be equal to the total number
- * of characters in the layout.)
+ * array. (The stored value will be one more than the total number
+ * of characters in the layout, since there need to be attributes
+ * corresponding to both the position before the first character
+ * and the position after the last character.)
*
* Retrieves an array of logical attributes for each character in
* the @layout.
@@ -934,12 +936,12 @@ pango_layout_get_log_attrs (PangoLayout *layout,
if (attrs)
{
- *attrs = g_new (PangoLogAttr, layout->n_chars);
- memcpy (*attrs, layout->log_attrs, sizeof(PangoLogAttr) * layout->n_chars);
+ *attrs = g_new (PangoLogAttr, layout->n_chars + 1);
+ memcpy (*attrs, layout->log_attrs, sizeof(PangoLogAttr) * (layout->n_chars + 1));
}
if (n_attrs)
- *n_attrs = layout->n_chars;
+ *n_attrs = layout->n_chars + 1;
}