GNOME Bugzilla – Bug 312912
word wrap difference between sheet view and printview
Last modified: 2005-08-09 18:26:43 UTC
Print preview may wrap text that is not wrapped in the sheetview. I am appending 2 attachments: 1) an image showing the difference and 2) the file used to create this image THis issue seems to be of great concern to some users.
Created attachment 50402 [details] Image showing difference between sheet and print preview
Created attachment 50403 [details] Workbook used to create the previous image
Confirmed. Something is bogus with this code: * We really want to keep the line breaks, but currently pango * does not support that. On one-line layouts, however, we * can simply turn off the wrapping. */ pango_layout_set_wrap (layout, pango_layout_get_wrap (olayout) && pango_layout_get_line_count (olayout) > 1); Wrap is an enum, not a boolean. /me gets both pieces.
Please try this. It's still a hack, but without Pango support it is going to have to be. Index: src/rendered-value.c =================================================================== RCS file: /cvs/gnome/gnumeric/src/rendered-value.c,v retrieving revision 1.106 diff -u -r1.106 rendered-value.c --- src/rendered-value.c 8 Aug 2005 09:38:39 -0000 1.106 +++ src/rendered-value.c 8 Aug 2005 20:11:58 -0000 @@ -500,19 +500,23 @@ pango_layout_set_justify (layout, pango_layout_get_justify (olayout)); pango_layout_set_width (layout, pango_layout_get_width (olayout)); pango_layout_set_spacing (layout, pango_layout_get_spacing (olayout)); - /* - * We really want to keep the line breaks, but currently pango - * does not support that. On one-line layouts, however, we - * can simply turn off the wrapping. - */ - pango_layout_set_wrap (layout, - pango_layout_get_wrap (olayout) && - pango_layout_get_line_count (olayout) > 1); + pango_layout_set_wrap (layout, pango_layout_get_wrap (olayout)); pango_layout_set_indent (layout, pango_layout_get_indent (olayout)); pango_layout_set_auto_dir (layout, pango_layout_get_auto_dir (olayout)); pango_layout_set_ellipsize (layout, pango_layout_get_ellipsize (olayout)); pango_layout_set_font_description (layout, pango_layout_get_font_description (olayout)); // ignore tabs + + /* + * We really want to keep the line breaks, but currently pango + * does not support that. + */ + if (pango_layout_get_line_count (olayout) == 1) { + res->wrap_text = FALSE; + if (pango_layout_get_line_count (layout) > 1) { + pango_layout_set_width (layout, -1); + } + } rendered_value_remeasure (res); return res;
This seems to fix it for me.
Fixed in cvs.