summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2012-03-28 14:03:46 +0200
committerDavid Tardon <dtardon@redhat.com>2012-03-29 08:06:17 +0200
commit38f8241859cdef4dd7c3098e365947dd5b64f78c (patch)
tree0b9750f307b0c016e368d6ebc34fdccc55afde88 /vcl/source
parentb512c3ca29735f15383c5f6215348fccfaddd40e (diff)
set correct paper tray in UI
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/gdi/print3.cxx21
1 files changed, 21 insertions, 0 deletions
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index 482420333060..260fdc02b5f7 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -172,9 +172,25 @@ public:
// set by user through printer config dialog
// if set, pages are centered and trimmed onto the fixed page
Size maFixedPageSize;
+ // set by user through printer config dialog
sal_Int32 mnDefaultPaperBin;
+ // Set by user through printer preferences in print dialog.
+ // Overrides application-set tray for a page.
sal_Int32 mnFixedPaperBin;
+ // N.B. Apparently we have three levels of paper tray settings
+ // (latter overrides former):
+ // 1. default tray
+ // 2. tray set for a concrete page by an application, e.g., writer
+ // allows setting a printer tray (for the default printer) for a
+ // page style. This setting can be overriden by user by selecting
+ // "Use only paper tray from printer preferences" on the Options
+ // page in the print dialog, in which case the default tray is
+ // used for all pages.
+ // 3. tray set in printer properties the printer dialog
+ // I'm not quite sure why 1. and 3. are distinct, but the commit
+ // history suggests this is intentional...
+
ImplPrinterControllerData() :
mbFirstPage( sal_True ),
mbLastPage( sal_False ),
@@ -818,6 +834,11 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons
mpPrinter->SetPaperSizeUser( aRealPaperSize, ! isFixedPageSize() );
}
+ // paper bin set from properties in print dialog overrides
+ // application default for a page
+ if ( mnFixedPaperBin != -1 )
+ nPaperBin = mnFixedPaperBin;
+
if( nPaperBin != -1 && nPaperBin != mpPrinter->GetPaperBin() )
mpPrinter->SetPaperBin( nPaperBin );