summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/print3.cxx
diff options
context:
space:
mode:
authorPhilipp Lohmann <pl@openoffice.org>2009-09-12 11:22:22 +0000
committerPhilipp Lohmann <pl@openoffice.org>2009-09-12 11:22:22 +0000
commit3aeb0fc95cf16c28c75095cfe5e720afb786e781 (patch)
tree7b1f460b815f5bff55b09e1885b9991cc0d12940 /vcl/source/gdi/print3.cxx
parent25f26445ab686fbbb064e620ebee39950a7fdc43 (diff)
solve problems with transparency and N-Up
Diffstat (limited to 'vcl/source/gdi/print3.cxx')
-rw-r--r--vcl/source/gdi/print3.cxx50
1 files changed, 28 insertions, 22 deletions
diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx
index c08abea15c7f..23b2f04272a4 100644
--- a/vcl/source/gdi/print3.cxx
+++ b/vcl/source/gdi/print3.cxx
@@ -874,24 +874,8 @@ int PrinterController::getFilteredPageCount()
return (getPageCountProtected() * mpImplData->maMultiPage.nRepeat + (nDiv-1)) / nDiv;
}
-void PrinterController::printFilteredPage( int i_nPage )
+ULONG PrinterController::removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut )
{
- if( mpImplData->meJobState != view::PrintableState_JOB_STARTED )
- return;
-
- GDIMetaFile aPageFile;
- PrinterController::PageSize aPageSize = getFilteredPageFile( i_nPage, aPageFile );
-
- if( mpImplData->mpProgress )
- {
- // do nothing if printing is canceled
- if( mpImplData->mpProgress->isCanceled() )
- {
- setJobState( view::PrintableState_JOB_ABORTED );
- return;
- }
- }
-
ULONG nRestoreDrawMode = mpImplData->mpPrinter->GetDrawMode();
sal_Int32 nMaxBmpDPIX = mpImplData->mpPrinter->ImplGetDPIX();
sal_Int32 nMaxBmpDPIY = mpImplData->mpPrinter->ImplGetDPIY();
@@ -936,14 +920,31 @@ void PrinterController::printFilteredPage( int i_nPage )
mpImplData->mpPrinter->SetDrawMode( mpImplData->mpPrinter->GetDrawMode() | DRAWMODE_NOTRANSPARENCY );
}
- GDIMetaFile aCleanedFile;
- mpImplData->mpPrinter->RemoveTransparenciesFromMetaFile( aPageFile, aCleanedFile, nMaxBmpDPIX, nMaxBmpDPIY,
+ mpImplData->mpPrinter->RemoveTransparenciesFromMetaFile( i_rIn, o_rOut, nMaxBmpDPIX, nMaxBmpDPIY,
rPrinterOptions.IsReduceTransparency(),
rPrinterOptions.GetReducedTransparencyMode() == PRINTER_TRANSPARENCY_AUTO,
rPrinterOptions.IsReduceBitmaps() && rPrinterOptions.IsReducedBitmapIncludesTransparency()
);
+ return nRestoreDrawMode;
+}
- mpImplData->mpPrinter->EnableOutput( TRUE );
+void PrinterController::printFilteredPage( int i_nPage )
+{
+ if( mpImplData->meJobState != view::PrintableState_JOB_STARTED )
+ return;
+
+ GDIMetaFile aPageFile;
+ PrinterController::PageSize aPageSize = getFilteredPageFile( i_nPage, aPageFile );
+
+ if( mpImplData->mpProgress )
+ {
+ // do nothing if printing is canceled
+ if( mpImplData->mpProgress->isCanceled() )
+ {
+ setJobState( view::PrintableState_JOB_ABORTED );
+ return;
+ }
+ }
// in N-Up printing set the correct page size
mpImplData->mpPrinter->SetMapMode( MAP_100TH_MM );
@@ -953,10 +954,15 @@ void PrinterController::printFilteredPage( int i_nPage )
if( aPageSize.bFullPaper )
{
Point aPageOffset( mpImplData->mpPrinter->GetPageOffset() );
- aCleanedFile.WindStart();
- aCleanedFile.Move( -aPageOffset.X(), -aPageOffset.Y() );
+ aPageFile.WindStart();
+ aPageFile.Move( -aPageOffset.X(), -aPageOffset.Y() );
}
+ GDIMetaFile aCleanedFile;
+ ULONG nRestoreDrawMode = removeTransparencies( aPageFile, aCleanedFile );
+
+ mpImplData->mpPrinter->EnableOutput( TRUE );
+
// actually print the page
mpImplData->mpPrinter->ImplStartPage();