diff options
author | Kai Ahrens <ka@openoffice.org> | 2002-07-26 07:32:44 +0000 |
---|---|---|
committer | Kai Ahrens <ka@openoffice.org> | 2002-07-26 07:32:44 +0000 |
commit | 98978996f61ea759d897cc23c91f9795046d34cd (patch) | |
tree | 843ae451232178fd5549656f20b856bec7a831cf /sd/source/ui | |
parent | e461ad2ba52a9081e442632a91fa14891d09621d (diff) |
#101752#: prepare formatting by screen
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/app/sdmod.cxx | 32 | ||||
-rw-r--r-- | sd/source/ui/docshell/docshel4.cxx | 63 | ||||
-rw-r--r-- | sd/source/ui/func/fuexpand.cxx | 7 | ||||
-rw-r--r-- | sd/source/ui/func/fuinsfil.cxx | 10 | ||||
-rw-r--r-- | sd/source/ui/func/fusumry.cxx | 6 | ||||
-rw-r--r-- | sd/source/ui/view/outlview.cxx | 10 |
6 files changed, 73 insertions, 55 deletions
diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx index 776c9f2f0cab..bd5514cc9722 100644 --- a/sd/source/ui/app/sdmod.cxx +++ b/sd/source/ui/app/sdmod.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdmod.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: ka $ $Date: 2001-08-23 10:43:51 $ + * last change: $Author: ka $ $Date: 2002-07-26 08:32:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -68,6 +68,9 @@ #ifndef _URLOBJ_HXX #include <tools/urlobj.hxx> #endif +#ifndef _SV_VIRDEV_HXX +#include <vcl/virdev.hxx> +#endif #ifndef _SFXAPP_HXX //autogen #include <sfx2/app.hxx> #endif @@ -83,6 +86,9 @@ #ifndef _SFXOBJFACE_HXX //autogen #include <sfx2/objface.hxx> #endif +#ifndef _SFX_PRINTER_HXX +#include <sfx2/printer.hxx> +#endif #ifndef _SVX_PSZCTRL_HXX //autogen #include <svx/pszctrl.hxx> #endif @@ -167,6 +173,9 @@ SdModule::SdModule(SvFactory* pDrawObjFact, SvFactory* pGraphicObjFact) ERRCODE_AREA_SD, ERRCODE_AREA_SD_END, GetResMgr() ); + + mpRefDevice = new VirtualDevice; + mpRefDevice->SetMapMode( MAP_100TH_MM ); } @@ -180,9 +189,12 @@ SdModule::SdModule(SvFactory* pDrawObjFact, SvFactory* pGraphicObjFact) SdModule::~SdModule() { delete pSearchItem; + if( pNumberFormatter ) delete pNumberFormatter; + delete mpErrorHdl; + delete static_cast< VirtualDevice* >( mpRefDevice ); } @@ -377,4 +389,20 @@ SvNumberFormatter* SdModule::GetNumberFormatter() return pNumberFormatter; } +/************************************************************************* +|* +\************************************************************************/ +OutputDevice* SdModule::GetRefDevice( SdDrawDocShell& rDocShell ) +{ + return( IsPrinterRefDevice() ? rDocShell.GetPrinter( sal_True ) : mpRefDevice ); +} + +/************************************************************************* +|* +\************************************************************************/ + +sal_Bool SdModule::IsPrinterRefDevice() const +{ + return sal_True; +} diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index 445e8ef23abf..84d9b4ac77f8 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -2,9 +2,9 @@ * * $RCSfile: docshel4.cxx,v $ * - * $Revision: 1.44 $ + * $Revision: 1.45 $ * - * last change: $Author: ka $ $Date: 2002-04-18 15:47:10 $ + * last change: $Author: ka $ $Date: 2002-07-26 08:32:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -210,22 +210,7 @@ SfxPrinter* SdDrawDocShell::GetPrinter(BOOL bCreate) MapMode aMM (pPrinter->GetMapMode()); aMM.SetMapUnit(MAP_100TH_MM); pPrinter->SetMapMode(aMM); - - // der Drawing Engine den neuen Printer als Referenz-Device setzen - if (pDoc) - { - pDoc->SetRefDevice(pPrinter); - - SdOutliner* pOutl = pDoc->GetOutliner(FALSE); - - if (pOutl) - pOutl->SetRefDevice(pPrinter); - - SdOutliner* pInternalOutl = pDoc->GetInternalOutliner(FALSE); - - if (pInternalOutl) - pInternalOutl->SetRefDevice(pPrinter); - } + UpdateRefDevice(); } return pPrinter; } @@ -257,25 +242,9 @@ void SdDrawDocShell::SetPrinter(SfxPrinter *pNewPrinter) pFontList = new FontList( GetPrinter(TRUE), Application::GetDefaultDevice(), FALSE ); SvxFontListItem aFontListItem( pFontList ); PutItem( aFontListItem ); - - // der Drawing Engine den neuen Printer als Referenz-Device setzen - if (pDoc) - { - pDoc->SetRefDevice(pPrinter); - - SdOutliner* pOutl = pDoc->GetOutliner(FALSE); - - if (pOutl) - pOutl->SetRefDevice(pPrinter); - - SdOutliner* pInternalOutl = pDoc->GetInternalOutliner(FALSE); - - if (pInternalOutl) - pInternalOutl->SetRefDevice(pPrinter); - } + UpdateRefDevice(); } - /************************************************************************* |* |* @@ -303,6 +272,30 @@ void SdDrawDocShell::OnDocumentPrinterChanged(Printer* pNewPrinter) } } +/************************************************************************* +|* +|* +|* +\************************************************************************/ +void SdDrawDocShell::UpdateRefDevice() +{ + if( pDoc ) + { + OutputDevice* pRefDevice = SD_MOD()->IsPrinterRefDevice() ? pPrinter : SD_MOD()->GetRefDevice( *this ); + + pDoc->SetRefDevice( pRefDevice ); + + SdOutliner* pOutl = pDoc->GetOutliner( FALSE ); + + if( pOutl ) + pOutl->SetRefDevice( pRefDevice ); + + SdOutliner* pInternalOutl = pDoc->GetInternalOutliner( FALSE ); + + if( pInternalOutl ) + pInternalOutl->SetRefDevice( pRefDevice ); + } +} /************************************************************************* |* diff --git a/sd/source/ui/func/fuexpand.cxx b/sd/source/ui/func/fuexpand.cxx index 67d5a4f9dc6c..f146496e39f8 100644 --- a/sd/source/ui/func/fuexpand.cxx +++ b/sd/source/ui/func/fuexpand.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fuexpand.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: cl $ $Date: 2002-05-07 14:04:19 $ + * last change: $Author: ka $ $Date: 2002-07-26 08:32:42 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -94,6 +94,7 @@ #include "docshell.hxx" #include "sdresid.hxx" #include "optsitem.hxx" +#include "sdmod.hxx" #ifndef _SFXDISPATCH_HXX //autogen #include <sfx2/dispatch.hxx> @@ -136,7 +137,7 @@ FuExpandPage::FuExpandPage(SdViewShell* pViewSh, SdWindow* pWin, SdView* pView, pOutl->EnableUndo(FALSE); if (pDocSh) - pOutl->SetRefDevice(pDocSh->GetPrinter(TRUE)); + pOutl->SetRefDevice( SD_MOD()->GetRefDevice( *pDocSh ) ); pOutl->SetDefTab( pDoc->GetDefaultTabulator() ); pOutl->SetStyleSheetPool((SfxStyleSheetPool*) pDoc->GetStyleSheetPool()); diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx index 06eb0adbb86f..5efddfedd71a 100644 --- a/sd/source/ui/func/fuinsfil.cxx +++ b/sd/source/ui/func/fuinsfil.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fuinsfil.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.23 $ * - * last change: $Author: ka $ $Date: 2002-04-09 08:05:15 $ + * last change: $Author: ka $ $Date: 2002-07-26 08:32:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -594,8 +594,7 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium) pOutliner->SetForbiddenCharsTable( pDoc->GetForbiddenCharsTable() ); // Referenz-Device setzen - SfxPrinter* pPrinter = pDocSh->GetPrinter(TRUE); - pOutliner->SetRefDevice(pPrinter); + pOutliner->SetRefDevice( SD_MOD()->GetRefDevice( *pDocSh ) ); SdPage* pPage = ((SdDrawViewShell*)pViewShell)->GetActualPage(); aLayoutName = pPage->GetLayoutName(); @@ -742,8 +741,7 @@ void FuInsertFile::InsTextOrRTFinOlMode(SfxMedium* pMedium) pOutliner->SetStyleSheetPool((SfxStyleSheetPool*)pDoc->GetStyleSheetPool()); // Referenz-Device setzen - SfxPrinter* pPrinter = pDocSh->GetPrinter(TRUE); - pOutliner->SetRefDevice(pPrinter); + pOutliner->SetRefDevice(SD_MOD()->GetRefDevice( *pDocSh )); pOutliner->SetPaperSize(Size(0x7fffffff, 0x7fffffff)); SvStream* pStream = pMedium->GetInStream(); diff --git a/sd/source/ui/func/fusumry.cxx b/sd/source/ui/func/fusumry.cxx index cf050b6d89ca..a786b8162c9b 100644 --- a/sd/source/ui/func/fusumry.cxx +++ b/sd/source/ui/func/fusumry.cxx @@ -2,9 +2,9 @@ * * $RCSfile: fusumry.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: aw $ $Date: 2000-10-30 11:46:17 $ + * last change: $Author: ka $ $Date: 2002-07-26 08:32:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -198,7 +198,7 @@ FuSummaryPage::FuSummaryPage(SdViewShell* pViewSh, SdWindow* pWin, SdView* pView pOutl->EnableUndo(FALSE); if (pDocSh) - pOutl->SetRefDevice(pDocSh->GetPrinter(TRUE)); + pOutl->SetRefDevice(SD_MOD()->GetRefDevice( *pDocSh )); pOutl->SetDefTab( pDoc->GetDefaultTabulator() ); pOutl->SetStyleSheetPool((SfxStyleSheetPool*) pDoc->GetStyleSheetPool()); diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index 7f2b288f1955..c8d82f29f5cf 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -2,9 +2,9 @@ * * $RCSfile: outlview.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: aw $ $Date: 2002-04-26 12:17:10 $ + * last change: $Author: ka $ $Date: 2002-07-26 08:32:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -237,8 +237,7 @@ SdOutlineView::SdOutlineView(SdDrawDocShell* pDocSh, Window* pWindow, pOutliner->OverwriteLevel0Bullet( aFormat ); } - SfxPrinter* pPrinter = pDocSh->GetPrinter(TRUE); - pOutliner->SetRefDevice(pPrinter); + pOutliner->SetRefDevice( SD_MOD()->GetRefDevice( *pDocSh ) ); ULONG nWidth = OUTLINE_PAPERWIDTH; pOutliner->SetPaperSize(Size(nWidth, 4000000000)); } @@ -1109,8 +1108,7 @@ BOOL SdOutlineView::PrepareClose(BOOL bUI) pTempLiner->SetForbiddenCharsTable( pDoc->GetForbiddenCharsTable() ); // Referenz-Device setzen - SfxPrinter* pPrinter = pDocSh->GetPrinter(TRUE); - pTempLiner->SetRefDevice(pPrinter); + pTempLiner->SetRefDevice( SD_MOD()->GetRefDevice( *pDocSh ) ); SfxStyleSheetBasePool* pSPool = pDoc->GetStyleSheetPool(); pTempLiner->SetMinDepth(0); |