print.cxx (9f62ea84) print.cxx (d7e5dbc3)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 1210 unchanged lines hidden (view full) ---

1219 return SetPaperSizeUser( rSize, false );
1220}
1221
1222sal_Bool Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
1223{
1224 if ( mbInPrintPage )
1225 return sal_False;
1226
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 1210 unchanged lines hidden (view full) ---

1219 return SetPaperSizeUser( rSize, false );
1220}
1221
1222sal_Bool Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest )
1223{
1224 if ( mbInPrintPage )
1225 return sal_False;
1226
1227 Size aPixSize = LogicToPixel( rSize );
1228 Size aPageSize = PixelToLogic( aPixSize, MAP_100TH_MM );
1229 if ( (maJobSetup.ImplGetConstData()->mePaperFormat != PAPER_USER) ||
1230 (maJobSetup.ImplGetConstData()->mnPaperWidth != aPageSize.Width()) ||
1231 (maJobSetup.ImplGetConstData()->mnPaperHeight != aPageSize.Height()) )
1227 const Size aPixSize = LogicToPixel( rSize );
1228 const Size aPageSize = PixelToLogic( aPixSize, MAP_100TH_MM );
1229 bool bNeedToChange(maJobSetup.ImplGetConstData()->mnPaperWidth != aPageSize.Width() ||
1230 maJobSetup.ImplGetConstData()->mnPaperHeight != aPageSize.Height());
1231
1232 if(!bNeedToChange)
1233 {
1234 // #122984# only need to change when Paper is different from PAPER_USER and
1235 // the mapped Paper which will created below in the call to ImplFindPaperFormatForUserSize
1236 // and will replace maJobSetup.ImplGetConstData()->mePaperFormat. This leads to
1237 // unnecessary JobSetups, e.g. when printing a multi-page fax, but also with
1238 // normal print
1239 const Paper aPaper = ImplGetPaperFormat(aPageSize.Width(), aPageSize.Height());
1240
1241 bNeedToChange = maJobSetup.ImplGetConstData()->mePaperFormat != PAPER_USER &&
1242 maJobSetup.ImplGetConstData()->mePaperFormat != aPaper;
1243 }
1244
1245 if(bNeedToChange)
1232 {
1233 JobSetup aJobSetup = maJobSetup;
1234 ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
1235 pSetupData->mePaperFormat = PAPER_USER;
1236 pSetupData->mnPaperWidth = aPageSize.Width();
1237 pSetupData->mnPaperHeight = aPageSize.Height();
1238
1239 if ( IsDisplayPrinter() )

--- 385 unchanged lines hidden ---
1246 {
1247 JobSetup aJobSetup = maJobSetup;
1248 ImplJobSetup* pSetupData = aJobSetup.ImplGetData();
1249 pSetupData->mePaperFormat = PAPER_USER;
1250 pSetupData->mnPaperWidth = aPageSize.Width();
1251 pSetupData->mnPaperHeight = aPageSize.Height();
1252
1253 if ( IsDisplayPrinter() )

--- 385 unchanged lines hidden ---