summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/print.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/gdi/print.cxx')
-rw-r--r--vcl/source/gdi/print.cxx24
1 files changed, 19 insertions, 5 deletions
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index d6503b5dc933..76e1642f1bd6 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1224,11 +1224,25 @@ sal_Bool Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
if ( mbInPrintPage )
return sal_False;
- Size aPixSize = LogicToPixel( rSize );
- Size aPageSize = PixelToLogic( aPixSize, MAP_100TH_MM );
- if ( (maJobSetup.ImplGetConstData()->mePaperFormat != PAPER_USER) ||
- (maJobSetup.ImplGetConstData()->mnPaperWidth != aPageSize.Width()) ||
- (maJobSetup.ImplGetConstData()->mnPaperHeight != aPageSize.Height()) )
+ const Size aPixSize = LogicToPixel( rSize );
+ const Size aPageSize = PixelToLogic( aPixSize, MAP_100TH_MM );
+ bool bNeedToChange(maJobSetup.ImplGetConstData()->mnPaperWidth != aPageSize.Width() ||
+ maJobSetup.ImplGetConstData()->mnPaperHeight != aPageSize.Height());
+
+ if(!bNeedToChange)
+ {
+ // #122984# only need to change when Paper is different from PAPER_USER and
+ // the mapped Paper which will created below in the call to ImplFindPaperFormatForUserSize
+ // and will replace maJobSetup.ImplGetConstData()->mePaperFormat. This leads to
+ // unnecessary JobSetups, e.g. when printing a multi-page fax, but also with
+ // normal print
+ const Paper aPaper = ImplGetPaperFormat(aPageSize.Width(), aPageSize.Height());
+
+ bNeedToChange = maJobSetup.ImplGetConstData()->mePaperFormat != PAPER_USER &&
+ maJobSetup.ImplGetConstData()->mePaperFormat != aPaper;
+ }
+
+ if(bNeedToChange)
{
JobSetup aJobSetup = maJobSetup;
ImplJobSetup* pSetupData = aJobSetup.ImplGetData();