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 67822 - Gnumeric printing 'Fit-to' feature not implemented
Gnumeric printing 'Fit-to' feature not implemented
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: Printing
git master
Other other
: Low enhancement
: ---
Assigned To: Jody Goldberg
Jody Goldberg
: 87937 (view as bug list)
Depends on: 101775
Blocks:
 
 
Reported: 2002-01-02 00:09 UTC by Wayne Schuller
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Implement fit-to - cvs diff -u > patch.diff (17.39 KB, patch)
2002-01-02 00:28 UTC, Wayne Schuller
none Details | Review
fix plugins diff (1.82 KB, patch)
2002-01-02 02:16 UTC, Wayne Schuller
none Details | Review
version 2 of scaling patch (20.22 KB, patch)
2002-01-18 04:34 UTC, Wayne Schuller
none Details | Review
Version 3 of fit-to patch for gnumeric 1.1.x (154.15 KB, patch)
2002-12-09 22:20 UTC, Wayne Schuller
none Details | Review
Sample sheet that I find useful for testing the fit-to feature (1.76 KB, application/octet-stream)
2002-12-09 22:26 UTC, Wayne Schuller
  Details

Description Wayne Schuller 2002-01-02 00:09:57 UTC
'fit-to' is the last major area of the printing dialog which isn't
implemented yet.
Comment 1 Wayne Schuller 2002-01-02 00:28:19 UTC
Created attachment 6325 [details] [review]
Implement fit-to - cvs diff -u > patch.diff
Comment 2 Wayne Schuller 2002-01-02 00:31:16 UTC
The above patch is a first attempt at making fit-to work.

It works pretty nice on my build.

All the code is documented, and code conforms to the gnumeric style (I
hope).

The basic idea is I split the scaling into x and y.

Then I make the pages fit-to by calculating the correct scaling needed
to fit to the users requested pages wide and high.

This patch might take a few attempts to get it just right.

But I hope the basic method is ok.
Comment 3 Wayne Schuller 2002-01-02 01:10:48 UTC
hmmm my changes to the xml-io will require changes to the gnumeric.xsd
file.

I don't really fully get this stuff yet.

But probably something like:
Index: gnumeric.xsd
===================================================================
RCS file: /cvs/gnome/gnumeric/gnumeric.xsd,v
retrieving revision 1.5
diff -u -r1.5 gnumeric.xsd
--- gnumeric.xsd	2001/10/25 19:25:27	1.5
+++ gnumeric.xsd	2002/01/02 01:09:37
@@ -202,7 +202,8 @@
             <xsd:element name="Scale">
                 <xsd:complexType>
                     <xsd:attribute name="type" type="xsd:string"
use="required"/>
-
	    <xsd:attribute name="percentage" type="xsd:double" />
+
	    <xsd:attribute name="x_percentage" type="xsd:double" />
+
	    <xsd:attribute name="y_percentage" type="xsd:double" />
 
	    <xsd:attribute name="cols" type="xsd:integer" />
 
	    <xsd:attribute name="rows" type="xsd:integer" />
                 </xsd:complexType>
Comment 4 Wayne Schuller 2002-01-02 02:15:29 UTC
Oh, the patch breaks 2 plugins also. Damn.
Comment 5 Wayne Schuller 2002-01-02 02:16:22 UTC
Created attachment 6326 [details] [review]
fix plugins diff
Comment 6 Jody Goldberg 2002-01-12 21:11:24 UTC
This patch is not ready for prime time.
1) We don't need to persist distinct x/y scale factors.
   They are only generated when the fit-to option is used
   in which case we should not persist the scale factors at all.
   The driving element is the fit-to selection.

2) I'm not convinced that the calculation of the factors is correct 
   in the face of repeated cols/rows.

Please give it some more work.  We can test it in 1.1 and back port to 1.0 if
things work out.
Comment 7 Wayne Schuller 2002-01-18 04:34:25 UTC
Created attachment 6432 [details] [review]
version 2 of scaling patch
Comment 8 Wayne Schuller 2002-01-18 04:41:38 UTC
ok jody

I have remassaged the patch a bit.

I have made it so it only uses the x and y percentages internally.

It does not save the x + y percentages to the gnumeric file.

When it is simple percentage scaling mode, we simply make sure that
the x + y percentages are equal. We only save the x percentage to the
file.

This also fixes a few other minor bugs I found.

The only problem remaining is the repeated rows and cols...

The code for working out the repeated rows and cols space is taken
from the same function... so in theory it should be right if that code
is right.

In practice it seems to work ok for me in most cases... I haven't used
repeated rows very much so I have to make sure that is not a bug in
the original code (eg: in the simple non-scaling case).

Could you please compile the patch and tell me what you think?
Comment 9 Andreas J. Guelzow 2002-07-14 06:20:33 UTC
*** Bug 87937 has been marked as a duplicate of this bug. ***
Comment 10 Jody Goldberg 2002-11-01 01:29:09 UTC
I'd like to get this in before 1.2.
Any chance that you could rework the patch for the development tree ?
Comment 11 Wayne Schuller 2002-11-02 03:01:43 UTC
hi Jody

I have not hacked gnumeric for a while... I have not hacked much for a
while...

When I finish exams in two weeks I will have a bit more time for hacking..

I will focus my efforts on getting my gnumeric 1.1 cvs version
compiling and getting this feature implemented.

are you still aiming for a december release?

I may not make it, we'll see... it shouldn't be too hard if gnumeric
code is still as nice as it was last year.
Comment 12 Wayne Schuller 2002-12-09 22:20:04 UTC
Created attachment 12879 [details] [review]
Version 3 of fit-to patch for gnumeric 1.1.x
Comment 13 Wayne Schuller 2002-12-09 22:22:51 UTC
ok. I applied each part of the old patch manually. It didn't need much
changing for it to compile in 1.1.x.

It is not ready for committing yet. There may be some bugs to iron out.
I still need to make it reload the saved 'fit-to' values into the dialog.

Jody: Can you have a quick read of the patch. Are you happy with my
general approach of having the x and y scaling in the print-info header?
eg: What I'm asking is - if this patch worked fully (as it nearly
does), would you commit it? Or are their design issues you are unhappy
with?

Comment 14 Wayne Schuller 2002-12-09 22:26:17 UTC
Created attachment 12881 [details]
Sample sheet that I find useful for testing the fit-to feature
Comment 15 Jody Goldberg 2002-12-17 22:39:10 UTC
It is a decent approach given our current printing infrastructure.  The main
failing is that the fit to calc ignores the repeated rows cols.  Tidy that up
and it can go in.
Comment 16 Wayne Schuller 2002-12-22 00:12:21 UTC
Jody, with my cvs copy of gnumeric 1.1.x I can't seem to get repeated
rows working in any case.

Has my patch broken repeated rows for the normal case (with no
fit-to)....?

Does repeated rows work in your copy of 1.1.x (without my patch applied) ?
Comment 17 Jody Goldberg 2003-01-23 05:05:53 UTC
Ok the patch will be in 1.1.16.  Repeated cols/rows are working with general
printing but your measurement to decide how to scale things looks fishy to me
when they are around.  We'll also need to work on the persistence of this.  As
things stand we just save a percentage, which is not what we want if fit-to is
selected.

The entire print measuring mechanism will need to be reworked during 1.3 to
allow user selectable page bounds, hard page breaks, and disaply of print
regions.  Lets close this one for now and open new bugs for the missing bits.

Thanks for your work and patience.