summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/X11/XprintAppUtil/xpapputil.h3
-rw-r--r--src/xpapputil.c19
2 files changed, 11 insertions, 11 deletions
diff --git a/include/X11/XprintAppUtil/xpapputil.h b/include/X11/XprintAppUtil/xpapputil.h
index 174b71d..d7159bb 100644
--- a/include/X11/XprintAppUtil/xpapputil.h
+++ b/include/X11/XprintAppUtil/xpapputil.h
@@ -71,7 +71,8 @@ typedef struct
void *print_to_filehandle;
Screen *pscreen;
int pscreennumber;
- long document_dpi;
+ long document_dpi_x,
+ document_dpi_y;
XpuSupportedFlags supported_job_attributes;
XpuSupportedFlags supported_doc_attributes;
diff --git a/src/xpapputil.c b/src/xpapputil.c
index 7e86f8e..afb81e4 100644
--- a/src/xpapputil.c
+++ b/src/xpapputil.c
@@ -131,15 +131,13 @@ XpAuErrorValue XpauParseArg( const char *arg_name, const char *arg_value, XpauCo
return XpAuError_success;
}
else if( !strcasecmp(arg_name, "resolution") )
- {
- int arg_res = atoi(arg_value);
-
+ {
if( !(context->resolution_list && (context->supported_doc_attributes & XPUATTRIBUTESUPPORTED_DEFAULT_PRINTER_RESOLUTION)) )
return XpAuError_unsupported_resolution;
- docvalues->resolution = XpuFindResolution(context->resolution_list,
+ docvalues->resolution = XpuFindResolutionByName(context->resolution_list,
context->resolution_num_list_entries,
- arg_res, arg_res);
+ arg_value);
if( !docvalues->resolution )
return XpAuError_unsupported_resolution;
@@ -409,7 +407,7 @@ XpAuErrorValue XpauStartJob( XpauContext *context, const char *printerfile )
}
/* Get default printer resolution */
- if( XpuGetResolution(context->pdpy, context->pcontext, &context->document_dpi) != 1 )
+ if( XpuGetResolution(context->pdpy, context->pcontext, &context->document_dpi_x, &context->document_dpi_y) != 1 )
{
result = XpAuError_no_dpi_set;
}
@@ -440,10 +438,11 @@ XpAuErrorValue XpauEndJob( XpauContext *context )
*/
XFlush(context->pdpy);
- context->inJob = False;
- context->pscreen = NULL;
- context->pscreennumber = -1;
- context->document_dpi = 0L;
+ context->inJob = False;
+ context->pscreen = NULL;
+ context->pscreennumber = -1;
+ context->document_dpi_x = 0L;
+ context->document_dpi_y = 0L;
if( context->print_to_filehandle )
{