LCOV - code coverage report
Current view: top level - libreoffice/sw/source/ui/uiview - viewstat.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 6 232 2.6 %
Date: 2012-12-27 Functions: 1 3 33.3 %
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             : 
      21             : #include <hintids.hxx>
      22             : #include <com/sun/star/linguistic2/XThesaurus.hpp>
      23             : #include <com/sun/star/uno/Sequence.hxx>
      24             : #include <svl/aeitem.hxx>
      25             : #include <svl/whiter.hxx>
      26             : #include <svl/cjkoptions.hxx>
      27             : 
      28             : #include <sfx2/viewfrm.hxx>
      29             : #include <sfx2/objitem.hxx>
      30             : #include <svl/imageitm.hxx>
      31             : #include <svl/languageoptions.hxx>
      32             : #include <editeng/protitem.hxx>
      33             : #include <sfx2/linkmgr.hxx>
      34             : #include <editeng/langitem.hxx>
      35             : #include <editeng/brshitem.hxx>
      36             : #include <svx/htmlmode.hxx>
      37             : #include <editeng/unolingu.hxx>
      38             : #include <sfx2/msgpool.hxx>
      39             : #include <swmodule.hxx>
      40             : #include <tox.hxx>
      41             : #include <sfx2/dispatch.hxx>
      42             : #include <sfx2/app.hxx>
      43             : #include <view.hxx>
      44             : #include <wrtsh.hxx>
      45             : #include <basesh.hxx>
      46             : #include <uitool.hxx>
      47             : #include <viewopt.hxx>
      48             : #include <tablemgr.hxx>
      49             : #include <pagedesc.hxx>
      50             : #include <wview.hxx>
      51             : #include <globdoc.hxx>
      52             : #include <svl/stritem.hxx>
      53             : #include <unotools/moduleoptions.hxx>
      54             : #include <svl/visitem.hxx>
      55             : 
      56             : #include <cmdid.h>
      57             : 
      58             : #include <IDocumentRedlineAccess.hxx>
      59             : #include <doc.hxx>
      60             : 
      61             : using namespace ::com::sun::star;
      62             : 
      63           0 : void SwView::GetState(SfxItemSet &rSet)
      64             : {
      65           0 :     SfxWhichIter aIter(rSet);
      66           0 :     sal_uInt16 nWhich = aIter.FirstWhich();
      67           0 :     sal_uInt16 eFrmType = FRMTYPE_NONE;
      68           0 :     int bGetFrmType = sal_False;
      69           0 :     sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
      70             : 
      71           0 :     while(nWhich)
      72             :     {
      73           0 :         switch(nWhich)
      74             :         {
      75             :             case FN_EDIT_LINK_DLG:
      76           0 :                 if( pWrtShell->GetLinkManager().GetLinks().empty() )
      77           0 :                     rSet.DisableItem(nWhich);
      78           0 :                 else if( pWrtShell->IsSelFrmMode() &&
      79           0 :                             pWrtShell->IsSelObjProtected(FLYPROTECT_CONTENT))
      80           0 :                         rSet.DisableItem(nWhich);
      81           0 :                 break;
      82             : 
      83             :             case FN_INSERT_CAPTION:
      84             :             {
      85             :                 // Captions gibt's fuer Grafiken, OLE-Objekte, Rahmen und Tabellen
      86           0 :                 if( !bGetFrmType )
      87           0 :                     eFrmType = pWrtShell->GetFrmType(0,sal_True), bGetFrmType = sal_True;
      88           0 :                 if (! ( ((eFrmType & FRMTYPE_FLY_ANY) && nSelectionType != nsSelectionType::SEL_DRW_TXT)||
      89             :                         nSelectionType & nsSelectionType::SEL_TBL ||
      90           0 :                         nSelectionType & nsSelectionType::SEL_DRW) )
      91           0 :                     rSet.DisableItem(nWhich);
      92           0 :                 else if((pWrtShell->IsObjSelected()||pWrtShell->IsFrmSelected()) &&
      93           0 :                         (pWrtShell->IsSelObjProtected( FLYPROTECT_PARENT)||
      94           0 :                             pWrtShell->IsSelObjProtected( FLYPROTECT_CONTENT )))
      95           0 :                     rSet.DisableItem(nWhich);
      96           0 :                 else if( pWrtShell->IsTableMode() )
      97           0 :                     rSet.DisableItem(nWhich);
      98             :             }
      99           0 :             break;
     100             : 
     101             :             case FN_EDIT_FOOTNOTE:
     102             :             {
     103           0 :                 if( !pWrtShell->GetCurFtn() )
     104           0 :                     rSet.DisableItem(nWhich);
     105             :             }
     106           0 :             break;
     107             : 
     108             :             case FN_CHANGE_PAGENUM:
     109             :             {
     110           0 :                 sal_uInt16 nType = pWrtShell->GetFrmType(0,sal_True);
     111           0 :                 if( ( FRMTYPE_FLY_ANY | FRMTYPE_HEADER | FRMTYPE_FOOTER |
     112             :                       FRMTYPE_FOOTNOTE | FRMTYPE_DRAWOBJ ) & nType )
     113           0 :                     rSet.DisableItem(nWhich);
     114             :                 else
     115           0 :                     rSet.Put(SfxUInt16Item(nWhich, pWrtShell->GetPageOffset()));
     116             :             }
     117           0 :             break;
     118             :             case SID_PRINTDOC:
     119             :             case SID_PRINTDOCDIRECT:
     120           0 :                 GetSlotState( nWhich, SfxViewShell::GetInterface(), &rSet );
     121           0 :             break;
     122             :             case SID_ATTR_PAGE:
     123             :             case SID_ATTR_PAGE_SIZE:
     124             :             case SID_ATTR_PAGE_PAPERBIN:
     125             :             case RES_PAPER_BIN:
     126             :             case FN_PARAM_FTN_INFO:
     127             :             {
     128           0 :                 const sal_uInt16 nCurIdx = pWrtShell->GetCurPageDesc();
     129           0 :                 const SwPageDesc& rDesc = pWrtShell->GetPageDesc( nCurIdx );
     130           0 :                 ::PageDescToItemSet( rDesc, rSet);
     131             :             }
     132           0 :             break;
     133             :             case RES_BACKGROUND:
     134             :             case SID_ATTR_BRUSH:
     135             :             {
     136           0 :                 const sal_uInt16 nCurIdx = pWrtShell->GetCurPageDesc();
     137           0 :                 const SwPageDesc& rDesc = pWrtShell->GetPageDesc( nCurIdx );
     138           0 :                 const SwFrmFmt& rMaster = rDesc.GetMaster();
     139             :                 const SvxBrushItem& rBrush = (const SvxBrushItem&)
     140           0 :                                     rMaster.GetFmtAttr(RES_BACKGROUND, sal_True);
     141           0 :                 rSet.Put(rBrush);
     142             :             }
     143           0 :             break;
     144             :             case SID_CLEARHISTORY:
     145             :             {
     146           0 :                 rSet.Put(SfxBoolItem(nWhich, pWrtShell->GetLastUndoInfo(0, 0)));
     147             :             }
     148           0 :             break;
     149             :             case SID_UNDO:
     150             :             {
     151             :                 // die muss noch nicht vorhanden sein
     152             :                 // also lasse sie mal anlegen:
     153           0 :                 if( !pShell )
     154           0 :                     SelectShell();
     155             : 
     156           0 :                 const SfxPoolItem* pState = pShell->GetSlotState(SID_UNDO);
     157           0 :                 if(pState)
     158           0 :                     rSet.Put(*pState);
     159             :                 else
     160           0 :                     rSet.DisableItem(nWhich);
     161             :             }
     162           0 :             break;
     163             :             case FN_INSERT_CTRL:
     164             :             {
     165           0 :                 SfxImageItem aImgItem(nWhich, bWeb ? SwView::nWebInsertCtrlState : SwView::nInsertCtrlState);
     166           0 :                 SfxSlotPool& rPool = SfxSlotPool::GetSlotPool( GetViewFrame() );
     167           0 :                 const SfxSlot* pSlot = rPool.GetSlot( aImgItem.GetValue() );
     168           0 :                 if(pSlot && pSlot->IsMode( SFX_SLOT_IMAGEROTATION ))
     169             :                 {
     170           0 :                     if(pWrtShell->IsInVerticalText())
     171           0 :                         aImgItem.SetRotation(2700);
     172           0 :                     if(pWrtShell->IsInRightToLeftText())
     173           0 :                         aImgItem.SetMirrored(sal_True);
     174             :                 }
     175           0 :                 rSet.Put(aImgItem);
     176             :             }
     177           0 :             break;
     178             :             case FN_INSERT_OBJ_CTRL:
     179           0 :             if(bWeb)
     180           0 :                 rSet.DisableItem(nWhich);
     181             :             else
     182             :             {
     183           0 :                 SfxImageItem aImgItem(nWhich, SwView::nInsertObjectCtrlState);
     184           0 :                 SfxSlotPool& rPool = SfxSlotPool::GetSlotPool( GetViewFrame() );
     185           0 :                 const SfxSlot* pSlot = rPool.GetSlot( aImgItem.GetValue() );
     186           0 :                 if(pSlot && pSlot->IsMode( SFX_SLOT_IMAGEROTATION ))
     187             :                 {
     188           0 :                     if(pWrtShell->IsInVerticalText())
     189           0 :                         aImgItem.SetRotation(2700);
     190           0 :                     if(pWrtShell->IsInRightToLeftText())
     191           0 :                         aImgItem.SetMirrored(sal_True);
     192             :                 }
     193           0 :                 rSet.Put(aImgItem);
     194             :             }
     195           0 :             break;
     196             :             case FN_UPDATE_TOX:
     197           0 :                 if(!pWrtShell->GetTOXCount())
     198           0 :                     rSet.DisableItem(nWhich);
     199           0 :             break;
     200             :             case FN_EDIT_CURRENT_TOX:
     201             :             case FN_UPDATE_CUR_TOX:
     202             :             {
     203           0 :                 const SwTOXBase* pBase = 0;
     204           0 :                 if(0 == (pBase = pWrtShell->GetCurTOX()) ||
     205           0 :                     (FN_EDIT_CURRENT_TOX == nWhich && pBase->IsTOXBaseInReadonly()))
     206           0 :                     rSet.DisableItem(nWhich);
     207             :             }
     208           0 :             break;
     209             :             case SID_TWAIN_SELECT:
     210             :             case SID_TWAIN_TRANSFER:
     211             : #if defined WNT || defined UNX
     212             :             {
     213           0 :                 if(!SW_MOD()->GetScannerManager().is())
     214           0 :                     rSet.DisableItem(nWhich);
     215             :             }
     216             : #endif
     217           0 :             break;
     218             :             case RES_PARATR_TABSTOP:
     219             :             case SID_ATTR_DEFTABSTOP:
     220             :             {
     221             :                 const SvxTabStopItem& rDefTabs =
     222             :                     (const SvxTabStopItem&)pWrtShell->
     223           0 :                                         GetDefault(RES_PARATR_TABSTOP);
     224             :                 rSet.Put( SfxUInt16Item( nWhich,
     225           0 :                                                 (sal_uInt16)::GetTabDist(rDefTabs)));
     226             :             }
     227           0 :             break;
     228             :             case SID_ATTR_LANGUAGE:
     229             :             {
     230             :                 rSet.Put((const SvxLanguageItem&)
     231           0 :                     pWrtShell->GetDefault(RES_CHRATR_LANGUAGE), SID_ATTR_LANGUAGE);
     232             :             }
     233           0 :             break;
     234             :             case RES_CHRATR_CJK_LANGUAGE:
     235             :                 rSet.Put((const SvxLanguageItem&)
     236           0 :                     pWrtShell->GetDefault(RES_CHRATR_CJK_LANGUAGE), RES_CHRATR_CJK_LANGUAGE);
     237           0 :             break;
     238             :             case RES_CHRATR_CTL_LANGUAGE:
     239             :                 rSet.Put((const SvxLanguageItem&)
     240           0 :                     pWrtShell->GetDefault(RES_CHRATR_CTL_LANGUAGE), RES_CHRATR_CTL_LANGUAGE);
     241           0 :             break;
     242             :             case FN_REDLINE_ON:
     243           0 :                 rSet.Put( SfxBoolItem( nWhich, GetDocShell()->IsChangeRecording() ) );
     244           0 :             break;
     245             :             case FN_REDLINE_PROTECT :
     246           0 :                 rSet.Put( SfxBoolItem( nWhich, GetDocShell()->HasChangeRecordProtection() ) );
     247           0 :             break;
     248             :             case FN_REDLINE_SHOW:
     249             :             {
     250           0 :                 sal_uInt16 nMask = nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE;
     251             :                 rSet.Put( SfxBoolItem( nWhich,
     252           0 :                     (pWrtShell->GetRedlineMode() & nMask) == nMask ));
     253             :             }
     254           0 :             break;
     255             :             case SID_GALLERY :
     256             :             case SID_AVMEDIA_PLAYER :
     257             :             case FN_REDLINE_ACCEPT :
     258             :             {
     259           0 :                 SfxViewFrame* pVFrame = GetViewFrame();
     260           0 :                 if (pVFrame->KnowsChildWindow(nWhich))
     261           0 :                     rSet.Put(SfxBoolItem( nWhich, pVFrame->HasChildWindow(nWhich)));
     262             :                 else
     263           0 :                     rSet.DisableItem(nWhich);
     264             :             }
     265           0 :             break;
     266             :             case FN_REDLINE_ACCEPT_DIRECT:
     267             :             case FN_REDLINE_REJECT_DIRECT:
     268             :             {
     269             :                 // If the selection/cursor start position isn't on a redline, disable
     270             :                 // accepting/rejecting changes.
     271           0 :                 SwDoc *pDoc = pWrtShell->GetDoc();
     272           0 :                 SwPaM *pCursor = pWrtShell->GetCrsr();
     273           0 :                 if (0 == pDoc->GetRedline(*pCursor->Start(), 0))
     274           0 :                     rSet.DisableItem(nWhich);
     275             :             }
     276           0 :             break;
     277             : 
     278             :             case FN_REDLINE_NEXT_CHANGE:
     279             :             case FN_REDLINE_PREV_CHANGE:
     280             :             {
     281             :                 // Enable change navigation if we have any redlines. Ideally we should disable
     282             :                 // "Next Change" if we're at or past the last change, and similarly for
     283             :                 // "Previous Change"
     284           0 :                 if (0 == pWrtShell->GetRedlineCount())
     285           0 :                     rSet.DisableItem(nWhich);
     286             :             }
     287           0 :             break;
     288             : 
     289             :             case SID_THESAURUS:
     290             :             {
     291           0 :                 SwWrtShell  &rSh = GetWrtShell();
     292           0 :                 if (2 <= rSh.GetCrsrCnt())  // multi selection?
     293           0 :                     rSet.DisableItem(nWhich);
     294             :                 else
     295             :                 {
     296           0 :                     LanguageType nLang = rSh.GetCurLang();
     297             : 
     298             :                     // disable "Thesaurus" (menu entry and key shortcut) if the
     299             :                     // language is not supported (by default it is enabled)
     300           0 :                     uno::Reference< linguistic2::XThesaurus >  xThes( ::GetThesaurus() );
     301           0 :                     if (!xThes.is() || nLang == LANGUAGE_NONE ||
     302           0 :                         !xThes->hasLocale( LanguageTag( nLang ).getLocale() ))
     303           0 :                         rSet.DisableItem(nWhich);
     304             :                 }
     305             :             }
     306           0 :             break;
     307             :             case SID_HANGUL_HANJA_CONVERSION:
     308             :             case SID_CHINESE_CONVERSION:
     309             :             {
     310           0 :                 if (!SvtCJKOptions().IsAnyEnabled())
     311             :                 {
     312           0 :                     GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_False );
     313           0 :                     rSet.DisableItem(nWhich);
     314             :                 }
     315             :                 else
     316           0 :                     GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_True );
     317             :             }
     318           0 :             break;
     319             :             case SID_MAIL_SCROLLBODY_PAGEDOWN:
     320             :                 {
     321           0 :                     const long nBottom = pWrtShell->GetDocSize().Height() + DOCUMENTBORDER;
     322           0 :                     const long nAct = GetVisArea().Bottom();
     323           0 :                     rSet.Put(SfxBoolItem(SID_MAIL_SCROLLBODY_PAGEDOWN, nAct < nBottom ));
     324             :                 }
     325           0 :                 break;
     326             : 
     327             :             case SID_DOCUMENT_COMPARE:
     328             :             case SID_DOCUMENT_MERGE:
     329           0 :                 if( GetDocShell()->IsA( SwGlobalDocShell::StaticType() ) ||
     330           0 :                     (SID_DOCUMENT_MERGE == nWhich && pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength()))
     331           0 :                     rSet.DisableItem(nWhich);
     332           0 :             break;
     333             :             case  SID_VIEW_DATA_SOURCE_BROWSER:
     334           0 :                 if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::E_SDATABASE ) )
     335           0 :                     rSet.Put( SfxVisibilityItem( nWhich, sal_False ) );
     336             :                 else
     337           0 :                     rSet.Put( SfxBoolItem( nWhich, GetViewFrame()->HasChildWindow( SID_BROWSER ) ) );
     338           0 :             break;
     339             :             case SID_READONLY_MODE:
     340             :                 rSet.Put(SfxBoolItem(nWhich,
     341           0 :                     pWrtShell->HasReadonlySel()||GetDocShell()->IsReadOnly()));
     342           0 :             break;
     343             :             case SID_IMAGE_ORIENTATION:
     344             :             {
     345           0 :                 SfxImageItem aImageItem(nWhich);
     346           0 :                 if(pWrtShell->IsInVerticalText())
     347           0 :                     aImageItem.SetRotation( 2700 );
     348           0 :                 if(pWrtShell->IsInRightToLeftText())
     349           0 :                     aImageItem.SetMirrored( sal_True );
     350           0 :                 rSet.Put(aImageItem);
     351             :             }
     352           0 :             break;
     353             :             case FN_INSERT_FIELD_DATA_ONLY :
     354           0 :                 if(!bInMailMerge && !GetViewFrame()->HasChildWindow(nWhich))
     355           0 :                     rSet.DisableItem(nWhich);
     356           0 :             break;
     357             :             case FN_MAILMERGE_SENDMAIL_CHILDWINDOW:
     358           0 :             break;
     359             :             case FN_MAILMERGE_CHILDWINDOW:
     360             :             {
     361           0 :                 if(!GetMailMergeConfigItem())
     362           0 :                     rSet.DisableItem(nWhich);
     363             :             }
     364           0 :             break;
     365             :             case SID_ALIGN_ANY_LEFT :
     366             :             case SID_ALIGN_ANY_HCENTER  :
     367             :             case SID_ALIGN_ANY_RIGHT    :
     368             :             case SID_ALIGN_ANY_JUSTIFIED:
     369             :             case SID_ALIGN_ANY_TOP      :
     370             :             case SID_ALIGN_ANY_VCENTER  :
     371             :             case SID_ALIGN_ANY_BOTTOM   :
     372             :             case SID_ALIGN_ANY_HDEFAULT :
     373             :             case SID_ALIGN_ANY_VDEFAULT :
     374             :             {
     375           0 :                 if( !pShell )
     376           0 :                     SelectShell();
     377           0 :                 sal_uInt16 nAlias = 0;
     378           0 :                 bool bDraw = false;
     379           0 :                 if( nSelectionType & (nsSelectionType::SEL_DRW_TXT|nsSelectionType::SEL_TXT) )
     380             :                 {
     381           0 :                     switch( nWhich )
     382             :                     {
     383           0 :                         case SID_ALIGN_ANY_LEFT :       nAlias = SID_ATTR_PARA_ADJUST_LEFT; break;
     384           0 :                         case SID_ALIGN_ANY_HCENTER  :   nAlias = SID_ATTR_PARA_ADJUST_CENTER; break;
     385           0 :                         case SID_ALIGN_ANY_RIGHT    :   nAlias = SID_ATTR_PARA_ADJUST_RIGHT; break;
     386           0 :                         case SID_ALIGN_ANY_JUSTIFIED:   nAlias = SID_ATTR_PARA_ADJUST_BLOCK; break;
     387           0 :                         case SID_ALIGN_ANY_TOP      :   nAlias = FN_TABLE_VERT_NONE; break;
     388           0 :                         case SID_ALIGN_ANY_VCENTER  :   nAlias = FN_TABLE_VERT_CENTER; break;
     389           0 :                         case SID_ALIGN_ANY_BOTTOM   :   nAlias = FN_TABLE_VERT_BOTTOM; break;
     390             :                     }
     391             :                 }
     392           0 :                 else if(nSelectionType & (nsSelectionType::SEL_DRW))
     393             :                 {
     394             :                     //the draw shell cannot provide a status per item - only one for SID_OBJECT_ALIGN
     395           0 :                     if(nWhich != SID_ALIGN_ANY_JUSTIFIED)
     396             :                     {
     397           0 :                         const SfxPoolItem* pItem = 0;
     398           0 :                         GetViewFrame()->GetDispatcher()->QueryState( SID_OBJECT_ALIGN, pItem );
     399           0 :                         if(pItem)
     400           0 :                             bDraw = true;
     401             :                     }
     402             :                 }
     403             :                 else
     404             :                 {
     405           0 :                     switch( nWhich )
     406             :                     {
     407           0 :                         case SID_ALIGN_ANY_LEFT :       nAlias = SID_OBJECT_ALIGN_LEFT    ; break;
     408           0 :                         case SID_ALIGN_ANY_HCENTER  :   nAlias = SID_OBJECT_ALIGN_CENTER ; break;
     409           0 :                         case SID_ALIGN_ANY_RIGHT    :   nAlias = SID_OBJECT_ALIGN_RIGHT  ; break;
     410           0 :                         case SID_ALIGN_ANY_TOP      :   nAlias = SID_OBJECT_ALIGN_UP     ;  break;
     411           0 :                         case SID_ALIGN_ANY_VCENTER  :   nAlias = SID_OBJECT_ALIGN_MIDDLE ;  break;
     412           0 :                         case SID_ALIGN_ANY_BOTTOM   :   nAlias = SID_OBJECT_ALIGN_DOWN    ; break;
     413             :                     }
     414             :                 }
     415             :                 //these slots are either re-mapped to text or object alignment
     416           0 :                 const SfxPoolItem* pState = 0;
     417           0 :                 if(nAlias)
     418           0 :                     GetViewFrame()->GetDispatcher()->QueryState( nAlias, pState );
     419           0 :                 if(pState)
     420           0 :                     rSet.Put(*pState, nWhich);
     421           0 :                 else if(!bDraw)
     422           0 :                     rSet.DisableItem(nWhich);
     423             :             }
     424           0 :             break;
     425             :         }
     426           0 :         nWhich = aIter.NextWhich();
     427           0 :     }
     428           0 : }
     429             : 
     430           0 : void SwView::GetDrawState(SfxItemSet &rSet)
     431             : {
     432           0 :     SfxWhichIter aIter(rSet);
     433           0 :     sal_Bool bWeb = 0 != PTR_CAST(SwWebView, this);
     434             : 
     435           0 :     for( sal_uInt16 nWhich = aIter.FirstWhich(); nWhich;
     436             :                                             nWhich = aIter.NextWhich() )
     437           0 :         switch(nWhich)
     438             :         {
     439             :         case SID_INSERT_DRAW:
     440           0 :             if ( bWeb )
     441           0 :                 rSet.DisableItem( nWhich );
     442             :             else
     443             :             {
     444           0 :                 SfxAllEnumItem aEnum(SID_INSERT_DRAW, nDrawSfxId);
     445           0 :                 if ( !SvtLanguageOptions().IsVerticalTextEnabled() )
     446             :                 {
     447           0 :                     aEnum.DisableValue( SID_DRAW_CAPTION_VERTICAL );
     448           0 :                     aEnum.DisableValue( SID_DRAW_TEXT_VERTICAL );
     449             :                 }
     450           0 :                 rSet.Put(aEnum);
     451             :             }
     452           0 :             break;
     453             : 
     454             :         case SID_SHOW_HIDDEN:
     455             :         case SID_SHOW_FORMS:
     456           0 :             rSet.DisableItem( nWhich );
     457           0 :             break;
     458             : 
     459             :         case SID_DRAW_TEXT_MARQUEE:
     460           0 :             if (::GetHtmlMode(GetDocShell()) & HTMLMODE_SOME_STYLES)
     461           0 :                 rSet.Put( SfxBoolItem(nWhich, nDrawSfxId == nWhich));
     462             :             else
     463           0 :                 rSet.DisableItem(nWhich);
     464           0 :             break;
     465             :         case SID_OBJECT_SELECT:
     466             :             rSet.Put( SfxBoolItem(nWhich, nDrawSfxId == nWhich ||
     467           0 :                                           nFormSfxId == nWhich));
     468           0 :             break;
     469             : 
     470             :         case SID_FONTWORK_GALLERY_FLOATER :
     471             :         {
     472           0 :             if ( bWeb )
     473           0 :                 rSet.DisableItem( nWhich );
     474             :         }
     475           0 :         break;
     476             : 
     477             :         case SID_DRAWTBX_CS_BASIC :
     478             :         case SID_DRAWTBX_CS_SYMBOL :
     479             :         case SID_DRAWTBX_CS_ARROW :
     480             :         case SID_DRAWTBX_CS_FLOWCHART :
     481             :         case SID_DRAWTBX_CS_CALLOUT :
     482             :         case SID_DRAWTBX_CS_STAR :
     483             :         {
     484           0 :             if ( bWeb )
     485           0 :                 rSet.DisableItem( nWhich );
     486             :             else
     487           0 :                 rSet.Put(SfxStringItem(nWhich, aCurrShapeEnumCommand[ nWhich - SID_DRAWTBX_CS_BASIC ] ));
     488             :         }
     489           0 :         break;
     490             : 
     491           0 :         }
     492           0 : }
     493             : 
     494        1188 : sal_Bool SwView::HasUIFeature( sal_uInt32 nFeature )
     495             : {
     496        1188 :     sal_Bool bRet = sal_False;
     497        1188 :     switch(nFeature)
     498             :     {
     499         594 :         case CHILDWIN_LABEL     : bRet = pWrtShell->IsLabelDoc(); break;
     500         594 :         case CHILDWIN_MAILMERGE : bRet = 0 != GetMailMergeConfigItem(); break;
     501             :     }
     502        1188 :     return bRet;
     503             : }
     504             : 
     505             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10