diff options
Diffstat (limited to 'vcl/source/gdi/print3.cxx')
-rw-r--r-- | vcl/source/gdi/print3.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index b8ed8d5afb9d..047ddc8091c3 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -162,6 +162,9 @@ public: // set by user through printer properties subdialog of printer settings dialog Size maDefaultPageSize; + // set by user through printer properties subdialog of print dialog. + // if set, pages are centered and trimmed onto the fixed page + Size maFixedPageSize; // set by user through printer properties subdialog of printer settings dialog sal_Int32 mnDefaultPaperBin; // Set by user through printer properties subdialog of print dialog. @@ -792,6 +795,7 @@ void PrinterController::setPrinter( const VclPtr<Printer>& i_rPrinter ) mpImplData->maDefaultPageSize = mpImplData->mxPrinter->GetPaperSize(); mpImplData->mxPrinter->Pop(); mpImplData->mnFixedPaperBin = -1; + mpImplData->maFixedPageSize = Size(); } void PrinterController::resetPrinterOptions( bool i_bFileOutput ) @@ -828,7 +832,7 @@ bool PrinterController::setupPrinter( vcl::Window* i_pParent ) // configured to use the driver papersize if (aNewPaperSize != mpImplData->maDefaultPageSize) { - mpImplData->maDefaultPageSize = aNewPaperSize; + mpImplData->maFixedPageSize = aNewPaperSize; bInvalidateCache = getPapersizeFromSetup(); } @@ -844,6 +848,11 @@ bool PrinterController::setupPrinter( vcl::Window* i_pParent ) { mpImplData->maPageCache.invalidate(); } + + if( aNewPaperSize != aPaperSize || nNewPaperBin != nPaperBin ) + { + mpImplData->maPageCache.invalidate(); + } } else { @@ -928,11 +937,14 @@ PrinterController::PageSize vcl::ImplPrinterControllerData::modifyJobSetup( cons //print dialog void vcl::ImplPrinterControllerData::resetPaperToLastConfigured() { + Size aPaperSize(maDefaultPageSize); + if (maFixedPageSize.Width() > 0 && maFixedPageSize.Height() > 0) + aPaperSize = maFixedPageSize; mxPrinter->Push(); mxPrinter->SetMapMode(MapMode(MAP_100TH_MM)); Size aCurSize(mxPrinter->GetPaperSize()); - if (aCurSize != maDefaultPageSize) - mxPrinter->SetPaperSizeUser(maDefaultPageSize, !isFixedPageSize()); + if (aPaperSize != aCurSize) + mxPrinter->SetPaperSizeUser(aPaperSize, !isFixedPageSize()); mxPrinter->Pop(); } |