summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/print3.cxx
diff options
context:
space:
mode:
authorDaniel <danielfaleirosilva@gmail.com>2018-08-06 10:50:17 -0300
committerDaniel Silva <danielfaleirosilva@gmail.com>2018-11-29 13:02:16 -0200
commitb368e4043582e6785a88b444e148fdffdc2aece1 (patch)
tree11255f482019116227191380f2c0e1448c417838 /vcl/source/gdi/print3.cxx
parentb4601ff6d9261d185cd440ebdbca8d78f3b5d459 (diff)
Fix paper size combobox selection
Change-Id: I9682e0fcd58b45957e7f488e0b184475a39240c2 Reviewed-on: https://gerrit.libreoffice.org/58644 Tested-by: Jenkins Reviewed-by: Daniel Silva <danielfaleirosilva@gmail.com>
Diffstat (limited to 'vcl/source/gdi/print3.cxx')
-rw-r--r--vcl/source/gdi/print3.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index e698ab9ee251..91306453977e 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -152,6 +152,7 @@ public:
bool mbLastPage;
bool mbReversePageOrder;
bool mbPapersizeFromSetup;
+ bool mbPapersizeFromUser;
bool mbPrinterModified;
css::view::PrintableState meJobState;
@@ -163,6 +164,8 @@ public:
// set by user through printer properties subdialog of printer settings dialog
Size maDefaultPageSize;
+ // set by user through print dialog
+ Size maUserPageSize;
// set by user through printer properties subdialog of printer settings dialog
sal_Int32 mnDefaultPaperBin;
// Set by user through printer properties subdialog of print dialog.
@@ -187,6 +190,7 @@ public:
mbLastPage( false ),
mbReversePageOrder( false ),
mbPapersizeFromSetup( false ),
+ mbPapersizeFromUser( false ),
mbPrinterModified( false ),
meJobState( css::view::PrintableState_JOB_STARTED ),
mpProgress( nullptr ),
@@ -197,6 +201,8 @@ public:
const Size& getRealPaperSize( const Size& i_rPageSize, bool bNoNUP ) const
{
+ if ( mbPapersizeFromUser )
+ return maUserPageSize;
if( mbPapersizeFromSetup )
return maDefaultPageSize;
if( maMultiPage.nRows * maMultiPage.nColumns > 1 && ! bNoNUP )
@@ -783,6 +789,7 @@ void PrinterController::setPrinter( const VclPtr<Printer>& i_rPrinter )
mpImplData->mxPrinter->Push();
mpImplData->mxPrinter->SetMapMode(MapMode(MapUnit::Map100thMM));
mpImplData->maDefaultPageSize = mpImplData->mxPrinter->GetPaperSize();
+ mpImplData->mbPapersizeFromUser = false;
mpImplData->mxPrinter->Pop();
mpImplData->mnFixedPaperBin = -1;
}
@@ -1362,6 +1369,8 @@ void PrinterController::setPapersizeFromSetup( bool i_bPapersizeFromSetup )
{
mpImplData->mbPapersizeFromSetup = i_bPapersizeFromSetup;
mpImplData->mxPrinter->SetPrinterSettingsPreferred( i_bPapersizeFromSetup );
+ if ( i_bPapersizeFromSetup )
+ mpImplData->mbPapersizeFromUser = !i_bPapersizeFromSetup;
}
bool PrinterController::getPapersizeFromSetup() const
@@ -1369,6 +1378,15 @@ bool PrinterController::getPapersizeFromSetup() const
return mpImplData->mbPapersizeFromSetup;
}
+void PrinterController::setPaperSizeFromUser( Size i_aUserSize )
+{
+ mpImplData->mbPapersizeFromUser = true;
+ mpImplData->mbPapersizeFromSetup = false;
+ mpImplData->mxPrinter->SetPrinterSettingsPreferred( false );
+
+ mpImplData->maUserPageSize = i_aUserSize;
+}
+
void PrinterController::setPrinterModified( bool i_bPrinterModified )
{
mpImplData->mbPrinterModified = i_bPrinterModified;