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