xref: /AOO41X/main/sd/source/ui/view/drviews5.cxx (revision 4d7c9de063a797b8b4f3d45e3561e82ad1f8ef1f)
15b190011SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
35b190011SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
45b190011SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
55b190011SAndrew Rist  * distributed with this work for additional information
65b190011SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
75b190011SAndrew Rist  * to you under the Apache License, Version 2.0 (the
85b190011SAndrew Rist  * "License"); you may not use this file except in compliance
95b190011SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
115b190011SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
135b190011SAndrew Rist  * Unless required by applicable law or agreed to in writing,
145b190011SAndrew Rist  * software distributed under the License is distributed on an
155b190011SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
165b190011SAndrew Rist  * KIND, either express or implied.  See the License for the
175b190011SAndrew Rist  * specific language governing permissions and limitations
185b190011SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
205b190011SAndrew Rist  *************************************************************/
215b190011SAndrew Rist 
225b190011SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sd.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "DrawViewShell.hxx"
28cdf0e10cSrcweir #include "PresentationViewShell.hxx"
29cdf0e10cSrcweir #include <editeng/outliner.hxx>
30cdf0e10cSrcweir #ifndef _SVXIDS_HXX
31cdf0e10cSrcweir #include <svx/svxids.hrc>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #include <sfx2/request.hxx>
34cdf0e10cSrcweir #include <sfx2/dispatch.hxx>
35cdf0e10cSrcweir #include <svx/svdpagv.hxx>
36cdf0e10cSrcweir #include <vcl/scrbar.hxx>
37cdf0e10cSrcweir #include <tools/poly.hxx>
38cdf0e10cSrcweir #include <svx/fmshell.hxx>
39cdf0e10cSrcweir #include <editeng/eeitem.hxx>
40cdf0e10cSrcweir #include <svtools/colorcfg.hxx>
41cdf0e10cSrcweir #include "AccessibleDrawDocumentView.hxx"
42cdf0e10cSrcweir 
43cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
44cdf0e10cSrcweir #include "LayerTabBar.hxx"
45cdf0e10cSrcweir 
46cdf0e10cSrcweir #include "strings.hrc"
47cdf0e10cSrcweir #include "res_bmp.hrc"
48cdf0e10cSrcweir #include "glob.hrc"
49cdf0e10cSrcweir #include "app.hrc"
50cdf0e10cSrcweir #include "helpids.h"
51cdf0e10cSrcweir #include "optsitem.hxx"
52cdf0e10cSrcweir #include "app.hxx"
53cdf0e10cSrcweir #include "FrameView.hxx"
54cdf0e10cSrcweir #include "sdattr.hxx"
55cdf0e10cSrcweir #include "futext.hxx"
56cdf0e10cSrcweir #include "sdpage.hxx"
57cdf0e10cSrcweir #include "stlpool.hxx"
58cdf0e10cSrcweir #include "prntopts.hxx"
59cdf0e10cSrcweir #include "sdresid.hxx"
60cdf0e10cSrcweir #include "Window.hxx"
61cdf0e10cSrcweir #include "drawview.hxx"
62cdf0e10cSrcweir #include "drawdoc.hxx"
63cdf0e10cSrcweir #include "DrawDocShell.hxx"
64cdf0e10cSrcweir #include "Outliner.hxx"
65cdf0e10cSrcweir #include "Client.hxx"
66cdf0e10cSrcweir #include "slideshow.hxx"
67cdf0e10cSrcweir #include "unokywds.hxx"
68cdf0e10cSrcweir #include "SdUnoDrawView.hxx"
69cdf0e10cSrcweir #include "ViewShellBase.hxx"
70cdf0e10cSrcweir #include "FormShellManager.hxx"
71cdf0e10cSrcweir #include "LayerDialogContent.hxx"
72cdf0e10cSrcweir #include "DrawController.hxx"
73cdf0e10cSrcweir 
74cdf0e10cSrcweir namespace sd {
75cdf0e10cSrcweir 
76cdf0e10cSrcweir static const int TABCONTROL_INITIAL_SIZE = 350;
77cdf0e10cSrcweir static const int PAPER_SHADOW_EXT_PIXEL = 2;
78cdf0e10cSrcweir 
79cdf0e10cSrcweir 
80cdf0e10cSrcweir /*************************************************************************
81cdf0e10cSrcweir |*
82cdf0e10cSrcweir |* Wird gerufen, wenn sich das Model aendert
83cdf0e10cSrcweir |*
84cdf0e10cSrcweir \************************************************************************/
85cdf0e10cSrcweir 
ModelHasChanged()86cdf0e10cSrcweir void DrawViewShell::ModelHasChanged()
87cdf0e10cSrcweir {
88cdf0e10cSrcweir 	Invalidate();
89cdf0e10cSrcweir 	// Damit der Navigator auch einen aktuellen Status bekommt
90cdf0e10cSrcweir 	GetViewFrame()->GetBindings().Invalidate( SID_NAVIGATOR_STATE, sal_True, sal_False );
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 	//Update3DWindow();
93cdf0e10cSrcweir 	SfxBoolItem aItem( SID_3D_STATE, sal_True );
94cdf0e10cSrcweir 	GetViewFrame()->GetDispatcher()->Execute(
95cdf0e10cSrcweir 		SID_3D_STATE, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L );
96cdf0e10cSrcweir 
97cdf0e10cSrcweir 	// jetzt den von der Drawing Engine neu erzeugten TextEditOutliner
98cdf0e10cSrcweir 	// initialisieren
99cdf0e10cSrcweir 	::Outliner* pOutliner 	  = mpDrawView->GetTextEditOutliner();
100cdf0e10cSrcweir 	if (pOutliner)
101cdf0e10cSrcweir 	{
102cdf0e10cSrcweir 		SfxStyleSheetPool* pSPool = (SfxStyleSheetPool*) GetDocSh()->GetStyleSheetPool();
103cdf0e10cSrcweir 		pOutliner->SetStyleSheetPool(pSPool);
104cdf0e10cSrcweir 	}
105cdf0e10cSrcweir }
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 
Resize(void)110cdf0e10cSrcweir void DrawViewShell::Resize (void)
111cdf0e10cSrcweir {
112cdf0e10cSrcweir 	ViewShell::Resize();
113cdf0e10cSrcweir 
114cdf0e10cSrcweir 	if ( GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
115cdf0e10cSrcweir 	{
116cdf0e10cSrcweir 		SetZoomRect( GetDocSh()->GetVisArea(ASPECT_CONTENT) );
117cdf0e10cSrcweir 	}
118cdf0e10cSrcweir 
119cdf0e10cSrcweir     rtl::Reference< sd::SlideShow > xSlideshow( SlideShow::GetSlideShow( GetViewShellBase() ) );
120cdf0e10cSrcweir     if( xSlideshow.is() && xSlideshow->isRunning() && !xSlideshow->isFullScreen() )
121cdf0e10cSrcweir     {
122cdf0e10cSrcweir 		xSlideshow->resize(maViewSize);
123cdf0e10cSrcweir     }
124cdf0e10cSrcweir }
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 
127cdf0e10cSrcweir 
128cdf0e10cSrcweir 
ArrangeGUIElements(void)129cdf0e10cSrcweir void DrawViewShell::ArrangeGUIElements (void)
130cdf0e10cSrcweir {
131cdf0e10cSrcweir     // Retrieve the current size (thickness) of the scroll bars.  That is
132cdf0e10cSrcweir     // the width of the vertical and the height of the horizontal scroll
133cdf0e10cSrcweir     // bar.
134cdf0e10cSrcweir     int nScrollBarSize =
135cdf0e10cSrcweir         GetParentWindow()->GetSettings().GetStyleSettings().GetScrollBarSize();
136cdf0e10cSrcweir 	maScrBarWH = Size (nScrollBarSize, nScrollBarSize);
137cdf0e10cSrcweir 
138cdf0e10cSrcweir     Point aHPos = maViewPos;
139cdf0e10cSrcweir     aHPos.Y() += maViewSize.Height();
140cdf0e10cSrcweir 
141cdf0e10cSrcweir 
142cdf0e10cSrcweir     ViewShell::ArrangeGUIElements ();
143cdf0e10cSrcweir 
144cdf0e10cSrcweir     maTabControl.Hide();
145cdf0e10cSrcweir 
146cdf0e10cSrcweir     OSL_ASSERT (GetViewShell()!=NULL);
147cdf0e10cSrcweir     Client* pIPClient = static_cast<Client*>(GetViewShell()->GetIPClient());
148cdf0e10cSrcweir     sal_Bool bClientActive = sal_False;
149cdf0e10cSrcweir     if ( pIPClient && pIPClient->IsObjectInPlaceActive() )
150cdf0e10cSrcweir         bClientActive = sal_True;
151cdf0e10cSrcweir 
152cdf0e10cSrcweir     sal_Bool bInPlaceActive = GetViewFrame()->GetFrame().IsInPlace();
153cdf0e10cSrcweir 
154cdf0e10cSrcweir     if ( mbZoomOnPage && !bInPlaceActive && !bClientActive )
155cdf0e10cSrcweir     {
156cdf0e10cSrcweir         // bei Split immer erstes Fenster resizen
157cdf0e10cSrcweir         //af pWindow = mpContentWindow.get();
158cdf0e10cSrcweir         SfxRequest aReq(SID_SIZE_PAGE, 0, GetDoc()->GetItemPool());
159cdf0e10cSrcweir         ExecuteSlot( aReq );
160cdf0e10cSrcweir     }
161cdf0e10cSrcweir }
162cdf0e10cSrcweir 
163cdf0e10cSrcweir /*************************************************************************
164cdf0e10cSrcweir |*
165cdf0e10cSrcweir |* Daten der FrameView auf die aktuelle View uebertragen
166cdf0e10cSrcweir |*
167cdf0e10cSrcweir \************************************************************************/
168cdf0e10cSrcweir 
ReadFrameViewData(FrameView * pView)169cdf0e10cSrcweir void DrawViewShell::ReadFrameViewData(FrameView* pView)
170cdf0e10cSrcweir {
171cdf0e10cSrcweir 	ModifyGuard aGuard( GetDoc() );
172cdf0e10cSrcweir 
173cdf0e10cSrcweir 	// Diese Option wird am Model eingestellt
174cdf0e10cSrcweir 	GetDoc()->SetPickThroughTransparentTextFrames(
175cdf0e10cSrcweir 			 SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType())->IsPickThrough());
176cdf0e10cSrcweir 
177cdf0e10cSrcweir 	// Initialisierungen der Zeichen-(Bildschirm-)Attribute
178cdf0e10cSrcweir 	if (HasRuler() != pView->HasRuler())
179cdf0e10cSrcweir 		SetRuler( pView->HasRuler() );
180cdf0e10cSrcweir 
181cdf0e10cSrcweir 	if (mpDrawView->GetGridCoarse() != pView->GetGridCoarse())
182cdf0e10cSrcweir 		mpDrawView->SetGridCoarse( pView->GetGridCoarse() );
183cdf0e10cSrcweir 
184cdf0e10cSrcweir 	if (mpDrawView->GetGridFine() != pView->GetGridFine())
185cdf0e10cSrcweir 		mpDrawView->SetGridFine( pView->GetGridFine() );
186cdf0e10cSrcweir 
187cdf0e10cSrcweir 	if (mpDrawView->GetSnapGridWidthX() != pView->GetSnapGridWidthX() || mpDrawView->GetSnapGridWidthY() != pView->GetSnapGridWidthY())
188cdf0e10cSrcweir 		mpDrawView->SetSnapGridWidth(pView->GetSnapGridWidthX(), pView->GetSnapGridWidthY());
189cdf0e10cSrcweir 
190cdf0e10cSrcweir 	if (mpDrawView->IsGridVisible() != pView->IsGridVisible())
191cdf0e10cSrcweir 		mpDrawView->SetGridVisible( pView->IsGridVisible() );
192cdf0e10cSrcweir 
193cdf0e10cSrcweir 	if (mpDrawView->IsGridFront() != pView->IsGridFront())
194cdf0e10cSrcweir 		mpDrawView->SetGridFront( pView->IsGridFront() );
195cdf0e10cSrcweir 
196cdf0e10cSrcweir 	if (mpDrawView->GetSnapAngle() != pView->GetSnapAngle())
197cdf0e10cSrcweir 		mpDrawView->SetSnapAngle( pView->GetSnapAngle() );
198cdf0e10cSrcweir 
199cdf0e10cSrcweir 	if (mpDrawView->IsGridSnap() !=  pView->IsGridSnap() )
200cdf0e10cSrcweir 		mpDrawView->SetGridSnap( pView->IsGridSnap() );
201cdf0e10cSrcweir 
202cdf0e10cSrcweir 	if (mpDrawView->IsBordSnap() !=  pView->IsBordSnap() )
203cdf0e10cSrcweir 		mpDrawView->SetBordSnap( pView->IsBordSnap() );
204cdf0e10cSrcweir 
205cdf0e10cSrcweir 	if (mpDrawView->IsHlplSnap() !=  pView->IsHlplSnap() )
206cdf0e10cSrcweir 		mpDrawView->SetHlplSnap( pView->IsHlplSnap() );
207cdf0e10cSrcweir 
208cdf0e10cSrcweir 	if (mpDrawView->IsOFrmSnap() !=  pView->IsOFrmSnap() )
209cdf0e10cSrcweir 		mpDrawView->SetOFrmSnap( pView->IsOFrmSnap() );
210cdf0e10cSrcweir 
211cdf0e10cSrcweir 	if (mpDrawView->IsOPntSnap() !=  pView->IsOPntSnap() )
212cdf0e10cSrcweir 		mpDrawView->SetOPntSnap( pView->IsOPntSnap() );
213cdf0e10cSrcweir 
214cdf0e10cSrcweir 	if (mpDrawView->IsOConSnap() !=  pView->IsOConSnap() )
215cdf0e10cSrcweir 		mpDrawView->SetOConSnap( pView->IsOConSnap() );
216cdf0e10cSrcweir 
217cdf0e10cSrcweir 	if (mpDrawView->IsHlplVisible() != pView->IsHlplVisible() )
218cdf0e10cSrcweir 		mpDrawView->SetHlplVisible( pView->IsHlplVisible() );
219cdf0e10cSrcweir 
220cdf0e10cSrcweir 	if (mpDrawView->IsDragStripes() != pView->IsDragStripes() )
221cdf0e10cSrcweir 		mpDrawView->SetDragStripes( pView->IsDragStripes() );
222cdf0e10cSrcweir 
223cdf0e10cSrcweir 	if (mpDrawView->IsPlusHandlesAlwaysVisible() != pView->IsPlusHandlesAlwaysVisible() )
224cdf0e10cSrcweir 		mpDrawView->SetPlusHandlesAlwaysVisible( pView->IsPlusHandlesAlwaysVisible() );
225cdf0e10cSrcweir 
226cdf0e10cSrcweir 	if (mpDrawView->GetSnapMagneticPixel() != pView->GetSnapMagneticPixel() )
227cdf0e10cSrcweir 		mpDrawView->SetSnapMagneticPixel( pView->GetSnapMagneticPixel() );
228cdf0e10cSrcweir 
229cdf0e10cSrcweir 	if (mpDrawView->IsMarkedHitMovesAlways() != pView->IsMarkedHitMovesAlways() )
230cdf0e10cSrcweir 		mpDrawView->SetMarkedHitMovesAlways( pView->IsMarkedHitMovesAlways() );
231cdf0e10cSrcweir 
232cdf0e10cSrcweir 	if (mpDrawView->IsMoveOnlyDragging() != pView->IsMoveOnlyDragging() )
233cdf0e10cSrcweir 		mpDrawView->SetMoveOnlyDragging( pView->IsMoveOnlyDragging() );
234cdf0e10cSrcweir 
235cdf0e10cSrcweir //    mpDrawView->SetSlantButShear( pView->IsSlantButShear() );
236cdf0e10cSrcweir 
237cdf0e10cSrcweir 	if (mpDrawView->IsNoDragXorPolys() != pView->IsNoDragXorPolys() )
238cdf0e10cSrcweir 		mpDrawView->SetNoDragXorPolys( pView->IsNoDragXorPolys() );
239cdf0e10cSrcweir 
240cdf0e10cSrcweir 	if (mpDrawView->IsCrookNoContortion() != pView->IsCrookNoContortion() )
241cdf0e10cSrcweir 		mpDrawView->SetCrookNoContortion( pView->IsCrookNoContortion() );
242cdf0e10cSrcweir 
243cdf0e10cSrcweir 	if (mpDrawView->IsAngleSnapEnabled() != pView->IsAngleSnapEnabled() )
244cdf0e10cSrcweir 		mpDrawView->SetAngleSnapEnabled( pView->IsAngleSnapEnabled() );
245cdf0e10cSrcweir 
246cdf0e10cSrcweir 	if (mpDrawView->IsBigOrtho() != pView->IsBigOrtho() )
247cdf0e10cSrcweir 		mpDrawView->SetBigOrtho( pView->IsBigOrtho() );
248cdf0e10cSrcweir 
249cdf0e10cSrcweir 	if (mpDrawView->IsOrtho() != pView->IsOrtho() )
250cdf0e10cSrcweir 		mpDrawView->SetOrtho( pView->IsOrtho() );
251cdf0e10cSrcweir 
252cdf0e10cSrcweir 	if (mpDrawView->GetEliminatePolyPointLimitAngle() != pView->GetEliminatePolyPointLimitAngle() )
253cdf0e10cSrcweir 		mpDrawView->SetEliminatePolyPointLimitAngle( pView->GetEliminatePolyPointLimitAngle() );
254cdf0e10cSrcweir 
255cdf0e10cSrcweir 	if (mpDrawView->IsEliminatePolyPoints() != pView->IsEliminatePolyPoints() )
256cdf0e10cSrcweir 		mpDrawView->SetEliminatePolyPoints( pView->IsEliminatePolyPoints() );
257cdf0e10cSrcweir 
258cdf0e10cSrcweir 	if (mpDrawView->IsSolidMarkHdl() != pView->IsSolidMarkHdl() )
259cdf0e10cSrcweir 		mpDrawView->SetSolidMarkHdl( pView->IsSolidMarkHdl() );
260cdf0e10cSrcweir 
261cdf0e10cSrcweir 	if (mpDrawView->IsSolidDragging() != pView->IsSolidDragging() )
262cdf0e10cSrcweir 		mpDrawView->SetSolidDragging( pView->IsSolidDragging() );
263cdf0e10cSrcweir 
264cdf0e10cSrcweir 	if (mpDrawView->IsQuickTextEditMode() != pView->IsQuickEdit())
265cdf0e10cSrcweir 		mpDrawView->SetQuickTextEditMode( pView->IsQuickEdit() );
266cdf0e10cSrcweir 
267cdf0e10cSrcweir 	// #i26631#
268cdf0e10cSrcweir 	if (mpDrawView->IsMasterPagePaintCaching() != pView->IsMasterPagePaintCaching())
269cdf0e10cSrcweir 		mpDrawView->SetMasterPagePaintCaching( pView->IsMasterPagePaintCaching() );
270cdf0e10cSrcweir 
271cdf0e10cSrcweir 	// Definition:
272cdf0e10cSrcweir 	//	grosse Handles:	9
273cdf0e10cSrcweir 	//	kleine Handles:	7
274cdf0e10cSrcweir 	sal_uInt16 nTmp = mpDrawView->GetMarkHdlSizePixel();
275cdf0e10cSrcweir 	//DBG_ASSERT(nTmp != 7, "HandleSize != 7 oder 9");
276cdf0e10cSrcweir 	if( nTmp == 9 && !pView->IsBigHandles() )
277cdf0e10cSrcweir 		mpDrawView->SetMarkHdlSizePixel( 7 );
278cdf0e10cSrcweir 	else if( nTmp == 7 && pView->IsBigHandles() )
279cdf0e10cSrcweir 		mpDrawView->SetMarkHdlSizePixel( 9 );
280cdf0e10cSrcweir 
281cdf0e10cSrcweir 
282cdf0e10cSrcweir 	SdrPageView* pPageView = mpDrawView->GetSdrPageView();
283cdf0e10cSrcweir 	if (pPageView)
284cdf0e10cSrcweir 	{
285cdf0e10cSrcweir 		if ( pPageView->GetVisibleLayers() != pView->GetVisibleLayers() )
286cdf0e10cSrcweir 			pPageView->SetVisibleLayers( pView->GetVisibleLayers() );
287cdf0e10cSrcweir 
288cdf0e10cSrcweir 		if ( pPageView->GetPrintableLayers() != pView->GetPrintableLayers() )
289cdf0e10cSrcweir 			pPageView->SetPrintableLayers( pView->GetPrintableLayers() );
290cdf0e10cSrcweir 
291cdf0e10cSrcweir 		if ( pPageView->GetLockedLayers() != pView->GetLockedLayers() )
292cdf0e10cSrcweir 			pPageView->SetLockedLayers( pView->GetLockedLayers() );
293cdf0e10cSrcweir 
294cdf0e10cSrcweir 		if (mePageKind == PK_NOTES)
295cdf0e10cSrcweir 		{
296cdf0e10cSrcweir 			if (pPageView->GetHelpLines() != pView->GetNotesHelpLines())
297cdf0e10cSrcweir 				pPageView->SetHelpLines( pView->GetNotesHelpLines() );
298cdf0e10cSrcweir 		}
299cdf0e10cSrcweir 		else if (mePageKind == PK_HANDOUT)
300cdf0e10cSrcweir 		{
301cdf0e10cSrcweir 			if (pPageView->GetHelpLines() != pView->GetHandoutHelpLines())
302cdf0e10cSrcweir 				pPageView->SetHelpLines( pView->GetHandoutHelpLines() );
303cdf0e10cSrcweir 		}
304cdf0e10cSrcweir 		else
305cdf0e10cSrcweir 		{
306cdf0e10cSrcweir 			if (pPageView->GetHelpLines() != pView->GetStandardHelpLines())
307cdf0e10cSrcweir 				pPageView->SetHelpLines( pView->GetStandardHelpLines() );
308cdf0e10cSrcweir 		}
309cdf0e10cSrcweir 	}
310cdf0e10cSrcweir 
311cdf0e10cSrcweir 	if ( mpDrawView->GetActiveLayer() != pView->GetActiveLayer() )
312cdf0e10cSrcweir 		mpDrawView->SetActiveLayer( pView->GetActiveLayer() );
313cdf0e10cSrcweir 
314cdf0e10cSrcweir 	sal_uInt16 nSelectedPage = 0;
315cdf0e10cSrcweir 
316cdf0e10cSrcweir 	if (mePageKind != PK_HANDOUT)
317cdf0e10cSrcweir 	{
318cdf0e10cSrcweir 		nSelectedPage = pView->GetSelectedPage();
319cdf0e10cSrcweir 	}
320cdf0e10cSrcweir 
321cdf0e10cSrcweir 	EditMode eNewEditMode = pView->GetViewShEditMode(mePageKind);
322cdf0e10cSrcweir 	sal_Bool bNewLayerMode = pView->IsLayerMode();
323cdf0e10cSrcweir 	ChangeEditMode(eNewEditMode, bNewLayerMode);
324cdf0e10cSrcweir 	SwitchPage(nSelectedPage);
325cdf0e10cSrcweir 
326cdf0e10cSrcweir 	// DrawMode fuer 'Normales' Fenster wiederherstellen
327cdf0e10cSrcweir 	if(GetActiveWindow()->GetDrawMode() != pView->GetDrawMode())
328cdf0e10cSrcweir 	  GetActiveWindow()->SetDrawMode(pView->GetDrawMode());
329cdf0e10cSrcweir 
330cdf0e10cSrcweir 	if ( mpDrawView->IsDesignMode() != pView->IsDesignMode() )
331cdf0e10cSrcweir 	{
332cdf0e10cSrcweir 		SfxBoolItem aDesignModeItem( SID_FM_DESIGN_MODE, pView->IsDesignMode() );
333cdf0e10cSrcweir 		GetViewFrame()->GetDispatcher()->Execute( SID_FM_DESIGN_MODE, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD, &aDesignModeItem, 0L );
334cdf0e10cSrcweir 	}
335cdf0e10cSrcweir 
336cdf0e10cSrcweir 	// Muss am Ende gerufen werden, da ein WriteFrameViewData() ausgeloest wird
337cdf0e10cSrcweir 	if (mpDrawView->IsFrameDragSingles() != pView->IsFrameDragSingles() )
338cdf0e10cSrcweir 		mpDrawView->SetFrameDragSingles( pView->IsFrameDragSingles() );
339cdf0e10cSrcweir }
340cdf0e10cSrcweir 
341cdf0e10cSrcweir /*************************************************************************
342cdf0e10cSrcweir |*
343cdf0e10cSrcweir |* Daten der aktuellen View auf die FrameView uebertragen
344cdf0e10cSrcweir |*
345cdf0e10cSrcweir \************************************************************************/
346cdf0e10cSrcweir 
WriteFrameViewData()347cdf0e10cSrcweir void DrawViewShell::WriteFrameViewData()
348cdf0e10cSrcweir {
349cdf0e10cSrcweir 	// Zeichen-(Bildschirm-)Attribute an FrameView merken
350cdf0e10cSrcweir 	mpFrameView->SetRuler( HasRuler() );
351cdf0e10cSrcweir 	mpFrameView->SetGridCoarse( mpDrawView->GetGridCoarse() );
352cdf0e10cSrcweir 	mpFrameView->SetGridFine( mpDrawView->GetGridFine() );
353cdf0e10cSrcweir 	mpFrameView->SetSnapGridWidth(mpDrawView->GetSnapGridWidthX(), mpDrawView->GetSnapGridWidthY());
354cdf0e10cSrcweir 	mpFrameView->SetGridVisible( mpDrawView->IsGridVisible() );
355cdf0e10cSrcweir 	mpFrameView->SetGridFront( mpDrawView->IsGridFront() );
356cdf0e10cSrcweir 	mpFrameView->SetSnapAngle( mpDrawView->GetSnapAngle() );
357cdf0e10cSrcweir 	mpFrameView->SetGridSnap( mpDrawView->IsGridSnap() );
358cdf0e10cSrcweir 	mpFrameView->SetBordSnap( mpDrawView->IsBordSnap() );
359cdf0e10cSrcweir 	mpFrameView->SetHlplSnap( mpDrawView->IsHlplSnap() );
360cdf0e10cSrcweir 	mpFrameView->SetOFrmSnap( mpDrawView->IsOFrmSnap() );
361cdf0e10cSrcweir 	mpFrameView->SetOPntSnap( mpDrawView->IsOPntSnap() );
362cdf0e10cSrcweir 	mpFrameView->SetOConSnap( mpDrawView->IsOConSnap() );
363cdf0e10cSrcweir 	mpFrameView->SetHlplVisible( mpDrawView->IsHlplVisible() );
364cdf0e10cSrcweir 	mpFrameView->SetDragStripes( mpDrawView->IsDragStripes() );
365cdf0e10cSrcweir 	mpFrameView->SetPlusHandlesAlwaysVisible( mpDrawView->IsPlusHandlesAlwaysVisible() );
366cdf0e10cSrcweir 	mpFrameView->SetFrameDragSingles( mpDrawView->IsFrameDragSingles() );
367cdf0e10cSrcweir 	mpFrameView->SetMarkedHitMovesAlways( mpDrawView->IsMarkedHitMovesAlways() );
368cdf0e10cSrcweir 	mpFrameView->SetMoveOnlyDragging( mpDrawView->IsMoveOnlyDragging() );
369cdf0e10cSrcweir 	mpFrameView->SetNoDragXorPolys( mpDrawView->IsNoDragXorPolys() );
370cdf0e10cSrcweir 	mpFrameView->SetCrookNoContortion( mpDrawView->IsCrookNoContortion() );
371cdf0e10cSrcweir 	mpFrameView->SetBigOrtho( mpDrawView->IsBigOrtho() );
372cdf0e10cSrcweir 	mpFrameView->SetEliminatePolyPointLimitAngle( mpDrawView->GetEliminatePolyPointLimitAngle() );
373cdf0e10cSrcweir 	mpFrameView->SetEliminatePolyPoints( mpDrawView->IsEliminatePolyPoints() );
374cdf0e10cSrcweir 
375cdf0e10cSrcweir 	mpFrameView->SetSolidMarkHdl( mpDrawView->IsSolidMarkHdl() );
376cdf0e10cSrcweir 	mpFrameView->SetSolidDragging( mpDrawView->IsSolidDragging() );
377cdf0e10cSrcweir 	mpFrameView->SetQuickEdit( mpDrawView->IsQuickTextEditMode() );
378cdf0e10cSrcweir 
379cdf0e10cSrcweir 	mpFrameView->SetDesignMode( mpDrawView->IsDesignMode() );
380cdf0e10cSrcweir 
381cdf0e10cSrcweir 	Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
382cdf0e10cSrcweir 	Rectangle aVisArea = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
383cdf0e10cSrcweir 	mpFrameView->SetVisArea(aVisArea);
384cdf0e10cSrcweir 
385cdf0e10cSrcweir 	if( mePageKind == PK_HANDOUT )
386cdf0e10cSrcweir 		mpFrameView->SetSelectedPage(0);
387cdf0e10cSrcweir 	else
388cdf0e10cSrcweir 	{
389cdf0e10cSrcweir 		mpFrameView->SetSelectedPage( maTabControl.GetCurPageId() - 1 );
390cdf0e10cSrcweir 	}
391cdf0e10cSrcweir 
392cdf0e10cSrcweir 	mpFrameView->SetViewShEditMode(meEditMode, mePageKind);
393cdf0e10cSrcweir 	mpFrameView->SetLayerMode(IsLayerModeActive());
394cdf0e10cSrcweir 
395cdf0e10cSrcweir 	SdrPageView* pPageView = mpDrawView->GetSdrPageView();
396cdf0e10cSrcweir 
397cdf0e10cSrcweir 	if (pPageView)
398cdf0e10cSrcweir 	{
399cdf0e10cSrcweir 		if ( mpFrameView->GetVisibleLayers() != pPageView->GetVisibleLayers() )
400cdf0e10cSrcweir 			mpFrameView->SetVisibleLayers( pPageView->GetVisibleLayers() );
401cdf0e10cSrcweir 
402cdf0e10cSrcweir 		if ( mpFrameView->GetPrintableLayers() != pPageView->GetPrintableLayers() )
403cdf0e10cSrcweir 			mpFrameView->SetPrintableLayers( pPageView->GetPrintableLayers() );
404cdf0e10cSrcweir 
405cdf0e10cSrcweir 		if ( mpFrameView->GetLockedLayers() != pPageView->GetLockedLayers() )
406cdf0e10cSrcweir 			mpFrameView->SetLockedLayers( pPageView->GetLockedLayers() );
407cdf0e10cSrcweir 
408cdf0e10cSrcweir 		if (mePageKind == PK_NOTES)
409cdf0e10cSrcweir 		{
410cdf0e10cSrcweir 			mpFrameView->SetNotesHelpLines( pPageView->GetHelpLines() );
411cdf0e10cSrcweir 		}
412cdf0e10cSrcweir 		else if (mePageKind == PK_HANDOUT)
413cdf0e10cSrcweir 		{
414cdf0e10cSrcweir 			mpFrameView->SetHandoutHelpLines( pPageView->GetHelpLines() );
415cdf0e10cSrcweir 		}
416cdf0e10cSrcweir 		else
417cdf0e10cSrcweir 		{
418cdf0e10cSrcweir 			mpFrameView->SetStandardHelpLines( pPageView->GetHelpLines() );
419cdf0e10cSrcweir 		}
420cdf0e10cSrcweir 	}
421cdf0e10cSrcweir 
422cdf0e10cSrcweir 	if ( mpFrameView->GetActiveLayer() != mpDrawView->GetActiveLayer() )
423cdf0e10cSrcweir 		mpFrameView->SetActiveLayer( mpDrawView->GetActiveLayer() );
424cdf0e10cSrcweir 
425cdf0e10cSrcweir 	// DrawMode fuer 'Normales' Fenster merken
426cdf0e10cSrcweir 	if(mpFrameView->GetDrawMode() != GetActiveWindow()->GetDrawMode())
427cdf0e10cSrcweir 	  mpFrameView->SetDrawMode(GetActiveWindow()->GetDrawMode());
428cdf0e10cSrcweir }
429cdf0e10cSrcweir 
430cdf0e10cSrcweir 
431cdf0e10cSrcweir 
432cdf0e10cSrcweir /*************************************************************************
433cdf0e10cSrcweir |*
434cdf0e10cSrcweir |* PrePaint-Method
435cdf0e10cSrcweir |*
436cdf0e10cSrcweir \************************************************************************/
437cdf0e10cSrcweir 
PrePaint()438cdf0e10cSrcweir void DrawViewShell::PrePaint()
439cdf0e10cSrcweir {
440cdf0e10cSrcweir 	mpDrawView->PrePaint();
441cdf0e10cSrcweir }
442cdf0e10cSrcweir 
443cdf0e10cSrcweir /*************************************************************************
444cdf0e10cSrcweir |*
445cdf0e10cSrcweir |* Paint-Methode: das Ereignis wird vom Fenster pWin an
446cdf0e10cSrcweir |* die Viewshell und die aktuelle Funktion weitergeleitet
447cdf0e10cSrcweir |*
448cdf0e10cSrcweir |* Anmerkung: pWin==NULL, wenn Paint() vom ShowWindow gerufen wird!
449cdf0e10cSrcweir |*
450cdf0e10cSrcweir \************************************************************************/
451cdf0e10cSrcweir 
Paint(const Rectangle & rRect,::sd::Window * pWin)452cdf0e10cSrcweir void DrawViewShell::Paint(const Rectangle& rRect, ::sd::Window* pWin)
453cdf0e10cSrcweir {
454cdf0e10cSrcweir 	// #103834# Fill var FillColor here to have it available on later call
455cdf0e10cSrcweir     svtools::ColorConfig aColorConfig;
456cdf0e10cSrcweir 	Color aFillColor;
457cdf0e10cSrcweir 
458cdf0e10cSrcweir     if(DOCUMENT_TYPE_IMPRESS == GetDoc()->GetDocumentType())
459cdf0e10cSrcweir 	{
460cdf0e10cSrcweir         aFillColor = Color( aColorConfig.GetColorValue( svtools::APPBACKGROUND ).nColor );
461cdf0e10cSrcweir 	}
462cdf0e10cSrcweir     else
463cdf0e10cSrcweir 	{
464cdf0e10cSrcweir         aFillColor = Color( aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor );
465cdf0e10cSrcweir 	}
466cdf0e10cSrcweir 
467cdf0e10cSrcweir 	/* #97517#	This is done before each text edit, so why not do it before every paint.
468cdf0e10cSrcweir 				The default language is only used if the outliner only contains one
469cdf0e10cSrcweir 				character in a symbol font */
470cdf0e10cSrcweir 	GetDoc()->GetDrawOutliner( NULL ).SetDefaultLanguage( GetDoc()->GetLanguage( EE_CHAR_LANGUAGE ) );
471cdf0e10cSrcweir 
472cdf0e10cSrcweir 	// #103834# Set Application Background color for usage in SdrPaintView(s)
473cdf0e10cSrcweir 	mpDrawView->SetApplicationBackgroundColor(aFillColor);
474cdf0e10cSrcweir 
475cdf0e10cSrcweir 	/* #97517#	This is done before each text edit, so why not do it before every paint.
476cdf0e10cSrcweir 				The default language is only used if the outliner only contains one
477cdf0e10cSrcweir 				character in a symbol font */
478cdf0e10cSrcweir 	GetDoc()->GetDrawOutliner( NULL ).SetDefaultLanguage( Application::GetSettings().GetLanguage() );
479cdf0e10cSrcweir 
480cdf0e10cSrcweir 	mpDrawView->CompleteRedraw( pWin, Region( rRect ) );
481cdf0e10cSrcweir 
482cdf0e10cSrcweir 	if( pWin )
483cdf0e10cSrcweir 	{
484cdf0e10cSrcweir 		if( GetDocSh()->GetDocShellFunction().is() )
485cdf0e10cSrcweir 			GetDocSh()->GetDocShellFunction()->Paint( rRect, pWin );
486cdf0e10cSrcweir 
487cdf0e10cSrcweir 		if( HasCurrentFunction() )
488cdf0e10cSrcweir 			GetCurrentFunction()->Paint( rRect, pWin );
489cdf0e10cSrcweir 	}
490cdf0e10cSrcweir }
491cdf0e10cSrcweir 
492cdf0e10cSrcweir /*************************************************************************
493cdf0e10cSrcweir |*
494cdf0e10cSrcweir |* Zoom-Faktor fuer InPlace einstellen
495cdf0e10cSrcweir |*
496cdf0e10cSrcweir \************************************************************************/
497cdf0e10cSrcweir 
SetZoomFactor(const Fraction & rZoomX,const Fraction & rZoomY)498cdf0e10cSrcweir void DrawViewShell::SetZoomFactor(const Fraction& rZoomX, const Fraction& rZoomY)
499cdf0e10cSrcweir {
500cdf0e10cSrcweir 	ViewShell::SetZoomFactor(rZoomX, rZoomY);
501cdf0e10cSrcweir 	mbZoomOnPage = sal_False;
502cdf0e10cSrcweir 	Point aOrigin = GetActiveWindow()->GetViewOrigin();
503cdf0e10cSrcweir 	GetActiveWindow()->SetWinViewPos(aOrigin);
504cdf0e10cSrcweir }
505cdf0e10cSrcweir 
506cdf0e10cSrcweir /*************************************************************************
507cdf0e10cSrcweir |*
508cdf0e10cSrcweir |* Optimale Groesse zurueckgeben
509cdf0e10cSrcweir |*
510cdf0e10cSrcweir \************************************************************************/
511cdf0e10cSrcweir 
GetOptimalSizePixel() const512cdf0e10cSrcweir Size DrawViewShell::GetOptimalSizePixel() const
513cdf0e10cSrcweir {
514cdf0e10cSrcweir 	Size aSize;
515cdf0e10cSrcweir 
516cdf0e10cSrcweir 	SdrPageView* pPV = mpDrawView->GetSdrPageView();
517cdf0e10cSrcweir 	if (pPV)
518cdf0e10cSrcweir 	{
519cdf0e10cSrcweir 		SdPage* pPage = (SdPage*) pPV->GetPage();
520cdf0e10cSrcweir 
521cdf0e10cSrcweir 		if (pPage)
522cdf0e10cSrcweir 		{
523cdf0e10cSrcweir 			if (!mbZoomOnPage)
524cdf0e10cSrcweir 			{
525cdf0e10cSrcweir 				// Gegenwaertigen MapMode beruecksichtigen
526cdf0e10cSrcweir 				aSize = GetActiveWindow()->LogicToPixel( pPage->GetSize() );
527cdf0e10cSrcweir 			}
528cdf0e10cSrcweir 			else
529cdf0e10cSrcweir 			{
530cdf0e10cSrcweir 				// 1:1 Darstellung
531cdf0e10cSrcweir 				MapMode aMapMode(MAP_100TH_MM);
532cdf0e10cSrcweir 				aSize = GetActiveWindow()->LogicToPixel( pPage->GetSize(), aMapMode );
533cdf0e10cSrcweir 				const_cast< DrawViewShell* >(this)->mbZoomOnPage = sal_True;
534cdf0e10cSrcweir 			}
535cdf0e10cSrcweir 		}
536cdf0e10cSrcweir 	}
537cdf0e10cSrcweir 
538cdf0e10cSrcweir 	return(aSize);
539cdf0e10cSrcweir }
540cdf0e10cSrcweir 
541cdf0e10cSrcweir 
542cdf0e10cSrcweir /*************************************************************************
543cdf0e10cSrcweir |*
544cdf0e10cSrcweir |* Seite wird gehided
545cdf0e10cSrcweir |*
546cdf0e10cSrcweir \************************************************************************/
547cdf0e10cSrcweir 
HidePage()548cdf0e10cSrcweir void DrawViewShell::HidePage()
549cdf0e10cSrcweir {
550cdf0e10cSrcweir     FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
551cdf0e10cSrcweir     if (pFormShell != NULL)
552cdf0e10cSrcweir         pFormShell->PrepareClose (sal_False);
553cdf0e10cSrcweir }
554cdf0e10cSrcweir 
555cdf0e10cSrcweir 
556cdf0e10cSrcweir 
WriteUserDataSequence(::com::sun::star::uno::Sequence<::com::sun::star::beans::PropertyValue> & rSequence,sal_Bool bBrowse)557cdf0e10cSrcweir void DrawViewShell::WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& rSequence, sal_Bool bBrowse )
558cdf0e10cSrcweir {
559cdf0e10cSrcweir 	WriteFrameViewData();
560cdf0e10cSrcweir 
561cdf0e10cSrcweir 	ViewShell::WriteUserDataSequence( rSequence, bBrowse );
562cdf0e10cSrcweir 
563cdf0e10cSrcweir 	const sal_Int32 nIndex = rSequence.getLength();
564cdf0e10cSrcweir 	rSequence.realloc( nIndex + 1 );
565cdf0e10cSrcweir 	rSequence[nIndex].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( sUNO_View_ZoomOnPage ) );
566cdf0e10cSrcweir 	rSequence[nIndex].Value <<= (sal_Bool)mbZoomOnPage;
567cdf0e10cSrcweir }
568cdf0e10cSrcweir 
ReadUserDataSequence(const::com::sun::star::uno::Sequence<::com::sun::star::beans::PropertyValue> & rSequence,sal_Bool bBrowse)569cdf0e10cSrcweir void DrawViewShell::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& rSequence, sal_Bool bBrowse )
570cdf0e10cSrcweir {
571cdf0e10cSrcweir 	WriteFrameViewData();
572cdf0e10cSrcweir 
573cdf0e10cSrcweir 	ViewShell::ReadUserDataSequence( rSequence, bBrowse );
574cdf0e10cSrcweir 
575cdf0e10cSrcweir 	const sal_Int32 nLength = rSequence.getLength();
576cdf0e10cSrcweir     const com::sun::star::beans::PropertyValue *pValue = rSequence.getConstArray();
577cdf0e10cSrcweir     for (sal_Int16 i = 0 ; i < nLength; i++, pValue++ )
578cdf0e10cSrcweir     {
579cdf0e10cSrcweir         if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_ZoomOnPage ) ) )
580cdf0e10cSrcweir 		{
581cdf0e10cSrcweir 			sal_Bool bZoomPage = sal_False;
582cdf0e10cSrcweir 			if( pValue->Value >>= bZoomPage )
583cdf0e10cSrcweir 			{
584cdf0e10cSrcweir 				mbZoomOnPage = bZoomPage;
585cdf0e10cSrcweir 			}
586cdf0e10cSrcweir 		}
587cdf0e10cSrcweir 	}
588cdf0e10cSrcweir 
589cdf0e10cSrcweir 	if( mpFrameView->GetPageKind() != mePageKind )
590cdf0e10cSrcweir 	{
591cdf0e10cSrcweir 		mePageKind = mpFrameView->GetPageKind();
592cdf0e10cSrcweir 
593cdf0e10cSrcweir 		if (mePageKind == PK_NOTES)
594cdf0e10cSrcweir 		{
595cdf0e10cSrcweir 			SetHelpId( SID_NOTESMODE );
596cdf0e10cSrcweir 			GetActiveWindow()->SetHelpId( CMD_SID_NOTESMODE );
597cdf0e10cSrcweir 			GetActiveWindow()->SetUniqueId( CMD_SID_NOTESMODE );
598cdf0e10cSrcweir 		}
599cdf0e10cSrcweir 		else if (mePageKind == PK_HANDOUT)
600cdf0e10cSrcweir 		{
601cdf0e10cSrcweir 			SetHelpId( SID_HANDOUTMODE );
602cdf0e10cSrcweir 			GetActiveWindow()->SetHelpId( CMD_SID_HANDOUTMODE );
603cdf0e10cSrcweir 			GetActiveWindow()->SetUniqueId( CMD_SID_HANDOUTMODE );
604cdf0e10cSrcweir 		}
605cdf0e10cSrcweir 		else
606cdf0e10cSrcweir 		{
607cdf0e10cSrcweir 			SetHelpId( SD_IF_SDDRAWVIEWSHELL );
608cdf0e10cSrcweir 			GetActiveWindow()->SetHelpId( HID_SDDRAWVIEWSHELL );
609cdf0e10cSrcweir 			GetActiveWindow()->SetUniqueId( HID_SDDRAWVIEWSHELL );
610cdf0e10cSrcweir 		}
611cdf0e10cSrcweir 	}
612cdf0e10cSrcweir 
613cdf0e10cSrcweir 	ReadFrameViewData( mpFrameView );
614cdf0e10cSrcweir 
615cdf0e10cSrcweir 	if( !mbZoomOnPage )
616cdf0e10cSrcweir 	{
617cdf0e10cSrcweir 		const Rectangle aVisArea( mpFrameView->GetVisArea() );
618cdf0e10cSrcweir 
619cdf0e10cSrcweir 		if ( GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
620cdf0e10cSrcweir 		{
621cdf0e10cSrcweir 			GetDocSh()->SetVisArea(aVisArea);
622cdf0e10cSrcweir 		}
623cdf0e10cSrcweir 
624cdf0e10cSrcweir 		VisAreaChanged(aVisArea);
625cdf0e10cSrcweir 
626cdf0e10cSrcweir 		::sd::View* pView = GetView();
627cdf0e10cSrcweir 
628cdf0e10cSrcweir 		if (pView)
629cdf0e10cSrcweir 		{
630cdf0e10cSrcweir 			pView->VisAreaChanged(GetActiveWindow());
631cdf0e10cSrcweir 		}
632cdf0e10cSrcweir 
633cdf0e10cSrcweir 		SetZoomRect(aVisArea);
634cdf0e10cSrcweir 	}
635cdf0e10cSrcweir 
636cdf0e10cSrcweir 	ChangeEditMode (meEditMode, ! IsLayerModeActive());
637cdf0e10cSrcweir 	ChangeEditMode (meEditMode, ! IsLayerModeActive());
638cdf0e10cSrcweir }
639cdf0e10cSrcweir 
VisAreaChanged(const Rectangle & rRect)640cdf0e10cSrcweir void DrawViewShell::VisAreaChanged(const Rectangle& rRect)
641cdf0e10cSrcweir {
642cdf0e10cSrcweir 	ViewShell::VisAreaChanged( rRect );
643cdf0e10cSrcweir 
644cdf0e10cSrcweir 	DrawController& rController = GetViewShellBase().GetDrawController();
645cdf0e10cSrcweir     rController.FireVisAreaChanged (rRect);
646cdf0e10cSrcweir }
647cdf0e10cSrcweir 
648cdf0e10cSrcweir 
649cdf0e10cSrcweir 
650cdf0e10cSrcweir 
651cdf0e10cSrcweir /** If there is a valid controller then create a new instance of
652cdf0e10cSrcweir     <type>AccessibleDrawDocumentView</type>.  Otherwise delegate this call
653cdf0e10cSrcweir     to the base class to return a default object (probably an empty
654cdf0e10cSrcweir     reference).
655cdf0e10cSrcweir */
656cdf0e10cSrcweir ::com::sun::star::uno::Reference<
657cdf0e10cSrcweir     ::com::sun::star::accessibility::XAccessible>
CreateAccessibleDocumentView(::sd::Window * pWindow)658cdf0e10cSrcweir     DrawViewShell::CreateAccessibleDocumentView (::sd::Window* pWindow)
659cdf0e10cSrcweir {
660cdf0e10cSrcweir     if (GetViewShellBase().GetController() != NULL)
661cdf0e10cSrcweir     {
662cdf0e10cSrcweir         accessibility::AccessibleDrawDocumentView* pDocumentView =
663cdf0e10cSrcweir             new accessibility::AccessibleDrawDocumentView (
664cdf0e10cSrcweir                 pWindow,
665cdf0e10cSrcweir                 this,
666cdf0e10cSrcweir                 GetViewShellBase().GetController(),
667cdf0e10cSrcweir                 pWindow->GetAccessibleParentWindow()->GetAccessible());
668cdf0e10cSrcweir         pDocumentView->Init();
669cdf0e10cSrcweir         return ::com::sun::star::uno::Reference<
670cdf0e10cSrcweir             ::com::sun::star::accessibility::XAccessible>
671cdf0e10cSrcweir             (static_cast< ::com::sun::star::uno::XWeak*>(pDocumentView),
672cdf0e10cSrcweir                 ::com::sun::star::uno::UNO_QUERY);
673cdf0e10cSrcweir     }
674cdf0e10cSrcweir     else
675cdf0e10cSrcweir     {
676cdf0e10cSrcweir         OSL_TRACE ("DrawViewShell::CreateAccessibleDocumentView: no controller");
677cdf0e10cSrcweir         return ViewShell::CreateAccessibleDocumentView (pWindow);
678cdf0e10cSrcweir     }
679cdf0e10cSrcweir }
680cdf0e10cSrcweir 
681cdf0e10cSrcweir 
682cdf0e10cSrcweir 
683cdf0e10cSrcweir 
GetActiveTabLayerIndex(void) const684cdf0e10cSrcweir int DrawViewShell::GetActiveTabLayerIndex (void) const
685cdf0e10cSrcweir {
686cdf0e10cSrcweir     const LayerTabBar* pBar
687cdf0e10cSrcweir         = const_cast<DrawViewShell*>(this)->GetLayerTabControl ();
688cdf0e10cSrcweir     if (pBar != NULL)
689cdf0e10cSrcweir         return pBar->GetPagePos (pBar->GetCurPageId());
690cdf0e10cSrcweir     else
691cdf0e10cSrcweir         return -1;
692cdf0e10cSrcweir }
693cdf0e10cSrcweir 
694cdf0e10cSrcweir 
695cdf0e10cSrcweir 
696cdf0e10cSrcweir 
SetActiveTabLayerIndex(int nIndex)697cdf0e10cSrcweir void DrawViewShell::SetActiveTabLayerIndex (int nIndex)
698cdf0e10cSrcweir {
699cdf0e10cSrcweir     LayerTabBar* pBar = GetLayerTabControl ();
700cdf0e10cSrcweir     if (pBar != NULL)
701cdf0e10cSrcweir     {
702cdf0e10cSrcweir         // Ignore invalid indices silently.
703cdf0e10cSrcweir         if (nIndex>=0 && nIndex<pBar->GetPageCount())
704cdf0e10cSrcweir         {
705cdf0e10cSrcweir             // Tell the draw view and the tab control of the new active layer.
706cdf0e10cSrcweir             mpDrawView->SetActiveLayer (pBar->GetPageText (pBar->GetPageId ((sal_uInt16)nIndex)));
707cdf0e10cSrcweir             pBar->SetCurPageId (pBar->GetPageId ((sal_uInt16)nIndex));
708*0deba7fbSSteve Yin 		SdUnoDrawView* pUnoDrawView = new SdUnoDrawView (
709*0deba7fbSSteve Yin             GetViewShellBase().GetDrawController(),
710*0deba7fbSSteve Yin             *this,
711*0deba7fbSSteve Yin             *GetView());
712*0deba7fbSSteve Yin 		::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer> rLayer = pUnoDrawView->getActiveLayer();
713*0deba7fbSSteve Yin 		GetViewShellBase().GetDrawController().fireChangeLayer( &rLayer );
714*0deba7fbSSteve Yin 		delete pUnoDrawView;
715cdf0e10cSrcweir         }
716cdf0e10cSrcweir     }
717cdf0e10cSrcweir }
718cdf0e10cSrcweir 
719cdf0e10cSrcweir 
720cdf0e10cSrcweir 
721cdf0e10cSrcweir 
GetPageTabControl(void)722cdf0e10cSrcweir TabControl* DrawViewShell::GetPageTabControl (void)
723cdf0e10cSrcweir {
724cdf0e10cSrcweir     return &maTabControl;
725cdf0e10cSrcweir }
726cdf0e10cSrcweir 
727cdf0e10cSrcweir 
728cdf0e10cSrcweir 
729cdf0e10cSrcweir 
GetLayerTabControl(void)730cdf0e10cSrcweir LayerTabBar* DrawViewShell::GetLayerTabControl (void)
731cdf0e10cSrcweir {
732cdf0e10cSrcweir     return mpLayerTabBar.get();
733cdf0e10cSrcweir }
734cdf0e10cSrcweir 
735cdf0e10cSrcweir 
736cdf0e10cSrcweir 
737cdf0e10cSrcweir 
GetTabLayerCount(void) const738cdf0e10cSrcweir int DrawViewShell::GetTabLayerCount (void) const
739cdf0e10cSrcweir {
740cdf0e10cSrcweir     const LayerTabBar* pBar
741cdf0e10cSrcweir         = const_cast<DrawViewShell*>(this)->GetLayerTabControl ();
742cdf0e10cSrcweir     if (pBar != NULL)
743cdf0e10cSrcweir         return pBar->GetPageCount();
744cdf0e10cSrcweir     else
745cdf0e10cSrcweir         return 0;
746cdf0e10cSrcweir }
747cdf0e10cSrcweir 
748cdf0e10cSrcweir 
749cdf0e10cSrcweir } // end of namespace sd
750