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();
323*57d1e499SArmin Le Grand
324*57d1e499SArmin Le Grand if(IsLayerModeActive() && bNewLayerMode)
325*57d1e499SArmin Le Grand {
326*57d1e499SArmin Le Grand // #57936# Force mbIsLayerModeActive to false so that ChangeEditMode
327*57d1e499SArmin Le Grand // below does something regarding LayerTabBar content refresh. That refresh
328*57d1e499SArmin Le Grand // is only done when IsLayerModeActive changes. It needs to be done
329*57d1e499SArmin Le Grand // since e.g. Layer vsisibility was changed above and this may need
330*57d1e499SArmin Le Grand // a refresh to show the correct graphical representation
331*57d1e499SArmin Le Grand mbIsLayerModeActive = false;
332*57d1e499SArmin Le Grand }
333*57d1e499SArmin Le Grand
334cdf0e10cSrcweir ChangeEditMode(eNewEditMode, bNewLayerMode);
335cdf0e10cSrcweir SwitchPage(nSelectedPage);
336cdf0e10cSrcweir
337cdf0e10cSrcweir // DrawMode fuer 'Normales' Fenster wiederherstellen
338cdf0e10cSrcweir if(GetActiveWindow()->GetDrawMode() != pView->GetDrawMode())
339cdf0e10cSrcweir GetActiveWindow()->SetDrawMode(pView->GetDrawMode());
340cdf0e10cSrcweir
341cdf0e10cSrcweir if ( mpDrawView->IsDesignMode() != pView->IsDesignMode() )
342cdf0e10cSrcweir {
343cdf0e10cSrcweir SfxBoolItem aDesignModeItem( SID_FM_DESIGN_MODE, pView->IsDesignMode() );
344cdf0e10cSrcweir GetViewFrame()->GetDispatcher()->Execute( SID_FM_DESIGN_MODE, SFX_CALLMODE_SYNCHRON | SFX_CALLMODE_RECORD, &aDesignModeItem, 0L );
345cdf0e10cSrcweir }
346cdf0e10cSrcweir
347cdf0e10cSrcweir // Muss am Ende gerufen werden, da ein WriteFrameViewData() ausgeloest wird
348cdf0e10cSrcweir if (mpDrawView->IsFrameDragSingles() != pView->IsFrameDragSingles() )
349cdf0e10cSrcweir mpDrawView->SetFrameDragSingles( pView->IsFrameDragSingles() );
350cdf0e10cSrcweir }
351cdf0e10cSrcweir
352cdf0e10cSrcweir /*************************************************************************
353cdf0e10cSrcweir |*
354cdf0e10cSrcweir |* Daten der aktuellen View auf die FrameView uebertragen
355cdf0e10cSrcweir |*
356cdf0e10cSrcweir \************************************************************************/
357cdf0e10cSrcweir
WriteFrameViewData()358cdf0e10cSrcweir void DrawViewShell::WriteFrameViewData()
359cdf0e10cSrcweir {
360cdf0e10cSrcweir // Zeichen-(Bildschirm-)Attribute an FrameView merken
361cdf0e10cSrcweir mpFrameView->SetRuler( HasRuler() );
362cdf0e10cSrcweir mpFrameView->SetGridCoarse( mpDrawView->GetGridCoarse() );
363cdf0e10cSrcweir mpFrameView->SetGridFine( mpDrawView->GetGridFine() );
364cdf0e10cSrcweir mpFrameView->SetSnapGridWidth(mpDrawView->GetSnapGridWidthX(), mpDrawView->GetSnapGridWidthY());
365cdf0e10cSrcweir mpFrameView->SetGridVisible( mpDrawView->IsGridVisible() );
366cdf0e10cSrcweir mpFrameView->SetGridFront( mpDrawView->IsGridFront() );
367cdf0e10cSrcweir mpFrameView->SetSnapAngle( mpDrawView->GetSnapAngle() );
368cdf0e10cSrcweir mpFrameView->SetGridSnap( mpDrawView->IsGridSnap() );
369cdf0e10cSrcweir mpFrameView->SetBordSnap( mpDrawView->IsBordSnap() );
370cdf0e10cSrcweir mpFrameView->SetHlplSnap( mpDrawView->IsHlplSnap() );
371cdf0e10cSrcweir mpFrameView->SetOFrmSnap( mpDrawView->IsOFrmSnap() );
372cdf0e10cSrcweir mpFrameView->SetOPntSnap( mpDrawView->IsOPntSnap() );
373cdf0e10cSrcweir mpFrameView->SetOConSnap( mpDrawView->IsOConSnap() );
374cdf0e10cSrcweir mpFrameView->SetHlplVisible( mpDrawView->IsHlplVisible() );
375cdf0e10cSrcweir mpFrameView->SetDragStripes( mpDrawView->IsDragStripes() );
376cdf0e10cSrcweir mpFrameView->SetPlusHandlesAlwaysVisible( mpDrawView->IsPlusHandlesAlwaysVisible() );
377cdf0e10cSrcweir mpFrameView->SetFrameDragSingles( mpDrawView->IsFrameDragSingles() );
378cdf0e10cSrcweir mpFrameView->SetMarkedHitMovesAlways( mpDrawView->IsMarkedHitMovesAlways() );
379cdf0e10cSrcweir mpFrameView->SetMoveOnlyDragging( mpDrawView->IsMoveOnlyDragging() );
380cdf0e10cSrcweir mpFrameView->SetNoDragXorPolys( mpDrawView->IsNoDragXorPolys() );
381cdf0e10cSrcweir mpFrameView->SetCrookNoContortion( mpDrawView->IsCrookNoContortion() );
382cdf0e10cSrcweir mpFrameView->SetBigOrtho( mpDrawView->IsBigOrtho() );
383cdf0e10cSrcweir mpFrameView->SetEliminatePolyPointLimitAngle( mpDrawView->GetEliminatePolyPointLimitAngle() );
384cdf0e10cSrcweir mpFrameView->SetEliminatePolyPoints( mpDrawView->IsEliminatePolyPoints() );
385cdf0e10cSrcweir
386cdf0e10cSrcweir mpFrameView->SetSolidMarkHdl( mpDrawView->IsSolidMarkHdl() );
387cdf0e10cSrcweir mpFrameView->SetSolidDragging( mpDrawView->IsSolidDragging() );
388cdf0e10cSrcweir mpFrameView->SetQuickEdit( mpDrawView->IsQuickTextEditMode() );
389cdf0e10cSrcweir
390cdf0e10cSrcweir mpFrameView->SetDesignMode( mpDrawView->IsDesignMode() );
391cdf0e10cSrcweir
392cdf0e10cSrcweir Size aVisSizePixel = GetActiveWindow()->GetOutputSizePixel();
393cdf0e10cSrcweir Rectangle aVisArea = GetActiveWindow()->PixelToLogic( Rectangle( Point(0,0), aVisSizePixel) );
394cdf0e10cSrcweir mpFrameView->SetVisArea(aVisArea);
395cdf0e10cSrcweir
396cdf0e10cSrcweir if( mePageKind == PK_HANDOUT )
397cdf0e10cSrcweir mpFrameView->SetSelectedPage(0);
398cdf0e10cSrcweir else
399cdf0e10cSrcweir {
400cdf0e10cSrcweir mpFrameView->SetSelectedPage( maTabControl.GetCurPageId() - 1 );
401cdf0e10cSrcweir }
402cdf0e10cSrcweir
403cdf0e10cSrcweir mpFrameView->SetViewShEditMode(meEditMode, mePageKind);
404cdf0e10cSrcweir mpFrameView->SetLayerMode(IsLayerModeActive());
405cdf0e10cSrcweir
406cdf0e10cSrcweir SdrPageView* pPageView = mpDrawView->GetSdrPageView();
407cdf0e10cSrcweir
408cdf0e10cSrcweir if (pPageView)
409cdf0e10cSrcweir {
410cdf0e10cSrcweir if ( mpFrameView->GetVisibleLayers() != pPageView->GetVisibleLayers() )
411cdf0e10cSrcweir mpFrameView->SetVisibleLayers( pPageView->GetVisibleLayers() );
412cdf0e10cSrcweir
413cdf0e10cSrcweir if ( mpFrameView->GetPrintableLayers() != pPageView->GetPrintableLayers() )
414cdf0e10cSrcweir mpFrameView->SetPrintableLayers( pPageView->GetPrintableLayers() );
415cdf0e10cSrcweir
416cdf0e10cSrcweir if ( mpFrameView->GetLockedLayers() != pPageView->GetLockedLayers() )
417cdf0e10cSrcweir mpFrameView->SetLockedLayers( pPageView->GetLockedLayers() );
418cdf0e10cSrcweir
419cdf0e10cSrcweir if (mePageKind == PK_NOTES)
420cdf0e10cSrcweir {
421cdf0e10cSrcweir mpFrameView->SetNotesHelpLines( pPageView->GetHelpLines() );
422cdf0e10cSrcweir }
423cdf0e10cSrcweir else if (mePageKind == PK_HANDOUT)
424cdf0e10cSrcweir {
425cdf0e10cSrcweir mpFrameView->SetHandoutHelpLines( pPageView->GetHelpLines() );
426cdf0e10cSrcweir }
427cdf0e10cSrcweir else
428cdf0e10cSrcweir {
429cdf0e10cSrcweir mpFrameView->SetStandardHelpLines( pPageView->GetHelpLines() );
430cdf0e10cSrcweir }
431cdf0e10cSrcweir }
432cdf0e10cSrcweir
433cdf0e10cSrcweir if ( mpFrameView->GetActiveLayer() != mpDrawView->GetActiveLayer() )
434cdf0e10cSrcweir mpFrameView->SetActiveLayer( mpDrawView->GetActiveLayer() );
435cdf0e10cSrcweir
436cdf0e10cSrcweir // DrawMode fuer 'Normales' Fenster merken
437cdf0e10cSrcweir if(mpFrameView->GetDrawMode() != GetActiveWindow()->GetDrawMode())
438cdf0e10cSrcweir mpFrameView->SetDrawMode(GetActiveWindow()->GetDrawMode());
439cdf0e10cSrcweir }
440cdf0e10cSrcweir
441cdf0e10cSrcweir
442cdf0e10cSrcweir
443cdf0e10cSrcweir /*************************************************************************
444cdf0e10cSrcweir |*
445cdf0e10cSrcweir |* PrePaint-Method
446cdf0e10cSrcweir |*
447cdf0e10cSrcweir \************************************************************************/
448cdf0e10cSrcweir
PrePaint()449cdf0e10cSrcweir void DrawViewShell::PrePaint()
450cdf0e10cSrcweir {
451cdf0e10cSrcweir mpDrawView->PrePaint();
452cdf0e10cSrcweir }
453cdf0e10cSrcweir
454cdf0e10cSrcweir /*************************************************************************
455cdf0e10cSrcweir |*
456cdf0e10cSrcweir |* Paint-Methode: das Ereignis wird vom Fenster pWin an
457cdf0e10cSrcweir |* die Viewshell und die aktuelle Funktion weitergeleitet
458cdf0e10cSrcweir |*
459cdf0e10cSrcweir |* Anmerkung: pWin==NULL, wenn Paint() vom ShowWindow gerufen wird!
460cdf0e10cSrcweir |*
461cdf0e10cSrcweir \************************************************************************/
462cdf0e10cSrcweir
Paint(const Rectangle & rRect,::sd::Window * pWin)463cdf0e10cSrcweir void DrawViewShell::Paint(const Rectangle& rRect, ::sd::Window* pWin)
464cdf0e10cSrcweir {
465cdf0e10cSrcweir // #103834# Fill var FillColor here to have it available on later call
466cdf0e10cSrcweir svtools::ColorConfig aColorConfig;
467cdf0e10cSrcweir Color aFillColor;
468cdf0e10cSrcweir
469cdf0e10cSrcweir if(DOCUMENT_TYPE_IMPRESS == GetDoc()->GetDocumentType())
470cdf0e10cSrcweir {
471cdf0e10cSrcweir aFillColor = Color( aColorConfig.GetColorValue( svtools::APPBACKGROUND ).nColor );
472cdf0e10cSrcweir }
473cdf0e10cSrcweir else
474cdf0e10cSrcweir {
475cdf0e10cSrcweir aFillColor = Color( aColorConfig.GetColorValue( svtools::DOCCOLOR ).nColor );
476cdf0e10cSrcweir }
477cdf0e10cSrcweir
478cdf0e10cSrcweir /* #97517# This is done before each text edit, so why not do it before every paint.
479cdf0e10cSrcweir The default language is only used if the outliner only contains one
480cdf0e10cSrcweir character in a symbol font */
481cdf0e10cSrcweir GetDoc()->GetDrawOutliner( NULL ).SetDefaultLanguage( GetDoc()->GetLanguage( EE_CHAR_LANGUAGE ) );
482cdf0e10cSrcweir
483cdf0e10cSrcweir // #103834# Set Application Background color for usage in SdrPaintView(s)
484cdf0e10cSrcweir mpDrawView->SetApplicationBackgroundColor(aFillColor);
485cdf0e10cSrcweir
486cdf0e10cSrcweir /* #97517# This is done before each text edit, so why not do it before every paint.
487cdf0e10cSrcweir The default language is only used if the outliner only contains one
488cdf0e10cSrcweir character in a symbol font */
489cdf0e10cSrcweir GetDoc()->GetDrawOutliner( NULL ).SetDefaultLanguage( Application::GetSettings().GetLanguage() );
490cdf0e10cSrcweir
491cdf0e10cSrcweir mpDrawView->CompleteRedraw( pWin, Region( rRect ) );
492cdf0e10cSrcweir
493cdf0e10cSrcweir if( pWin )
494cdf0e10cSrcweir {
495cdf0e10cSrcweir if( GetDocSh()->GetDocShellFunction().is() )
496cdf0e10cSrcweir GetDocSh()->GetDocShellFunction()->Paint( rRect, pWin );
497cdf0e10cSrcweir
498cdf0e10cSrcweir if( HasCurrentFunction() )
499cdf0e10cSrcweir GetCurrentFunction()->Paint( rRect, pWin );
500cdf0e10cSrcweir }
501cdf0e10cSrcweir }
502cdf0e10cSrcweir
503cdf0e10cSrcweir /*************************************************************************
504cdf0e10cSrcweir |*
505cdf0e10cSrcweir |* Zoom-Faktor fuer InPlace einstellen
506cdf0e10cSrcweir |*
507cdf0e10cSrcweir \************************************************************************/
508cdf0e10cSrcweir
SetZoomFactor(const Fraction & rZoomX,const Fraction & rZoomY)509cdf0e10cSrcweir void DrawViewShell::SetZoomFactor(const Fraction& rZoomX, const Fraction& rZoomY)
510cdf0e10cSrcweir {
511cdf0e10cSrcweir ViewShell::SetZoomFactor(rZoomX, rZoomY);
512cdf0e10cSrcweir mbZoomOnPage = sal_False;
513cdf0e10cSrcweir Point aOrigin = GetActiveWindow()->GetViewOrigin();
514cdf0e10cSrcweir GetActiveWindow()->SetWinViewPos(aOrigin);
515cdf0e10cSrcweir }
516cdf0e10cSrcweir
517cdf0e10cSrcweir /*************************************************************************
518cdf0e10cSrcweir |*
519cdf0e10cSrcweir |* Optimale Groesse zurueckgeben
520cdf0e10cSrcweir |*
521cdf0e10cSrcweir \************************************************************************/
522cdf0e10cSrcweir
GetOptimalSizePixel() const523cdf0e10cSrcweir Size DrawViewShell::GetOptimalSizePixel() const
524cdf0e10cSrcweir {
525cdf0e10cSrcweir Size aSize;
526cdf0e10cSrcweir
527cdf0e10cSrcweir SdrPageView* pPV = mpDrawView->GetSdrPageView();
528cdf0e10cSrcweir if (pPV)
529cdf0e10cSrcweir {
530cdf0e10cSrcweir SdPage* pPage = (SdPage*) pPV->GetPage();
531cdf0e10cSrcweir
532cdf0e10cSrcweir if (pPage)
533cdf0e10cSrcweir {
534cdf0e10cSrcweir if (!mbZoomOnPage)
535cdf0e10cSrcweir {
536cdf0e10cSrcweir // Gegenwaertigen MapMode beruecksichtigen
537cdf0e10cSrcweir aSize = GetActiveWindow()->LogicToPixel( pPage->GetSize() );
538cdf0e10cSrcweir }
539cdf0e10cSrcweir else
540cdf0e10cSrcweir {
541cdf0e10cSrcweir // 1:1 Darstellung
542cdf0e10cSrcweir MapMode aMapMode(MAP_100TH_MM);
543cdf0e10cSrcweir aSize = GetActiveWindow()->LogicToPixel( pPage->GetSize(), aMapMode );
544cdf0e10cSrcweir const_cast< DrawViewShell* >(this)->mbZoomOnPage = sal_True;
545cdf0e10cSrcweir }
546cdf0e10cSrcweir }
547cdf0e10cSrcweir }
548cdf0e10cSrcweir
549cdf0e10cSrcweir return(aSize);
550cdf0e10cSrcweir }
551cdf0e10cSrcweir
552cdf0e10cSrcweir
553cdf0e10cSrcweir /*************************************************************************
554cdf0e10cSrcweir |*
555cdf0e10cSrcweir |* Seite wird gehided
556cdf0e10cSrcweir |*
557cdf0e10cSrcweir \************************************************************************/
558cdf0e10cSrcweir
HidePage()559cdf0e10cSrcweir void DrawViewShell::HidePage()
560cdf0e10cSrcweir {
561cdf0e10cSrcweir FmFormShell* pFormShell = GetViewShellBase().GetFormShellManager()->GetFormShell();
562cdf0e10cSrcweir if (pFormShell != NULL)
563cdf0e10cSrcweir pFormShell->PrepareClose (sal_False);
564cdf0e10cSrcweir }
565cdf0e10cSrcweir
566cdf0e10cSrcweir
567cdf0e10cSrcweir
WriteUserDataSequence(::com::sun::star::uno::Sequence<::com::sun::star::beans::PropertyValue> & rSequence,sal_Bool bBrowse)568cdf0e10cSrcweir void DrawViewShell::WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& rSequence, sal_Bool bBrowse )
569cdf0e10cSrcweir {
570cdf0e10cSrcweir WriteFrameViewData();
571cdf0e10cSrcweir
572cdf0e10cSrcweir ViewShell::WriteUserDataSequence( rSequence, bBrowse );
573cdf0e10cSrcweir
574cdf0e10cSrcweir const sal_Int32 nIndex = rSequence.getLength();
575cdf0e10cSrcweir rSequence.realloc( nIndex + 1 );
576cdf0e10cSrcweir rSequence[nIndex].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( sUNO_View_ZoomOnPage ) );
577cdf0e10cSrcweir rSequence[nIndex].Value <<= (sal_Bool)mbZoomOnPage;
578cdf0e10cSrcweir }
579cdf0e10cSrcweir
ReadUserDataSequence(const::com::sun::star::uno::Sequence<::com::sun::star::beans::PropertyValue> & rSequence,sal_Bool bBrowse)580cdf0e10cSrcweir void DrawViewShell::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& rSequence, sal_Bool bBrowse )
581cdf0e10cSrcweir {
582cdf0e10cSrcweir WriteFrameViewData();
583cdf0e10cSrcweir
584cdf0e10cSrcweir ViewShell::ReadUserDataSequence( rSequence, bBrowse );
585cdf0e10cSrcweir
586cdf0e10cSrcweir const sal_Int32 nLength = rSequence.getLength();
587cdf0e10cSrcweir const com::sun::star::beans::PropertyValue *pValue = rSequence.getConstArray();
588cdf0e10cSrcweir for (sal_Int16 i = 0 ; i < nLength; i++, pValue++ )
589cdf0e10cSrcweir {
590cdf0e10cSrcweir if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_ZoomOnPage ) ) )
591cdf0e10cSrcweir {
592cdf0e10cSrcweir sal_Bool bZoomPage = sal_False;
593cdf0e10cSrcweir if( pValue->Value >>= bZoomPage )
594cdf0e10cSrcweir {
595cdf0e10cSrcweir mbZoomOnPage = bZoomPage;
596cdf0e10cSrcweir }
597cdf0e10cSrcweir }
598cdf0e10cSrcweir }
599cdf0e10cSrcweir
600cdf0e10cSrcweir if( mpFrameView->GetPageKind() != mePageKind )
601cdf0e10cSrcweir {
602cdf0e10cSrcweir mePageKind = mpFrameView->GetPageKind();
603cdf0e10cSrcweir
604cdf0e10cSrcweir if (mePageKind == PK_NOTES)
605cdf0e10cSrcweir {
606cdf0e10cSrcweir SetHelpId( SID_NOTESMODE );
607cdf0e10cSrcweir GetActiveWindow()->SetHelpId( CMD_SID_NOTESMODE );
608cdf0e10cSrcweir GetActiveWindow()->SetUniqueId( CMD_SID_NOTESMODE );
609cdf0e10cSrcweir }
610cdf0e10cSrcweir else if (mePageKind == PK_HANDOUT)
611cdf0e10cSrcweir {
612cdf0e10cSrcweir SetHelpId( SID_HANDOUTMODE );
613cdf0e10cSrcweir GetActiveWindow()->SetHelpId( CMD_SID_HANDOUTMODE );
614cdf0e10cSrcweir GetActiveWindow()->SetUniqueId( CMD_SID_HANDOUTMODE );
615cdf0e10cSrcweir }
616cdf0e10cSrcweir else
617cdf0e10cSrcweir {
618cdf0e10cSrcweir SetHelpId( SD_IF_SDDRAWVIEWSHELL );
619cdf0e10cSrcweir GetActiveWindow()->SetHelpId( HID_SDDRAWVIEWSHELL );
620cdf0e10cSrcweir GetActiveWindow()->SetUniqueId( HID_SDDRAWVIEWSHELL );
621cdf0e10cSrcweir }
622cdf0e10cSrcweir }
623cdf0e10cSrcweir
624cdf0e10cSrcweir ReadFrameViewData( mpFrameView );
625cdf0e10cSrcweir
626cdf0e10cSrcweir if( !mbZoomOnPage )
627cdf0e10cSrcweir {
628cdf0e10cSrcweir const Rectangle aVisArea( mpFrameView->GetVisArea() );
629cdf0e10cSrcweir
630cdf0e10cSrcweir if ( GetDocSh()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED )
631cdf0e10cSrcweir {
632cdf0e10cSrcweir GetDocSh()->SetVisArea(aVisArea);
633cdf0e10cSrcweir }
634cdf0e10cSrcweir
635cdf0e10cSrcweir VisAreaChanged(aVisArea);
636cdf0e10cSrcweir
637cdf0e10cSrcweir ::sd::View* pView = GetView();
638cdf0e10cSrcweir
639cdf0e10cSrcweir if (pView)
640cdf0e10cSrcweir {
641cdf0e10cSrcweir pView->VisAreaChanged(GetActiveWindow());
642cdf0e10cSrcweir }
643cdf0e10cSrcweir
644cdf0e10cSrcweir SetZoomRect(aVisArea);
645cdf0e10cSrcweir }
646cdf0e10cSrcweir
647cdf0e10cSrcweir ChangeEditMode (meEditMode, ! IsLayerModeActive());
648cdf0e10cSrcweir ChangeEditMode (meEditMode, ! IsLayerModeActive());
649cdf0e10cSrcweir }
650cdf0e10cSrcweir
VisAreaChanged(const Rectangle & rRect)651cdf0e10cSrcweir void DrawViewShell::VisAreaChanged(const Rectangle& rRect)
652cdf0e10cSrcweir {
653cdf0e10cSrcweir ViewShell::VisAreaChanged( rRect );
654cdf0e10cSrcweir
655cdf0e10cSrcweir DrawController& rController = GetViewShellBase().GetDrawController();
656cdf0e10cSrcweir rController.FireVisAreaChanged (rRect);
657cdf0e10cSrcweir }
658cdf0e10cSrcweir
659cdf0e10cSrcweir
660cdf0e10cSrcweir
661cdf0e10cSrcweir
662cdf0e10cSrcweir /** If there is a valid controller then create a new instance of
663cdf0e10cSrcweir <type>AccessibleDrawDocumentView</type>. Otherwise delegate this call
664cdf0e10cSrcweir to the base class to return a default object (probably an empty
665cdf0e10cSrcweir reference).
666cdf0e10cSrcweir */
667cdf0e10cSrcweir ::com::sun::star::uno::Reference<
668cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessible>
CreateAccessibleDocumentView(::sd::Window * pWindow)669cdf0e10cSrcweir DrawViewShell::CreateAccessibleDocumentView (::sd::Window* pWindow)
670cdf0e10cSrcweir {
671cdf0e10cSrcweir if (GetViewShellBase().GetController() != NULL)
672cdf0e10cSrcweir {
673cdf0e10cSrcweir accessibility::AccessibleDrawDocumentView* pDocumentView =
674cdf0e10cSrcweir new accessibility::AccessibleDrawDocumentView (
675cdf0e10cSrcweir pWindow,
676cdf0e10cSrcweir this,
677cdf0e10cSrcweir GetViewShellBase().GetController(),
678cdf0e10cSrcweir pWindow->GetAccessibleParentWindow()->GetAccessible());
679cdf0e10cSrcweir pDocumentView->Init();
680cdf0e10cSrcweir return ::com::sun::star::uno::Reference<
681cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessible>
682cdf0e10cSrcweir (static_cast< ::com::sun::star::uno::XWeak*>(pDocumentView),
683cdf0e10cSrcweir ::com::sun::star::uno::UNO_QUERY);
684cdf0e10cSrcweir }
685cdf0e10cSrcweir else
686cdf0e10cSrcweir {
687cdf0e10cSrcweir OSL_TRACE ("DrawViewShell::CreateAccessibleDocumentView: no controller");
688cdf0e10cSrcweir return ViewShell::CreateAccessibleDocumentView (pWindow);
689cdf0e10cSrcweir }
690cdf0e10cSrcweir }
691cdf0e10cSrcweir
692cdf0e10cSrcweir
693cdf0e10cSrcweir
694cdf0e10cSrcweir
GetActiveTabLayerIndex(void) const695cdf0e10cSrcweir int DrawViewShell::GetActiveTabLayerIndex (void) const
696cdf0e10cSrcweir {
697cdf0e10cSrcweir const LayerTabBar* pBar
698cdf0e10cSrcweir = const_cast<DrawViewShell*>(this)->GetLayerTabControl ();
699cdf0e10cSrcweir if (pBar != NULL)
700cdf0e10cSrcweir return pBar->GetPagePos (pBar->GetCurPageId());
701cdf0e10cSrcweir else
702cdf0e10cSrcweir return -1;
703cdf0e10cSrcweir }
704cdf0e10cSrcweir
705cdf0e10cSrcweir
706cdf0e10cSrcweir
707cdf0e10cSrcweir
SetActiveTabLayerIndex(int nIndex)708cdf0e10cSrcweir void DrawViewShell::SetActiveTabLayerIndex (int nIndex)
709cdf0e10cSrcweir {
710cdf0e10cSrcweir LayerTabBar* pBar = GetLayerTabControl ();
711cdf0e10cSrcweir if (pBar != NULL)
712cdf0e10cSrcweir {
713cdf0e10cSrcweir // Ignore invalid indices silently.
714cdf0e10cSrcweir if (nIndex>=0 && nIndex<pBar->GetPageCount())
715cdf0e10cSrcweir {
716cdf0e10cSrcweir // Tell the draw view and the tab control of the new active layer.
717cdf0e10cSrcweir mpDrawView->SetActiveLayer (pBar->GetPageText (pBar->GetPageId ((sal_uInt16)nIndex)));
718cdf0e10cSrcweir pBar->SetCurPageId (pBar->GetPageId ((sal_uInt16)nIndex));
7190deba7fbSSteve Yin SdUnoDrawView* pUnoDrawView = new SdUnoDrawView (
7200deba7fbSSteve Yin GetViewShellBase().GetDrawController(),
7210deba7fbSSteve Yin *this,
7220deba7fbSSteve Yin *GetView());
7230deba7fbSSteve Yin ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XLayer> rLayer = pUnoDrawView->getActiveLayer();
7240deba7fbSSteve Yin GetViewShellBase().GetDrawController().fireChangeLayer( &rLayer );
7250deba7fbSSteve Yin delete pUnoDrawView;
726cdf0e10cSrcweir }
727cdf0e10cSrcweir }
728cdf0e10cSrcweir }
729cdf0e10cSrcweir
730cdf0e10cSrcweir
731cdf0e10cSrcweir
732cdf0e10cSrcweir
GetPageTabControl(void)733cdf0e10cSrcweir TabControl* DrawViewShell::GetPageTabControl (void)
734cdf0e10cSrcweir {
735cdf0e10cSrcweir return &maTabControl;
736cdf0e10cSrcweir }
737cdf0e10cSrcweir
738cdf0e10cSrcweir
739cdf0e10cSrcweir
740cdf0e10cSrcweir
GetLayerTabControl(void)741cdf0e10cSrcweir LayerTabBar* DrawViewShell::GetLayerTabControl (void)
742cdf0e10cSrcweir {
743cdf0e10cSrcweir return mpLayerTabBar.get();
744cdf0e10cSrcweir }
745cdf0e10cSrcweir
746cdf0e10cSrcweir
747cdf0e10cSrcweir
748cdf0e10cSrcweir
GetTabLayerCount(void) const749cdf0e10cSrcweir int DrawViewShell::GetTabLayerCount (void) const
750cdf0e10cSrcweir {
751cdf0e10cSrcweir const LayerTabBar* pBar
752cdf0e10cSrcweir = const_cast<DrawViewShell*>(this)->GetLayerTabControl ();
753cdf0e10cSrcweir if (pBar != NULL)
754cdf0e10cSrcweir return pBar->GetPageCount();
755cdf0e10cSrcweir else
756cdf0e10cSrcweir return 0;
757cdf0e10cSrcweir }
758cdf0e10cSrcweir
759cdf0e10cSrcweir
760cdf0e10cSrcweir } // end of namespace sd
761