diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-05-20 10:11:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-05-20 11:26:20 +0100 |
commit | 71ebe4404b6e7c78a7d2e352f6af88d57209680a (patch) | |
tree | a48c8a63115b316f238fde8c649040f773b45f71 | |
parent | a9eab694d896426783c1826f4dfe3e2871043f84 (diff) |
Related: fdo#61186 always operate on printer settings paper format
scenario 2: with attached test document
a file->printer settings->properties->paper
set a paper size, ideally something not used in the test doc, e.g. Executive
b file->print->properties
the paper size here should now still be what was selected in a and
*not* what happened to be the current page format shown in the preview
which is legal
Change-Id: Ie2f440621201d309eb20a650122f9ff7bff441da
-rw-r--r-- | vcl/source/gdi/print3.cxx | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index f230214e8e76..cea6bc379a25 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -781,26 +781,46 @@ bool PrinterController::setupPrinter( Window* i_pParent ) bool bRet = false; if( mpImplData->mpPrinter.get() ) { - // get old data - Size aPaperSize( mpImplData->mpPrinter->PixelToLogic( - mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) ); + mpImplData->mpPrinter->Push(); + mpImplData->mpPrinter->SetMapMode(MapMode(MAP_100TH_MM)); + + // get current data + Size aPaperSize(mpImplData->mpPrinter->GetPaperSize()); sal_uInt16 nPaperBin = mpImplData->mpPrinter->GetPaperBin(); + // reset paper size back to last configured size, not + // whatever happens to be the current page + resetPaperToLastConfigured(); + // call driver setup bRet = mpImplData->mpPrinter->Setup( i_pParent ); - if( bRet ) + Size aNewPaperSize(mpImplData->mpPrinter->GetPaperSize()); + if (bRet) { - // was papersize or bin overridden ? if so we need to take action - Size aNewPaperSize( mpImplData->mpPrinter->PixelToLogic( - mpImplData->mpPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) ); + // was papersize or bin overridden ? if so we need to take action + if( aNewPaperSize != aPaperSize ) + { + mpImplData->maFixedPageSize = aNewPaperSize; + } + sal_uInt16 nNewPaperBin = mpImplData->mpPrinter->GetPaperBin(); + if( nNewPaperBin != nPaperBin ) + { + mpImplData->mnFixedPaperBin = nNewPaperBin; + } + if( aNewPaperSize != aPaperSize || nNewPaperBin != nPaperBin ) { - mpImplData->maFixedPageSize = aNewPaperSize; mpImplData->maPageCache.invalidate(); - mpImplData->mnFixedPaperBin = nNewPaperBin; } } + else + { + //restore to whatever it was before we entered this method + if (aPaperSize != aNewPaperSize) + mpImplData->mpPrinter->SetPaperSizeUser(aPaperSize, !mpImplData->isFixedPageSize()); + } + mpImplData->mpPrinter->Pop(); } return bRet; } |