merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0075-printing-bugfix-254573.diff
blobc4775d7aa9f3e6a3b769dbbe0929402e43f85a45
1 --- sd/source/ui/view/PrintManager.cxx.O 2007-05-18 18:46:10.000000000 +0200
2 +++ sd/source/ui/view/PrintManager.cxx 2007-05-18 18:54:58.000000000 +0200
3 @@ -755,12 +755,14 @@ bool PrintManager::FitPageToPrinterWithD
4 SdOptionsPrintItem* pPrintOpts = NULL;
5 BOOL bScalePage = TRUE;
6 BOOL bTilePage = FALSE;
7 + BOOL bNotesPage = FALSE;
8 BOOL bPrintBooklet = FALSE;
10 if( rOptions.GetItemState( ATTR_OPTIONS_PRINT, FALSE, (const SfxPoolItem**) &pPrintOpts ) == SFX_ITEM_SET )
12 bScalePage = pPrintOpts->GetOptionsPrint().IsPagesize();
13 bPrintBooklet = pPrintOpts->GetOptionsPrint().IsBooklet();
14 + bNotesPage = pPrintOpts->GetOptionsPrint().IsNotes();
15 pPrintOpts->GetOptionsPrint().SetCutPage( FALSE );
17 else
18 @@ -771,18 +773,30 @@ bool PrintManager::FitPageToPrinterWithD
19 Size aPrintSize( pPrinter->GetOutputSize() );
20 long nPageWidth = aPageSize.Width() - pPage->GetLftBorder() - pPage->GetRgtBorder();
21 long nPageHeight = aPageSize.Height() - pPage->GetUppBorder() - pPage->GetLwrBorder();
22 + long nNotesPageWidth, nNotesPageHeight;
23 long nPrintWidth = aPrintSize.Width();
24 long nPrintHeight = aPrintSize.Height();
25 USHORT nRet = RET_OK;
27 + if( bNotesPage ) {
28 + SdPage* pNotesPage = mrBase.GetDocument()->GetSdPage( 0, PK_NOTES );
29 + Size aNotesPageSize = Size( pNotesPage->GetSize () );
30 + nNotesPageWidth = aNotesPageSize.Width() - pNotesPage->GetLftBorder() - pNotesPage->GetRgtBorder();
31 + nNotesPageHeight = aNotesPageSize.Height() - pNotesPage->GetUppBorder() - pNotesPage->GetLwrBorder();
32 + }
34 // When necessary then show a dialog that asks the user how to fit
35 // the pages to be printed to the (smaller) printer pages.
36 if ( !bScalePage
37 && !bTilePage
38 && !bPrintBooklet
39 - && ( ( nPageWidth > nPrintWidth || nPageHeight > nPrintHeight )
40 + && ( ( ( nPageWidth > nPrintWidth || nPageHeight > nPrintHeight )
41 && ( nPageWidth > nPrintHeight || nPageHeight > nPrintWidth )
42 - )
43 + ) ||
44 + ( bNotesPage
45 + && ( nNotesPageWidth > nPrintWidth || nNotesPageHeight > nPrintHeight )
46 + && ( nNotesPageWidth > nPrintHeight || nNotesPageHeight > nPrintWidth ) )
47 + )
50 if (IsScreenFormat())