Re: [PATCH] Inconsistent read/write of a GtkPaperSize to GKeyFile



Andrea wrote:
> Hi,
> 
> I've been chasing a bug in GIMP for a few days
> http://bugzilla.gnome.org/show_bug.cgi?id=567806
> 
> and I have finally found what the problem is.
> 
> Basically when I write and read a GtkPaperSize to a GKeyFile
> 
> gtk_paper_size_to_key_file
> gtk_paper_size_new_from_key_file
> 
> I get different sizes.
> 
> This happens only for some paper sizes (the non standard I guess) e.g. the photo paper.
> 
> The problem is that
> 
> the sizes are written in unit = GTK_UNIT_MM (in gtkpapersize.c:916)
> and read as GTK_UNIT_POINTS (in gtk_paper_size_new_from_ppd() in gtkpapersize.c:311)
> 
> This does not happens always, because if the ppd name is recognized as a standard value (in
> gtk_paper_size_new_from_ppd()), the code follows a different path.
> 
> I attach a patch to fix the way values as read (MM rather than POINTS).
> I have not tested it yet (I need to recompile GTK's rpm source), but I am pretty confident.

Ok, it does work completely.
One thing is solved (i.e. paper sizes are not modified by reading and writing).
But some part of the code needs them to be in POINTS (e.g. gtkprintbackendcups.c, function
create_page_setup)

So what happens now is that the sizes are overscaled...

I will try to change them boths to POINTS rather than MM.

Anyone has an idea?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]