cid#1607171 Data race condition
[LibreOffice.git] / sd / source / ui / view / drviewsj.cxx
blob934a4e475d218ac5a0c66eddb0b3b81a9c5ec098
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <DrawViewShell.hxx>
21 #include <com/sun/star/embed/EmbedMisc.hpp>
22 #include <com/sun/star/embed/XEmbeddedObject.hpp>
23 #include <com/sun/star/presentation/ClickAction.hpp>
24 #include <sfx2/objsh.hxx>
25 #include <svx/svxids.hrc>
26 #include <svx/sdmetitm.hxx>
27 #include <editeng/flditem.hxx>
28 #include <svx/svdogrp.hxx>
29 #include <svx/svdograf.hxx>
30 #include <svx/svdoole2.hxx>
31 #include <svx/sdtfsitm.hxx>
32 #include <svx/svdopath.hxx>
33 #include <svx/obj3d.hxx>
34 #include <svx/scene3d.hxx>
36 #include <app.hrc>
38 #include <anminfo.hxx>
39 #include <drawdoc.hxx>
40 #include <drawview.hxx>
41 #include <ViewShellBase.hxx>
43 using namespace com::sun::star;
45 namespace sd {
47 /**
48 * Set state (Enabled/Disabled) of Menu-SfxSlots
50 void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
52 // Status of menu entries (Buttons,...)
54 // Single selection
55 const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
56 const size_t nMarkCount = rMarkList.GetMarkCount();
58 if ( nMarkCount == 1 )
60 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_BEZIER_EDIT ) ||
61 SfxItemState::DEFAULT == rSet.GetItemState( SID_UNGROUP ) ||
62 SfxItemState::DEFAULT == rSet.GetItemState( SID_ENTER_GROUP ) ||
63 SfxItemState::DEFAULT == rSet.GetItemState( SID_NAME_GROUP ) ||
65 // #i68101#
66 SfxItemState::DEFAULT == rSet.GetItemState( SID_OBJECT_TITLE_DESCRIPTION ) ||
68 SfxItemState::DEFAULT == rSet.GetItemState( SID_ATTR_FILL_STYLE ) ||
69 SfxItemState::DEFAULT == rSet.GetItemState( SID_ATTR_FILL_USE_SLIDE_BACKGROUND ) ||
70 SfxItemState::DEFAULT == rSet.GetItemState( SID_ATTR_FILL_TRANSPARENCE ) ||
71 SfxItemState::DEFAULT == rSet.GetItemState( SID_ATTR_FILL_FLOATTRANSPARENCE ) ||
72 SfxItemState::DEFAULT == rSet.GetItemState( SID_CHANGEBEZIER ) ||
73 SfxItemState::DEFAULT == rSet.GetItemState( SID_CHANGEPOLYGON ) ||
74 SfxItemState::DEFAULT == rSet.GetItemState( SID_LINEEND_POLYGON ) ||
75 SfxItemState::DEFAULT == rSet.GetItemState( SID_MEASURE_DLG ) ||
76 SfxItemState::DEFAULT == rSet.GetItemState( SID_CONNECTION_DLG ) ||
77 SfxItemState::DEFAULT == rSet.GetItemState( SID_CONNECTION_NEW_ROUTING ) ||
78 SfxItemState::DEFAULT == rSet.GetItemState( SID_OBJECT_SHEAR ) ||
79 SfxItemState::DEFAULT == rSet.GetItemState( SID_OBJECT_ALIGN_LEFT ) ||
80 SfxItemState::DEFAULT == rSet.GetItemState( SID_OBJECT_ALIGN_CENTER ) ||
81 SfxItemState::DEFAULT == rSet.GetItemState( SID_OBJECT_ALIGN_RIGHT ) ||
82 SfxItemState::DEFAULT == rSet.GetItemState( SID_OBJECT_ALIGN_UP ) ||
83 SfxItemState::DEFAULT == rSet.GetItemState( SID_OBJECT_ALIGN_MIDDLE ) ||
84 SfxItemState::DEFAULT == rSet.GetItemState( SID_OBJECT_ALIGN_DOWN ) ||
85 SfxItemState::DEFAULT == rSet.GetItemState( SID_FRAME_TO_TOP ) ||
86 SfxItemState::DEFAULT == rSet.GetItemState( SID_MOREFRONT ) ||
87 SfxItemState::DEFAULT == rSet.GetItemState( SID_FRAME_UP ) ||
88 SfxItemState::DEFAULT == rSet.GetItemState( SID_MOREBACK ) ||
89 SfxItemState::DEFAULT == rSet.GetItemState( SID_FRAME_DOWN ) ||
90 SfxItemState::DEFAULT == rSet.GetItemState( SID_FRAME_TO_BOTTOM ) ||
91 SfxItemState::DEFAULT == rSet.GetItemState( SID_BEFORE_OBJ ) ||
92 SfxItemState::DEFAULT == rSet.GetItemState( SID_BEHIND_OBJ ) ||
93 SfxItemState::DEFAULT == rSet.GetItemState( SID_REVERSE_ORDER ) ||
94 SfxItemState::DEFAULT == rSet.GetItemState( SID_ORIGINAL_SIZE ) ||
95 SfxItemState::DEFAULT == rSet.GetItemState( SID_SAVE_GRAPHIC ) ||
96 SfxItemState::DEFAULT == rSet.GetItemState( SID_COMPRESS_GRAPHIC ) ||
97 SfxItemState::DEFAULT == rSet.GetItemState( SID_TEXTATTR_DLG ) ||
98 SfxItemState::DEFAULT == rSet.GetItemState( SID_EXECUTE_ANIMATION_EFFECT ))
100 const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
101 const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(pObj);
102 const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(pObj);
103 const SdAnimationInfo* pAnimationInfo
104 = SdDrawDocument::GetAnimationInfo(rMarkList.GetMark(0)->GetMarkedSdrObj());
105 SdrInventor nInv = pObj->GetObjInventor();
106 SdrObjKind nId = pObj->GetObjIdentifier();
107 SdrObjTransformInfoRec aInfoRec;
108 pObj->TakeObjInfo( aInfoRec );
110 // don't show original size entry if not possible
111 if(pSdrOle2Obj)
113 if (pSdrOle2Obj->GetObjRef().is() &&
114 (pSdrOle2Obj->GetObjRef()->getStatus( pSdrOle2Obj->GetAspect() ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE) )
115 rSet.DisableItem(SID_ORIGINAL_SIZE);
118 if(!pSdrGrafObj)
120 rSet.DisableItem(SID_SAVE_GRAPHIC);
121 rSet.DisableItem(SID_COMPRESS_GRAPHIC);
124 if (!pAnimationInfo
125 || pAnimationInfo->meClickAction == presentation::ClickAction::ClickAction_NONE
126 // Sound does not work in edit mode
127 || pAnimationInfo->meClickAction == presentation::ClickAction::ClickAction_SOUND
128 // No point in exiting the presentation in edit mode
129 || pAnimationInfo->meClickAction
130 == presentation::ClickAction::ClickAction_STOPPRESENTATION)
132 rSet.DisableItem(SID_EXECUTE_ANIMATION_EFFECT);
135 /* If it is not a group object or 3D object, we disable "enter
136 group". */
137 const auto* pSdrObjGroup = dynamic_cast<const SdrObjGroup*>(pObj);
139 if( !( ( pSdrObjGroup != nullptr && nInv == SdrInventor::Default ) ||
140 DynCastE3dScene(pObj) ) )
142 rSet.DisableItem( SID_ENTER_GROUP );
145 // Don't allow enter Diagrams
146 if(nullptr != pSdrObjGroup && pSdrObjGroup->isDiagram())
148 rSet.DisableItem( SID_ENTER_GROUP );
151 // If it is not a group object, we disable "ungroup"
152 if(pSdrObjGroup == nullptr || nInv != SdrInventor::Default)
154 rSet.DisableItem(SID_UNGROUP);
157 // Support advanced DiagramHelper
158 if(!pSdrObjGroup || !pSdrObjGroup->isDiagram())
160 rSet.DisableItem( SID_REGENERATE_DIAGRAM );
161 rSet.DisableItem( SID_EDIT_DIAGRAM );
164 if( nInv == SdrInventor::Default &&
165 (nId == SdrObjKind::Line ||
166 nId == SdrObjKind::PolyLine ||
167 nId == SdrObjKind::PathLine ||
168 nId == SdrObjKind::FreehandLine ))
170 //rSet.DisableItem( SID_ATTRIBUTES_AREA ); // remove again!
171 rSet.DisableItem( SID_ATTR_FILL_STYLE );
172 rSet.DisableItem( SID_ATTR_FILL_USE_SLIDE_BACKGROUND );
173 rSet.DisableItem( SID_ATTR_FILL_TRANSPARENCE );
174 rSet.DisableItem( SID_ATTR_FILL_FLOATTRANSPARENCE );
176 if( (dynamic_cast< const SdrPathObj *>( pObj ) == nullptr&& !aInfoRec.bCanConvToPath) || dynamic_cast< const SdrObjGroup *>( pObj ) != nullptr ) // As long as JOE handles it incorrectly!
177 { // JOE: a group object may can be converted into a PathObj
178 rSet.DisableItem( SID_LINEEND_POLYGON );
180 if(nInv == SdrInventor::Default &&
181 (nId == SdrObjKind::PathFill || nId == SdrObjKind::PathLine || !aInfoRec.bCanConvToPath))
182 rSet.DisableItem( SID_CHANGEBEZIER );
184 if( nInv == SdrInventor::Default &&
185 ( nId == SdrObjKind::Polygon || nId == SdrObjKind::PolyLine || !aInfoRec.bCanConvToPoly ) &&
186 !GetView()->IsVectorizeAllowed() )
188 rSet.DisableItem( SID_CHANGEPOLYGON );
191 if(nInv == SdrInventor::Default && nId == SdrObjKind::Table )
193 rSet.DisableItem( SID_TEXTATTR_DLG );
196 if( nInv != SdrInventor::Default || nId != SdrObjKind::Measure )
197 rSet.DisableItem( SID_MEASURE_DLG );
199 if( nInv != SdrInventor::Default || nId != SdrObjKind::Edge )
200 rSet.DisableItem( SID_CONNECTION_DLG );
201 else
203 bool bDisable = true;
204 SfxItemSet aAttrSet( GetDoc()->GetPool() );
205 GetView()->GetAttributes( aAttrSet );
207 if( aAttrSet.GetItemState( SDRATTR_EDGELINE1DELTA ) >= SfxItemState::DEFAULT &&
208 aAttrSet.GetItemState( SDRATTR_EDGELINE2DELTA ) >= SfxItemState::DEFAULT &&
209 aAttrSet.GetItemState( SDRATTR_EDGELINE3DELTA ) >= SfxItemState::DEFAULT )
211 ::tools::Long nVal1 = aAttrSet.Get( SDRATTR_EDGELINE1DELTA ).GetValue();
212 ::tools::Long nVal2 = aAttrSet.Get( SDRATTR_EDGELINE2DELTA ).GetValue();
213 ::tools::Long nVal3 = aAttrSet.Get( SDRATTR_EDGELINE3DELTA ).GetValue();
215 if( nVal1 != 0 || nVal2 != 0 || nVal3 != 0 )
216 bDisable = false;
219 if( bDisable )
220 rSet.DisableItem( SID_CONNECTION_NEW_ROUTING );
223 if ( nInv == SdrInventor::E3d ||
224 (!mpDrawView->IsConvertToPathObjPossible() &&
225 !mpDrawView->IsShearAllowed() &&
226 !mpDrawView->IsDistortAllowed()) )
228 rSet.DisableItem( SID_OBJECT_SHEAR );
231 if(dynamic_cast< const E3dCompoundObject *>( pObj ) != nullptr)
233 rSet.DisableItem( SID_OBJECT_ALIGN );
234 rSet.DisableItem( SID_OBJECT_ALIGN_LEFT );
235 rSet.DisableItem( SID_OBJECT_ALIGN_CENTER );
236 rSet.DisableItem( SID_OBJECT_ALIGN_RIGHT );
237 rSet.DisableItem( SID_OBJECT_ALIGN_UP );
238 rSet.DisableItem( SID_OBJECT_ALIGN_MIDDLE );
239 rSet.DisableItem( SID_OBJECT_ALIGN_DOWN );
240 rSet.DisableItem( SID_FRAME_TO_TOP );
241 rSet.DisableItem( SID_MOREFRONT );
242 rSet.DisableItem( SID_FRAME_UP );
243 rSet.DisableItem( SID_MOREBACK );
244 rSet.DisableItem( SID_FRAME_DOWN );
245 rSet.DisableItem( SID_FRAME_TO_BOTTOM );
246 rSet.DisableItem( SID_BEFORE_OBJ );
247 rSet.DisableItem( SID_BEHIND_OBJ );
248 rSet.DisableItem( SID_REVERSE_ORDER );
249 rSet.DisableItem( SID_POSITION );
253 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_DISMANTLE ) ||
254 SfxItemState::DEFAULT == rSet.GetItemState( SID_BREAK ) )
256 if ( !mpDrawView->IsDismantlePossible() )
258 rSet.DisableItem( SID_DISMANTLE );
261 if ( !mpDrawView->IsDismantlePossible(true) &&
262 !mpDrawView->IsImportMtfPossible() &&
263 !mpDrawView->IsBreak3DObjPossible() )
265 rSet.DisableItem( SID_BREAK );
268 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_MODIFY_FIELD ) )
270 OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
272 if( pOLV )
274 const SvxFieldItem* pFldItem = pOLV->GetFieldAtSelection();
276 if( !( pFldItem && (nullptr != dynamic_cast< const SvxDateField *>( pFldItem->GetField() ) ||
277 nullptr != dynamic_cast< const SvxAuthorField *>( pFldItem->GetField() ) ||
278 nullptr != dynamic_cast< const SvxExtFileField *>( pFldItem->GetField() ) ||
279 nullptr != dynamic_cast< const SvxExtTimeField *>( pFldItem->GetField() ) ) ) )
281 rSet.DisableItem( SID_MODIFY_FIELD );
284 else
285 rSet.DisableItem( SID_MODIFY_FIELD );
287 if( SfxItemState::DEFAULT == rSet.GetItemState( SID_OUTLINE_TEXT_AUTOFIT ) )
289 const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
290 const SdrTextFitToSizeTypeItem* pItem = pObj->GetMergedItemSet().GetItem<SdrTextFitToSizeTypeItem>(SDRATTR_TEXT_FITTOSIZE);
291 const bool bSet = pItem && pItem->GetValue() != drawing::TextFitToSizeType_NONE;
292 rSet.Put(SfxBoolItem(SID_OUTLINE_TEXT_AUTOFIT, bSet));
295 rSet.DisableItem(SID_GROUP);
296 rSet.DisableItem(SID_TEXT_COMBINE);
297 rSet.DisableItem(SID_COMBINE);
298 rSet.DisableItem(SID_DISTRIBUTE_HLEFT);
299 rSet.DisableItem(SID_DISTRIBUTE_HCENTER);
300 rSet.DisableItem(SID_DISTRIBUTE_HDISTANCE);
301 rSet.DisableItem(SID_DISTRIBUTE_HRIGHT);
302 rSet.DisableItem(SID_DISTRIBUTE_VTOP);
303 rSet.DisableItem(SID_DISTRIBUTE_VCENTER);
304 rSet.DisableItem(SID_DISTRIBUTE_VDISTANCE);
305 rSet.DisableItem(SID_DISTRIBUTE_VBOTTOM);
306 rSet.DisableItem(SID_POLY_MERGE);
307 rSet.DisableItem(SID_POLY_SUBSTRACT);
308 rSet.DisableItem(SID_POLY_INTERSECT);
309 rSet.DisableItem(SID_EQUALIZEWIDTH);
310 rSet.DisableItem(SID_EQUALIZEHEIGHT);
311 rSet.DisableItem(SID_CONNECT);
313 // multi-selection
314 else if( nMarkCount > 1 )
316 // distribute dialog for 3+n objects
317 if(nMarkCount <= 2)
319 rSet.DisableItem(SID_DISTRIBUTE_HLEFT);
320 rSet.DisableItem(SID_DISTRIBUTE_HCENTER);
321 rSet.DisableItem(SID_DISTRIBUTE_HDISTANCE);
322 rSet.DisableItem(SID_DISTRIBUTE_HRIGHT);
323 rSet.DisableItem(SID_DISTRIBUTE_VTOP);
324 rSet.DisableItem(SID_DISTRIBUTE_VCENTER);
325 rSet.DisableItem(SID_DISTRIBUTE_VDISTANCE);
326 rSet.DisableItem(SID_DISTRIBUTE_VBOTTOM);
329 rSet.DisableItem( SID_LINEEND_POLYGON );
330 rSet.DisableItem( SID_ENTER_GROUP );
331 // Now names for objects have to be unique
332 rSet.DisableItem( SID_NAME_GROUP );
333 // #i68101#
334 rSet.DisableItem( SID_OBJECT_TITLE_DESCRIPTION );
335 rSet.DisableItem( SID_MODIFY_FIELD );
338 bool bText = false;
339 bool bLine = false;
340 bool bGroup = false;
341 bool bDrawObj = false;
342 bool b3dObj = false;
343 bool bTable = false;
344 bool bMeasureObj = false;
345 bool bEdgeObj = false; // Connector
346 bool bE3dCompoundObject = false;
348 for( size_t i = 0; i < nMarkCount && !bText && i < 50; ++i )
350 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
351 SdrInventor nInv = pObj->GetObjInventor();
352 SdrObjKind nId = pObj->GetObjIdentifier();
354 if (nInv == SdrInventor::Default)
356 switch (nId)
358 case SdrObjKind::Text: bText = true; break;
360 case SdrObjKind::Line: bLine = true; break;
362 case SdrObjKind::Edge: bEdgeObj = true; break;
364 case SdrObjKind::Measure: bMeasureObj = true; break;
366 case SdrObjKind::Rectangle:
367 case SdrObjKind::CircleOrEllipse:
368 case SdrObjKind::FreehandLine:
369 case SdrObjKind::FreehandFill:
370 case SdrObjKind::PathFill:
371 case SdrObjKind::PathLine:
372 case SdrObjKind::CircleSection:
373 case SdrObjKind::CircleArc:
374 case SdrObjKind::CircleCut: bDrawObj = true; break;
376 case SdrObjKind::Group: bGroup = true; break;
378 case SdrObjKind::Graphic: break;
380 case SdrObjKind::Table: bTable = true; break;
381 default: ;
384 else if (nInv == SdrInventor::E3d)
386 if(DynCastE3dScene(pObj))
387 b3dObj = true;
388 else if(dynamic_cast< const E3dCompoundObject* >(pObj) != nullptr)
389 bE3dCompoundObject = true;
392 if( bLine && !bText && !bDrawObj &&!b3dObj)
394 rSet.DisableItem( SID_ATTR_FILL_STYLE );
395 rSet.DisableItem( SID_ATTR_FILL_USE_SLIDE_BACKGROUND );
396 rSet.DisableItem( SID_ATTR_FILL_TRANSPARENCE );
397 rSet.DisableItem( SID_ATTR_FILL_FLOATTRANSPARENCE );
399 if( !bEdgeObj )
400 rSet.DisableItem( SID_CONNECTION_DLG );
402 if (b3dObj)
404 rSet.DisableItem( SID_COMBINE );
405 rSet.DisableItem(SID_POLY_MERGE);
406 rSet.DisableItem(SID_POLY_SUBSTRACT);
407 rSet.DisableItem(SID_POLY_INTERSECT);
408 rSet.DisableItem(SID_EQUALIZEWIDTH);
409 rSet.DisableItem(SID_EQUALIZEHEIGHT);
412 if (b3dObj ||
413 (!mpDrawView->IsConvertToPathObjPossible() &&
414 !mpDrawView->IsShearAllowed() &&
415 !mpDrawView->IsDistortAllowed()) )
417 rSet.DisableItem( SID_OBJECT_SHEAR );
420 if( !bGroup )
422 rSet.DisableItem( SID_UNGROUP );
424 if( bTable )
425 rSet.DisableItem( SID_TEXTATTR_DLG );
427 if( !bMeasureObj )
428 rSet.DisableItem( SID_MEASURE_DLG );
430 if(bE3dCompoundObject)
432 rSet.DisableItem( SID_OBJECT_ALIGN );
433 rSet.DisableItem( SID_OBJECT_ALIGN_LEFT );
434 rSet.DisableItem( SID_OBJECT_ALIGN_CENTER );
435 rSet.DisableItem( SID_OBJECT_ALIGN_RIGHT );
436 rSet.DisableItem( SID_OBJECT_ALIGN_UP );
437 rSet.DisableItem( SID_OBJECT_ALIGN_MIDDLE );
438 rSet.DisableItem( SID_OBJECT_ALIGN_DOWN );
439 rSet.DisableItem( SID_FRAME_TO_TOP );
440 rSet.DisableItem( SID_MOREFRONT );
441 rSet.DisableItem( SID_FRAME_UP );
442 rSet.DisableItem( SID_MOREBACK );
443 rSet.DisableItem( SID_FRAME_DOWN );
444 rSet.DisableItem( SID_FRAME_TO_BOTTOM );
445 rSet.DisableItem( SID_BEFORE_OBJ );
446 rSet.DisableItem( SID_BEHIND_OBJ );
447 rSet.DisableItem( SID_REVERSE_ORDER );
448 rSet.DisableItem( SID_POSITION );
452 if ( !mpDrawView->IsDismantlePossible() )
454 rSet.DisableItem( SID_DISMANTLE );
456 if ( !mpDrawView->IsDismantlePossible(true) &&
457 !mpDrawView->IsImportMtfPossible() &&
458 !mpDrawView->IsBreak3DObjPossible() )
460 rSet.DisableItem( SID_BREAK );
462 if ( !mpDrawView->IsCombinePossible() )
464 rSet.DisableItem(SID_COMBINE);
465 rSet.DisableItem(SID_POLY_MERGE);
466 rSet.DisableItem(SID_POLY_SUBSTRACT);
467 rSet.DisableItem(SID_POLY_INTERSECT);
468 rSet.DisableItem(SID_EQUALIZEWIDTH);
469 rSet.DisableItem(SID_EQUALIZEHEIGHT);
471 if ( !mpDrawView->IsCombinePossible(true) )
473 rSet.DisableItem( SID_CONNECT );
475 if ( !mpDrawView->IsGroupPossible() )
477 rSet.DisableItem( SID_GROUP );
479 if ( !mpDrawView->IsUnGroupPossible() )
481 rSet.DisableItem( SID_UNGROUP );
484 // select no object
485 else
487 rSet.DisableItem(SID_SETLAYER);
488 rSet.DisableItem( SID_ENTER_GROUP );
489 rSet.DisableItem( SID_CUT );
490 rSet.DisableItem( SID_COPY );
491 rSet.DisableItem( SID_DELETE );
492 rSet.DisableItem( SID_ATTR_TRANSFORM );
494 rSet.DisableItem( SID_OBJECT_ALIGN );
495 rSet.DisableItem( SID_OBJECT_ALIGN_LEFT );
496 rSet.DisableItem( SID_OBJECT_ALIGN_CENTER );
497 rSet.DisableItem( SID_OBJECT_ALIGN_RIGHT );
498 rSet.DisableItem( SID_OBJECT_ALIGN_UP );
499 rSet.DisableItem( SID_OBJECT_ALIGN_MIDDLE );
500 rSet.DisableItem( SID_OBJECT_ALIGN_DOWN );
502 rSet.DisableItem( SID_FRAME_TO_TOP );
503 rSet.DisableItem( SID_MOREFRONT );
504 rSet.DisableItem( SID_FRAME_UP );
505 rSet.DisableItem( SID_MOREBACK );
506 rSet.DisableItem( SID_FRAME_DOWN );
507 rSet.DisableItem( SID_FRAME_TO_BOTTOM );
508 rSet.DisableItem( SID_BEFORE_OBJ );
509 rSet.DisableItem( SID_BEHIND_OBJ );
510 rSet.DisableItem( SID_POSITION );
512 rSet.DisableItem( SID_SIZE_OPTIMAL );
513 rSet.DisableItem( SID_LINEEND_POLYGON );
514 rSet.DisableItem( SID_COPYOBJECTS );
515 rSet.DisableItem( SID_HORIZONTAL );
516 rSet.DisableItem( SID_VERTICAL );
517 rSet.DisableItem( SID_FLIP_HORIZONTAL );
518 rSet.DisableItem( SID_FLIP_VERTICAL );
519 rSet.DisableItem( SID_GROUP );
520 rSet.DisableItem( SID_UNGROUP );
521 rSet.DisableItem( SID_NAME_GROUP );
523 // #i68101#
524 rSet.DisableItem( SID_OBJECT_TITLE_DESCRIPTION );
526 rSet.DisableItem( SID_DISMANTLE );
527 rSet.DisableItem( SID_BREAK );
528 rSet.DisableItem( SID_TEXT_COMBINE );
529 rSet.DisableItem( SID_COMBINE );
530 rSet.DisableItem(SID_DISTRIBUTE_DLG);
531 rSet.DisableItem(SID_DISTRIBUTE_HLEFT);
532 rSet.DisableItem(SID_DISTRIBUTE_HCENTER);
533 rSet.DisableItem(SID_DISTRIBUTE_HDISTANCE);
534 rSet.DisableItem(SID_DISTRIBUTE_HRIGHT);
535 rSet.DisableItem(SID_DISTRIBUTE_VTOP);
536 rSet.DisableItem(SID_DISTRIBUTE_VCENTER);
537 rSet.DisableItem(SID_DISTRIBUTE_VDISTANCE);
538 rSet.DisableItem(SID_DISTRIBUTE_VBOTTOM);
539 rSet.DisableItem(SID_POLY_MERGE);
540 rSet.DisableItem(SID_POLY_SUBSTRACT);
541 rSet.DisableItem(SID_POLY_INTERSECT);
542 rSet.DisableItem(SID_EQUALIZEWIDTH);
543 rSet.DisableItem(SID_EQUALIZEHEIGHT);
544 rSet.DisableItem( SID_CONNECT );
545 rSet.DisableItem( SID_ANIMATION_EFFECTS );
546 rSet.DisableItem( SID_EXECUTE_ANIMATION_EFFECT );
547 rSet.DisableItem( SID_MODIFY_FIELD );
548 rSet.DisableItem (SID_OBJECT_SHEAR);
551 if (GetObjectShell()->isContentExtractionLocked())
553 rSet.DisableItem(SID_COPY);
554 rSet.DisableItem(SID_CUT);
556 if(GetObjectShell()->isExportLocked())
558 rSet.DisableItem(SID_SAVE_GRAPHIC);
559 rSet.DisableItem(SID_EXTERNAL_EDIT);
561 if (GetDoc()->getImagePreferredDPI() <= 0)
563 rSet.DisableItem(SID_GRAPHIC_SIZE_CHECK);
567 const SdViewOptions& DrawViewShell::GetViewOptions() const
569 return GetViewShellBase().GetViewOptions();
572 void DrawViewShell::SetViewOptions(const SdViewOptions& rOptions)
574 GetViewShellBase().SetViewOptions(rOptions);
577 } // end of namespace sd
579 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */