xref: /aoo41x/main/sd/source/ui/view/drviewsj.cxx (revision d5370dc8)
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 "DrawViewShell.hxx"
28 #include <com/sun/star/embed/EmbedMisc.hpp>
29 #include <svl/aeitem.hxx>
30 #ifndef _SVXIDS_HRC //autogen
31 #include <svx/svxids.hrc>
32 #endif
33 #ifndef _GLOBL3D_HXX //autogen
34 #include <svx/globl3d.hxx>
35 #endif
36 #include <editeng/eeitem.hxx>
37 #ifndef _FLDITEM_HXX
38 #include <editeng/flditem.hxx>
39 #endif
40 #include <svx/svdogrp.hxx>
41 #include <svx/svdograf.hxx>
42 #include <svx/svdoole2.hxx>
43 #include <svx/sxelditm.hxx>
44 #include <sfx2/dispatch.hxx>
45 #include <sfx2/request.hxx>
46 #include <svx/svdopath.hxx>
47 #include <svx/polysc3d.hxx>
48 #include <svx/obj3d.hxx>
49 #include <sfx2/event.hxx>
50 #include <sfx2/docfile.hxx>
51 #include <rtl/ustrbuf.hxx>
52 
53 
54 #include "app.hrc"
55 
56 #include "Outliner.hxx"
57 #include "sdpage.hxx"
58 #include "fupoor.hxx"
59 #include "fusel.hxx"
60 #include "drawdoc.hxx"
61 #include "DrawDocShell.hxx"
62 #include "drawview.hxx"
63 #include "optsitem.hxx"
64 
65 using namespace com::sun::star;
66 
67 namespace sd {
68 
69 /*************************************************************************
70 |*
71 |* Status (Enabled/Disabled) von Menue-SfxSlots setzen
72 |*
73 \************************************************************************/
74 
75 void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet )
76 {
77 	// Status der Menueintraege, bzw. Buttons
78 	// Einfachselektion
79 
80 	const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList();
81 	sal_uLong nMarkCount = rMarkList.GetMarkCount();
82 
83 	if ( nMarkCount == 1 )
84 	{
85 		if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_BEZIER_EDIT ) ||
86 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_UNGROUP ) ||
87 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ENTER_GROUP ) ||
88 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_NAME_GROUP ) ||
89 
90 			// #i68101#
91 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_TITLE_DESCRIPTION ) ||
92 
93 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ATTR_FILL_STYLE ) ||
94 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ATTR_FILL_TRANSPARENCE ) ||
95 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ATTR_FILL_FLOATTRANSPARENCE ) ||
96 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CHANGEBEZIER ) ||
97 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CHANGEPOLYGON ) ||
98 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_LINEEND_POLYGON ) ||
99 			SFX_ITEM_AVAILABLE == rSet.GetItemState( OBJ_TITLETEXT ) ||
100 			SFX_ITEM_AVAILABLE == rSet.GetItemState( OBJ_OUTLINETEXT ) ||
101 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_MEASURE_DLG ) ||
102 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONNECTION_DLG ) ||
103 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONNECTION_NEW_ROUTING ) ||
104 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_3D_LATHE ) ||
105 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_3D_LATHE_FAST ) ||
106 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_SHEAR ) ||
107 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_1BIT_THRESHOLD ) ||
108 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_1BIT_MATRIX ) ||
109 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_4BIT_GRAYS ) ||
110 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_4BIT_COLORS ) ||
111 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_8BIT_GRAYS ) ||
112 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_8BIT_COLORS ) ||
113 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_24BIT ) ||
114 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_LEFT ) ||
115 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_CENTER ) ||
116 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_RIGHT ) ||
117 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_UP ) ||
118 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_MIDDLE ) ||
119 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_DOWN ) ||
120 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_FRAME_TO_TOP ) ||
121 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_MOREFRONT ) ||
122 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_MOREBACK ) ||
123 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_FRAME_TO_BOTTOM ) ||
124 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_BEFORE_OBJ ) ||
125 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_BEHIND_OBJ ) ||
126 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_REVERSE_ORDER ) ||
127 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ORIGINAL_SIZE ) ||
128  			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_SAVEGRAPHIC ) ||
129 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_TEXTATTR_DLG ) )
130 		{
131 			const SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
132             const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(pObj);
133             const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(pObj);
134 			sal_uInt32 nInv = pObj->GetObjInventor();
135 			sal_uInt16 nId = pObj->GetObjIdentifier();
136 			SdrObjTransformInfoRec aInfoRec;
137 			pObj->TakeObjInfo( aInfoRec );
138 
139 			// #91929#; don't show original size entry if not possible
140             if(pSdrOle2Obj)
141 			{
142                 if (pSdrOle2Obj->GetObjRef().is() &&
143                     ((pSdrOle2Obj->GetObjRef()->getStatus( pSdrOle2Obj->GetAspect() ) & embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE) ) )
144 					rSet.DisableItem(SID_ORIGINAL_SIZE);
145             }
146 
147 			if(!pSdrGrafObj)
148 			{
149 				rSet.DisableItem(SID_SAVEGRAPHIC);
150 			}
151 
152 			// Wenn es sich um kein Gruppenobjekt oder 3D-Objekt handelt
153 			// wird "Gruppe betreten" disabled
154 			if( !( ( pObj->ISA( SdrObjGroup ) && nInv == SdrInventor ) ||
155 				(pObj->ISA (E3dPolyScene) || pObj->ISA (E3dScene) /*|| pObj->ISA (E3dCompoundObject) */) ) )
156 			{
157 				rSet.DisableItem( SID_ENTER_GROUP );
158 			}
159 
160 			// Wenn es sich um kein Gruppenobjekt handelt
161 			// wird "Gruppierung aufheben" disabled
162 			if (!(pObj->ISA(SdrObjGroup) && nInv == SdrInventor))
163 			{
164 				rSet.DisableItem(SID_UNGROUP);
165 			}
166 /*
167 			if (!pObj->ISA(SdrObjGroup) && !pObj->ISA(SdrGrafObj) && !pObj->ISA(SdrOle2Obj))
168 			{
169 				rSet.DisableItem( SID_NAME_GROUP );
170 			}
171 */
172 			if(!pSdrGrafObj ||
173 				pSdrGrafObj->GetGraphicType() != GRAPHIC_BITMAP ||
174 				pSdrGrafObj->IsLinkedGraphic() ||
175                 pSdrGrafObj->isEmbeddedSvg())
176 			{
177 				rSet.DisableItem(SID_CONVERT_TO_1BIT_THRESHOLD);
178 				rSet.DisableItem(SID_CONVERT_TO_1BIT_MATRIX);
179 				rSet.DisableItem(SID_CONVERT_TO_4BIT_GRAYS);
180 				rSet.DisableItem(SID_CONVERT_TO_4BIT_COLORS);
181 				rSet.DisableItem(SID_CONVERT_TO_8BIT_GRAYS);
182 				rSet.DisableItem(SID_CONVERT_TO_8BIT_COLORS);
183 				rSet.DisableItem(SID_CONVERT_TO_24BIT);
184 			}
185 
186 			if( nInv == SdrInventor &&
187 			   (nId == OBJ_LINE ||
188 				nId == OBJ_PLIN ||
189 				nId == OBJ_PATHLINE ||
190 				nId == OBJ_FREELINE ))
191 			{
192 				//rSet.DisableItem( SID_ATTRIBUTES_AREA ); // wieder raus!
193 				rSet.DisableItem( SID_ATTR_FILL_STYLE );
194 				rSet.DisableItem( SID_ATTR_FILL_TRANSPARENCE );
195 				rSet.DisableItem( SID_ATTR_FILL_FLOATTRANSPARENCE );
196 			}
197 			if( (!pObj->ISA( SdrPathObj ) && !aInfoRec.bCanConvToPath) || pObj->ISA( SdrObjGroup ) ) // Solange es JOE fehlerhaft behandelt!
198 			{ // JOE: Ein Gruppenobjekt kann eben u.U. in ein PathObj gewandelt werden
199 				rSet.DisableItem( SID_LINEEND_POLYGON );
200 			}
201 			if(nInv == SdrInventor &&
202 			   (nId == OBJ_PATHFILL || nId == OBJ_PATHLINE || !aInfoRec.bCanConvToPath))
203 				rSet.DisableItem( SID_CHANGEBEZIER );
204 
205 			if( nInv == SdrInventor &&
206 				( nId == OBJ_POLY || nId == OBJ_PLIN || !aInfoRec.bCanConvToPoly ) &&
207 				!GetView()->IsVectorizeAllowed() )
208 			{
209 				rSet.DisableItem( SID_CHANGEPOLYGON );
210 			}
211 
212 			if(nInv == SdrInventor && nId == OBJ_TABLE )
213 			{
214 				rSet.DisableItem( SID_TEXTATTR_DLG );
215 			}
216 
217 			if( nInv != SdrInventor || nId != OBJ_MEASURE )
218 				rSet.DisableItem( SID_MEASURE_DLG );
219 
220 			if( nInv != SdrInventor || nId != OBJ_EDGE )
221 				rSet.DisableItem( SID_CONNECTION_DLG );
222 			else
223 			{
224 				sal_Bool bDisable = sal_True;
225 				SfxItemSet aAttrSet( GetDoc()->GetPool() );
226 				GetView()->GetAttributes( aAttrSet );
227 
228 				if( aAttrSet.GetItemState( SDRATTR_EDGELINE1DELTA ) >= SFX_ITEM_AVAILABLE &&
229 					aAttrSet.GetItemState( SDRATTR_EDGELINE2DELTA ) >= SFX_ITEM_AVAILABLE &&
230 					aAttrSet.GetItemState( SDRATTR_EDGELINE3DELTA ) >= SFX_ITEM_AVAILABLE )
231 				{
232 					long nVal1 = ( ( const SdrEdgeLine1DeltaItem& ) aAttrSet.Get( SDRATTR_EDGELINE1DELTA ) ).GetValue();
233 					long nVal2 = ( ( const SdrEdgeLine2DeltaItem& ) aAttrSet.Get( SDRATTR_EDGELINE2DELTA ) ).GetValue();
234 					long nVal3 = ( ( const SdrEdgeLine3DeltaItem& ) aAttrSet.Get( SDRATTR_EDGELINE3DELTA ) ).GetValue();
235 					{
236 						if( nVal1 != 0 || nVal2 != 0 || nVal3 != 0 )
237 							bDisable = sal_False;
238 					}
239 				}
240 				if( bDisable )
241 					rSet.DisableItem( SID_CONNECTION_NEW_ROUTING );
242 			}
243 
244 			if ( nInv == E3dInventor                          ||
245 				 (!mpDrawView->IsConvertToPathObjPossible(sal_False) &&
246 				  !mpDrawView->IsShearAllowed()                  &&
247 				  !mpDrawView->IsDistortAllowed()) )
248 			{
249 				rSet.DisableItem( SID_OBJECT_SHEAR );
250 			}
251 
252 			if(pObj->ISA(E3dCompoundObject))
253 			{
254 				rSet.DisableItem( SID_OBJECT_ALIGN_LEFT );
255 				rSet.DisableItem( SID_OBJECT_ALIGN_CENTER );
256 				rSet.DisableItem( SID_OBJECT_ALIGN_RIGHT );
257 				rSet.DisableItem( SID_OBJECT_ALIGN_UP );
258 				rSet.DisableItem( SID_OBJECT_ALIGN_MIDDLE );
259 				rSet.DisableItem( SID_OBJECT_ALIGN_DOWN );
260 				rSet.DisableItem( SID_FRAME_TO_TOP );
261 				rSet.DisableItem( SID_MOREFRONT );
262 				rSet.DisableItem( SID_MOREBACK );
263 				rSet.DisableItem( SID_FRAME_TO_BOTTOM );
264 				rSet.DisableItem( SID_BEFORE_OBJ );
265 				rSet.DisableItem( SID_BEHIND_OBJ );
266 				rSet.DisableItem( SID_REVERSE_ORDER );
267 			}
268 		}
269 
270 		if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_DISMANTLE ) ||
271 			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_BREAK ) )
272 		{
273 			if ( !mpDrawView->IsDismantlePossible(sal_False) )
274 			{
275 				rSet.DisableItem( SID_DISMANTLE );
276 			}
277 
278 			if ( !mpDrawView->IsDismantlePossible(sal_True) &&
279 				 !mpDrawView->IsImportMtfPossible()     &&
280 				 !mpDrawView->IsBreak3DObjPossible() )
281 			{
282 				rSet.DisableItem( SID_BREAK );
283 			}
284 		}
285 		if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_MODIFY_FIELD ) )
286 		{
287 			OutlinerView* pOLV = mpDrawView->GetTextEditOutlinerView();
288 
289 			if( pOLV )
290 			{
291 				const SvxFieldItem* pFldItem = pOLV->GetFieldAtSelection();
292 
293 				if( !( pFldItem && (pFldItem->GetField()->ISA( SvxDateField ) ||
294 								 pFldItem->GetField()->ISA( SvxAuthorField ) ||
295 								 pFldItem->GetField()->ISA( SvxExtFileField ) ||
296 								 pFldItem->GetField()->ISA( SvxExtTimeField ) ) ) )
297 				{
298 					rSet.DisableItem( SID_MODIFY_FIELD );
299 				}
300 			}
301 			else
302 				rSet.DisableItem( SID_MODIFY_FIELD );
303 		}
304 
305 		rSet.DisableItem( SID_GROUP );
306 		rSet.DisableItem( SID_COMBINE );
307         rSet.DisableItem(SID_DISTRIBUTE_DLG);
308         rSet.DisableItem(SID_POLY_MERGE);
309         rSet.DisableItem(SID_POLY_SUBSTRACT);
310         rSet.DisableItem(SID_POLY_INTERSECT);
311 		rSet.DisableItem( SID_CONNECT );
312 	}
313 	// Mehrfachselektion
314 	else if( nMarkCount > 1 )
315 	{
316 		// distribure dialog for 3+n objects
317 		if(nMarkCount <= 2)
318 			rSet.DisableItem(SID_DISTRIBUTE_DLG);
319 
320 //        rSet.ClearItem( SID_BEZIER_EDIT );
321 //        rSet.DisableItem( SID_BEZIER_EDIT );
322 		rSet.DisableItem( SID_LINEEND_POLYGON );
323 		rSet.DisableItem( SID_ENTER_GROUP );
324 		// Jetzt (28.10.96) muessen Namen fuer Objekte eindeutig sein
325 		rSet.DisableItem( SID_NAME_GROUP );
326 		// #i68101#
327 		rSet.DisableItem( SID_OBJECT_TITLE_DESCRIPTION );
328 		rSet.DisableItem( SID_MODIFY_FIELD );
329 
330 		if( 1 )
331 //		if( SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_ATTR_FILL_STYLE ) ||
332 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_UNGROUP ) ||
333 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_MEASURE_DLG ) ||
334 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONNECTION_DLG ) ||
335 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_COMBINE ) ||
336 //            SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_SHEAR ) ||
337 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_TEXTATTR_DLG ) ||
338 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_3D_LATHE ) ||
339 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_CONVERT_TO_3D_LATHE_FAST ) ||
340 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_LEFT ) ||
341 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_CENTER ) ||
342 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_RIGHT ) ||
343 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_UP ) ||
344 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_MIDDLE ) ||
345 //			SFX_ITEM_AVAILABLE == rSet.GetItemState( SID_OBJECT_ALIGN_DOWN ) )
346 		{
347 			sal_Bool bText = sal_False;
348 			sal_Bool bLine = sal_False;
349 			sal_Bool bGroup = sal_False;
350 			sal_Bool bGraf = sal_False;
351 			sal_Bool bDrawObj = sal_False;
352 			sal_Bool b3dObj = sal_False;
353 			sal_Bool bTitOutText = sal_False;
354 			bool bTable = false;
355 			sal_Bool bMeasureObj = sal_False;
356 			sal_Bool bEdgeObj = sal_False; // Connector
357 			sal_Bool bE3dCompoundObject = sal_False;
358 
359 			for( sal_uLong i = 0;
360 				 i < nMarkCount && !bText && i < 50;
361 				 i++ )
362 			{
363 				SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
364 				sal_uInt32 nInv = pObj->GetObjInventor();
365 				sal_uInt16 nId = pObj->GetObjIdentifier();
366 
367 				if (nInv == SdrInventor)
368 				{
369 					switch (nId)
370 					{
371 						case OBJ_TEXT: bText = sal_True; break;
372 
373 						case OBJ_LINE: bLine = sal_True; break;
374 
375 						case OBJ_EDGE: bEdgeObj = sal_True; break;
376 
377 						case OBJ_MEASURE: bMeasureObj = sal_True; break;
378 
379 						case OBJ_RECT:
380 						case OBJ_CIRC:
381 						case OBJ_FREELINE:
382 						case OBJ_FREEFILL:
383 						case OBJ_PATHFILL:
384 						case OBJ_PATHLINE:
385 						case OBJ_SECT:
386 						case OBJ_CARC:
387 						case OBJ_CCUT: bDrawObj = sal_True; break;
388 
389 						case OBJ_GRUP: bGroup = sal_True; break;
390 
391 						case OBJ_GRAF: bGraf = sal_True; break;
392 
393 						case OBJ_TITLETEXT:
394 						case OBJ_OUTLINETEXT: bTitOutText = sal_True; break;
395 						case OBJ_TABLE: bTable = true; break;
396 					}
397 				}
398 				else if (nInv == E3dInventor)
399 				{
400 					if(pObj->ISA(E3dScene))
401 						b3dObj = sal_True;
402 					else if(pObj->ISA(E3dCompoundObject))
403 						bE3dCompoundObject = sal_True;
404 				}
405 			}
406 			/* Kann wohl raus, da jedes(?) Objekt Text enthalten kann
407 			if( !bText )
408 			{
409 				rSet.DisableItem( SID_CHAR_DLG );
410 				rSet.DisableItem( SID_PARA_DLG );
411 				rSet.DisableItem( SID_CHARMAP );
412 			}
413 			*/
414 			if( bLine && !bText && !bDrawObj &&!b3dObj)
415 			{
416 				//rSet.DisableItem( SID_ATTRIBUTES_AREA );
417 				rSet.DisableItem( SID_ATTR_FILL_STYLE );
418 				rSet.DisableItem( SID_ATTR_FILL_TRANSPARENCE );
419 				rSet.DisableItem( SID_ATTR_FILL_FLOATTRANSPARENCE );
420 			}
421 			if( !bEdgeObj )
422 				rSet.DisableItem( SID_CONNECTION_DLG );
423 
424 			if (b3dObj)
425 			{
426 				rSet.DisableItem( SID_COMBINE );
427 				rSet.DisableItem(SID_POLY_MERGE);
428 				rSet.DisableItem(SID_POLY_SUBSTRACT);
429 				rSet.DisableItem(SID_POLY_INTERSECT);
430 			}
431 
432 			if (b3dObj                                        ||
433 				 (!mpDrawView->IsConvertToPathObjPossible(sal_False) &&
434 				  !mpDrawView->IsShearAllowed()                  &&
435 				  !mpDrawView->IsDistortAllowed()) )
436 			{
437 				rSet.DisableItem( SID_OBJECT_SHEAR );
438 			}
439 
440 			if( !bGroup )
441 			{
442 				rSet.DisableItem( SID_UNGROUP );
443 			}
444 			if( bTable )
445 				rSet.DisableItem( SID_TEXTATTR_DLG );
446 
447 			if( !bMeasureObj )
448 				rSet.DisableItem( SID_MEASURE_DLG );
449 
450 			if (!bGraf)
451 			{
452 				rSet.DisableItem(SID_CONVERT_TO_1BIT_THRESHOLD);
453 				rSet.DisableItem(SID_CONVERT_TO_1BIT_MATRIX);
454 				rSet.DisableItem(SID_CONVERT_TO_4BIT_GRAYS);
455 				rSet.DisableItem(SID_CONVERT_TO_4BIT_COLORS);
456 				rSet.DisableItem(SID_CONVERT_TO_8BIT_GRAYS);
457 				rSet.DisableItem(SID_CONVERT_TO_8BIT_COLORS);
458 				rSet.DisableItem(SID_CONVERT_TO_24BIT);
459 			}
460 
461 			if(bE3dCompoundObject)
462 			{
463 				rSet.DisableItem( SID_OBJECT_ALIGN_LEFT );
464 				rSet.DisableItem( SID_OBJECT_ALIGN_CENTER );
465 				rSet.DisableItem( SID_OBJECT_ALIGN_RIGHT );
466 				rSet.DisableItem( SID_OBJECT_ALIGN_UP );
467 				rSet.DisableItem( SID_OBJECT_ALIGN_MIDDLE );
468 				rSet.DisableItem( SID_OBJECT_ALIGN_DOWN );
469 				rSet.DisableItem( SID_FRAME_TO_TOP );
470 				rSet.DisableItem( SID_MOREFRONT );
471 				rSet.DisableItem( SID_MOREBACK );
472 				rSet.DisableItem( SID_FRAME_TO_BOTTOM );
473 				rSet.DisableItem( SID_BEFORE_OBJ );
474 				rSet.DisableItem( SID_BEHIND_OBJ );
475 				rSet.DisableItem( SID_REVERSE_ORDER );
476 			}
477 		}
478 
479 		if ( !mpDrawView->IsDismantlePossible(sal_False) )
480 		{
481 			rSet.DisableItem( SID_DISMANTLE );
482 		}
483 		if ( !mpDrawView->IsDismantlePossible(sal_True) &&
484 			 !mpDrawView->IsImportMtfPossible()     &&
485 			 !mpDrawView->IsBreak3DObjPossible() )
486 		{
487 			rSet.DisableItem( SID_BREAK );
488 		}
489 		if ( !mpDrawView->IsCombinePossible(sal_False) )
490 		{
491 			rSet.DisableItem( SID_COMBINE );
492 			rSet.DisableItem(SID_POLY_MERGE);
493 			rSet.DisableItem(SID_POLY_SUBSTRACT);
494 			rSet.DisableItem(SID_POLY_INTERSECT);
495 		}
496 		if ( !mpDrawView->IsCombinePossible(sal_True) )
497 		{
498 			rSet.DisableItem( SID_CONNECT );
499 		}
500 		if ( !mpDrawView->IsGroupPossible() )
501 		{
502 			rSet.DisableItem( SID_GROUP );
503 		}
504 		if ( !mpDrawView->IsUnGroupPossible() )
505 		{
506 			rSet.DisableItem( SID_UNGROUP );
507 		}
508 	}
509 	// kein Objekt selektiert
510 	else
511 	{
512 //        rSet.ClearItem( SID_BEZIER_EDIT );
513 
514 		rSet.DisableItem( SID_ENTER_GROUP );
515 		rSet.DisableItem( SID_CUT );
516 		rSet.DisableItem( SID_COPY );
517 		rSet.DisableItem( SID_DELETE );
518 		rSet.DisableItem( SID_ATTR_TRANSFORM );
519 
520 		rSet.DisableItem( SID_OBJECT_ALIGN_LEFT );
521 		rSet.DisableItem( SID_OBJECT_ALIGN_CENTER );
522 		rSet.DisableItem( SID_OBJECT_ALIGN_RIGHT );
523 		rSet.DisableItem( SID_OBJECT_ALIGN_UP );
524 		rSet.DisableItem( SID_OBJECT_ALIGN_MIDDLE );
525 		rSet.DisableItem( SID_OBJECT_ALIGN_DOWN );
526 
527 		rSet.DisableItem( SID_FRAME_TO_TOP );
528 		rSet.DisableItem( SID_MOREFRONT );
529 		rSet.DisableItem( SID_MOREBACK );
530 		rSet.DisableItem( SID_FRAME_TO_BOTTOM );
531 		rSet.DisableItem( SID_BEFORE_OBJ );
532 		rSet.DisableItem( SID_BEHIND_OBJ );
533 		rSet.DisableItem( SID_CONVERT );
534 
535 //		rSet.DisableItem( SID_BEZIER_EDIT );
536 		rSet.DisableItem( SID_SIZE_OPTIMAL );
537 		rSet.DisableItem( SID_LINEEND_POLYGON );
538 		rSet.DisableItem( SID_COPYOBJECTS );
539 		rSet.DisableItem( SID_HORIZONTAL );
540 		rSet.DisableItem( SID_VERTICAL );
541 		rSet.DisableItem( SID_GROUP );
542 		rSet.DisableItem( SID_UNGROUP );
543 		rSet.DisableItem( SID_NAME_GROUP );
544 
545 		// #i68101#
546 		rSet.DisableItem( SID_OBJECT_TITLE_DESCRIPTION );
547 
548 		rSet.DisableItem( SID_DISMANTLE );
549 		rSet.DisableItem( SID_BREAK );
550 		rSet.DisableItem( SID_COMBINE );
551         rSet.DisableItem(SID_DISTRIBUTE_DLG);
552         rSet.DisableItem(SID_POLY_MERGE);
553         rSet.DisableItem(SID_POLY_SUBSTRACT);
554         rSet.DisableItem(SID_POLY_INTERSECT);
555 		rSet.DisableItem( SID_CONNECT );
556 		rSet.DisableItem( SID_ANIMATION_EFFECTS );
557 		rSet.DisableItem( SID_MODIFY_FIELD );
558 		rSet.DisableItem (SID_OBJECT_SHEAR);
559 	}
560 
561 }
562 
563 
564 } // end of namespace sd
565