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

Generated by: LCOV version 1.11