[Libreoffice-commits] core.git: Branch 'feature/propose-master-cib' - vcl/source
Jan-Marek Glogowski
glogow at fbihome.de
Wed May 13 00:51:16 PDT 2015
Rebased ref, commits from common ancestor:
commit 238a2fa0c862f486b1713a924495d107895ecda3
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date: Mon Dec 16 21:11:14 2013 +0100
Handle fixed page size printer option.
Correctly handle the printer option "fixed page size". If set,
pages are centered and trimmed onto the fixed page, regardless
of the page size option.
(cherry picked from commit b002226b5c9a970960de39be535e97e861860866)
Conflicts:
vcl/source/gdi/print3.cxx
Change-Id: I10f6f5a10268c452847f032e204df8f363be99a1
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index b8ed8d5..047ddc8 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();
}
More information about the Libreoffice-commits
mailing list