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