[Users] Printing text from a HTML/text message

Lyle Bickley lbickley at bickleywest.com
Mon Nov 18 00:24:21 CET 2019


Hi Colin,

I just got some time to recompile claws and am now at version 3.17.4git70.

Claws after this update printed text as it should! A big "Thank you" for
fixing this bug!!!

Cheers,
Lyle
--

On Sat,  9 Nov 2019 22:14:25 +0000 (UTC)
colin at claws-mail.org wrote:

> The branch, master has been updated
>        via  844944f102a6a295b818eca8bf6e8e7a2f2e0f92 (commit)
>       from  5286b61fa85f46ed353f68c65af30a187cbabaa1 (commit)
> 
> Summary of changes:
>  src/messageview.c | 14 +++++++++++---
>  src/printing.c    | 16 +++++++++-------
>  2 files changed, 20 insertions(+), 10 deletions(-)
> 
> 
> - Log -----------------------------------------------------------------
> commit 844944f102a6a295b818eca8bf6e8e7a2f2e0f92
> Author: Colin Leroy <colin at colino.net>
> Date:   Sat Nov 9 23:13:33 2019 +0100
> 
>     Printing: only print as plain text if the part is of type text;
>     fix a segfault with default info icon when trying to print a non-text
>     part.
> 
> diff --git a/src/messageview.c b/src/messageview.c
> index b4fc18316..3a6184f98 100644
> --- a/src/messageview.c
> +++ b/src/messageview.c
> @@ -2181,9 +2181,17 @@ static void print_mimeview(MimeView *mimeview, gint
> sel_start, gint sel_end, gin viewer->print(viewer);
>  				return;
>  			} else {
> -				/* Force text rendering */
> -				mimeview_show_part_as_text(mimeview,
> -
> mimeview_get_selected_part(mimeview));
> +				/* Force text rendering if possible */
> +				MimeInfo *mimepart;
> +
> +				mimepart =
> mimeview_get_selected_part(mimeview);
> +				if (mimepart == NULL
> +				||  (mimepart->type != MIMETYPE_TEXT &&
> mimepart->type != MIMETYPE_MESSAGE)) {
> +					alertpanel_warning(_("Cannot print:
> the message doesn't "
> +							     "contain
> text."));
> +					return;
> +				}
> +				mimeview_show_part_as_text(mimeview,
> mimepart); }
>  		}
>  		if (sel_start != -1 && sel_end != -1) {
> diff --git a/src/printing.c b/src/printing.c
> index ae3cd15ef..d0d3d97ef 100644
> --- a/src/printing.c
> +++ b/src/printing.c
> @@ -1122,16 +1122,18 @@ static void
> printing_textview_cb_draw_page(GtkPrintOperation *op, GtkPrintContex
> GdkPixbuf *pixbuf = gtk_image_get_pixbuf(print_data->avatar); gdouble
> startx, starty; 
> -		startx =
> gtk_print_context_get_width(context)/print_data->zoom;
> +		if (pixbuf != NULL) {
> +			startx =
> gtk_print_context_get_width(context)/print_data->zoom; 
> -		startx -= ((double)gdk_pixbuf_get_width(pixbuf));
> +			startx -= ((double)gdk_pixbuf_get_width(pixbuf));
>  
> -		starty = start_pos;
> +			starty = start_pos;
>  
> -		surface = pixbuf_to_surface(pixbuf);
> -		cairo_set_source_surface (cr, surface, startx, starty);
> -		cairo_paint (cr);
> -		cairo_surface_destroy (surface);
> +			surface = pixbuf_to_surface(pixbuf);
> +			cairo_set_source_surface (cr, surface, startx,
> starty);
> +			cairo_paint (cr);
> +			cairo_surface_destroy (surface);
> +		}
>  	}
>  
>  	pango_layout_iter_free(iter);
> 
> -----------------------------------------------------------------------
> 
> 
> hooks/post-receive



-- 
73   NM6Y
Bickley Consulting West Inc.
https://bickleywest.com

"Black holes are where God is dividing by zero"


More information about the Users mailing list