aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/printing
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-10-21 03:58:29 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-10-21 03:58:29 +0800
commit603c0228de30416b3c530a8d1eaeb6fa03dcba55 (patch)
tree670773e02c7c6ec19bc207e60c2de5705e5e5458 /addressbook/printing
parentf9f86c3ee2ffdda05bcc06c997710e9af8218dbf (diff)
downloadgsoc2013-evolution-603c0228de30416b3c530a8d1eaeb6fa03dcba55.tar
gsoc2013-evolution-603c0228de30416b3c530a8d1eaeb6fa03dcba55.tar.gz
gsoc2013-evolution-603c0228de30416b3c530a8d1eaeb6fa03dcba55.tar.bz2
gsoc2013-evolution-603c0228de30416b3c530a8d1eaeb6fa03dcba55.tar.lz
gsoc2013-evolution-603c0228de30416b3c530a8d1eaeb6fa03dcba55.tar.xz
gsoc2013-evolution-603c0228de30416b3c530a8d1eaeb6fa03dcba55.tar.zst
gsoc2013-evolution-603c0228de30416b3c530a8d1eaeb6fa03dcba55.zip
Filter out empty destinations. (also Bug #13036)
2001-10-20 Jon Trowbridge <trow@ximian.com> * backend/ebook/e-destination.c (e_destination_importv): Filter out empty destinations. (also Bug #13036) * printing/e-contact-print.c (e_contact_build_style): Use gnome_font_new_closest; if gnome_font_new fails and returns NULL, our spacing gets all messed up. (Bug #10785) * gui/widgets/e-addressbook-view.c (e_addressbook_view_can_print): Allow printing if there are any cards in our view. The selection has nothing to do with it. * backend/ebook/e-destination.c (e_destination_is_empty): Check for strings that contain non-whitespace, rather than just looking for a non-zero first character. (Bug #13036) svn path=/trunk/; revision=13826
Diffstat (limited to 'addressbook/printing')
-rw-r--r--addressbook/printing/e-contact-print.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c
index c4118e0dbf..18e5922854 100644
--- a/addressbook/printing/e-contact-print.c
+++ b/addressbook/printing/e-contact-print.c
@@ -44,6 +44,7 @@
#include <addressbook/backend/ebook/e-book.h>
#include <addressbook/backend/ebook/e-card.h>
#include <addressbook/backend/ebook/e-card-simple.h>
+#include <addressbook/backend/ebook/e-destination.h>
#define SCALE 5
#define HYPHEN_PIXELS 20
@@ -438,6 +439,8 @@ e_contact_get_card_size(ECardSimple *simple, EContactPrintContext *ctxt)
g_free(string);
}
height += gnome_font_get_size (ctxt->style->headings_font) * .4;
+
+ g_message ("%s %g", e_card_simple_get (simple, E_CARD_SIMPLE_FIELD_FILE_AS), height);
return height;
}
@@ -474,6 +477,17 @@ e_contact_print_card (ECardSimple *simple, EContactPrintContext *ctxt)
for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST_SIMPLE_STRING; field++) {
char *string;
string = e_card_simple_get(simple, field);
+
+ if (!strncmp (string, "<?xml", 4)) {
+ EDestination *dest = e_destination_import (string);
+ if (dest != NULL) {
+ gchar *new_string = g_strdup (e_destination_get_address (dest));
+ g_free (string);
+ string = new_string;
+ gtk_object_unref (GTK_OBJECT (dest));
+ }
+ }
+
if (string && *string) {
double xoff = 0;
e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, -1, e_card_simple_get_name(simple, field));
@@ -859,8 +873,10 @@ e_contact_build_style(EContactPrintStyle *style)
style->blank_forms = 2;
style->letter_tabs = TRUE;
style->letter_headings = FALSE;
- style->headings_font = gnome_font_new("Helvetica-Bold", 8);
- style->body_font = gnome_font_new("Helvetica", 6);
+
+ style->headings_font = gnome_font_new_closest("Helvetica", GNOME_FONT_BOLD, FALSE, 8);
+ style->body_font = gnome_font_new_closest("Helvetica", GNOME_FONT_BOOK, FALSE, 6);
+
style->print_using_grey = TRUE;
style->paper_type = 0;
style->paper_width = 8.5;
@@ -882,11 +898,15 @@ e_contact_build_style(EContactPrintStyle *style)
style->page_height = 8.5;
#endif
style->orientation_portrait = FALSE;
- style->header_font = gnome_font_new("Helvetica", 6);
+
+ style->header_font = gnome_font_new_closest("Helvetica", GNOME_FONT_BOOK, FALSE, 6);
+
style->left_header = g_strdup("");
style->center_header = g_strdup("");
style->right_header = g_strdup("");
- style->footer_font = gnome_font_new("Helvetica", 6);
+
+ style->footer_font = gnome_font_new_closest("Helvetica", GNOME_FONT_BOOK, FALSE, 6);
+
style->left_footer = g_strdup("");
style->center_footer = g_strdup("");
style->right_footer = g_strdup("");