xref: /AOO41X/main/sd/source/ui/view/frmview.cxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir 
28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
29*cdf0e10cSrcweir #include "precompiled_sd.hxx"
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #include "FrameView.hxx"
32*cdf0e10cSrcweir 
33*cdf0e10cSrcweir #ifndef _SVXIDS_HRC
34*cdf0e10cSrcweir #include <svx/svxids.hrc>
35*cdf0e10cSrcweir #endif
36*cdf0e10cSrcweir #include <com/sun/star/awt/Rectangle.hpp>
37*cdf0e10cSrcweir #include <com/sun/star/drawing/framework/ResourceId.hpp>
38*cdf0e10cSrcweir #include <rtl/ustrbuf.hxx>
39*cdf0e10cSrcweir #include "unokywds.hxx"
40*cdf0e10cSrcweir 
41*cdf0e10cSrcweir #include <vector>
42*cdf0e10cSrcweir #include "ViewShell.hxx"
43*cdf0e10cSrcweir #include "drawdoc.hxx"
44*cdf0e10cSrcweir #include "DrawDocShell.hxx"
45*cdf0e10cSrcweir #include "optsitem.hxx"
46*cdf0e10cSrcweir #include "ViewShellBase.hxx"
47*cdf0e10cSrcweir #include "DrawViewShell.hxx"
48*cdf0e10cSrcweir #include "OutlineViewShell.hxx"
49*cdf0e10cSrcweir #include "app.hxx"
50*cdf0e10cSrcweir #include "sdresid.hxx"
51*cdf0e10cSrcweir #include "pres.hxx"
52*cdf0e10cSrcweir #include "glob.hrc"
53*cdf0e10cSrcweir #include "sdiocmpt.hxx"
54*cdf0e10cSrcweir #include "framework/FrameworkHelper.hxx"
55*cdf0e10cSrcweir #include <comphelper/processfactory.hxx>
56*cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir using namespace ::com::sun::star;
59*cdf0e10cSrcweir using namespace ::com::sun::star::uno;
60*cdf0e10cSrcweir using namespace ::com::sun::star::beans;
61*cdf0e10cSrcweir using namespace ::std;
62*cdf0e10cSrcweir using ::rtl::OUString;
63*cdf0e10cSrcweir 
64*cdf0e10cSrcweir namespace sd {
65*cdf0e10cSrcweir 
66*cdf0e10cSrcweir /*************************************************************************
67*cdf0e10cSrcweir |*
68*cdf0e10cSrcweir |* Ctor
69*cdf0e10cSrcweir |*
70*cdf0e10cSrcweir \************************************************************************/
71*cdf0e10cSrcweir 
72*cdf0e10cSrcweir FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK */)
73*cdf0e10cSrcweir   : SdrView(pDrawDoc, (OutputDevice*) NULL),
74*cdf0e10cSrcweir     mnRefCount(0),
75*cdf0e10cSrcweir     mnPresViewShellId(SID_VIEWSHELL0),
76*cdf0e10cSrcweir     mnSlotId(SID_OBJECT_SELECT),
77*cdf0e10cSrcweir     mbIsNavigatorShowingAllShapes(false)
78*cdf0e10cSrcweir {
79*cdf0e10cSrcweir 	EndListening(*pDrawDoc);
80*cdf0e10cSrcweir 
81*cdf0e10cSrcweir 	EnableExtendedKeyInputDispatcher(sal_False);
82*cdf0e10cSrcweir 	EnableExtendedMouseEventDispatcher(sal_False);
83*cdf0e10cSrcweir 	EnableExtendedCommandEventDispatcher(sal_False);
84*cdf0e10cSrcweir 
85*cdf0e10cSrcweir 	SetGridFront( sal_False );
86*cdf0e10cSrcweir 	SetHlplFront( sal_False );
87*cdf0e10cSrcweir 	SetOConSnap( sal_False );
88*cdf0e10cSrcweir 	SetFrameDragSingles( sal_True );
89*cdf0e10cSrcweir 	SetSlidesPerRow(4);
90*cdf0e10cSrcweir 
91*cdf0e10cSrcweir 	if( NULL == pFrameView )
92*cdf0e10cSrcweir 	{
93*cdf0e10cSrcweir 		DrawDocShell* pDocShell = pDrawDoc->GetDocSh();
94*cdf0e10cSrcweir 
95*cdf0e10cSrcweir 		if ( pDocShell )
96*cdf0e10cSrcweir 		{
97*cdf0e10cSrcweir 			/**********************************************************************
98*cdf0e10cSrcweir 			* Das Dokument wurde geladen, ist eine FrameView vorhanden?
99*cdf0e10cSrcweir 			**********************************************************************/
100*cdf0e10cSrcweir 			sal_uLong nSdViewShellCount = 0;
101*cdf0e10cSrcweir 			ViewShellBase* pBase = NULL;
102*cdf0e10cSrcweir 			SfxViewShell* pSfxViewSh = NULL;
103*cdf0e10cSrcweir 			SfxViewFrame* pSfxViewFrame = SfxViewFrame::GetFirst(pDocShell);
104*cdf0e10cSrcweir 
105*cdf0e10cSrcweir 			while (pSfxViewFrame)
106*cdf0e10cSrcweir 			{
107*cdf0e10cSrcweir 				// Count the FrameViews and remember the type of the main
108*cdf0e10cSrcweir 				// view shell.
109*cdf0e10cSrcweir 				pSfxViewSh = pSfxViewFrame->GetViewShell();
110*cdf0e10cSrcweir 				pBase = PTR_CAST(ViewShellBase, pSfxViewSh );
111*cdf0e10cSrcweir 
112*cdf0e10cSrcweir 				if (pBase != NULL)
113*cdf0e10cSrcweir 				{
114*cdf0e10cSrcweir 					nSdViewShellCount++;
115*cdf0e10cSrcweir 
116*cdf0e10cSrcweir                     ::rtl::OUString sViewURL;
117*cdf0e10cSrcweir                     Reference<drawing::framework::XView> xView (
118*cdf0e10cSrcweir                         framework::FrameworkHelper::Instance(*pBase)->GetView(
119*cdf0e10cSrcweir                             drawing::framework::ResourceId::create(
120*cdf0e10cSrcweir                                 ::comphelper::getProcessComponentContext(),
121*cdf0e10cSrcweir                                 framework::FrameworkHelper::msCenterPaneURL)));
122*cdf0e10cSrcweir                     if (xView.is())
123*cdf0e10cSrcweir                         sViewURL = xView->getResourceId()->getResourceURL();
124*cdf0e10cSrcweir 
125*cdf0e10cSrcweir                     switch (framework::FrameworkHelper::GetViewId(sViewURL))
126*cdf0e10cSrcweir                     {
127*cdf0e10cSrcweir 						default:
128*cdf0e10cSrcweir //                        case ViewShell::ST_IMPRESS:
129*cdf0e10cSrcweir //	                      case ViewShell::ST_NOTES:
130*cdf0e10cSrcweir //                        case ViewShell::ST_HANDOUT:
131*cdf0e10cSrcweir                             mnPresViewShellId = SID_VIEWSHELL0;
132*cdf0e10cSrcweir                             break;
133*cdf0e10cSrcweir 
134*cdf0e10cSrcweir                         case ViewShell::ST_SLIDE_SORTER:
135*cdf0e10cSrcweir                             mnPresViewShellId = SID_VIEWSHELL1;
136*cdf0e10cSrcweir                             break;
137*cdf0e10cSrcweir 
138*cdf0e10cSrcweir                         case ViewShell::ST_OUTLINE:
139*cdf0e10cSrcweir                             mnPresViewShellId = SID_VIEWSHELL2;
140*cdf0e10cSrcweir                             break;
141*cdf0e10cSrcweir 					}
142*cdf0e10cSrcweir 				}
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir 				pSfxViewFrame = SfxViewFrame::GetNext(*pSfxViewFrame, pDocShell);
145*cdf0e10cSrcweir 			}
146*cdf0e10cSrcweir 
147*cdf0e10cSrcweir 			SdDrawDocument* pDoc = pDocShell->GetDoc();
148*cdf0e10cSrcweir 			pFrameView = pDoc->GetFrameView(nSdViewShellCount);
149*cdf0e10cSrcweir 		}
150*cdf0e10cSrcweir 	}
151*cdf0e10cSrcweir 
152*cdf0e10cSrcweir 	if (pFrameView)
153*cdf0e10cSrcweir 	{
154*cdf0e10cSrcweir 		/**********************************************************************
155*cdf0e10cSrcweir 		* FrameView mit der FrameView der DocShell initialisieren
156*cdf0e10cSrcweir 		**********************************************************************/
157*cdf0e10cSrcweir 		SetRuler( pFrameView->HasRuler() );
158*cdf0e10cSrcweir 		SetGridCoarse( pFrameView->GetGridCoarse() );
159*cdf0e10cSrcweir 		SetGridFine( pFrameView->GetGridFine() );
160*cdf0e10cSrcweir 		SetSnapGridWidth(pFrameView->GetSnapGridWidthX(), pFrameView->GetSnapGridWidthY());
161*cdf0e10cSrcweir 		SetGridVisible( pFrameView->IsGridVisible() );
162*cdf0e10cSrcweir 		SetGridFront( pFrameView->IsGridFront() );
163*cdf0e10cSrcweir 		SetSnapAngle( pFrameView->GetSnapAngle() );
164*cdf0e10cSrcweir 		SetGridSnap( pFrameView->IsGridSnap() );
165*cdf0e10cSrcweir 		SetBordSnap( pFrameView->IsBordSnap() );
166*cdf0e10cSrcweir 		SetHlplSnap( pFrameView->IsHlplSnap() );
167*cdf0e10cSrcweir 		SetOFrmSnap( pFrameView->IsOFrmSnap() );
168*cdf0e10cSrcweir 		SetOPntSnap( pFrameView->IsOPntSnap() );
169*cdf0e10cSrcweir 		SetOConSnap( pFrameView->IsOConSnap() );
170*cdf0e10cSrcweir 		SetHlplVisible( pFrameView->IsHlplVisible() );
171*cdf0e10cSrcweir 		SetDragStripes( pFrameView->IsDragStripes() );
172*cdf0e10cSrcweir 		SetPlusHandlesAlwaysVisible( pFrameView->IsPlusHandlesAlwaysVisible() );
173*cdf0e10cSrcweir 		SetFrameDragSingles( pFrameView->IsFrameDragSingles() );
174*cdf0e10cSrcweir 		SetSnapMagneticPixel( pFrameView->GetSnapMagneticPixel() );
175*cdf0e10cSrcweir 		SetMarkedHitMovesAlways( pFrameView->IsMarkedHitMovesAlways() );
176*cdf0e10cSrcweir 		SetMoveOnlyDragging( pFrameView->IsMoveOnlyDragging() );
177*cdf0e10cSrcweir 		SetCrookNoContortion( pFrameView->IsCrookNoContortion() );
178*cdf0e10cSrcweir 		SetSlantButShear( pFrameView->IsSlantButShear() );
179*cdf0e10cSrcweir 		SetNoDragXorPolys( pFrameView->IsNoDragXorPolys() );
180*cdf0e10cSrcweir 		SetAngleSnapEnabled( pFrameView->IsAngleSnapEnabled() );
181*cdf0e10cSrcweir 		SetBigOrtho( pFrameView->IsBigOrtho() );
182*cdf0e10cSrcweir 		SetOrtho( pFrameView->IsOrtho() );
183*cdf0e10cSrcweir 		SetEliminatePolyPointLimitAngle( pFrameView->GetEliminatePolyPointLimitAngle() );
184*cdf0e10cSrcweir 		SetEliminatePolyPoints( pFrameView->IsEliminatePolyPoints() );
185*cdf0e10cSrcweir // #110094#-7
186*cdf0e10cSrcweir //		SetMasterPagePaintCaching( pFrameView->IsMasterPagePaintCaching() );
187*cdf0e10cSrcweir 		SetDesignMode( pFrameView->IsDesignMode() );
188*cdf0e10cSrcweir 
189*cdf0e10cSrcweir 		SetSolidMarkHdl( pFrameView->IsSolidMarkHdl() );
190*cdf0e10cSrcweir 		SetSolidDragging( pFrameView->IsSolidDragging() );
191*cdf0e10cSrcweir 
192*cdf0e10cSrcweir 		maVisibleLayers = pFrameView->GetVisibleLayers();
193*cdf0e10cSrcweir 		maPrintableLayers = pFrameView->GetPrintableLayers();
194*cdf0e10cSrcweir 		maLockedLayers = pFrameView->GetLockedLayers();
195*cdf0e10cSrcweir 		maStandardHelpLines = pFrameView->GetStandardHelpLines();
196*cdf0e10cSrcweir 		maNotesHelpLines = pFrameView->GetNotesHelpLines();
197*cdf0e10cSrcweir 		maHandoutHelpLines = pFrameView->GetHandoutHelpLines();
198*cdf0e10cSrcweir 		SetActiveLayer( pFrameView->GetActiveLayer() );
199*cdf0e10cSrcweir 		mbNoColors = pFrameView->IsNoColors();
200*cdf0e10cSrcweir 		mbNoAttribs = pFrameView->IsNoAttribs() ;
201*cdf0e10cSrcweir 		maVisArea = pFrameView->GetVisArea();
202*cdf0e10cSrcweir 		mePageKind = pFrameView->GetPageKind();
203*cdf0e10cSrcweir 		mePageKindOnLoad = pFrameView->GetPageKindOnLoad();
204*cdf0e10cSrcweir 		mnSelectedPage = pFrameView->GetSelectedPage();
205*cdf0e10cSrcweir 		mnSelectedPageOnLoad = pFrameView->GetSelectedPageOnLoad();
206*cdf0e10cSrcweir 		meStandardEditMode = pFrameView->GetViewShEditMode(PK_STANDARD);
207*cdf0e10cSrcweir 		meNotesEditMode = pFrameView->GetViewShEditMode(PK_NOTES);
208*cdf0e10cSrcweir 		meHandoutEditMode = pFrameView->GetViewShEditMode(PK_HANDOUT);
209*cdf0e10cSrcweir 		SetViewShEditModeOnLoad(pFrameView->GetViewShEditModeOnLoad());
210*cdf0e10cSrcweir 		mbLayerMode = pFrameView->IsLayerMode();
211*cdf0e10cSrcweir 		mbQuickEdit = pFrameView->IsQuickEdit();
212*cdf0e10cSrcweir 
213*cdf0e10cSrcweir 		// #i26631#
214*cdf0e10cSrcweir 		SetMasterPagePaintCaching( pFrameView->IsMasterPagePaintCaching() );
215*cdf0e10cSrcweir 
216*cdf0e10cSrcweir 		SetDragWithCopy( pFrameView->IsDragWithCopy() );
217*cdf0e10cSrcweir 		mbBigHandles 		 = pFrameView->IsBigHandles();
218*cdf0e10cSrcweir 		mbDoubleClickTextEdit = pFrameView->IsDoubleClickTextEdit();
219*cdf0e10cSrcweir 		mbClickChangeRotation = pFrameView->IsClickChangeRotation();
220*cdf0e10cSrcweir 		mnSlidesPerRow = pFrameView->GetSlidesPerRow();
221*cdf0e10cSrcweir 		mnDrawMode = pFrameView->GetDrawMode();
222*cdf0e10cSrcweir 		mnTabCtrlPercent = pFrameView->GetTabCtrlPercent();
223*cdf0e10cSrcweir         mbIsNavigatorShowingAllShapes = pFrameView->IsNavigatorShowingAllShapes();
224*cdf0e10cSrcweir         SetPreviousViewShellType (pFrameView->GetPreviousViewShellType());
225*cdf0e10cSrcweir         SetViewShellTypeOnLoad (pFrameView->GetViewShellTypeOnLoad());
226*cdf0e10cSrcweir 	}
227*cdf0e10cSrcweir 	else
228*cdf0e10cSrcweir 	{
229*cdf0e10cSrcweir 		/**********************************************************************
230*cdf0e10cSrcweir 		* FrameView mit den Applikationsdaten initialisieren
231*cdf0e10cSrcweir 		**********************************************************************/
232*cdf0e10cSrcweir 		maVisibleLayers.SetAll();
233*cdf0e10cSrcweir 		maPrintableLayers.SetAll();
234*cdf0e10cSrcweir 		SetGridCoarse( Size( 1000, 1000 ) );
235*cdf0e10cSrcweir 		SetSnapGridWidth(Fraction(1000, 1), Fraction(1000, 1));
236*cdf0e10cSrcweir 		SetActiveLayer( String( SdResId(STR_LAYER_LAYOUT) ) );
237*cdf0e10cSrcweir 		mbNoColors = sal_True;
238*cdf0e10cSrcweir 		mbNoAttribs = sal_False;
239*cdf0e10cSrcweir 		maVisArea = Rectangle( Point(), Size(0, 0) );
240*cdf0e10cSrcweir 		mePageKind = PK_STANDARD;
241*cdf0e10cSrcweir 		mePageKindOnLoad = PK_STANDARD;
242*cdf0e10cSrcweir 		mnSelectedPage = 0;
243*cdf0e10cSrcweir 		mnSelectedPageOnLoad = 0;
244*cdf0e10cSrcweir 		meStandardEditMode = EM_PAGE;
245*cdf0e10cSrcweir 		meNotesEditMode = EM_PAGE;
246*cdf0e10cSrcweir 		meHandoutEditMode = EM_MASTERPAGE;
247*cdf0e10cSrcweir         SetViewShEditModeOnLoad(EM_PAGE);
248*cdf0e10cSrcweir 		mbLayerMode = sal_False;
249*cdf0e10cSrcweir 		SetEliminatePolyPoints(sal_False);
250*cdf0e10cSrcweir 		mbBigHandles = sal_False;
251*cdf0e10cSrcweir 		mbDoubleClickTextEdit = sal_False;
252*cdf0e10cSrcweir 		mbClickChangeRotation = sal_False;
253*cdf0e10cSrcweir 		mnSlidesPerRow = 4;
254*cdf0e10cSrcweir 
255*cdf0e10cSrcweir 		{
256*cdf0e10cSrcweir 			bool bUseContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode();
257*cdf0e10cSrcweir 			mnDrawMode = bUseContrast ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR;
258*cdf0e10cSrcweir 		}
259*cdf0e10cSrcweir 		mnTabCtrlPercent = 0.0;
260*cdf0e10cSrcweir         mbIsNavigatorShowingAllShapes = false;
261*cdf0e10cSrcweir         SetPreviousViewShellType (ViewShell::ST_NONE);
262*cdf0e10cSrcweir         SetViewShellTypeOnLoad (ViewShell::ST_IMPRESS);
263*cdf0e10cSrcweir 
264*cdf0e10cSrcweir 		// get default for design mode
265*cdf0e10cSrcweir 		sal_Bool bInitDesignMode = pDrawDoc->GetOpenInDesignMode();
266*cdf0e10cSrcweir 		if( pDrawDoc->OpenInDesignModeIsDefaulted() )
267*cdf0e10cSrcweir 		{
268*cdf0e10cSrcweir 			bInitDesignMode = sal_True;
269*cdf0e10cSrcweir 		}
270*cdf0e10cSrcweir 
271*cdf0e10cSrcweir 		SfxObjectShell* pObjShell = pDrawDoc->GetObjectShell();
272*cdf0e10cSrcweir 		if( pObjShell && pObjShell->IsReadOnly() )
273*cdf0e10cSrcweir 			bInitDesignMode = sal_False;
274*cdf0e10cSrcweir 		SetDesignMode( bInitDesignMode );
275*cdf0e10cSrcweir 
276*cdf0e10cSrcweir 		Update( SD_MOD()->GetSdOptions(pDrawDoc->GetDocumentType()) );
277*cdf0e10cSrcweir 	}
278*cdf0e10cSrcweir 
279*cdf0e10cSrcweir }
280*cdf0e10cSrcweir 
281*cdf0e10cSrcweir /*************************************************************************
282*cdf0e10cSrcweir |*
283*cdf0e10cSrcweir |* Dtor
284*cdf0e10cSrcweir |*
285*cdf0e10cSrcweir \************************************************************************/
286*cdf0e10cSrcweir 
287*cdf0e10cSrcweir FrameView::~FrameView()
288*cdf0e10cSrcweir {
289*cdf0e10cSrcweir }
290*cdf0e10cSrcweir 
291*cdf0e10cSrcweir 
292*cdf0e10cSrcweir /*************************************************************************
293*cdf0e10cSrcweir |*
294*cdf0e10cSrcweir |* Verbindung herstellen
295*cdf0e10cSrcweir |*
296*cdf0e10cSrcweir \************************************************************************/
297*cdf0e10cSrcweir 
298*cdf0e10cSrcweir void FrameView::Connect()
299*cdf0e10cSrcweir {
300*cdf0e10cSrcweir 	mnRefCount++;
301*cdf0e10cSrcweir }
302*cdf0e10cSrcweir 
303*cdf0e10cSrcweir 
304*cdf0e10cSrcweir /*************************************************************************
305*cdf0e10cSrcweir |*
306*cdf0e10cSrcweir |* Verbindung loesen
307*cdf0e10cSrcweir |*
308*cdf0e10cSrcweir \************************************************************************/
309*cdf0e10cSrcweir 
310*cdf0e10cSrcweir void FrameView::Disconnect()
311*cdf0e10cSrcweir {
312*cdf0e10cSrcweir 	if (mnRefCount > 0)
313*cdf0e10cSrcweir 	{
314*cdf0e10cSrcweir 		mnRefCount--;
315*cdf0e10cSrcweir 	}
316*cdf0e10cSrcweir 
317*cdf0e10cSrcweir 	if (mnRefCount == 0)
318*cdf0e10cSrcweir 	{
319*cdf0e10cSrcweir 		delete this;
320*cdf0e10cSrcweir 	}
321*cdf0e10cSrcweir }
322*cdf0e10cSrcweir 
323*cdf0e10cSrcweir /*************************************************************************
324*cdf0e10cSrcweir |*
325*cdf0e10cSrcweir |* Update mit Daten der SdOptions
326*cdf0e10cSrcweir |*
327*cdf0e10cSrcweir \************************************************************************/
328*cdf0e10cSrcweir 
329*cdf0e10cSrcweir void FrameView::Update(SdOptions* pOptions)
330*cdf0e10cSrcweir {
331*cdf0e10cSrcweir 	if (pOptions)
332*cdf0e10cSrcweir 	{
333*cdf0e10cSrcweir 		mbRuler = pOptions->IsRulerVisible();
334*cdf0e10cSrcweir 		SetGridVisible( pOptions->IsGridVisible() );
335*cdf0e10cSrcweir 		SetSnapAngle( pOptions->GetAngle() );
336*cdf0e10cSrcweir 		SetGridSnap( pOptions->IsUseGridSnap() );
337*cdf0e10cSrcweir 		SetBordSnap( pOptions->IsSnapBorder()  );
338*cdf0e10cSrcweir 		SetHlplSnap( pOptions->IsSnapHelplines() );
339*cdf0e10cSrcweir 		SetOFrmSnap( pOptions->IsSnapFrame() );
340*cdf0e10cSrcweir 		SetOPntSnap( pOptions->IsSnapPoints() );
341*cdf0e10cSrcweir 		SetHlplVisible( pOptions->IsHelplines() );
342*cdf0e10cSrcweir 		SetDragStripes( pOptions->IsDragStripes() );
343*cdf0e10cSrcweir 		SetPlusHandlesAlwaysVisible( pOptions->IsHandlesBezier() );
344*cdf0e10cSrcweir 		SetSnapMagneticPixel( pOptions->GetSnapArea() );
345*cdf0e10cSrcweir 		SetMarkedHitMovesAlways( pOptions->IsMarkedHitMovesAlways() );
346*cdf0e10cSrcweir 		SetMoveOnlyDragging( pOptions->IsMoveOnlyDragging() );
347*cdf0e10cSrcweir 		SetSlantButShear( pOptions->IsMoveOnlyDragging() );
348*cdf0e10cSrcweir 		SetNoDragXorPolys ( !pOptions->IsMoveOutline() );
349*cdf0e10cSrcweir 		SetCrookNoContortion( pOptions->IsCrookNoContortion() );
350*cdf0e10cSrcweir 		SetAngleSnapEnabled( pOptions->IsRotate() );
351*cdf0e10cSrcweir 		SetBigOrtho( pOptions->IsBigOrtho() );
352*cdf0e10cSrcweir 		SetOrtho( pOptions->IsOrtho() );
353*cdf0e10cSrcweir 		SetEliminatePolyPointLimitAngle( pOptions->GetEliminatePolyPointLimitAngle() );
354*cdf0e10cSrcweir // #110094#-7
355*cdf0e10cSrcweir //		SetMasterPagePaintCaching( pOptions->IsMasterPagePaintCaching() );
356*cdf0e10cSrcweir 		GetModel()->SetPickThroughTransparentTextFrames( pOptions->IsPickThrough() );
357*cdf0e10cSrcweir 
358*cdf0e10cSrcweir 		SetSolidMarkHdl( pOptions->IsSolidMarkHdl() );
359*cdf0e10cSrcweir 		SetSolidDragging( pOptions->IsSolidDragging() );
360*cdf0e10cSrcweir 
361*cdf0e10cSrcweir 		SetGridCoarse( Size( pOptions->GetFldDrawX(), pOptions->GetFldDrawY() ) );
362*cdf0e10cSrcweir 		SetGridFine( Size( pOptions->GetFldDivisionX(), pOptions->GetFldDivisionY() ) );
363*cdf0e10cSrcweir 		Fraction aFractX(pOptions->GetFldDrawX(), pOptions->GetFldDrawX() / ( pOptions->GetFldDivisionX() ? pOptions->GetFldDivisionX() : 1 ));
364*cdf0e10cSrcweir 		Fraction aFractY(pOptions->GetFldDrawY(), pOptions->GetFldDrawY() / ( pOptions->GetFldDivisionY() ? pOptions->GetFldDivisionY() : 1 ));
365*cdf0e10cSrcweir 		SetSnapGridWidth(aFractX, aFractY);
366*cdf0e10cSrcweir 		SetQuickEdit(pOptions->IsQuickEdit());
367*cdf0e10cSrcweir 
368*cdf0e10cSrcweir 		// #i26631#
369*cdf0e10cSrcweir 		SetMasterPagePaintCaching( pOptions->IsMasterPagePaintCaching() );
370*cdf0e10cSrcweir 
371*cdf0e10cSrcweir 		SetDragWithCopy(pOptions->IsDragWithCopy());
372*cdf0e10cSrcweir 		SetBigHandles( pOptions->IsBigHandles() );
373*cdf0e10cSrcweir 		SetDoubleClickTextEdit( pOptions->IsDoubleClickTextEdit() );
374*cdf0e10cSrcweir 		SetClickChangeRotation( pOptions->IsClickChangeRotation() );
375*cdf0e10cSrcweir 	}
376*cdf0e10cSrcweir }
377*cdf0e10cSrcweir 
378*cdf0e10cSrcweir 
379*cdf0e10cSrcweir /*************************************************************************
380*cdf0e10cSrcweir |*
381*cdf0e10cSrcweir |* EditMode (Page oder MasterPage) des Arbeitsmodus setzen
382*cdf0e10cSrcweir |*
383*cdf0e10cSrcweir \************************************************************************/
384*cdf0e10cSrcweir 
385*cdf0e10cSrcweir void FrameView::SetViewShEditMode(EditMode eMode, PageKind eKind)
386*cdf0e10cSrcweir {
387*cdf0e10cSrcweir 	if (eKind == PK_STANDARD)
388*cdf0e10cSrcweir 	{
389*cdf0e10cSrcweir 		meStandardEditMode = eMode;
390*cdf0e10cSrcweir 	}
391*cdf0e10cSrcweir 	else if (eKind == PK_NOTES)
392*cdf0e10cSrcweir 	{
393*cdf0e10cSrcweir 		meNotesEditMode = eMode;
394*cdf0e10cSrcweir 	}
395*cdf0e10cSrcweir 	else if (eKind == PK_HANDOUT)
396*cdf0e10cSrcweir 	{
397*cdf0e10cSrcweir 		meHandoutEditMode = eMode;
398*cdf0e10cSrcweir 	}
399*cdf0e10cSrcweir }
400*cdf0e10cSrcweir 
401*cdf0e10cSrcweir 
402*cdf0e10cSrcweir /*************************************************************************
403*cdf0e10cSrcweir |*
404*cdf0e10cSrcweir |* EditMode (Page oder MasterPage) des Arbeitsmodus zurueckgeben
405*cdf0e10cSrcweir |*
406*cdf0e10cSrcweir \************************************************************************/
407*cdf0e10cSrcweir 
408*cdf0e10cSrcweir EditMode FrameView::GetViewShEditMode(PageKind eKind)
409*cdf0e10cSrcweir {
410*cdf0e10cSrcweir 	EditMode eMode = EM_PAGE;
411*cdf0e10cSrcweir 
412*cdf0e10cSrcweir 	if (eKind == PK_STANDARD)
413*cdf0e10cSrcweir 	{
414*cdf0e10cSrcweir 		eMode = meStandardEditMode;
415*cdf0e10cSrcweir 	}
416*cdf0e10cSrcweir 	else if (eKind == PK_NOTES)
417*cdf0e10cSrcweir 	{
418*cdf0e10cSrcweir 		eMode = meNotesEditMode;
419*cdf0e10cSrcweir 	}
420*cdf0e10cSrcweir 	else if (eKind == PK_HANDOUT)
421*cdf0e10cSrcweir 	{
422*cdf0e10cSrcweir 		eMode = meHandoutEditMode;
423*cdf0e10cSrcweir 	}
424*cdf0e10cSrcweir 
425*cdf0e10cSrcweir 	return (eMode);
426*cdf0e10cSrcweir }
427*cdf0e10cSrcweir 
428*cdf0e10cSrcweir 
429*cdf0e10cSrcweir 
430*cdf0e10cSrcweir 
431*cdf0e10cSrcweir void FrameView::SetViewShEditModeOnLoad (EditMode eMode)
432*cdf0e10cSrcweir {
433*cdf0e10cSrcweir     meEditModeOnLoad = eMode;
434*cdf0e10cSrcweir }
435*cdf0e10cSrcweir 
436*cdf0e10cSrcweir 
437*cdf0e10cSrcweir 
438*cdf0e10cSrcweir 
439*cdf0e10cSrcweir EditMode FrameView::GetViewShEditModeOnLoad (void) const
440*cdf0e10cSrcweir {
441*cdf0e10cSrcweir     return meEditModeOnLoad;
442*cdf0e10cSrcweir }
443*cdf0e10cSrcweir 
444*cdf0e10cSrcweir 
445*cdf0e10cSrcweir 
446*cdf0e10cSrcweir 
447*cdf0e10cSrcweir static OUString createHelpLinesString( const SdrHelpLineList& rHelpLines )
448*cdf0e10cSrcweir {
449*cdf0e10cSrcweir 	::rtl::OUStringBuffer aLines;
450*cdf0e10cSrcweir 
451*cdf0e10cSrcweir 	const sal_uInt16 nCount = rHelpLines.GetCount();
452*cdf0e10cSrcweir 	for( sal_uInt16 nHlpLine = 0; nHlpLine < nCount; nHlpLine++ )
453*cdf0e10cSrcweir 	{
454*cdf0e10cSrcweir 		const SdrHelpLine& rHelpLine = rHelpLines[nHlpLine];
455*cdf0e10cSrcweir 		const Point& rPos = rHelpLine.GetPos();
456*cdf0e10cSrcweir 
457*cdf0e10cSrcweir 		switch( rHelpLine.GetKind() )
458*cdf0e10cSrcweir 		{
459*cdf0e10cSrcweir 			case SDRHELPLINE_POINT:
460*cdf0e10cSrcweir 				aLines.append( (sal_Unicode)'P' );
461*cdf0e10cSrcweir 				aLines.append( (sal_Int32)rPos.X() );
462*cdf0e10cSrcweir 				aLines.append( (sal_Unicode)',' );
463*cdf0e10cSrcweir 				aLines.append( (sal_Int32)rPos.Y() );
464*cdf0e10cSrcweir 				break;
465*cdf0e10cSrcweir 			case SDRHELPLINE_VERTICAL:
466*cdf0e10cSrcweir 				aLines.append( (sal_Unicode)'V' );
467*cdf0e10cSrcweir 				aLines.append( (sal_Int32)rPos.X() );
468*cdf0e10cSrcweir 				break;
469*cdf0e10cSrcweir 			case SDRHELPLINE_HORIZONTAL:
470*cdf0e10cSrcweir 				aLines.append( (sal_Unicode)'H' );
471*cdf0e10cSrcweir 				aLines.append( (sal_Int32)rPos.Y() );
472*cdf0e10cSrcweir 				break;
473*cdf0e10cSrcweir 			default:
474*cdf0e10cSrcweir 				DBG_ERROR( "Unsupported helpline Kind!" );
475*cdf0e10cSrcweir 		}
476*cdf0e10cSrcweir 	}
477*cdf0e10cSrcweir 
478*cdf0e10cSrcweir 	return aLines.makeStringAndClear();
479*cdf0e10cSrcweir }
480*cdf0e10cSrcweir 
481*cdf0e10cSrcweir #define addValue( n, v ) push_back( std::pair< OUString, Any >( OUString( RTL_CONSTASCII_USTRINGPARAM( n ) ), v ) )
482*cdf0e10cSrcweir void FrameView::WriteUserDataSequence ( ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& rValues, sal_Bool )
483*cdf0e10cSrcweir {
484*cdf0e10cSrcweir 	std::vector< std::pair< OUString, Any > > aUserData;
485*cdf0e10cSrcweir 
486*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_GridIsVisible, makeAny( (sal_Bool)IsGridVisible() ) );
487*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_GridIsFront, makeAny( (sal_Bool)IsGridFront() ) );
488*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_IsSnapToGrid, makeAny( (sal_Bool)IsGridSnap() ) );
489*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_IsSnapToPageMargins, makeAny( (sal_Bool)IsBordSnap() ) );
490*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_IsSnapToSnapLines, makeAny( (sal_Bool)IsHlplSnap() ) );
491*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_IsSnapToObjectFrame, makeAny( (sal_Bool)IsOFrmSnap() ) );
492*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_IsSnapToObjectPoints, makeAny( (sal_Bool)IsOPntSnap() ) );
493*cdf0e10cSrcweir 
494*cdf0e10cSrcweir //	pValue->Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( sUNO_View_IsSnapLinesVisible ) );
495*cdf0e10cSrcweir //	pValue->Value <<= (sal_Bool)IsHlplVisible();
496*cdf0e10cSrcweir //  pValue++;nIndex++;
497*cdf0e10cSrcweir 
498*cdf0e10cSrcweir //	pValue->Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( sUNO_View_IsDragStripes ) );
499*cdf0e10cSrcweir //	pValue->Value <<= (sal_Bool)IsDragStripes();
500*cdf0e10cSrcweir //  pValue++;nIndex++;
501*cdf0e10cSrcweir 
502*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_IsPlusHandlesAlwaysVisible, makeAny( (sal_Bool)IsPlusHandlesAlwaysVisible() ) );
503*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_IsFrameDragSingles, makeAny( (sal_Bool)IsFrameDragSingles() ) );
504*cdf0e10cSrcweir 
505*cdf0e10cSrcweir //	pValue->Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( sUNO_View_IsMarkedHitMovesAlways ) );
506*cdf0e10cSrcweir //	pValue->Value <<= (sal_Bool)IsMarkedHitMovesAlways();
507*cdf0e10cSrcweir //  pValue++;nIndex++;
508*cdf0e10cSrcweir 
509*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_EliminatePolyPointLimitAngle, makeAny( (sal_Int32)GetEliminatePolyPointLimitAngle() ) );
510*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_IsEliminatePolyPoints, makeAny( (sal_Bool)IsEliminatePolyPoints() ) );
511*cdf0e10cSrcweir 
512*cdf0e10cSrcweir //	pValue->Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( sUNO_View_IsLineDraft ) );
513*cdf0e10cSrcweir //	pValue->Value <<= (sal_Bool)IsLineDraft();
514*cdf0e10cSrcweir //  pValue++;nIndex++;
515*cdf0e10cSrcweir 
516*cdf0e10cSrcweir //	pValue->Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( sUNO_View_IsFillDraft ) );
517*cdf0e10cSrcweir //	pValue->Value <<= (sal_Bool)IsFillDraft();
518*cdf0e10cSrcweir //  pValue++;nIndex++;
519*cdf0e10cSrcweir 
520*cdf0e10cSrcweir //	pValue->Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( sUNO_View_IsTextDraft ) );
521*cdf0e10cSrcweir //	pValue->Value <<= (sal_Bool)IsTextDraft();
522*cdf0e10cSrcweir //  pValue++;nIndex++;
523*cdf0e10cSrcweir 
524*cdf0e10cSrcweir //	pValue->Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( sUNO_View_IsGrafDraft ) );
525*cdf0e10cSrcweir //	pValue->Value <<= (sal_Bool)IsGrafDraft();
526*cdf0e10cSrcweir //  pValue++;nIndex++;
527*cdf0e10cSrcweir 
528*cdf0e10cSrcweir 	Any aAny;
529*cdf0e10cSrcweir 	GetVisibleLayers().QueryValue( aAny );
530*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_VisibleLayers, aAny );
531*cdf0e10cSrcweir 
532*cdf0e10cSrcweir 	GetPrintableLayers().QueryValue( aAny );
533*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_PrintableLayers, aAny );
534*cdf0e10cSrcweir 
535*cdf0e10cSrcweir 	GetLockedLayers().QueryValue( aAny );
536*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_LockedLayers, aAny );
537*cdf0e10cSrcweir 
538*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_NoAttribs, makeAny( (sal_Bool)IsNoAttribs() ) );
539*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_NoColors, makeAny( (sal_Bool)IsNoColors() ) );
540*cdf0e10cSrcweir 
541*cdf0e10cSrcweir 	if( GetStandardHelpLines().GetCount() )
542*cdf0e10cSrcweir 		aUserData.addValue( sUNO_View_SnapLinesDrawing, makeAny( createHelpLinesString( GetStandardHelpLines() ) ) );
543*cdf0e10cSrcweir 
544*cdf0e10cSrcweir 	if( GetNotesHelpLines().GetCount() )
545*cdf0e10cSrcweir 		aUserData.addValue( sUNO_View_SnapLinesNotes, makeAny( createHelpLinesString( GetNotesHelpLines() ) ) );
546*cdf0e10cSrcweir 
547*cdf0e10cSrcweir 	if( GetHandoutHelpLines().GetCount() )
548*cdf0e10cSrcweir 		aUserData.addValue( sUNO_View_SnapLinesHandout, makeAny( createHelpLinesString( GetHandoutHelpLines() ) ) );
549*cdf0e10cSrcweir 
550*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_RulerIsVisible, makeAny( (sal_Bool)HasRuler() ) );
551*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_PageKind, makeAny( (sal_Int16)GetPageKind() ) );
552*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_SelectedPage, makeAny( (sal_Int16)GetSelectedPage() ) );
553*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_IsLayerMode, makeAny( (sal_Bool)IsLayerMode() ) );
554*cdf0e10cSrcweir 
555*cdf0e10cSrcweir //	pValue->Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( sUNO_View_IsQuickEdit ) );
556*cdf0e10cSrcweir //	pValue->Value <<= (sal_Bool)IsQuickEdit();
557*cdf0e10cSrcweir //  pValue++;nIndex++;
558*cdf0e10cSrcweir 
559*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_IsBigHandles, makeAny( (sal_Bool)IsBigHandles() ) );
560*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_IsDoubleClickTextEdit,  makeAny( (sal_Bool)IsDoubleClickTextEdit() ) );
561*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_IsClickChangeRotation, makeAny( (sal_Bool)IsClickChangeRotation() ) );
562*cdf0e10cSrcweir 
563*cdf0e10cSrcweir //	pValue->Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( sUNO_View_IsDragWithCopy ) );
564*cdf0e10cSrcweir //	pValue->Value <<= (sal_Bool)IsDragWithCopy();
565*cdf0e10cSrcweir //  pValue++;nIndex++;
566*cdf0e10cSrcweir 
567*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_SlidesPerRow, makeAny( (sal_Int16)GetSlidesPerRow() ) );
568*cdf0e10cSrcweir /* #107128# Product managment decided to not make this persistent
569*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_DrawMode, makeAny( (sal_Int32)GetDrawMode() ) );
570*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_PreviewDrawMode, makeAny( (sal_Int32)GetPreviewDrawMode() ) );
571*cdf0e10cSrcweir */
572*cdf0e10cSrcweir     aUserData.addValue( sUNO_View_EditModeStandard, makeAny( (sal_Int32)GetViewShEditMode( PK_STANDARD ) ) );
573*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_EditModeNotes, makeAny( (sal_Int32)GetViewShEditMode( PK_NOTES ) ) );
574*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_EditModeHandout, makeAny( (sal_Int32)GetViewShEditMode( PK_HANDOUT ) ) );
575*cdf0e10cSrcweir 
576*cdf0e10cSrcweir 	{
577*cdf0e10cSrcweir 		const Rectangle aVisArea = GetVisArea();
578*cdf0e10cSrcweir 
579*cdf0e10cSrcweir 		aUserData.addValue( sUNO_View_VisibleAreaTop, makeAny( (sal_Int32)aVisArea.Top() ) );
580*cdf0e10cSrcweir 		aUserData.addValue( sUNO_View_VisibleAreaLeft, makeAny( (sal_Int32)aVisArea.Left() ) );
581*cdf0e10cSrcweir 		aUserData.addValue( sUNO_View_VisibleAreaWidth, makeAny( (sal_Int32)aVisArea.GetWidth() ) );
582*cdf0e10cSrcweir 		aUserData.addValue( sUNO_View_VisibleAreaHeight, makeAny( (sal_Int32)aVisArea.GetHeight() ) );
583*cdf0e10cSrcweir 	}
584*cdf0e10cSrcweir 
585*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_GridCoarseWidth, makeAny( (sal_Int32)GetGridCoarse().Width() ) );
586*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_GridCoarseHeight, makeAny( (sal_Int32)GetGridCoarse().Height() ) );
587*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_GridFineWidth, makeAny( (sal_Int32)GetGridFine().Width() ) );
588*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_GridFineHeight, makeAny( (sal_Int32)GetGridFine().Height() ) );
589*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_GridSnapWidthXNumerator, makeAny( (sal_Int32)GetSnapGridWidthX().GetNumerator() ) );
590*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_GridSnapWidthXDenominator, makeAny( (sal_Int32)GetSnapGridWidthX().GetDenominator() ) );
591*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_GridSnapWidthYNumerator, makeAny( (sal_Int32)GetSnapGridWidthY().GetNumerator() ) );
592*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_GridSnapWidthYDenominator, makeAny( (sal_Int32)GetSnapGridWidthY().GetDenominator() ) );
593*cdf0e10cSrcweir 	aUserData.addValue( sUNO_View_IsAngleSnapEnabled, makeAny( (sal_Bool)IsAngleSnapEnabled() ) );
594*cdf0e10cSrcweir     aUserData.addValue( sUNO_View_SnapAngle, makeAny( (sal_Int32)GetSnapAngle() ) );
595*cdf0e10cSrcweir 
596*cdf0e10cSrcweir 	const sal_Int32 nOldLength = rValues.getLength();
597*cdf0e10cSrcweir 	rValues.realloc( nOldLength + aUserData.size() );
598*cdf0e10cSrcweir 
599*cdf0e10cSrcweir 	PropertyValue* pValue = &(rValues.getArray()[nOldLength]);
600*cdf0e10cSrcweir 
601*cdf0e10cSrcweir 	std::vector< std::pair< OUString, Any > >::iterator aIter( aUserData.begin() );
602*cdf0e10cSrcweir 	for( ; aIter != aUserData.end(); aIter++, pValue++ )
603*cdf0e10cSrcweir 	{
604*cdf0e10cSrcweir 		pValue->Name = (*aIter).first;
605*cdf0e10cSrcweir 		pValue->Value = (*aIter).second;
606*cdf0e10cSrcweir 	}
607*cdf0e10cSrcweir }
608*cdf0e10cSrcweir #undef addValue
609*cdf0e10cSrcweir 
610*cdf0e10cSrcweir static void createHelpLinesFromString( const rtl::OUString& rLines, SdrHelpLineList& rHelpLines )
611*cdf0e10cSrcweir {
612*cdf0e10cSrcweir 	const sal_Unicode * pStr = rLines.getStr();
613*cdf0e10cSrcweir 	SdrHelpLine aNewHelpLine;
614*cdf0e10cSrcweir 	rtl::OUStringBuffer sBuffer;
615*cdf0e10cSrcweir 
616*cdf0e10cSrcweir 	while( *pStr )
617*cdf0e10cSrcweir 	{
618*cdf0e10cSrcweir 		Point aPoint;
619*cdf0e10cSrcweir 
620*cdf0e10cSrcweir 		switch( *pStr )
621*cdf0e10cSrcweir 		{
622*cdf0e10cSrcweir 		case (sal_Unicode)'P':
623*cdf0e10cSrcweir 			aNewHelpLine.SetKind( SDRHELPLINE_POINT );
624*cdf0e10cSrcweir 			break;
625*cdf0e10cSrcweir 		case (sal_Unicode)'V':
626*cdf0e10cSrcweir 			aNewHelpLine.SetKind( SDRHELPLINE_VERTICAL );
627*cdf0e10cSrcweir 			break;
628*cdf0e10cSrcweir 		case (sal_Unicode)'H':
629*cdf0e10cSrcweir 			aNewHelpLine.SetKind( SDRHELPLINE_HORIZONTAL );
630*cdf0e10cSrcweir 			break;
631*cdf0e10cSrcweir 		default:
632*cdf0e10cSrcweir 			DBG_ERROR( "syntax error in snap lines settings string" );
633*cdf0e10cSrcweir 			return;
634*cdf0e10cSrcweir 		}
635*cdf0e10cSrcweir 
636*cdf0e10cSrcweir 		pStr++;
637*cdf0e10cSrcweir 
638*cdf0e10cSrcweir 		while( (*pStr >= sal_Unicode('0') && *pStr <= sal_Unicode('9')) || (*pStr == '+') || (*pStr == '-') )
639*cdf0e10cSrcweir 		{
640*cdf0e10cSrcweir 			sBuffer.append( *pStr++ );
641*cdf0e10cSrcweir 		}
642*cdf0e10cSrcweir 
643*cdf0e10cSrcweir 		sal_Int32 nValue = sBuffer.makeStringAndClear().toInt32();
644*cdf0e10cSrcweir 
645*cdf0e10cSrcweir 		if( aNewHelpLine.GetKind() == SDRHELPLINE_HORIZONTAL )
646*cdf0e10cSrcweir 		{
647*cdf0e10cSrcweir 			aPoint.Y() = nValue;
648*cdf0e10cSrcweir 		}
649*cdf0e10cSrcweir 		else
650*cdf0e10cSrcweir 		{
651*cdf0e10cSrcweir 			aPoint.X() = nValue;
652*cdf0e10cSrcweir 
653*cdf0e10cSrcweir 			if( aNewHelpLine.GetKind() == SDRHELPLINE_POINT )
654*cdf0e10cSrcweir 			{
655*cdf0e10cSrcweir 				if( *pStr++ != ',' )
656*cdf0e10cSrcweir 					return;
657*cdf0e10cSrcweir 
658*cdf0e10cSrcweir 				while( (*pStr >= sal_Unicode('0') && *pStr <= sal_Unicode('9')) || (*pStr == '+') || (*pStr == '-')  )
659*cdf0e10cSrcweir 				{
660*cdf0e10cSrcweir 					sBuffer.append( *pStr++ );
661*cdf0e10cSrcweir 				}
662*cdf0e10cSrcweir 
663*cdf0e10cSrcweir 				aPoint.Y() = sBuffer.makeStringAndClear().toInt32();
664*cdf0e10cSrcweir 
665*cdf0e10cSrcweir 			}
666*cdf0e10cSrcweir 		}
667*cdf0e10cSrcweir 
668*cdf0e10cSrcweir 		aNewHelpLine.SetPos( aPoint );
669*cdf0e10cSrcweir 		rHelpLines.Insert( aNewHelpLine );
670*cdf0e10cSrcweir 	}
671*cdf0e10cSrcweir }
672*cdf0e10cSrcweir 
673*cdf0e10cSrcweir void FrameView::ReadUserDataSequence ( const ::com::sun::star::uno::Sequence < ::com::sun::star::beans::PropertyValue >& rSequence, sal_Bool )
674*cdf0e10cSrcweir {
675*cdf0e10cSrcweir 	const sal_Int32 nLength = rSequence.getLength();
676*cdf0e10cSrcweir     if (nLength)
677*cdf0e10cSrcweir     {
678*cdf0e10cSrcweir 		const bool bImpress = dynamic_cast< SdDrawDocument* >(GetModel())->GetDocumentType() == DOCUMENT_TYPE_IMPRESS;
679*cdf0e10cSrcweir 
680*cdf0e10cSrcweir 		sal_Bool bBool = sal_False;
681*cdf0e10cSrcweir 		sal_Int32 nInt32 = 0;
682*cdf0e10cSrcweir 		sal_Int16 nInt16 = 0;
683*cdf0e10cSrcweir 		rtl::OUString aString;
684*cdf0e10cSrcweir 
685*cdf0e10cSrcweir 		sal_Int32 aSnapGridWidthXNum = GetSnapGridWidthX().GetNumerator();
686*cdf0e10cSrcweir 		sal_Int32 aSnapGridWidthXDom = GetSnapGridWidthX().GetDenominator();
687*cdf0e10cSrcweir 
688*cdf0e10cSrcweir 		sal_Int32 aSnapGridWidthYNum = GetSnapGridWidthY().GetNumerator();
689*cdf0e10cSrcweir 		sal_Int32 aSnapGridWidthYDom = GetSnapGridWidthY().GetDenominator();
690*cdf0e10cSrcweir 
691*cdf0e10cSrcweir         EditMode eStandardEditMode;
692*cdf0e10cSrcweir         EditMode eNotesEditMode;
693*cdf0e10cSrcweir         EditMode eHandoutEditMode;
694*cdf0e10cSrcweir 
695*cdf0e10cSrcweir         const com::sun::star::beans::PropertyValue *pValue = rSequence.getConstArray();
696*cdf0e10cSrcweir         for (sal_Int16 i = 0 ; i < nLength; i++, pValue++ )
697*cdf0e10cSrcweir         {
698*cdf0e10cSrcweir             if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_ViewId ) ) )
699*cdf0e10cSrcweir             {
700*cdf0e10cSrcweir             }
701*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_SnapLinesDrawing ) ) )
702*cdf0e10cSrcweir 			{
703*cdf0e10cSrcweir 				if( pValue->Value >>= aString )
704*cdf0e10cSrcweir 				{
705*cdf0e10cSrcweir 					SdrHelpLineList aHelpLines;
706*cdf0e10cSrcweir 					createHelpLinesFromString( aString, aHelpLines );
707*cdf0e10cSrcweir 					SetStandardHelpLines( aHelpLines );
708*cdf0e10cSrcweir 				}
709*cdf0e10cSrcweir 			}
710*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_SnapLinesNotes ) ) )
711*cdf0e10cSrcweir 			{
712*cdf0e10cSrcweir 				if( pValue->Value >>= aString )
713*cdf0e10cSrcweir 				{
714*cdf0e10cSrcweir 					SdrHelpLineList aHelpLines;
715*cdf0e10cSrcweir 					createHelpLinesFromString( aString, aHelpLines );
716*cdf0e10cSrcweir 					SetNotesHelpLines( aHelpLines );
717*cdf0e10cSrcweir 				}
718*cdf0e10cSrcweir 			}
719*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_SnapLinesHandout ) ) )
720*cdf0e10cSrcweir 			{
721*cdf0e10cSrcweir 				if( pValue->Value >>= aString )
722*cdf0e10cSrcweir 				{
723*cdf0e10cSrcweir 					SdrHelpLineList aHelpLines;
724*cdf0e10cSrcweir 					createHelpLinesFromString( aString, aHelpLines );
725*cdf0e10cSrcweir 					SetHandoutHelpLines( aHelpLines );
726*cdf0e10cSrcweir 				}
727*cdf0e10cSrcweir 			}
728*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_RulerIsVisible ) ) )
729*cdf0e10cSrcweir 			{
730*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
731*cdf0e10cSrcweir 				{
732*cdf0e10cSrcweir 					SetRuler( bBool );
733*cdf0e10cSrcweir 				}
734*cdf0e10cSrcweir 			}
735*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_PageKind ) ) )
736*cdf0e10cSrcweir 			{
737*cdf0e10cSrcweir 				if( pValue->Value >>= nInt16 )
738*cdf0e10cSrcweir 				{
739*cdf0e10cSrcweir 					SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
740*cdf0e10cSrcweir 					if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
741*cdf0e10cSrcweir                         SetPageKind( (PageKind)nInt16 );
742*cdf0e10cSrcweir 
743*cdf0e10cSrcweir 					SetPageKindOnLoad( (PageKind)nInt16 );
744*cdf0e10cSrcweir 				}
745*cdf0e10cSrcweir 			}
746*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_SelectedPage ) ) )
747*cdf0e10cSrcweir 			{
748*cdf0e10cSrcweir 				if( pValue->Value >>= nInt16 )
749*cdf0e10cSrcweir 				{
750*cdf0e10cSrcweir 					SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
751*cdf0e10cSrcweir 					if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
752*cdf0e10cSrcweir 						SetSelectedPage( (sal_uInt16)nInt16 );
753*cdf0e10cSrcweir 
754*cdf0e10cSrcweir 					SetSelectedPageOnLoad( (sal_uInt16)nInt16 );
755*cdf0e10cSrcweir 				}
756*cdf0e10cSrcweir 			}
757*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsLayerMode ) ) )
758*cdf0e10cSrcweir 			{
759*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
760*cdf0e10cSrcweir 				{
761*cdf0e10cSrcweir 					SetLayerMode( bBool );
762*cdf0e10cSrcweir 				}
763*cdf0e10cSrcweir 			}
764*cdf0e10cSrcweir /*			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsQuickEdit ) ) )
765*cdf0e10cSrcweir 			{
766*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
767*cdf0e10cSrcweir 				{
768*cdf0e10cSrcweir 					SetQuickEdit( bBool );
769*cdf0e10cSrcweir 				}
770*cdf0e10cSrcweir 			}
771*cdf0e10cSrcweir */			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsBigHandles ) ) )
772*cdf0e10cSrcweir 			{
773*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
774*cdf0e10cSrcweir 				{
775*cdf0e10cSrcweir 					SetBigHandles( bBool );
776*cdf0e10cSrcweir 				}
777*cdf0e10cSrcweir 			}
778*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsDoubleClickTextEdit ) ) )
779*cdf0e10cSrcweir 			{
780*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
781*cdf0e10cSrcweir 				{
782*cdf0e10cSrcweir 					SetDoubleClickTextEdit( bBool );
783*cdf0e10cSrcweir 				}
784*cdf0e10cSrcweir 			}
785*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsClickChangeRotation ) ) )
786*cdf0e10cSrcweir 			{
787*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
788*cdf0e10cSrcweir 				{
789*cdf0e10cSrcweir 					SetClickChangeRotation( bBool );
790*cdf0e10cSrcweir 				}
791*cdf0e10cSrcweir 			}
792*cdf0e10cSrcweir /*			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsDragWithCopy ) ) )
793*cdf0e10cSrcweir 			{
794*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
795*cdf0e10cSrcweir 				{
796*cdf0e10cSrcweir 					SetDragWithCopy( bBool );
797*cdf0e10cSrcweir 				}
798*cdf0e10cSrcweir 			}
799*cdf0e10cSrcweir */			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_SlidesPerRow ) ) )
800*cdf0e10cSrcweir 			{
801*cdf0e10cSrcweir 				if( pValue->Value >>= nInt16 )
802*cdf0e10cSrcweir 				{
803*cdf0e10cSrcweir 					SetSlidesPerRow( (sal_uInt16)nInt16 );
804*cdf0e10cSrcweir 				}
805*cdf0e10cSrcweir 			}
806*cdf0e10cSrcweir /* #107128# Product managment decided to not make this persistent
807*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_DrawMode ) ) )
808*cdf0e10cSrcweir 			{
809*cdf0e10cSrcweir 				if( pValue->Value >>= nInt32 )
810*cdf0e10cSrcweir 				{
811*cdf0e10cSrcweir 					const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
812*cdf0e10cSrcweir 					if( rStyleSettings.GetHighContrastMode() )
813*cdf0e10cSrcweir 						continue;
814*cdf0e10cSrcweir 					SetDrawMode( (sal_uLong)nInt32 );
815*cdf0e10cSrcweir 				}
816*cdf0e10cSrcweir 			}
817*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_PreviewDrawMode ) ) )
818*cdf0e10cSrcweir 			{
819*cdf0e10cSrcweir 				if( pValue->Value >>= nInt32 )
820*cdf0e10cSrcweir 				{
821*cdf0e10cSrcweir 					const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings();
822*cdf0e10cSrcweir 					SvtAccessibilityOptions aAccOptions;
823*cdf0e10cSrcweir 					if( rStyleSettings.GetHighContrastMode() && aAccOptions.GetIsForPagePreviews() )
824*cdf0e10cSrcweir 						continue;
825*cdf0e10cSrcweir 					SetPreviewDrawMode( (sal_uLong)nInt32 );
826*cdf0e10cSrcweir 				}
827*cdf0e10cSrcweir 			}
828*cdf0e10cSrcweir */
829*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_EditModeStandard ) ) )
830*cdf0e10cSrcweir 			{
831*cdf0e10cSrcweir 				if( pValue->Value >>= nInt32 )
832*cdf0e10cSrcweir 				{
833*cdf0e10cSrcweir 					SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
834*cdf0e10cSrcweir 					if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
835*cdf0e10cSrcweir                         SetViewShEditMode( (EditMode)nInt32, PK_STANDARD );
836*cdf0e10cSrcweir 					eStandardEditMode = (EditMode)nInt32;
837*cdf0e10cSrcweir 				}
838*cdf0e10cSrcweir 			}
839*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_EditModeNotes ) ) )
840*cdf0e10cSrcweir 			{
841*cdf0e10cSrcweir 				if( pValue->Value >>= nInt32 )
842*cdf0e10cSrcweir 				{
843*cdf0e10cSrcweir 					SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
844*cdf0e10cSrcweir 					if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
845*cdf0e10cSrcweir                         SetViewShEditMode( (EditMode)nInt32, PK_NOTES );
846*cdf0e10cSrcweir 					eNotesEditMode = (EditMode)nInt32;
847*cdf0e10cSrcweir 				}
848*cdf0e10cSrcweir 			}
849*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_EditModeHandout ) ) )
850*cdf0e10cSrcweir 			{
851*cdf0e10cSrcweir 				if( pValue->Value >>= nInt32 )
852*cdf0e10cSrcweir 				{
853*cdf0e10cSrcweir 					SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( GetModel() );
854*cdf0e10cSrcweir 					if( pDoc && pDoc->GetDocSh() && ( SFX_CREATE_MODE_EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
855*cdf0e10cSrcweir                         SetViewShEditMode( (EditMode)nInt32, PK_HANDOUT );
856*cdf0e10cSrcweir 					eHandoutEditMode = (EditMode)nInt32;
857*cdf0e10cSrcweir 				}
858*cdf0e10cSrcweir 			}
859*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_VisibleAreaTop ) ) )
860*cdf0e10cSrcweir 			{
861*cdf0e10cSrcweir 				sal_Int32 nTop = 0;
862*cdf0e10cSrcweir 				if( pValue->Value >>= nTop )
863*cdf0e10cSrcweir 				{
864*cdf0e10cSrcweir 					Rectangle aVisArea( GetVisArea() );
865*cdf0e10cSrcweir 					aVisArea.nBottom += nTop - aVisArea.nTop;
866*cdf0e10cSrcweir 					aVisArea.nTop = nTop;
867*cdf0e10cSrcweir 					SetVisArea( aVisArea );
868*cdf0e10cSrcweir 				}
869*cdf0e10cSrcweir 			}
870*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_VisibleAreaLeft ) ) )
871*cdf0e10cSrcweir 			{
872*cdf0e10cSrcweir 				sal_Int32 nLeft = 0;
873*cdf0e10cSrcweir 				if( pValue->Value >>= nLeft )
874*cdf0e10cSrcweir 				{
875*cdf0e10cSrcweir 					Rectangle aVisArea( GetVisArea() );
876*cdf0e10cSrcweir 					aVisArea.nRight += nLeft - aVisArea.nLeft;
877*cdf0e10cSrcweir 					aVisArea.nLeft = nLeft;
878*cdf0e10cSrcweir 					SetVisArea( aVisArea );
879*cdf0e10cSrcweir 				}
880*cdf0e10cSrcweir 			}
881*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_VisibleAreaWidth ) ) )
882*cdf0e10cSrcweir 			{
883*cdf0e10cSrcweir 				sal_Int32 nWidth = 0;
884*cdf0e10cSrcweir 				if( pValue->Value >>= nWidth )
885*cdf0e10cSrcweir 				{
886*cdf0e10cSrcweir 					Rectangle aVisArea( GetVisArea() );
887*cdf0e10cSrcweir 					aVisArea.nRight = aVisArea.nLeft + nWidth - 1;
888*cdf0e10cSrcweir 					SetVisArea( aVisArea );
889*cdf0e10cSrcweir 				}
890*cdf0e10cSrcweir 			}
891*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_VisibleAreaHeight ) ) )
892*cdf0e10cSrcweir 			{
893*cdf0e10cSrcweir 				sal_Int32 nHeight = 0;
894*cdf0e10cSrcweir 				if( pValue->Value >>= nHeight )
895*cdf0e10cSrcweir 				{
896*cdf0e10cSrcweir 					Rectangle aVisArea( GetVisArea() );
897*cdf0e10cSrcweir 					aVisArea.nBottom = nHeight + aVisArea.nTop - 1;
898*cdf0e10cSrcweir 					SetVisArea( aVisArea );
899*cdf0e10cSrcweir 				}
900*cdf0e10cSrcweir 			}
901*cdf0e10cSrcweir 
902*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_GridIsVisible ) ) )
903*cdf0e10cSrcweir 			{
904*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
905*cdf0e10cSrcweir 				{
906*cdf0e10cSrcweir 					SetGridVisible( bBool );
907*cdf0e10cSrcweir 				}
908*cdf0e10cSrcweir 			}
909*cdf0e10cSrcweir 
910*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsSnapToGrid ) ) )
911*cdf0e10cSrcweir 			{
912*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
913*cdf0e10cSrcweir 				{
914*cdf0e10cSrcweir 					SetGridSnap( bBool );
915*cdf0e10cSrcweir 				}
916*cdf0e10cSrcweir 			}
917*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_GridIsFront ) ) )
918*cdf0e10cSrcweir 			{
919*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
920*cdf0e10cSrcweir 				{
921*cdf0e10cSrcweir 					SetGridFront( bBool );
922*cdf0e10cSrcweir 				}
923*cdf0e10cSrcweir 			}
924*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsSnapToPageMargins ) ) )
925*cdf0e10cSrcweir 			{
926*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
927*cdf0e10cSrcweir 				{
928*cdf0e10cSrcweir 					SetBordSnap( bBool );
929*cdf0e10cSrcweir 				}
930*cdf0e10cSrcweir 			}
931*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsSnapToSnapLines ) ) )
932*cdf0e10cSrcweir 			{
933*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
934*cdf0e10cSrcweir 				{
935*cdf0e10cSrcweir 					SetHlplSnap( bBool );
936*cdf0e10cSrcweir 				}
937*cdf0e10cSrcweir 			}
938*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsSnapToObjectFrame ) ) )
939*cdf0e10cSrcweir 			{
940*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
941*cdf0e10cSrcweir 				{
942*cdf0e10cSrcweir 					SetOFrmSnap( bBool );
943*cdf0e10cSrcweir 				}
944*cdf0e10cSrcweir 			}
945*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsSnapToObjectPoints ) ) )
946*cdf0e10cSrcweir 			{
947*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
948*cdf0e10cSrcweir 				{
949*cdf0e10cSrcweir 					SetOPntSnap( bBool );
950*cdf0e10cSrcweir 				}
951*cdf0e10cSrcweir 			}
952*cdf0e10cSrcweir /*			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsSnapLinesVisible ) ) )
953*cdf0e10cSrcweir 			{
954*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
955*cdf0e10cSrcweir 				{
956*cdf0e10cSrcweir 					SetHlplVisible( bBool );
957*cdf0e10cSrcweir 				}
958*cdf0e10cSrcweir 			}
959*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsDragStripes ) ) )
960*cdf0e10cSrcweir 			{
961*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
962*cdf0e10cSrcweir 				{
963*cdf0e10cSrcweir 					SetDragStripes( bBool );
964*cdf0e10cSrcweir 				}
965*cdf0e10cSrcweir 			}
966*cdf0e10cSrcweir */			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsPlusHandlesAlwaysVisible ) ) )
967*cdf0e10cSrcweir 			{
968*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
969*cdf0e10cSrcweir 				{
970*cdf0e10cSrcweir 					SetPlusHandlesAlwaysVisible( bBool );
971*cdf0e10cSrcweir 				}
972*cdf0e10cSrcweir 			}
973*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsFrameDragSingles ) ) )
974*cdf0e10cSrcweir 			{
975*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
976*cdf0e10cSrcweir 				{
977*cdf0e10cSrcweir 					SetFrameDragSingles( bBool );
978*cdf0e10cSrcweir 				}
979*cdf0e10cSrcweir 			}
980*cdf0e10cSrcweir /*			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsMarkedHitMovesAlways ) ) )
981*cdf0e10cSrcweir 			{
982*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
983*cdf0e10cSrcweir 				{
984*cdf0e10cSrcweir 					SetMarkedHitMovesAlways( bBool );
985*cdf0e10cSrcweir 				}
986*cdf0e10cSrcweir 			}
987*cdf0e10cSrcweir */			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_EliminatePolyPointLimitAngle ) ) )
988*cdf0e10cSrcweir 			{
989*cdf0e10cSrcweir 				if( pValue->Value >>= nInt32 )
990*cdf0e10cSrcweir 				{
991*cdf0e10cSrcweir 					SetEliminatePolyPointLimitAngle( nInt32 );
992*cdf0e10cSrcweir 				}
993*cdf0e10cSrcweir 			}
994*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsEliminatePolyPoints ) ) )
995*cdf0e10cSrcweir 			{
996*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
997*cdf0e10cSrcweir 				{
998*cdf0e10cSrcweir 					SetEliminatePolyPoints( bBool );
999*cdf0e10cSrcweir 				}
1000*cdf0e10cSrcweir 			}
1001*cdf0e10cSrcweir /*
1002*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsLineDraft ) ) )
1003*cdf0e10cSrcweir 			{
1004*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
1005*cdf0e10cSrcweir 				{
1006*cdf0e10cSrcweir 					SetLineDraft( bBool );
1007*cdf0e10cSrcweir 				}
1008*cdf0e10cSrcweir 			}
1009*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsFillDraft ) ) )
1010*cdf0e10cSrcweir 			{
1011*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
1012*cdf0e10cSrcweir 				{
1013*cdf0e10cSrcweir 					SetFillDraft( bBool );
1014*cdf0e10cSrcweir 				}
1015*cdf0e10cSrcweir 			}
1016*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsTextDraft ) ) )
1017*cdf0e10cSrcweir 			{
1018*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
1019*cdf0e10cSrcweir 				{
1020*cdf0e10cSrcweir 					SetTextDraft( bBool );
1021*cdf0e10cSrcweir 				}
1022*cdf0e10cSrcweir 			}
1023*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsGrafDraft ) ) )
1024*cdf0e10cSrcweir 			{
1025*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
1026*cdf0e10cSrcweir 				{
1027*cdf0e10cSrcweir 					SetGrafDraft( bBool );
1028*cdf0e10cSrcweir 				}
1029*cdf0e10cSrcweir 			}
1030*cdf0e10cSrcweir */
1031*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_ActiveLayer ) ) )
1032*cdf0e10cSrcweir 			{
1033*cdf0e10cSrcweir 				if( pValue->Value >>= aString )
1034*cdf0e10cSrcweir 				{
1035*cdf0e10cSrcweir 					SetActiveLayer( aString );
1036*cdf0e10cSrcweir 				}
1037*cdf0e10cSrcweir 			}
1038*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_NoAttribs ) ) )
1039*cdf0e10cSrcweir 			{
1040*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
1041*cdf0e10cSrcweir 				{
1042*cdf0e10cSrcweir 					SetNoAttribs( bBool );
1043*cdf0e10cSrcweir 				}
1044*cdf0e10cSrcweir 			}
1045*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_NoColors ) ) )
1046*cdf0e10cSrcweir 			{
1047*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
1048*cdf0e10cSrcweir 				{
1049*cdf0e10cSrcweir 					SetNoColors( bBool );
1050*cdf0e10cSrcweir 				}
1051*cdf0e10cSrcweir 			}
1052*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_GridCoarseWidth ) ) )
1053*cdf0e10cSrcweir 			{
1054*cdf0e10cSrcweir 				if( pValue->Value >>= nInt32 )
1055*cdf0e10cSrcweir 				{
1056*cdf0e10cSrcweir 					const Size aCoarse( nInt32, GetGridCoarse().Height() );
1057*cdf0e10cSrcweir 					SetGridCoarse( aCoarse );
1058*cdf0e10cSrcweir 				}
1059*cdf0e10cSrcweir 			}
1060*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_GridCoarseHeight ) ) )
1061*cdf0e10cSrcweir 			{
1062*cdf0e10cSrcweir 				if( pValue->Value >>= nInt32 )
1063*cdf0e10cSrcweir 				{
1064*cdf0e10cSrcweir 					const Size aCoarse( GetGridCoarse().Width(), nInt32 );
1065*cdf0e10cSrcweir 					SetGridCoarse( aCoarse );
1066*cdf0e10cSrcweir 				}
1067*cdf0e10cSrcweir 			}
1068*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_GridFineWidth ) ) )
1069*cdf0e10cSrcweir 			{
1070*cdf0e10cSrcweir 				if( pValue->Value >>= nInt32 )
1071*cdf0e10cSrcweir 				{
1072*cdf0e10cSrcweir 					const Size aCoarse( nInt32, GetGridFine().Height() );
1073*cdf0e10cSrcweir 					SetGridFine( aCoarse );
1074*cdf0e10cSrcweir 				}
1075*cdf0e10cSrcweir 			}
1076*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_GridFineHeight ) ) )
1077*cdf0e10cSrcweir 			{
1078*cdf0e10cSrcweir 				if( pValue->Value >>= nInt32 )
1079*cdf0e10cSrcweir 				{
1080*cdf0e10cSrcweir 					const Size aCoarse( GetGridFine().Width(), nInt32 );
1081*cdf0e10cSrcweir 					SetGridFine( aCoarse );
1082*cdf0e10cSrcweir 				}
1083*cdf0e10cSrcweir 			}
1084*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_IsAngleSnapEnabled ) ) )
1085*cdf0e10cSrcweir 			{
1086*cdf0e10cSrcweir 				if( pValue->Value >>= bBool )
1087*cdf0e10cSrcweir 				{
1088*cdf0e10cSrcweir 					SetAngleSnapEnabled( bBool );
1089*cdf0e10cSrcweir 				}
1090*cdf0e10cSrcweir 			}
1091*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_SnapAngle ) ) )
1092*cdf0e10cSrcweir 			{
1093*cdf0e10cSrcweir 				if( pValue->Value >>= nInt32 )
1094*cdf0e10cSrcweir 				{
1095*cdf0e10cSrcweir 					SetSnapAngle( nInt32 );
1096*cdf0e10cSrcweir 				}
1097*cdf0e10cSrcweir 			}
1098*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_GridSnapWidthXNumerator ) ) )
1099*cdf0e10cSrcweir 			{
1100*cdf0e10cSrcweir 				pValue->Value >>= aSnapGridWidthXNum;
1101*cdf0e10cSrcweir 			}
1102*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_GridSnapWidthXDenominator ) ) )
1103*cdf0e10cSrcweir 			{
1104*cdf0e10cSrcweir 				pValue->Value >>= aSnapGridWidthXDom;
1105*cdf0e10cSrcweir 			}
1106*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_GridSnapWidthYNumerator ) ) )
1107*cdf0e10cSrcweir 			{
1108*cdf0e10cSrcweir 				pValue->Value >>= aSnapGridWidthYNum;
1109*cdf0e10cSrcweir 			}
1110*cdf0e10cSrcweir 			else if (pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_GridSnapWidthYDenominator ) ) )
1111*cdf0e10cSrcweir 			{
1112*cdf0e10cSrcweir 				pValue->Value >>= aSnapGridWidthYDom;
1113*cdf0e10cSrcweir 			}
1114*cdf0e10cSrcweir 			else if (!bImpress && pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_VisibleLayers ) ) )
1115*cdf0e10cSrcweir 			{
1116*cdf0e10cSrcweir 				SetOfByte aSetOfBytes;
1117*cdf0e10cSrcweir 				aSetOfBytes.PutValue( pValue->Value );
1118*cdf0e10cSrcweir 				SetVisibleLayers( aSetOfBytes );
1119*cdf0e10cSrcweir 			}
1120*cdf0e10cSrcweir 			else if (!bImpress && pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_PrintableLayers ) ) )
1121*cdf0e10cSrcweir 			{
1122*cdf0e10cSrcweir 				SetOfByte aSetOfBytes;
1123*cdf0e10cSrcweir 				aSetOfBytes.PutValue( pValue->Value );
1124*cdf0e10cSrcweir 				SetPrintableLayers( aSetOfBytes );
1125*cdf0e10cSrcweir 			}
1126*cdf0e10cSrcweir 			else if (!bImpress && pValue->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( sUNO_View_LockedLayers ) ) )
1127*cdf0e10cSrcweir 			{
1128*cdf0e10cSrcweir 				SetOfByte aSetOfBytes;
1129*cdf0e10cSrcweir 				aSetOfBytes.PutValue( pValue->Value );
1130*cdf0e10cSrcweir 				SetLockedLayers( aSetOfBytes );
1131*cdf0e10cSrcweir 			}
1132*cdf0e10cSrcweir 		}
1133*cdf0e10cSrcweir 
1134*cdf0e10cSrcweir         switch (GetPageKindOnLoad())
1135*cdf0e10cSrcweir         {
1136*cdf0e10cSrcweir             case PK_STANDARD: SetViewShEditModeOnLoad(meStandardEditMode); break;
1137*cdf0e10cSrcweir             case PK_NOTES: SetViewShEditModeOnLoad(meNotesEditMode); break;
1138*cdf0e10cSrcweir             case PK_HANDOUT: SetViewShEditModeOnLoad(meHandoutEditMode); break;
1139*cdf0e10cSrcweir             default: SetViewShEditModeOnLoad(EM_PAGE); break;
1140*cdf0e10cSrcweir         }
1141*cdf0e10cSrcweir 
1142*cdf0e10cSrcweir 		const Fraction aSnapGridWidthX( aSnapGridWidthXNum, aSnapGridWidthXDom );
1143*cdf0e10cSrcweir 		const Fraction aSnapGridWidthY( aSnapGridWidthYNum, aSnapGridWidthYDom );
1144*cdf0e10cSrcweir 
1145*cdf0e10cSrcweir 		SetSnapGridWidth( aSnapGridWidthX, aSnapGridWidthY );
1146*cdf0e10cSrcweir 	}
1147*cdf0e10cSrcweir }
1148*cdf0e10cSrcweir 
1149*cdf0e10cSrcweir 
1150*cdf0e10cSrcweir 
1151*cdf0e10cSrcweir 
1152*cdf0e10cSrcweir void FrameView::SetPreviousViewShellType (ViewShell::ShellType eType)
1153*cdf0e10cSrcweir {
1154*cdf0e10cSrcweir     mePreviousViewShellType = eType;
1155*cdf0e10cSrcweir }
1156*cdf0e10cSrcweir 
1157*cdf0e10cSrcweir 
1158*cdf0e10cSrcweir 
1159*cdf0e10cSrcweir 
1160*cdf0e10cSrcweir ViewShell::ShellType FrameView::GetPreviousViewShellType (void) const
1161*cdf0e10cSrcweir {
1162*cdf0e10cSrcweir     return mePreviousViewShellType;
1163*cdf0e10cSrcweir }
1164*cdf0e10cSrcweir 
1165*cdf0e10cSrcweir 
1166*cdf0e10cSrcweir 
1167*cdf0e10cSrcweir 
1168*cdf0e10cSrcweir void FrameView::SetViewShellTypeOnLoad (ViewShell::ShellType eType)
1169*cdf0e10cSrcweir {
1170*cdf0e10cSrcweir     meViewShellTypeOnLoad = eType;
1171*cdf0e10cSrcweir }
1172*cdf0e10cSrcweir 
1173*cdf0e10cSrcweir 
1174*cdf0e10cSrcweir 
1175*cdf0e10cSrcweir 
1176*cdf0e10cSrcweir ViewShell::ShellType FrameView::GetViewShellTypeOnLoad (void) const
1177*cdf0e10cSrcweir {
1178*cdf0e10cSrcweir     return meViewShellTypeOnLoad;
1179*cdf0e10cSrcweir }
1180*cdf0e10cSrcweir 
1181*cdf0e10cSrcweir 
1182*cdf0e10cSrcweir 
1183*cdf0e10cSrcweir 
1184*cdf0e10cSrcweir void FrameView::SetSelectedPage(sal_uInt16 nPage)
1185*cdf0e10cSrcweir {
1186*cdf0e10cSrcweir     mnSelectedPage = nPage;
1187*cdf0e10cSrcweir }
1188*cdf0e10cSrcweir 
1189*cdf0e10cSrcweir 
1190*cdf0e10cSrcweir 
1191*cdf0e10cSrcweir 
1192*cdf0e10cSrcweir sal_uInt16 FrameView::GetSelectedPage (void) const
1193*cdf0e10cSrcweir {
1194*cdf0e10cSrcweir     return mnSelectedPage;
1195*cdf0e10cSrcweir }
1196*cdf0e10cSrcweir 
1197*cdf0e10cSrcweir 
1198*cdf0e10cSrcweir 
1199*cdf0e10cSrcweir 
1200*cdf0e10cSrcweir void FrameView::SetIsNavigatorShowingAllShapes (const bool bIsNavigatorShowingAllShapes)
1201*cdf0e10cSrcweir {
1202*cdf0e10cSrcweir     mbIsNavigatorShowingAllShapes = bIsNavigatorShowingAllShapes;
1203*cdf0e10cSrcweir }
1204*cdf0e10cSrcweir 
1205*cdf0e10cSrcweir 
1206*cdf0e10cSrcweir 
1207*cdf0e10cSrcweir 
1208*cdf0e10cSrcweir bool FrameView::IsNavigatorShowingAllShapes (void) const
1209*cdf0e10cSrcweir {
1210*cdf0e10cSrcweir     return mbIsNavigatorShowingAllShapes;
1211*cdf0e10cSrcweir }
1212*cdf0e10cSrcweir 
1213*cdf0e10cSrcweir 
1214*cdf0e10cSrcweir } // end of namespace sd
1215