/src/libreoffice/sd/source/ui/view/frmview.cxx
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
5 | | * This Source Code Form is subject to the terms of the Mozilla Public |
6 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
7 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
11 | | * Licensed to the Apache Software Foundation (ASF) under one or more |
12 | | * contributor license agreements. See the NOTICE file distributed |
13 | | * with this work for additional information regarding copyright |
14 | | * ownership. The ASF licenses this file to you under the Apache |
15 | | * License, Version 2.0 (the "License"); you may not use this file |
16 | | * except in compliance with the License. You may obtain a copy of |
17 | | * the License at http://www.apache.org/licenses/LICENSE-2.0 . |
18 | | */ |
19 | | |
20 | | #include <FrameView.hxx> |
21 | | |
22 | | #include <svx/svxids.hrc> |
23 | | #include <framework/AbstractView.hxx> |
24 | | #include <rtl/ustrbuf.hxx> |
25 | | #include <unokywds.hxx> |
26 | | #include <vcl/settings.hxx> |
27 | | #include <vcl/svapp.hxx> |
28 | | #include <o3tl/string_view.hxx> |
29 | | #include <osl/diagnose.h> |
30 | | |
31 | | #include <vector> |
32 | | #include <ViewShell.hxx> |
33 | | #include <drawdoc.hxx> |
34 | | #include <DrawDocShell.hxx> |
35 | | #include <optsitem.hxx> |
36 | | #include <ViewShellBase.hxx> |
37 | | #include <sdmod.hxx> |
38 | | #include <pres.hxx> |
39 | | #include <ResourceId.hxx> |
40 | | #include <framework/FrameworkHelper.hxx> |
41 | | #include <comphelper/processfactory.hxx> |
42 | | #include <sfx2/viewfrm.hxx> |
43 | | #include <officecfg/Office/Common.hxx> |
44 | | #include <officecfg/Office/Draw.hxx> |
45 | | #include <officecfg/Office/Impress.hxx> |
46 | | |
47 | | using namespace ::com::sun::star; |
48 | | using namespace ::com::sun::star::uno; |
49 | | using namespace ::com::sun::star::beans; |
50 | | |
51 | | namespace sd { |
52 | | |
53 | | FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULL */) |
54 | 12.5k | : SdrView(*pDrawDoc, nullptr), // TTTT SdDrawDocument* -> should be reference |
55 | 12.5k | mnRefCount(0), |
56 | 12.5k | mnPresViewShellId(SID_VIEWSHELL0), |
57 | 12.5k | mbIsNavigatorShowingAllShapes(false) |
58 | 12.5k | { |
59 | 12.5k | EndListening(*pDrawDoc); |
60 | | |
61 | 12.5k | EnableExtendedKeyInputDispatcher(false); |
62 | 12.5k | EnableExtendedMouseEventDispatcher(false); |
63 | | |
64 | 12.5k | SetGridFront( false ); |
65 | 12.5k | SetHlplFront( false ); |
66 | 12.5k | SetOConSnap( false ); |
67 | 12.5k | SetFrameDragSingles(); |
68 | 12.5k | SetSlidesPerRow(4); |
69 | | |
70 | 12.5k | if( nullptr == pFrameView ) |
71 | 12.5k | { |
72 | 12.5k | DrawDocShell* pDocShell = pDrawDoc->GetDocSh(); |
73 | | |
74 | 12.5k | if ( pDocShell ) |
75 | 12.5k | { |
76 | | // document is loaded, is there a FrameView? |
77 | 12.5k | sal_uLong nSdViewShellCount = 0; |
78 | 12.5k | SfxViewFrame* pSfxViewFrame = SfxViewFrame::GetFirst(pDocShell); |
79 | | |
80 | 12.5k | while (pSfxViewFrame) |
81 | 0 | { |
82 | | // Count the FrameViews and remember the type of the main |
83 | | // view shell. |
84 | 0 | SfxViewShell* pSfxViewSh = pSfxViewFrame->GetViewShell(); |
85 | 0 | ViewShellBase* pBase = dynamic_cast<ViewShellBase*>( pSfxViewSh ); |
86 | |
|
87 | 0 | if (pBase != nullptr) |
88 | 0 | { |
89 | 0 | nSdViewShellCount++; |
90 | |
|
91 | 0 | OUString sViewURL; |
92 | 0 | rtl::Reference<sd::framework::AbstractView> xView ( |
93 | 0 | framework::FrameworkHelper::Instance(*pBase)->GetView( |
94 | 0 | new sd::framework::ResourceId( |
95 | 0 | framework::FrameworkHelper::msCenterPaneURL))); |
96 | 0 | if (xView.is()) |
97 | 0 | sViewURL = xView->getResourceId()->getResourceURL(); |
98 | |
|
99 | 0 | switch (framework::FrameworkHelper::GetViewId(sViewURL)) |
100 | 0 | { |
101 | 0 | default: |
102 | | // case ViewShell::ST_IMPRESS: |
103 | | // case ViewShell::ST_NOTES: |
104 | | // case ViewShell::ST_HANDOUT: |
105 | 0 | mnPresViewShellId = SID_VIEWSHELL0; |
106 | 0 | break; |
107 | | |
108 | 0 | case ViewShell::ST_SLIDE_SORTER: |
109 | 0 | mnPresViewShellId = SID_VIEWSHELL1; |
110 | 0 | break; |
111 | | |
112 | 0 | case ViewShell::ST_OUTLINE: |
113 | 0 | mnPresViewShellId = SID_VIEWSHELL2; |
114 | 0 | break; |
115 | 0 | } |
116 | 0 | } |
117 | | |
118 | 0 | pSfxViewFrame = SfxViewFrame::GetNext(*pSfxViewFrame, pDocShell); |
119 | 0 | } |
120 | | |
121 | 12.5k | SdDrawDocument* pDoc = pDocShell->GetDoc(); |
122 | 12.5k | pFrameView = pDoc->GetFrameView(nSdViewShellCount); |
123 | 12.5k | } |
124 | 12.5k | } |
125 | | |
126 | 12.5k | if (pFrameView) |
127 | 5 | { |
128 | | // initialize FrameView with the FrameView of the DocShell |
129 | 5 | SetRuler( pFrameView->HasRuler() ); |
130 | 5 | SetGridCoarse( pFrameView->GetGridCoarse() ); |
131 | 5 | SetGridFine( pFrameView->GetGridFine() ); |
132 | 5 | SetSnapGridWidth(pFrameView->GetSnapGridWidthX(), pFrameView->GetSnapGridWidthY()); |
133 | 5 | SetGridVisible( pFrameView->IsGridVisible() ); |
134 | 5 | SetGridFront( pFrameView->IsGridFront() ); |
135 | 5 | SetSnapAngle( pFrameView->GetSnapAngle() ); |
136 | 5 | SetGridSnap( pFrameView->IsGridSnap() ); |
137 | 5 | SetBordSnap( pFrameView->IsBordSnap() ); |
138 | 5 | SetHlplSnap( pFrameView->IsHlplSnap() ); |
139 | 5 | SetOFrmSnap( pFrameView->IsOFrmSnap() ); |
140 | 5 | SetOPntSnap( pFrameView->IsOPntSnap() ); |
141 | 5 | SetOConSnap( pFrameView->IsOConSnap() ); |
142 | 5 | SetHlplVisible( pFrameView->IsHlplVisible() ); |
143 | 5 | SetDragStripes( pFrameView->IsDragStripes() ); |
144 | 5 | SetPlusHandlesAlwaysVisible( pFrameView->IsPlusHandlesAlwaysVisible() ); |
145 | 5 | SetFrameDragSingles( pFrameView->IsFrameDragSingles() ); |
146 | 5 | SetSnapMagneticPixel( pFrameView->GetSnapMagneticPixel() ); |
147 | 5 | SetMarkedHitMovesAlways( pFrameView->IsMarkedHitMovesAlways() ); |
148 | 5 | SetMoveOnlyDragging( pFrameView->IsMoveOnlyDragging() ); |
149 | 5 | SetCrookNoContortion( pFrameView->IsCrookNoContortion() ); |
150 | 5 | SetSlantButShear( pFrameView->IsSlantButShear() ); |
151 | 5 | SetNoDragXorPolys( pFrameView->IsNoDragXorPolys() ); |
152 | 5 | SetAngleSnapEnabled( pFrameView->IsAngleSnapEnabled() ); |
153 | 5 | SetBigOrtho( pFrameView->IsBigOrtho() ); |
154 | 5 | SetOrtho( pFrameView->IsOrtho() ); |
155 | 5 | SetEliminatePolyPointLimitAngle( pFrameView->GetEliminatePolyPointLimitAngle() ); |
156 | 5 | SetEliminatePolyPoints( pFrameView->IsEliminatePolyPoints() ); |
157 | 5 | SetDesignMode( pFrameView->IsDesignMode() ); |
158 | | |
159 | 5 | SetSolidDragging( pFrameView->IsSolidDragging() ); |
160 | | |
161 | 5 | maVisibleLayers = pFrameView->GetVisibleLayers(); |
162 | 5 | maPrintableLayers = pFrameView->GetPrintableLayers(); |
163 | 5 | maLockedLayers = pFrameView->GetLockedLayers(); |
164 | 5 | maStandardHelpLines = pFrameView->GetStandardHelpLines(); |
165 | 5 | maNotesHelpLines = pFrameView->GetNotesHelpLines(); |
166 | 5 | maHandoutHelpLines = pFrameView->GetHandoutHelpLines(); |
167 | 5 | SetActiveLayer( pFrameView->GetActiveLayer() ); |
168 | 5 | mbNoColors = pFrameView->IsNoColors(); |
169 | 5 | mbNoAttribs = pFrameView->IsNoAttribs() ; |
170 | 5 | maVisArea = pFrameView->GetVisArea(); |
171 | 5 | mePageKind = pFrameView->GetPageKind(); |
172 | 5 | mePageKindOnLoad = pFrameView->GetPageKindOnLoad(); |
173 | 5 | mnSelectedPage = pFrameView->GetSelectedPage(); |
174 | 5 | mnSelectedPageOnLoad = pFrameView->GetSelectedPageOnLoad(); |
175 | 5 | mePageEditMode = pFrameView->GetViewShEditMode(); |
176 | | // meStandardEditMode = pFrameView->GetViewShEditMode(PageKind::Standard); |
177 | | // meNotesEditMode = pFrameView->GetViewShEditMode(PageKind::Notes); |
178 | | // meHandoutEditMode = pFrameView->GetViewShEditMode(PageKind::Handout); |
179 | 5 | SetViewShEditModeOnLoad(pFrameView->GetViewShEditModeOnLoad()); |
180 | 5 | mbLayerMode = pFrameView->IsLayerMode(); |
181 | 5 | mbQuickEdit = pFrameView->IsQuickEdit(); |
182 | | |
183 | | // #i26631# |
184 | 5 | SetMasterPagePaintCaching( pFrameView->IsMasterPagePaintCaching() ); |
185 | | |
186 | 5 | SetDragWithCopy( pFrameView->IsDragWithCopy() ); |
187 | 5 | mbDoubleClickTextEdit = pFrameView->IsDoubleClickTextEdit(); |
188 | 5 | mbClickChangeRotation = pFrameView->IsClickChangeRotation(); |
189 | 5 | mnSlidesPerRow = pFrameView->GetSlidesPerRow(); |
190 | 5 | mnDrawMode = pFrameView->GetDrawMode(); |
191 | 5 | mbIsNavigatorShowingAllShapes = pFrameView->IsNavigatorShowingAllShapes(); |
192 | 5 | SetPreviousViewShellType (pFrameView->GetPreviousViewShellType()); |
193 | 5 | SetViewShellTypeOnLoad (pFrameView->GetViewShellTypeOnLoad()); |
194 | 5 | } |
195 | 12.5k | else |
196 | 12.5k | { |
197 | | // initialize FrameView with the application data |
198 | | |
199 | | // Layers need to be set, otherwise they are not visible and not printable in |
200 | | // Impress documents. The document contains already the actual layers and their |
201 | | // settings for visible, printable and locked. In case not read from <draw:layer-set>, |
202 | | // ODF defaults are used. |
203 | 12.5k | SdrLayerAdmin rLayerAdmin = pDrawDoc -> GetLayerAdmin(); |
204 | 12.5k | rLayerAdmin.getVisibleLayersODF(maVisibleLayers); |
205 | 12.5k | rLayerAdmin.getPrintableLayersODF(maPrintableLayers); |
206 | 12.5k | rLayerAdmin.getLockedLayersODF(maLockedLayers); |
207 | 12.5k | SetGridCoarse( Size( 1000, 1000 ) ); |
208 | 12.5k | SetSnapGridWidth(Fraction(1000, 1), Fraction(1000, 1)); |
209 | 12.5k | SetActiveLayer(sUNO_LayerName_layout); |
210 | 12.5k | mbNoColors = true; |
211 | 12.5k | mbNoAttribs = false; |
212 | 12.5k | maVisArea = ::tools::Rectangle( Point(), Size(0, 0) ); |
213 | 12.5k | mePageKind = PageKind::Standard; |
214 | 12.5k | mePageKindOnLoad = PageKind::Standard; |
215 | 12.5k | mnSelectedPage = 0; |
216 | 12.5k | mnSelectedPageOnLoad = 0; |
217 | 12.5k | mePageEditMode = EditMode::Page; |
218 | | // meStandardEditMode = EditMode::Page; |
219 | | // meNotesEditMode = EditMode::Page; |
220 | | // meHandoutEditMode = EditMode::MasterPage; |
221 | 12.5k | SetViewShEditModeOnLoad(EditMode::Page); |
222 | 12.5k | mbLayerMode = false; |
223 | 12.5k | SetEliminatePolyPoints(false); |
224 | 12.5k | mbDoubleClickTextEdit = false; |
225 | 12.5k | mbClickChangeRotation = false; |
226 | 12.5k | mnSlidesPerRow = officecfg::Office::Impress::Misc::SorterSlidesPerRow::get(); |
227 | | |
228 | 12.5k | { |
229 | 12.5k | bool bUseContrast = Application::GetSettings().GetStyleSettings().GetHighContrastMode(); |
230 | 12.5k | mnDrawMode = bUseContrast ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR; |
231 | 12.5k | } |
232 | 12.5k | mbIsNavigatorShowingAllShapes = true; |
233 | 12.5k | SetPreviousViewShellType (ViewShell::ST_NONE); |
234 | 12.5k | SetViewShellTypeOnLoad (ViewShell::ST_IMPRESS); |
235 | | |
236 | | // get default for design mode |
237 | 12.5k | bool bInitDesignMode = pDrawDoc->GetOpenInDesignMode(); |
238 | 12.5k | if( pDrawDoc->OpenInDesignModeIsDefaulted() ) |
239 | 12.5k | { |
240 | 12.5k | bInitDesignMode = true; |
241 | 12.5k | } |
242 | | |
243 | 12.5k | SfxObjectShell* pObjShell = pDrawDoc->GetObjectShell(); |
244 | 12.5k | if( pObjShell && pObjShell->IsReadOnly() ) |
245 | 11.1k | bInitDesignMode = false; |
246 | 12.5k | SetDesignMode( bInitDesignMode ); |
247 | | |
248 | 12.5k | Update(SdModule::get()->GetSdOptions(pDrawDoc->GetDocumentType())); |
249 | 12.5k | } |
250 | | |
251 | 12.5k | } |
252 | | |
253 | | FrameView::~FrameView() |
254 | 12.5k | { |
255 | 12.5k | } |
256 | | |
257 | | void FrameView::Connect() |
258 | 0 | { |
259 | 0 | mnRefCount++; |
260 | 0 | } |
261 | | |
262 | | void FrameView::Disconnect() |
263 | 0 | { |
264 | 0 | if (mnRefCount > 0) |
265 | 0 | { |
266 | 0 | mnRefCount--; |
267 | 0 | } |
268 | |
|
269 | 0 | if (mnRefCount == 0) |
270 | 0 | { |
271 | 0 | delete this; |
272 | 0 | } |
273 | 0 | } |
274 | | |
275 | | /** |
276 | | * Update with data from the specified SdOptions |
277 | | */ |
278 | | void FrameView::Update(SdOptions const * pOptions) |
279 | 12.5k | { |
280 | 12.5k | if (!pOptions) |
281 | 0 | return; |
282 | | |
283 | 12.5k | SdDrawDocument* pDrawDocument = dynamic_cast<SdDrawDocument*>(&GetModel()); |
284 | 12.5k | const bool bImpress = pDrawDocument && pDrawDocument->GetDocumentType() == DocumentType::Impress; |
285 | | |
286 | 12.5k | if (bImpress) |
287 | 12.5k | { |
288 | 12.5k | mbRuler = officecfg::Office::Impress::Layout::Display::Ruler::get(); |
289 | 12.5k | SetAngleSnapEnabled( officecfg::Office::Impress::Snap::Position::Rotating::get() ); |
290 | 12.5k | SetBigOrtho( officecfg::Office::Impress::Snap::Position::ExtendEdges::get() ); |
291 | 12.5k | SetBordSnap( officecfg::Office::Impress::Snap::Object::PageMargin::get() ); |
292 | 12.5k | SetDragStripes( officecfg::Office::Impress::Layout::Display::Guide::get() ); |
293 | 12.5k | SetHlplSnap( officecfg::Office::Impress::Snap::Object::SnapLine::get() ); |
294 | 12.5k | SetHlplVisible( officecfg::Office::Impress::Layout::Display::Helpline::get() ); |
295 | 12.5k | SetEliminatePolyPointLimitAngle( Degree100(officecfg::Office::Impress::Snap::Position::PointReduction::get()) ); |
296 | 12.5k | SetNoDragXorPolys ( !officecfg::Office::Impress::Layout::Display::Contour::get() ); |
297 | 12.5k | SetOFrmSnap( officecfg::Office::Impress::Snap::Object::ObjectFrame::get() ); |
298 | 12.5k | SetOPntSnap( officecfg::Office::Impress::Snap::Object::ObjectPoint::get() ); |
299 | 12.5k | SetOrtho( officecfg::Office::Impress::Snap::Position::CreatingMoving::get() ); |
300 | 12.5k | SetPlusHandlesAlwaysVisible( officecfg::Office::Impress::Layout::Display::Bezier::get() ); |
301 | 12.5k | SetSnapAngle( Degree100(officecfg::Office::Impress::Snap::Position::RotatingValue::get()) ); |
302 | 12.5k | SetSnapMagneticPixel( officecfg::Office::Impress::Snap::Object::Range::get() ); |
303 | 12.5k | } |
304 | 0 | else |
305 | 0 | { |
306 | 0 | mbRuler = officecfg::Office::Draw::Layout::Display::Ruler::get(); |
307 | 0 | SetAngleSnapEnabled( officecfg::Office::Draw::Snap::Position::Rotating::get() ); |
308 | 0 | SetBigOrtho( officecfg::Office::Draw::Snap::Position::ExtendEdges::get() ); |
309 | 0 | SetBordSnap( officecfg::Office::Draw::Snap::Object::PageMargin::get() ); |
310 | 0 | SetDragStripes( officecfg::Office::Draw::Layout::Display::Guide::get() ); |
311 | 0 | SetHlplSnap( officecfg::Office::Draw::Snap::Object::SnapLine::get() ); |
312 | 0 | SetHlplVisible( officecfg::Office::Draw::Layout::Display::Helpline::get() ); |
313 | 0 | SetEliminatePolyPointLimitAngle( Degree100(officecfg::Office::Draw::Snap::Position::PointReduction::get()) ); |
314 | 0 | SetNoDragXorPolys ( !officecfg::Office::Draw::Layout::Display::Contour::get() ); |
315 | 0 | SetOFrmSnap( officecfg::Office::Draw::Snap::Object::ObjectFrame::get() ); |
316 | 0 | SetOPntSnap( officecfg::Office::Draw::Snap::Object::ObjectPoint::get() ); |
317 | 0 | SetOrtho( officecfg::Office::Draw::Snap::Position::CreatingMoving::get() ); |
318 | 0 | SetPlusHandlesAlwaysVisible( officecfg::Office::Draw::Layout::Display::Bezier::get() ); |
319 | 0 | SetSnapAngle( Degree100(officecfg::Office::Draw::Snap::Position::RotatingValue::get()) ); |
320 | 0 | SetSnapMagneticPixel( officecfg::Office::Draw::Snap::Object::Range::get() ); |
321 | 0 | } |
322 | | |
323 | 12.5k | SetGridVisible( pOptions->IsGridVisible() ); |
324 | 12.5k | SetGridSnap( pOptions->IsUseGridSnap() ); |
325 | 12.5k | SetMarkedHitMovesAlways( pOptions->IsMarkedHitMovesAlways() ); |
326 | 12.5k | SetMoveOnlyDragging( pOptions->IsMoveOnlyDragging() ); |
327 | 12.5k | SetSlantButShear( pOptions->IsMoveOnlyDragging() ); |
328 | 12.5k | SetCrookNoContortion( pOptions->IsCrookNoContortion() ); |
329 | 12.5k | GetModel().SetPickThroughTransparentTextFrames( pOptions->IsPickThrough() ); |
330 | | |
331 | 12.5k | SetSolidDragging( pOptions->IsSolidDragging() ); |
332 | | |
333 | 12.5k | SetGridCoarse( Size( pOptions->GetFieldDrawX(), pOptions->GetFieldDrawY() ) ); |
334 | 12.5k | SetGridFine( Size( pOptions->GetFieldDivisionX(), pOptions->GetFieldDivisionY() ) ); |
335 | 12.5k | Fraction aFractX(pOptions->GetFieldDrawX(), pOptions->GetFieldDrawX() / ( pOptions->GetFieldDivisionX() ? pOptions->GetFieldDivisionX() : 1 )); |
336 | 12.5k | Fraction aFractY(pOptions->GetFieldDrawY(), pOptions->GetFieldDrawY() / ( pOptions->GetFieldDivisionY() ? pOptions->GetFieldDivisionY() : 1 )); |
337 | 12.5k | SetSnapGridWidth(aFractX, aFractY); |
338 | 12.5k | SetQuickEdit(pOptions->IsQuickEdit()); |
339 | | |
340 | | // #i26631# |
341 | 12.5k | SetMasterPagePaintCaching( pOptions->IsMasterPagePaintCaching() ); |
342 | | |
343 | 12.5k | SetDragWithCopy(pOptions->IsDragWithCopy()); |
344 | 12.5k | SetDragThresholdPixels(pOptions->GetDragThresholdPixels()); |
345 | 12.5k | SetDoubleClickTextEdit( pOptions->IsDoubleClickTextEdit() ); |
346 | 12.5k | SetClickChangeRotation( pOptions->IsClickChangeRotation() ); |
347 | 12.5k | } |
348 | | |
349 | | /** |
350 | | * Set EditMode (Page or MasterPage) of working mode |
351 | | */ |
352 | | void FrameView::SetViewShEditMode(EditMode eMode) |
353 | 12.1k | { |
354 | 12.1k | mePageEditMode = eMode; |
355 | 12.1k | } |
356 | | |
357 | | /** |
358 | | * Return EditMode (Page or MasterPage) of working mode |
359 | | */ |
360 | | EditMode FrameView::GetViewShEditMode() const |
361 | 5 | { |
362 | 5 | return mePageEditMode; |
363 | 5 | } |
364 | | |
365 | | void FrameView::SetViewShEditModeOnLoad (EditMode eMode) |
366 | 14.0k | { |
367 | 14.0k | meEditModeOnLoad = eMode; |
368 | 14.0k | } |
369 | | |
370 | | static OUString createHelpLinesString( const SdrHelpLineList& rHelpLines ) |
371 | 0 | { |
372 | 0 | OUStringBuffer aLines; |
373 | |
|
374 | 0 | const sal_uInt16 nCount = rHelpLines.GetCount(); |
375 | 0 | for( sal_uInt16 nHlpLine = 0; nHlpLine < nCount; nHlpLine++ ) |
376 | 0 | { |
377 | 0 | const SdrHelpLine& rHelpLine = rHelpLines[nHlpLine]; |
378 | 0 | const Point& rPos = rHelpLine.GetPos(); |
379 | |
|
380 | 0 | switch( rHelpLine.GetKind() ) |
381 | 0 | { |
382 | 0 | case SdrHelpLineKind::Point: |
383 | 0 | aLines.append( 'P' ); |
384 | 0 | aLines.append( static_cast<sal_Int32>(rPos.X()) ); |
385 | 0 | aLines.append( ',' ); |
386 | 0 | aLines.append( static_cast<sal_Int32>(rPos.Y()) ); |
387 | 0 | break; |
388 | 0 | case SdrHelpLineKind::Vertical: |
389 | 0 | aLines.append( 'V' ); |
390 | 0 | aLines.append( static_cast<sal_Int32>(rPos.X()) ); |
391 | 0 | break; |
392 | 0 | case SdrHelpLineKind::Horizontal: |
393 | 0 | aLines.append( 'H' ); |
394 | 0 | aLines.append( static_cast<sal_Int32>(rPos.Y()) ); |
395 | 0 | break; |
396 | 0 | default: |
397 | 0 | OSL_FAIL( "Unsupported helpline Kind!" ); |
398 | 0 | } |
399 | 0 | } |
400 | | |
401 | 0 | return aLines.makeStringAndClear(); |
402 | 0 | } |
403 | | |
404 | | void FrameView::WriteUserDataSequence ( css::uno::Sequence < css::beans::PropertyValue >& rValues ) |
405 | 0 | { |
406 | 0 | std::vector< std::pair< OUString, Any > > aUserData; |
407 | 0 | aUserData.reserve(41); // worst case |
408 | |
|
409 | 0 | aUserData.emplace_back( sUNO_View_GridIsVisible, Any( IsGridVisible() ) ); |
410 | 0 | aUserData.emplace_back( sUNO_View_GridIsFront, Any( IsGridFront() ) ); |
411 | 0 | aUserData.emplace_back( sUNO_View_IsSnapToGrid, Any( IsGridSnap() ) ); |
412 | 0 | aUserData.emplace_back( sUNO_View_IsSnapToPageMargins, Any( IsBordSnap() ) ); |
413 | 0 | aUserData.emplace_back( sUNO_View_IsSnapToSnapLines, Any( IsHlplSnap() ) ); |
414 | 0 | aUserData.emplace_back( sUNO_View_IsSnapToObjectFrame, Any( IsOFrmSnap() ) ); |
415 | 0 | aUserData.emplace_back( sUNO_View_IsSnapToObjectPoints, Any( IsOPntSnap() ) ); |
416 | |
|
417 | 0 | aUserData.emplace_back( sUNO_View_IsPlusHandlesAlwaysVisible, Any( IsPlusHandlesAlwaysVisible() ) ); |
418 | 0 | aUserData.emplace_back( sUNO_View_IsFrameDragSingles, Any( IsFrameDragSingles() ) ); |
419 | |
|
420 | 0 | aUserData.emplace_back( sUNO_View_EliminatePolyPointLimitAngle, Any( static_cast<sal_Int32>(GetEliminatePolyPointLimitAngle()) ) ); |
421 | 0 | aUserData.emplace_back( sUNO_View_IsEliminatePolyPoints, Any( IsEliminatePolyPoints() ) ); |
422 | |
|
423 | 0 | if ( officecfg::Office::Common::Misc::WriteLayerStateAsConfigItem::get() ) |
424 | 0 | { |
425 | 0 | SdrLayerAdmin& rLayerAdmin = getSdrModelFromSdrView().GetLayerAdmin(); |
426 | 0 | Any aAny; |
427 | 0 | rLayerAdmin.QueryValue(GetVisibleLayers(), aAny); |
428 | 0 | aUserData.emplace_back( sUNO_View_VisibleLayers, aAny ); |
429 | |
|
430 | 0 | rLayerAdmin.QueryValue(GetPrintableLayers(), aAny); |
431 | 0 | aUserData.emplace_back( sUNO_View_PrintableLayers, aAny ); |
432 | |
|
433 | 0 | rLayerAdmin.QueryValue(GetLockedLayers(), aAny); |
434 | 0 | aUserData.emplace_back( sUNO_View_LockedLayers, aAny ); |
435 | 0 | } |
436 | |
|
437 | 0 | aUserData.emplace_back( sUNO_View_NoAttribs, Any( IsNoAttribs() ) ); |
438 | 0 | aUserData.emplace_back( sUNO_View_NoColors, Any( IsNoColors() ) ); |
439 | |
|
440 | 0 | if( GetStandardHelpLines().GetCount() ) |
441 | 0 | aUserData.emplace_back( sUNO_View_SnapLinesDrawing, Any( createHelpLinesString( GetStandardHelpLines() ) ) ); |
442 | |
|
443 | 0 | if( GetNotesHelpLines().GetCount() ) |
444 | 0 | aUserData.emplace_back( sUNO_View_SnapLinesNotes, Any( createHelpLinesString( GetNotesHelpLines() ) ) ); |
445 | |
|
446 | 0 | if( GetHandoutHelpLines().GetCount() ) |
447 | 0 | aUserData.emplace_back( sUNO_View_SnapLinesHandout, Any( createHelpLinesString( GetHandoutHelpLines() ) ) ); |
448 | |
|
449 | 0 | aUserData.emplace_back( sUNO_View_RulerIsVisible, Any( HasRuler() ) ); |
450 | 0 | aUserData.emplace_back( sUNO_View_PageKind, Any( static_cast<sal_Int16>(GetPageKind()) ) ); |
451 | 0 | aUserData.emplace_back( sUNO_View_SelectedPage, Any( static_cast<sal_Int16>(GetSelectedPage()) ) ); |
452 | 0 | aUserData.emplace_back( sUNO_View_IsLayerMode, Any( IsLayerMode() ) ); |
453 | |
|
454 | 0 | aUserData.emplace_back( sUNO_View_IsDoubleClickTextEdit, Any( IsDoubleClickTextEdit() ) ); |
455 | 0 | aUserData.emplace_back( sUNO_View_IsClickChangeRotation, Any( IsClickChangeRotation() ) ); |
456 | |
|
457 | 0 | aUserData.emplace_back( sUNO_View_SlidesPerRow, Any( static_cast<sal_Int16>(GetSlidesPerRow()) ) ); |
458 | 0 | aUserData.emplace_back( sUNO_View_EditMode, Any( static_cast<sal_Int32>(GetViewShEditMode()) ) ); |
459 | | // aUserData.emplace_back( sUNO_View_EditModeStandard, makeAny( (sal_Int32)GetViewShEditMode( PageKind::Standard ) ) ); |
460 | | // aUserData.emplace_back( sUNO_View_EditModeNotes, makeAny( (sal_Int32)GetViewShEditMode( PageKind::Notes ) ) ); |
461 | | // aUserData.emplace_back( sUNO_View_EditModeHandout, makeAny( (sal_Int32)GetViewShEditMode( PageKind::Handout ) ) ); |
462 | |
|
463 | 0 | { |
464 | 0 | const ::tools::Rectangle aVisArea = GetVisArea(); |
465 | |
|
466 | 0 | aUserData.emplace_back( sUNO_View_VisibleAreaTop, Any( static_cast<sal_Int32>(aVisArea.Top()) ) ); |
467 | 0 | aUserData.emplace_back( sUNO_View_VisibleAreaLeft, Any( static_cast<sal_Int32>(aVisArea.Left()) ) ); |
468 | 0 | aUserData.emplace_back( sUNO_View_VisibleAreaWidth, Any( static_cast<sal_Int32>(aVisArea.GetWidth()) ) ); |
469 | 0 | aUserData.emplace_back( sUNO_View_VisibleAreaHeight, Any( static_cast<sal_Int32>(aVisArea.GetHeight()) ) ); |
470 | 0 | } |
471 | |
|
472 | 0 | aUserData.emplace_back( sUNO_View_GridCoarseWidth, Any( static_cast<sal_Int32>(GetGridCoarse().Width()) ) ); |
473 | 0 | aUserData.emplace_back( sUNO_View_GridCoarseHeight, Any( static_cast<sal_Int32>(GetGridCoarse().Height()) ) ); |
474 | 0 | aUserData.emplace_back( sUNO_View_GridFineWidth, Any( static_cast<sal_Int32>(GetGridFine().Width()) ) ); |
475 | 0 | aUserData.emplace_back( sUNO_View_GridFineHeight, Any( static_cast<sal_Int32>(GetGridFine().Height()) ) ); |
476 | 0 | aUserData.emplace_back( sUNO_View_GridSnapWidthXNumerator, Any( GetSnapGridWidthX().GetNumerator() ) ); |
477 | 0 | aUserData.emplace_back( sUNO_View_GridSnapWidthXDenominator, Any( GetSnapGridWidthX().GetDenominator() ) ); |
478 | 0 | aUserData.emplace_back( sUNO_View_GridSnapWidthYNumerator, Any( GetSnapGridWidthY().GetNumerator() ) ); |
479 | 0 | aUserData.emplace_back( sUNO_View_GridSnapWidthYDenominator, Any( GetSnapGridWidthY().GetDenominator() ) ); |
480 | 0 | aUserData.emplace_back( sUNO_View_IsAngleSnapEnabled, Any( IsAngleSnapEnabled() ) ); |
481 | 0 | aUserData.emplace_back( sUNO_View_SnapAngle, Any( static_cast<sal_Int32>(GetSnapAngle()) ) ); |
482 | |
|
483 | 0 | const sal_Int32 nOldLength = rValues.getLength(); |
484 | 0 | rValues.realloc( nOldLength + aUserData.size() ); |
485 | |
|
486 | 0 | PropertyValue* pValue = &(rValues.getArray()[nOldLength]); |
487 | |
|
488 | 0 | for( const auto& rItem : aUserData ) |
489 | 0 | { |
490 | 0 | pValue->Name = rItem.first; |
491 | 0 | pValue->Value = rItem.second; |
492 | 0 | ++pValue; |
493 | 0 | } |
494 | 0 | } |
495 | | |
496 | | static void createHelpLinesFromString( const OUString& rLines, SdrHelpLineList& rHelpLines ) |
497 | 0 | { |
498 | 0 | const sal_Unicode * pStr = rLines.getStr(); |
499 | 0 | SdrHelpLine aNewHelpLine; |
500 | 0 | OUStringBuffer sBuffer; |
501 | |
|
502 | 0 | while( *pStr ) |
503 | 0 | { |
504 | 0 | Point aPoint; |
505 | |
|
506 | 0 | switch( *pStr ) |
507 | 0 | { |
508 | 0 | case 'P': |
509 | 0 | aNewHelpLine.SetKind( SdrHelpLineKind::Point ); |
510 | 0 | break; |
511 | 0 | case 'V': |
512 | 0 | aNewHelpLine.SetKind( SdrHelpLineKind::Vertical ); |
513 | 0 | break; |
514 | 0 | case 'H': |
515 | 0 | aNewHelpLine.SetKind( SdrHelpLineKind::Horizontal ); |
516 | 0 | break; |
517 | 0 | default: |
518 | 0 | OSL_FAIL( "syntax error in snap lines settings string" ); |
519 | 0 | return; |
520 | 0 | } |
521 | | |
522 | 0 | pStr++; |
523 | |
|
524 | 0 | while( (*pStr >= '0' && *pStr <= '9') || (*pStr == '+') || (*pStr == '-') ) |
525 | 0 | { |
526 | 0 | sBuffer.append( *pStr++ ); |
527 | 0 | } |
528 | |
|
529 | 0 | sal_Int32 nValue = o3tl::toInt32(sBuffer); |
530 | 0 | sBuffer.setLength(0); |
531 | |
|
532 | 0 | if( aNewHelpLine.GetKind() == SdrHelpLineKind::Horizontal ) |
533 | 0 | { |
534 | 0 | aPoint.setY( nValue ); |
535 | 0 | } |
536 | 0 | else |
537 | 0 | { |
538 | 0 | aPoint.setX( nValue ); |
539 | |
|
540 | 0 | if( aNewHelpLine.GetKind() == SdrHelpLineKind::Point ) |
541 | 0 | { |
542 | 0 | if( *pStr++ != ',' ) |
543 | 0 | return; |
544 | | |
545 | 0 | while( (*pStr >= '0' && *pStr <= '9') || (*pStr == '+') || (*pStr == '-') ) |
546 | 0 | { |
547 | 0 | sBuffer.append( *pStr++ ); |
548 | 0 | } |
549 | |
|
550 | 0 | aPoint.setY( o3tl::toInt32(sBuffer) ); |
551 | 0 | sBuffer.setLength(0); |
552 | |
|
553 | 0 | } |
554 | 0 | } |
555 | | |
556 | 0 | aNewHelpLine.SetPos( aPoint ); |
557 | 0 | rHelpLines.Insert( aNewHelpLine ); |
558 | 0 | } |
559 | 0 | } |
560 | | |
561 | | void FrameView::ReadUserDataSequence ( const css::uno::Sequence < css::beans::PropertyValue >& rSequence ) |
562 | 1.44k | { |
563 | 1.44k | const sal_Int32 nLength = rSequence.getLength(); |
564 | 1.44k | if (!nLength) |
565 | 0 | return; |
566 | | |
567 | 1.44k | SdDrawDocument* pDrawDocument = dynamic_cast<SdDrawDocument*>(&GetModel()); |
568 | 1.44k | const bool bImpress = pDrawDocument && pDrawDocument->GetDocumentType() == DocumentType::Impress; |
569 | | |
570 | 1.44k | bool bBool = false; |
571 | 1.44k | sal_Int32 nInt32 = 0; |
572 | 1.44k | sal_Int16 nInt16 = 0; |
573 | 1.44k | OUString aString; |
574 | | |
575 | 1.44k | sal_Int32 aSnapGridWidthXNum = GetSnapGridWidthX().GetNumerator(); |
576 | 1.44k | sal_Int32 aSnapGridWidthXDom = GetSnapGridWidthX().GetDenominator(); |
577 | | |
578 | 1.44k | sal_Int32 aSnapGridWidthYNum = GetSnapGridWidthY().GetNumerator(); |
579 | 1.44k | sal_Int32 aSnapGridWidthYDom = GetSnapGridWidthY().GetDenominator(); |
580 | | |
581 | 1.44k | for (const css::beans::PropertyValue& rValue : rSequence) |
582 | 47.0k | { |
583 | 47.0k | if ( rValue.Name == sUNO_View_ViewId ) |
584 | 1.22k | { |
585 | 1.22k | } |
586 | 45.8k | else if ( rValue.Name == sUNO_View_SnapLinesDrawing ) |
587 | 0 | { |
588 | 0 | if( rValue.Value >>= aString ) |
589 | 0 | { |
590 | 0 | SdrHelpLineList aHelpLines; |
591 | 0 | createHelpLinesFromString( aString, aHelpLines ); |
592 | 0 | SetStandardHelpLines( aHelpLines ); |
593 | 0 | } |
594 | 0 | } |
595 | 45.8k | else if ( rValue.Name == sUNO_View_SnapLinesNotes ) |
596 | 0 | { |
597 | 0 | if( rValue.Value >>= aString ) |
598 | 0 | { |
599 | 0 | SdrHelpLineList aHelpLines; |
600 | 0 | createHelpLinesFromString( aString, aHelpLines ); |
601 | 0 | SetNotesHelpLines( aHelpLines ); |
602 | 0 | } |
603 | 0 | } |
604 | 45.8k | else if ( rValue.Name == sUNO_View_SnapLinesHandout ) |
605 | 0 | { |
606 | 0 | if( rValue.Value >>= aString ) |
607 | 0 | { |
608 | 0 | SdrHelpLineList aHelpLines; |
609 | 0 | createHelpLinesFromString( aString, aHelpLines ); |
610 | 0 | SetHandoutHelpLines( aHelpLines ); |
611 | 0 | } |
612 | 0 | } |
613 | 45.8k | else if ( rValue.Name == sUNO_View_RulerIsVisible ) |
614 | 1.17k | { |
615 | 1.17k | if( rValue.Value >>= bBool ) |
616 | 1.17k | { |
617 | 1.17k | SetRuler( bBool ); |
618 | 1.17k | } |
619 | 1.17k | } |
620 | 44.6k | else if ( rValue.Name == sUNO_View_PageKind ) |
621 | 1.17k | { |
622 | 1.17k | if( rValue.Value >>= nInt16 ) |
623 | 1.14k | { |
624 | 1.14k | SdDrawDocument* pDoc = dynamic_cast<SdDrawDocument*>(&GetModel()); |
625 | 1.14k | if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) ) |
626 | 1.14k | SetPageKind( static_cast<PageKind>(nInt16) ); |
627 | | |
628 | 1.14k | SetPageKindOnLoad( static_cast<PageKind>(nInt16) ); |
629 | 1.14k | } |
630 | 1.17k | } |
631 | 43.5k | else if ( rValue.Name == sUNO_View_SelectedPage ) |
632 | 1.16k | { |
633 | 1.16k | if( rValue.Value >>= nInt16 ) |
634 | 1.16k | { |
635 | 1.16k | SdDrawDocument* pDoc = dynamic_cast<SdDrawDocument*>(&GetModel()); |
636 | 1.16k | if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) ) |
637 | 1.16k | SetSelectedPage( static_cast<sal_uInt16>(nInt16) ); |
638 | | |
639 | 1.16k | SetSelectedPageOnLoad( static_cast<sal_uInt16>(nInt16) ); |
640 | 1.16k | } |
641 | 1.16k | } |
642 | 42.3k | else if ( rValue.Name == sUNO_View_IsLayerMode ) |
643 | 1.17k | { |
644 | 1.17k | if( rValue.Value >>= bBool ) |
645 | 1.16k | { |
646 | 1.16k | SetLayerMode( bBool ); |
647 | 1.16k | } |
648 | 1.17k | } |
649 | 41.1k | else if ( rValue.Name == sUNO_View_IsDoubleClickTextEdit ) |
650 | 1.02k | { |
651 | 1.02k | if( rValue.Value >>= bBool ) |
652 | 1.02k | { |
653 | 1.02k | SetDoubleClickTextEdit( bBool ); |
654 | 1.02k | } |
655 | 1.02k | } |
656 | 40.1k | else if ( rValue.Name == sUNO_View_IsClickChangeRotation ) |
657 | 1.17k | { |
658 | 1.17k | if( rValue.Value >>= bBool ) |
659 | 1.17k | { |
660 | 1.17k | SetClickChangeRotation( bBool ); |
661 | 1.17k | } |
662 | 1.17k | } |
663 | 38.9k | else if ( rValue.Name == sUNO_View_SlidesPerRow ) |
664 | 1.01k | { |
665 | 1.01k | if( rValue.Value >>= nInt16 ) |
666 | 1.00k | { |
667 | 1.00k | SetSlidesPerRow( static_cast<sal_uInt16>(nInt16) ); |
668 | 1.00k | } |
669 | 1.01k | } |
670 | 37.9k | else if ( rValue.Name == sUNO_View_EditMode ) |
671 | 0 | { |
672 | 0 | if( rValue.Value >>= nInt32 ) |
673 | 0 | { |
674 | 0 | SdDrawDocument* pDoc = dynamic_cast<SdDrawDocument*>(&GetModel()); |
675 | 0 | if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) ) |
676 | 0 | SetViewShEditMode( static_cast<EditMode>(nInt32) ); |
677 | 0 | } |
678 | 0 | } |
679 | | // This one is kept for compatibility. Old value read from sUNO_View_EditModeStandard |
680 | | // is used. New value will be written into sUNO_View_EditMode. |
681 | | // Values from sUNO_View_EditModeNotes and sUNO_View_EditModeHangout will be ignored. |
682 | 37.9k | else if ( rValue.Name == sUNO_View_EditModeStandard ) |
683 | 1.00k | { |
684 | 1.00k | if( rValue.Value >>= nInt32 ) |
685 | 1.00k | { |
686 | 1.00k | SdDrawDocument* pDoc = dynamic_cast<SdDrawDocument*>(&GetModel()); |
687 | 1.00k | if( pDoc && pDoc->GetDocSh() && ( SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) ) |
688 | 1.00k | SetViewShEditMode( static_cast<EditMode>(nInt32) ); |
689 | 1.00k | } |
690 | 1.00k | } |
691 | 36.9k | else if ( rValue.Name == sUNO_View_VisibleAreaTop ) |
692 | 1.02k | { |
693 | 1.02k | sal_Int32 nTop = 0; |
694 | 1.02k | if( rValue.Value >>= nTop ) |
695 | 1.01k | { |
696 | 1.01k | ::tools::Rectangle aVisArea( GetVisArea() ); |
697 | 1.01k | aVisArea.AdjustBottom(nTop - aVisArea.Top() ); |
698 | 1.01k | aVisArea.SetTop( nTop ); |
699 | 1.01k | SetVisArea( aVisArea ); |
700 | 1.01k | } |
701 | 1.02k | } |
702 | 35.9k | else if ( rValue.Name == sUNO_View_VisibleAreaLeft ) |
703 | 1.02k | { |
704 | 1.02k | sal_Int32 nLeft = 0; |
705 | 1.02k | if( rValue.Value >>= nLeft ) |
706 | 1.01k | { |
707 | 1.01k | ::tools::Rectangle aVisArea( GetVisArea() ); |
708 | 1.01k | aVisArea.AdjustRight(nLeft - aVisArea.Left() ); |
709 | 1.01k | aVisArea.SetLeft( nLeft ); |
710 | 1.01k | SetVisArea( aVisArea ); |
711 | 1.01k | } |
712 | 1.02k | } |
713 | 34.9k | else if ( rValue.Name == sUNO_View_VisibleAreaWidth ) |
714 | 1.02k | { |
715 | 1.02k | sal_Int32 nWidth = 0; |
716 | 1.02k | if( rValue.Value >>= nWidth ) |
717 | 1.02k | { |
718 | 1.02k | ::tools::Rectangle aVisArea( GetVisArea() ); |
719 | 1.02k | aVisArea.SetRight( aVisArea.Left() + nWidth - 1 ); |
720 | 1.02k | SetVisArea( aVisArea ); |
721 | 1.02k | } |
722 | 1.02k | } |
723 | 33.8k | else if ( rValue.Name == sUNO_View_VisibleAreaHeight ) |
724 | 1.01k | { |
725 | 1.01k | sal_Int32 nHeight = 0; |
726 | 1.01k | if( rValue.Value >>= nHeight ) |
727 | 1.01k | { |
728 | 1.01k | ::tools::Rectangle aVisArea( GetVisArea() ); |
729 | 1.01k | aVisArea.SetBottom( nHeight + aVisArea.Top() - 1 ); |
730 | 1.01k | SetVisArea( aVisArea ); |
731 | 1.01k | } |
732 | 1.01k | } |
733 | | |
734 | 32.8k | else if ( rValue.Name == sUNO_View_GridIsVisible ) |
735 | 1.19k | { |
736 | 1.19k | if( rValue.Value >>= bBool ) |
737 | 1.17k | { |
738 | 1.17k | SetGridVisible( bBool ); |
739 | 1.17k | } |
740 | 1.19k | } |
741 | | |
742 | 31.6k | else if ( rValue.Name == sUNO_View_IsSnapToGrid ) |
743 | 1.05k | { |
744 | 1.05k | if( rValue.Value >>= bBool ) |
745 | 1.05k | { |
746 | 1.05k | SetGridSnap( bBool ); |
747 | 1.05k | } |
748 | 1.05k | } |
749 | 30.6k | else if ( rValue.Name == sUNO_View_GridIsFront ) |
750 | 1.20k | { |
751 | 1.20k | if( rValue.Value >>= bBool ) |
752 | 1.20k | { |
753 | 1.20k | SetGridFront( bBool ); |
754 | 1.20k | } |
755 | 1.20k | } |
756 | 29.4k | else if ( rValue.Name == sUNO_View_IsSnapToPageMargins ) |
757 | 1.03k | { |
758 | 1.03k | if( rValue.Value >>= bBool ) |
759 | 1.03k | { |
760 | 1.03k | SetBordSnap( bBool ); |
761 | 1.03k | } |
762 | 1.03k | } |
763 | 28.3k | else if ( rValue.Name == sUNO_View_IsSnapToSnapLines ) |
764 | 1.05k | { |
765 | 1.05k | if( rValue.Value >>= bBool ) |
766 | 1.05k | { |
767 | 1.05k | SetHlplSnap( bBool ); |
768 | 1.05k | } |
769 | 1.05k | } |
770 | 27.3k | else if ( rValue.Name == sUNO_View_IsSnapToObjectFrame ) |
771 | 1.04k | { |
772 | 1.04k | if( rValue.Value >>= bBool ) |
773 | 1.04k | { |
774 | 1.04k | SetOFrmSnap( bBool ); |
775 | 1.04k | } |
776 | 1.04k | } |
777 | 26.2k | else if ( rValue.Name == sUNO_View_IsSnapToObjectPoints ) |
778 | 1.04k | { |
779 | 1.04k | if( rValue.Value >>= bBool ) |
780 | 1.04k | { |
781 | 1.04k | SetOPntSnap( bBool ); |
782 | 1.04k | } |
783 | 1.04k | } |
784 | 25.2k | else if ( rValue.Name == sUNO_View_IsPlusHandlesAlwaysVisible ) |
785 | 1.04k | { |
786 | 1.04k | if( rValue.Value >>= bBool ) |
787 | 1.04k | { |
788 | 1.04k | SetPlusHandlesAlwaysVisible( bBool ); |
789 | 1.04k | } |
790 | 1.04k | } |
791 | 24.2k | else if ( rValue.Name == sUNO_View_IsFrameDragSingles ) |
792 | 1.03k | { |
793 | 1.03k | if( rValue.Value >>= bBool ) |
794 | 1.03k | { |
795 | 1.03k | SetFrameDragSingles( bBool ); |
796 | 1.03k | } |
797 | 1.03k | } |
798 | 23.1k | else if ( rValue.Name == sUNO_View_EliminatePolyPointLimitAngle ) |
799 | 1.03k | { |
800 | 1.03k | if( rValue.Value >>= nInt32 ) |
801 | 1.02k | { |
802 | 1.02k | SetEliminatePolyPointLimitAngle( Degree100(nInt32) ); |
803 | 1.02k | } |
804 | 1.03k | } |
805 | 22.1k | else if ( rValue.Name == sUNO_View_IsEliminatePolyPoints ) |
806 | 1.03k | { |
807 | 1.03k | if( rValue.Value >>= bBool ) |
808 | 1.03k | { |
809 | 1.03k | SetEliminatePolyPoints( bBool ); |
810 | 1.03k | } |
811 | 1.03k | } |
812 | 21.0k | else if ( rValue.Name == sUNO_View_ActiveLayer ) |
813 | 0 | { |
814 | 0 | if( rValue.Value >>= aString ) |
815 | 0 | { |
816 | 0 | SetActiveLayer( aString ); |
817 | 0 | } |
818 | 0 | } |
819 | 21.0k | else if ( rValue.Name == sUNO_View_NoAttribs ) |
820 | 1.03k | { |
821 | 1.03k | if( rValue.Value >>= bBool ) |
822 | 1.02k | { |
823 | 1.02k | SetNoAttribs( bBool ); |
824 | 1.02k | } |
825 | 1.03k | } |
826 | 20.0k | else if ( rValue.Name == sUNO_View_NoColors ) |
827 | 1.02k | { |
828 | 1.02k | if( rValue.Value >>= bBool ) |
829 | 1.02k | { |
830 | 1.02k | SetNoColors( bBool ); |
831 | 1.02k | } |
832 | 1.02k | } |
833 | 19.0k | else if ( rValue.Name == sUNO_View_GridCoarseWidth ) |
834 | 978 | { |
835 | 978 | if( rValue.Value >>= nInt32 ) |
836 | 978 | { |
837 | 978 | const Size aCoarse( nInt32, GetGridCoarse().Height() ); |
838 | 978 | SetGridCoarse( aCoarse ); |
839 | 978 | } |
840 | 978 | } |
841 | 18.0k | else if ( rValue.Name == sUNO_View_GridCoarseHeight ) |
842 | 1.01k | { |
843 | 1.01k | if( rValue.Value >>= nInt32 ) |
844 | 1.01k | { |
845 | 1.01k | const Size aCoarse( GetGridCoarse().Width(), nInt32 ); |
846 | 1.01k | SetGridCoarse( aCoarse ); |
847 | 1.01k | } |
848 | 1.01k | } |
849 | 17.0k | else if ( rValue.Name == sUNO_View_GridFineWidth ) |
850 | 805 | { |
851 | 805 | if( rValue.Value >>= nInt32 ) |
852 | 804 | { |
853 | 804 | const Size aCoarse( nInt32, GetGridFine().Height() ); |
854 | 804 | SetGridFine( aCoarse ); |
855 | 804 | } |
856 | 805 | } |
857 | 16.2k | else if ( rValue.Name == sUNO_View_GridFineHeight ) |
858 | 1.00k | { |
859 | 1.00k | if( rValue.Value >>= nInt32 ) |
860 | 1.00k | { |
861 | 1.00k | const Size aCoarse( GetGridFine().Width(), nInt32 ); |
862 | 1.00k | SetGridFine( aCoarse ); |
863 | 1.00k | } |
864 | 1.00k | } |
865 | 15.2k | else if ( rValue.Name == sUNO_View_IsAngleSnapEnabled ) |
866 | 1.37k | { |
867 | 1.37k | if( rValue.Value >>= bBool ) |
868 | 1.17k | { |
869 | 1.17k | SetAngleSnapEnabled( bBool ); |
870 | 1.17k | } |
871 | 1.37k | } |
872 | 13.8k | else if ( rValue.Name == sUNO_View_SnapAngle ) |
873 | 1.38k | { |
874 | 1.38k | if( rValue.Value >>= nInt32 ) |
875 | 1.34k | { |
876 | 1.34k | SetSnapAngle( Degree100(nInt32) ); |
877 | 1.34k | } |
878 | 1.38k | } |
879 | 12.4k | else if ( rValue.Name == sUNO_View_GridSnapWidthXNumerator ) |
880 | 1.00k | { |
881 | 1.00k | rValue.Value >>= aSnapGridWidthXNum; |
882 | 1.00k | } |
883 | 11.4k | else if ( rValue.Name == sUNO_View_GridSnapWidthXDenominator ) |
884 | 1.36k | { |
885 | 1.36k | rValue.Value >>= aSnapGridWidthXDom; |
886 | 1.36k | } |
887 | 10.1k | else if ( rValue.Name == sUNO_View_GridSnapWidthYNumerator ) |
888 | 1.34k | { |
889 | 1.34k | rValue.Value >>= aSnapGridWidthYNum; |
890 | 1.34k | } |
891 | 8.76k | else if ( rValue.Name == sUNO_View_GridSnapWidthYDenominator ) |
892 | 1.34k | { |
893 | 1.34k | rValue.Value >>= aSnapGridWidthYDom; |
894 | 1.34k | } |
895 | 7.41k | else if (!bImpress && rValue.Name == sUNO_View_VisibleLayers ) |
896 | 0 | { |
897 | 0 | SdrLayerIDSet aSdrLayerIDSets; |
898 | 0 | aSdrLayerIDSets.PutValue( rValue.Value ); |
899 | 0 | SetVisibleLayers( aSdrLayerIDSets ); |
900 | 0 | } |
901 | 7.41k | else if (!bImpress && rValue.Name == sUNO_View_PrintableLayers ) |
902 | 0 | { |
903 | 0 | SdrLayerIDSet aSdrLayerIDSets; |
904 | 0 | aSdrLayerIDSets.PutValue( rValue.Value ); |
905 | 0 | SetPrintableLayers( aSdrLayerIDSets ); |
906 | 0 | } |
907 | 7.41k | else if (!bImpress && rValue.Name == sUNO_View_LockedLayers ) |
908 | 0 | { |
909 | 0 | SdrLayerIDSet aSdrLayerIDSets; |
910 | 0 | aSdrLayerIDSets.PutValue( rValue.Value ); |
911 | 0 | SetLockedLayers( aSdrLayerIDSets ); |
912 | 0 | } |
913 | 47.0k | } |
914 | | |
915 | 1.44k | SetViewShEditModeOnLoad(EditMode::Page); |
916 | | |
917 | 1.44k | const Fraction aSnapGridWidthX( aSnapGridWidthXNum, aSnapGridWidthXDom ); |
918 | 1.44k | const Fraction aSnapGridWidthY( aSnapGridWidthYNum, aSnapGridWidthYDom ); |
919 | | |
920 | 1.44k | SetSnapGridWidth( aSnapGridWidthX, aSnapGridWidthY ); |
921 | 1.44k | } |
922 | | |
923 | | void FrameView::SetPreviousViewShellType (ViewShell::ShellType eType) |
924 | 12.5k | { |
925 | 12.5k | mePreviousViewShellType = eType; |
926 | 12.5k | } |
927 | | |
928 | | void FrameView::SetViewShellTypeOnLoad (ViewShell::ShellType eType) |
929 | 12.5k | { |
930 | 12.5k | meViewShellTypeOnLoad = eType; |
931 | 12.5k | } |
932 | | |
933 | | void FrameView::SetSelectedPage(sal_uInt16 nPage) |
934 | 12.3k | { |
935 | 12.3k | mnSelectedPage = nPage; |
936 | 12.3k | } |
937 | | |
938 | | void FrameView::SetIsNavigatorShowingAllShapes (const bool bIsNavigatorShowingAllShapes) |
939 | 0 | { |
940 | 0 | mbIsNavigatorShowingAllShapes = bIsNavigatorShowingAllShapes; |
941 | 0 | } |
942 | | |
943 | | } // end of namespace sd |
944 | | |
945 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |