diff options
author | Oliver Bolte <obo@openoffice.org> | 2006-01-16 14:19:12 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2006-01-16 14:19:12 +0000 |
commit | cb1c9f5c4ca1bce90b25ab7e145fbe2ef221d5fd (patch) | |
tree | edc84468df4b69fa7979ead52bc4713cc985d00d /sd/source/ui/dlg/docprev.cxx | |
parent | 4babccd3b4abf2baeb4c270fb88b8df102c5b48e (diff) |
INTEGRATION: CWS impress81 (1.16.90); FILE MERGED
2005/12/29 15:11:51 cl 1.16.90.1: #128887# check for existing page
Diffstat (limited to 'sd/source/ui/dlg/docprev.cxx')
-rw-r--r-- | sd/source/ui/dlg/docprev.cxx | 89 |
1 files changed, 46 insertions, 43 deletions
diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx index f683ef915fa3..583a1fc83106 100644 --- a/sd/source/ui/dlg/docprev.cxx +++ b/sd/source/ui/dlg/docprev.cxx @@ -4,9 +4,9 @@ * * $RCSfile: docprev.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: rt $ $Date: 2005-09-09 04:00:19 $ + * last change: $Author: obo $ $Date: 2006-01-16 15:19:12 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -288,66 +288,69 @@ void SdDocPreviewWin::updateViewSettings() if(pDoc) { - SdrOutliner& rOutl = pDoc->GetDrawOutliner(); - Color aOldBackgroundColor = rOutl.GetBackgroundColor(); - rOutl.SetBackgroundColor( maDocumentColor ); - - pMtf = new GDIMetaFile; SdPage * pPage = pDoc->GetSdPage( mnShowPage, PK_STANDARD ); + if( pPage ) + { + SdrOutliner& rOutl = pDoc->GetDrawOutliner(); + Color aOldBackgroundColor = rOutl.GetBackgroundColor(); + rOutl.SetBackgroundColor( maDocumentColor ); - VirtualDevice aVDev; + pMtf = new GDIMetaFile; - const Fraction aFrac( pDoc->GetScaleFraction() ); - const MapMode aMap( pDoc->GetScaleUnit(), Point(), aFrac, aFrac ); + VirtualDevice aVDev; - aVDev.SetMapMode( aMap ); + const Fraction aFrac( pDoc->GetScaleFraction() ); + const MapMode aMap( pDoc->GetScaleUnit(), Point(), aFrac, aFrac ); - // #109058# Disable output, as we only want to record a metafile - aVDev.EnableOutput( FALSE ); + aVDev.SetMapMode( aMap ); - pMtf->Record( &aVDev ); + // #109058# Disable output, as we only want to record a metafile + aVDev.EnableOutput( FALSE ); - ::sd::DrawView* pView = new ::sd::DrawView(pDocShell, this, NULL); + pMtf->Record( &aVDev ); + ::sd::DrawView* pView = new ::sd::DrawView(pDocShell, this, NULL); - const Size aSize( pPage->GetSize() ); - pView->SetBordVisible( FALSE ); - pView->SetPageVisible( FALSE ); - pView->ShowPage( pPage, Point() ); + const Size aSize( pPage->GetSize() ); - const Point aNewOrg( pPage->GetLftBorder(), pPage->GetUppBorder() ); - const Size aNewSize( aSize.Width() - pPage->GetLftBorder() - pPage->GetRgtBorder(), - aSize.Height() - pPage->GetUppBorder() - pPage->GetLwrBorder() ); - const Rectangle aClipRect( aNewOrg, aNewSize ); - MapMode aVMap( aMap ); + pView->SetBordVisible( FALSE ); + pView->SetPageVisible( FALSE ); + pView->ShowPage( pPage, Point() ); - SdrPageView* pPageView = pView->GetPageView( pPage ); + const Point aNewOrg( pPage->GetLftBorder(), pPage->GetUppBorder() ); + const Size aNewSize( aSize.Width() - pPage->GetLftBorder() - pPage->GetRgtBorder(), + aSize.Height() - pPage->GetUppBorder() - pPage->GetLwrBorder() ); + const Rectangle aClipRect( aNewOrg, aNewSize ); + MapMode aVMap( aMap ); - aVDev.Push(); - aVMap.SetOrigin( Point( -aNewOrg.X(), -aNewOrg.Y() ) ); - aVDev.SetRelativeMapMode( aVMap ); - aVDev.IntersectClipRegion( aClipRect ); + SdrPageView* pPageView = pView->GetPageView( pPage ); - // Use new StandardCheckVisisbilityRedirector - StandardCheckVisisbilityRedirector aRedirector; + aVDev.Push(); + aVMap.SetOrigin( Point( -aNewOrg.X(), -aNewOrg.Y() ) ); + aVDev.SetRelativeMapMode( aVMap ); + aVDev.IntersectClipRegion( aClipRect ); - for (USHORT i=0; i<pView->GetPageViewCount(); i++) - { - SdrPageView* pPV=pView->GetPageViewPvNum(i); - pPV->CompleteRedraw(&aVDev, Region(Rectangle(Point(), aNewSize)), 0, &aRedirector); - } + // Use new StandardCheckVisisbilityRedirector + StandardCheckVisisbilityRedirector aRedirector; - aVDev.Pop(); + for (USHORT i=0; i<pView->GetPageViewCount(); i++) + { + SdrPageView* pPV=pView->GetPageViewPvNum(i); + pPV->CompleteRedraw(&aVDev, Region(Rectangle(Point(), aNewSize)), 0, &aRedirector); + } - pMtf->Stop(); - pMtf->WindStart(); - pMtf->SetPrefMapMode( aMap ); - pMtf->SetPrefSize( aNewSize ); + aVDev.Pop(); - rOutl.SetBackgroundColor( aOldBackgroundColor ); + pMtf->Stop(); + pMtf->WindStart(); + pMtf->SetPrefMapMode( aMap ); + pMtf->SetPrefSize( aNewSize ); - delete pView; + rOutl.SetBackgroundColor( aOldBackgroundColor ); + + delete pView; + } } delete pMetaFile; |