After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 312912 - word wrap difference between sheet view and printview
word wrap difference between sheet view and printview
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Printing
git master
Other All
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2005-08-08 17:21 UTC by Andreas J. Guelzow
Modified: 2005-08-09 18:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Image showing difference between sheet and print preview (14.31 KB, image/png)
2005-08-08 17:25 UTC, Andreas J. Guelzow
Details
Workbook used to create the previous image (1.59 KB, application/octet-stream)
2005-08-08 17:25 UTC, Andreas J. Guelzow
Details

Description Andreas J. Guelzow 2005-08-08 17:21:49 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.
Comment 1 Andreas J. Guelzow 2005-08-08 17:25:09 UTC
Created attachment 50402 [details]
Image showing difference between sheet and print preview
Comment 2 Andreas J. Guelzow 2005-08-08 17:25:58 UTC
Created attachment 50403 [details]
Workbook used to create the previous image
Comment 3 Morten Welinder 2005-08-08 19:09:28 UTC
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.
Comment 4 Morten Welinder 2005-08-08 20:13:18 UTC
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;
Comment 5 Andreas J. Guelzow 2005-08-09 00:04:22 UTC
This seems to fix it for me.
Comment 6 Morten Welinder 2005-08-09 18:26:43 UTC
Fixed in cvs.