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