aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZbigniew Chyla <cyba@gnome.pl>2002-01-18 05:59:22 +0800
committerChyla Zbigniew <chyla@src.gnome.org>2002-01-18 05:59:22 +0800
commit7da35dfe09148edd34ae4b48a53b1eae179dc58c (patch)
treef5ede14d2173f55a2fbb32308c9b80874d415243
parenta51a121e95a5302c037f4f9d272846ede24717f3 (diff)
downloadgsoc2013-evolution-7da35dfe09148edd34ae4b48a53b1eae179dc58c.tar
gsoc2013-evolution-7da35dfe09148edd34ae4b48a53b1eae179dc58c.tar.gz
gsoc2013-evolution-7da35dfe09148edd34ae4b48a53b1eae179dc58c.tar.bz2
gsoc2013-evolution-7da35dfe09148edd34ae4b48a53b1eae179dc58c.tar.lz
gsoc2013-evolution-7da35dfe09148edd34ae4b48a53b1eae179dc58c.tar.xz
gsoc2013-evolution-7da35dfe09148edd34ae4b48a53b1eae179dc58c.tar.zst
gsoc2013-evolution-7da35dfe09148edd34ae4b48a53b1eae179dc58c.zip
Fixes #17725
2001-12-20 Zbigniew Chyla <cyba@gnome.pl> Fixes #17725 * evolution/addressbook/printing/e-contact-print.c (complete_sequence): Do not assume that the first byte of file_as is the first letter, use utf8 functions instead. svn path=/trunk/; revision=15351
-rw-r--r--addressbook/ChangeLog8
-rw-r--r--addressbook/printing/e-contact-print.c12
2 files changed, 16 insertions, 4 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index ff4a55333e..5ed542d2cf 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,11 @@
+2001-12-20 Zbigniew Chyla <cyba@gnome.pl>
+
+ Fixes #17725
+
+ * evolution/addressbook/printing/e-contact-print.c (complete_sequence):
+ Do not assume that the first byte of file_as is the first letter, use
+ utf8 functions instead.
+
2002-01-16 JP Rosevear <jpr@ximian.com>
* conduit/address-conduit.c: move all functions here, get rid of
diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c
index 458b854c77..81f5c4e965 100644
--- a/addressbook/printing/e-contact-print.c
+++ b/addressbook/printing/e-contact-print.c
@@ -541,19 +541,22 @@ complete_sequence(EBookView *book_view, EContactPrintContext *ctxt)
ECard *card = cards->data;
ECardSimple *simple = e_card_simple_new(card);
guchar *file_as;
+ gchar *letter_str = NULL;
gtk_object_get(GTK_OBJECT(card),
"file_as", &file_as,
NULL);
- if ( file_as && (!ctxt->character || *ctxt->character != tolower(*file_as)) ) {
+ if (file_as != NULL) {
+ letter_str = g_strndup (file_as, g_utf8_next_char (file_as) - (gchar *) file_as);
+ }
+ if ( file_as && (!ctxt->character || g_utf8_collate (ctxt->character, letter_str) != 0) ) {
+ g_free (ctxt->character);
+ ctxt->character = g_strdup (letter_str);
if (ctxt->style->sections_start_new_page && ! ctxt->first_contact) {
e_contact_start_new_page(ctxt);
}
else if ((!ctxt->first_contact) && (ctxt->y - e_contact_get_letter_heading_height(ctxt) - e_contact_get_card_size(simple, ctxt) < ctxt->style->bottom_margin * 72))
e_contact_start_new_column(ctxt);
- if (!ctxt->character)
- ctxt->character = g_strdup(" ");
- *ctxt->character = tolower(*file_as);
if ( ctxt->style->letter_headings )
e_contact_print_letter_heading(ctxt, ctxt->character);
ctxt->first_section = FALSE;
@@ -563,6 +566,7 @@ complete_sequence(EBookView *book_view, EContactPrintContext *ctxt)
if ( ctxt->style->letter_headings )
e_contact_print_letter_heading(ctxt, ctxt->character);
}
+ g_free (letter_str);
ctxt->last_char_on_page = toupper(*file_as);
if ( ctxt->last_char_on_page < ctxt->first_char_on_page )
ctxt->first_char_on_page = ctxt->last_char_on_page;