LCOV - code coverage report
Current view: top level - libreoffice/sd/source/ui/view - drviewsj.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 1 287 0.3 %
Date: 2012-12-27 Functions: 2 3 66.7 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10