[gnumeric] Improve horizontal fill. [#594193, part 3]
- From: Andreas J. Guelzow <guelzow src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Improve horizontal fill. [#594193, part 3]
- Date: Thu, 1 Jul 2010 04:54:45 +0000 (UTC)
commit 0c94ba422d71f27f8517f1eb92249ea9ed6245c5
Author: Andreas J Guelzow <aguelzow pyrshep ca>
Date: Wed Jun 30 22:54:46 2010 -0600
Improve horizontal fill. [#594193, part 3]
2010-06-30 Andreas J. Guelzow <aguelzow pyrshep ca>
* src/gnm-format.h: add define
* src/cell-draw.c (cell_calc_layout): replicate the pango attributes
with the text
ChangeLog | 6 ++++++
NEWS | 2 +-
src/cell-draw.c | 11 +++++++++++
src/gnm-format.h | 3 +--
4 files changed, 19 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 6fc61a7..6efccab 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2010-06-30 Andreas J. Guelzow <aguelzow pyrshep ca>
+ * src/gnm-format.h: add define
+ * src/cell-draw.c (cell_calc_layout): replicate the pango attributes
+ with the text
+
+2010-06-30 Andreas J. Guelzow <aguelzow pyrshep ca>
+
* src/gnm-format.c (format_value_common): use go_string_replace
* src/func.c (gnm_func_convert_markup_to_pango): ditto
diff --git a/NEWS b/NEWS
index bd8cd89..938a72b 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,7 @@ Andreas:
* Add new Excel and Openformula units ("pica" and "picapt") to CONVERT.
* Save default search settings. [#105615]
* Improve configurable text export of numbers. [#126444]
- * Improve horizontal fill. [#594193, parts 1 and 2]
+ * Improve horizontal fill. [#594193]
--------------------------------------------------------------------------
Gnumeric 1.10.7
diff --git a/src/cell-draw.c b/src/cell-draw.c
index 2b9d85b..9f1fb6e 100644
--- a/src/cell-draw.c
+++ b/src/cell-draw.c
@@ -146,6 +146,8 @@ cell_calc_layout (GnmCell const *cell, GnmRenderedValue *rv, int y_direction,
size_t len1 = strlen (copy1);
GString *multi = g_string_sized_new ((len1 + 6) * copies);
int i;
+ PangoAttrList *attr = pango_layout_get_attributes (layout);
+
for (i = 0; i < copies; i++) {
if (i)
g_string_append_unichar (multi, UNICODE_ZERO_WIDTH_SPACE_C);
@@ -153,6 +155,15 @@ cell_calc_layout (GnmCell const *cell, GnmRenderedValue *rv, int y_direction,
}
pango_layout_set_text (layout, multi->str, multi->len);
g_string_free (multi, TRUE);
+
+ if (attr != NULL && !go_pango_attr_list_is_empty (attr)) {
+ PangoAttrList *attr_c = pango_attr_list_copy (attr);
+ size_t len = len1 + UNICODE_ZERO_WIDTH_SPACE_C_UTF8_LENGTH;
+ for (i = 1; i < copies;
+ i++, len += len1 + UNICODE_ZERO_WIDTH_SPACE_C_UTF8_LENGTH)
+ pango_attr_list_splice (attr, attr_c, len, len1);
+ pango_attr_list_unref (attr_c);
+ }
}
rv->hfilled = TRUE;
break;
diff --git a/src/gnm-format.h b/src/gnm-format.h
index 9b109dc..21dd538 100644
--- a/src/gnm-format.h
+++ b/src/gnm-format.h
@@ -63,6 +63,7 @@ GOFormat *gnm_format_import (const char *fmt,
*/
#define UNICODE_LOGICAL_NOT_C 0x00AC
#define UNICODE_ZERO_WIDTH_SPACE_C 0X200B
+#define UNICODE_ZERO_WIDTH_SPACE_C_UTF8_LENGTH 3
#define UNICODE_EURO_SIGN_C 0x20AC
#define UNICODE_MINUS_SIGN_C 0x2212
#define UNICODE_DIVISION_SLASH_C 0x2215
@@ -72,8 +73,6 @@ GOFormat *gnm_format_import (const char *fmt,
#define UNICODE_LESS_THAN_OR_EQUAL_TO_C 0x2264
#define UNICODE_GREATER_THAN_OR_EQUAL_TO_C 0x2265
-
-
G_END_DECLS
#endif /* _GNM_FORMAT_H_ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]