Re: [Patch] Complete Excel paper size import
- From: Jody Goldberg <jody gnome org>
- To: gnumeric-list gnome org
- Subject: Re: [Patch] Complete Excel paper size import
- Date: Sun, 21 Nov 2004 12:04:34 -0500
On Sat, Nov 20, 2004 at 01:13:36PM +0100, J.H.M. Dassen (Ray) wrote:
Before we entered full patch review mode, I committed the start of paper
size import for XLS files. The code currently in CVS has one relatively
major limitation: it only imports paper sizes for which the gnome-print
system has names. The attached patch removes that limitation, by adding
paper_width and paper_height fields to struct PrintInformation and setting
and using them appropriately; it's a straightforward extension of what's
already in place.
Please let me know if it's OK to commit this patch.
Please do not commit. This is non-critical, it can wait for 1.4.1
+print_info_get_paper_width (PrintInformation const *pi)
+print_info_get_paper_height (PrintInformation const *pi)
Nothing calls these just now, I suppose the intent is to use them
for xls export ?
@@ -732,8 +766,15 @@ print_info_make_config (PrintInformation
? gnome_print_config_from_string (gnm_app_prefs->printer_config, 0)
: gnome_print_config_default ());
- if (NULL != pi->paper)
+ if (NULL != pi->paper) {
gnome_print_config_set (res, GNOME_PRINT_KEY_PAPER_SIZE, pi->paper);
+ } else {
+ if ((NULL != pi->paper_width) && (NULL != pi->paper_height)) {
+ gnome_print_config_set (res, GNOME_PRINT_KEY_PAPER_SIZE, "Custom");
+ gnome_print_config_set (res, GNOME_PRINT_KEY_PAPER_WIDTH, pi->paper_width);
+ gnome_print_config_set (res, GNOME_PRINT_KEY_PAPER_HEIGHT, pi->paper_height);
+ }
+ }
This only solves part of the problem. There are two issues it
leaves untouched.
1) persistence to/from .gnumeric
We currently save only the paper name, not the sizes, so we'd
lose the new info.
2) It may not work once the user opens a printer setup dialog.
When we reload the PrintInfo from the gnomeprintconfig we'll load
a paper name which will override the selected sizes.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]