Files
libreoffice/sw/source/ui/uiview/viewstat.cxx

506 lines
19 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
re-base on ALv2 code. Includes: Patches contributed by Oliver-Rainer Wittmann sw34bf06: #i117783# - Writer's implementation of XPagePrintable - apply print settings to new printing routines http://svn.apache.org/viewvc?view=revision&revision=1172115 sw34bf06: #o12311627# use <rtl_random> methods to create unique ids for list styles and list ids http://svn.apache.org/viewvc?view=revision&revision=1172112 sw34bf06 #i114725#,#i115828# - method <SwDoc::ClearDoc()> - clear list structures completely http://svn.apache.org/viewvc?view=revision&revision=1172122 i#118572 - remove ui string and help content regarding usage of Java Mail in Writer's Mail Merge as Java Mail is not used. http://svn.apache.org/viewvc?view=revision&revision=1197035 Patches contributed by Mathias Bauer cws mba34issues01: #i117718#: provide filter name in case storage of medium does not allow to detect one http://svn.apache.org/viewvc?view=revision&revision=1172350 cws mba34issues01: #i117721#: directly provide parameters retrieved from SfxMedium http://svn.apache.org/viewvc?view=revision&revision=1172353 gnumake4 work variously http://svn.apache.org/viewvc?view=revision&revision=1394707 http://svn.apache.org/viewvc?view=revision&revision=1394326 http://svn.apache.org/viewvc?view=revision&revision=1396797 http://svn.apache.org/viewvc?view=revision&revision=1397315 cws mba34issues01: #i117723#: convert assertion into trace http://svn.apache.org/viewvc?view=revision&revision=1172355 cws mba34issues01: #i117699#: keep layout alive until swdoc dies http://svn.apache.org/viewvc?view=revision&revision=1172362 cws mba34issues01: #i117943#: missing color attributes in RTF clipboard http://svn.apache.org/viewvc?view=revision&revision=1172363 Patch contributed by Henning Brinkmann imported patch i#103878 http://svn.apache.org/viewvc?view=revision&revision=1172109 Patches contributed by Michael Stahl sw34bf06: #i117955#: WW8 export: disable storing of section breaks in endnotes http://svn.apache.org/viewvc?view=revision&revision=1172119 Patch contributed by imacat Fixed the Asian language work count. http://svn.apache.org/viewvc?view=revision&revision=1241345 Patch contributed by Pedro Giffuni i#20878 - Add comment with BZ issue for reference. http://svn.apache.org/viewvc?view=revision&revision=1244517 Patch contributed by Andre Fischer Do not add targets for junit tests when junit is disabled. http://svn.apache.org/viewvc?view=revision&revision=1241508 add writerperfect dependency.
2011-03-31 10:05:04 +02:00
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
2000-09-18 16:15:01 +00:00
#include <hintids.hxx>
#include <com/sun/star/linguistic2/XThesaurus.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <svl/aeitem.hxx>
#include <svl/whiter.hxx>
#include <svl/cjkoptions.hxx>
#include <sfx2/viewfrm.hxx>
2000-09-18 16:15:01 +00:00
#include <sfx2/objitem.hxx>
#include <svl/imageitm.hxx>
#include <svl/languageoptions.hxx>
#include <editeng/protitem.hxx>
2010-01-13 22:25:07 +01:00
#include <sfx2/linkmgr.hxx>
#include <editeng/langitem.hxx>
#include <editeng/brushitem.hxx>
2000-09-18 16:15:01 +00:00
#include <svx/htmlmode.hxx>
#include <editeng/unolingu.hxx>
#include <sfx2/msgpool.hxx>
2001-03-16 13:42:55 +00:00
#include <swmodule.hxx>
#include <tox.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/app.hxx>
2000-09-18 16:15:01 +00:00
#include <view.hxx>
#include <wrtsh.hxx>
#include <basesh.hxx>
#include <uitool.hxx>
#include <viewopt.hxx>
#include <tablemgr.hxx>
#include <pagedesc.hxx>
#include <wview.hxx>
#include <globdoc.hxx>
#include <svl/stritem.hxx>
#include <unotools/moduleoptions.hxx>
#include <svl/visitem.hxx>
2000-09-18 16:15:01 +00:00
#include <cmdid.h>
#include <IDocumentRedlineAccess.hxx>
#include <doc.hxx>
2000-09-18 16:15:01 +00:00
using namespace ::com::sun::star;
2000-09-18 16:15:01 +00:00
void SwView::GetState(SfxItemSet &rSet)
{
SfxWhichIter aIter(rSet);
sal_uInt16 nWhich = aIter.FirstWhich();
sal_uInt16 eFrmType = FRMTYPE_NONE;
int bGetFrmType = sal_False;
bool bWeb = 0 != PTR_CAST(SwWebView, this);
2000-09-18 16:15:01 +00:00
while(nWhich)
{
switch(nWhich)
{
case FN_EDIT_LINK_DLG:
if( pWrtShell->GetLinkManager().GetLinks().empty() )
2000-09-18 16:15:01 +00:00
rSet.DisableItem(nWhich);
else if( pWrtShell->IsSelFrmMode() &&
pWrtShell->IsSelObjProtected(FLYPROTECT_CONTENT))
rSet.DisableItem(nWhich);
break;
case FN_INSERT_CAPTION:
{
// Captions gibt's fuer Grafiken, OLE-Objekte, Rahmen und Tabellen
if( !bGetFrmType )
eFrmType = pWrtShell->GetFrmType(0,sal_True), bGetFrmType = sal_True;
if (! ( ((eFrmType & FRMTYPE_FLY_ANY) && nSelectionType != nsSelectionType::SEL_DRW_TXT)||
nSelectionType & nsSelectionType::SEL_TBL ||
nSelectionType & nsSelectionType::SEL_DRW) )
2000-09-18 16:15:01 +00:00
rSet.DisableItem(nWhich);
else if((pWrtShell->IsObjSelected()||pWrtShell->IsFrmSelected()) &&
(pWrtShell->IsSelObjProtected( FLYPROTECT_PARENT)||
pWrtShell->IsSelObjProtected( FLYPROTECT_CONTENT )))
rSet.DisableItem(nWhich);
2000-09-18 16:15:01 +00:00
else if( pWrtShell->IsTableMode() )
rSet.DisableItem(nWhich);
}
break;
case FN_EDIT_FOOTNOTE:
{
if( !pWrtShell->GetCurFtn() )
rSet.DisableItem(nWhich);
}
break;
case FN_CHANGE_PAGENUM:
{
sal_uInt16 nType = pWrtShell->GetFrmType(0,sal_True);
if( ( FRMTYPE_FLY_ANY | FRMTYPE_HEADER | FRMTYPE_FOOTER |
FRMTYPE_FOOTNOTE | FRMTYPE_DRAWOBJ ) & nType )
rSet.DisableItem(nWhich);
else
rSet.Put(SfxUInt16Item(nWhich, pWrtShell->GetPageOffset()));
}
break;
case SID_PRINTDOC:
case SID_PRINTDOCDIRECT:
GetSlotState( nWhich, SfxViewShell::GetInterface(), &rSet );
break;
case SID_ATTR_PAGE:
case SID_ATTR_PAGE_SIZE:
case SID_ATTR_PAGE_PAPERBIN:
case RES_PAPER_BIN:
case FN_PARAM_FTN_INFO:
{
const sal_uInt16 nCurIdx = pWrtShell->GetCurPageDesc();
const SwPageDesc& rDesc = pWrtShell->GetPageDesc( nCurIdx );
::PageDescToItemSet( rDesc, rSet);
}
break;
case RES_BACKGROUND:
case SID_ATTR_BRUSH:
{
const sal_uInt16 nCurIdx = pWrtShell->GetCurPageDesc();
const SwPageDesc& rDesc = pWrtShell->GetPageDesc( nCurIdx );
const SwFrmFmt& rMaster = rDesc.GetMaster();
const SvxBrushItem& rBrush = (const SvxBrushItem&)
rMaster.GetFmtAttr(RES_BACKGROUND, sal_True);
2000-09-18 16:15:01 +00:00
rSet.Put(rBrush);
}
break;
case SID_CLEARHISTORY:
{
rSet.Put(SfxBoolItem(nWhich, pWrtShell->GetLastUndoInfo(0, 0)));
2000-09-18 16:15:01 +00:00
}
break;
case SID_UNDO:
{
2011-01-29 10:26:56 +09:00
// die muss noch nicht vorhanden sein
// also lasse sie mal anlegen:
2000-09-18 16:15:01 +00:00
if( !pShell )
SelectShell();
const SfxPoolItem* pState = pShell->GetSlotState(SID_UNDO);
if(pState)
rSet.Put(*pState);
else
rSet.DisableItem(nWhich);
}
break;
case FN_INSERT_CTRL:
{
SfxImageItem aImgItem(nWhich, bWeb ? SwView::nWebInsertCtrlState : SwView::nInsertCtrlState);
SfxSlotPool& rPool = SfxSlotPool::GetSlotPool( GetViewFrame() );
const SfxSlot* pSlot = rPool.GetSlot( aImgItem.GetValue() );
if(pSlot && pSlot->IsMode( SFX_SLOT_IMAGEROTATION ))
{
if(pWrtShell->IsInVerticalText())
aImgItem.SetRotation(2700);
if(pWrtShell->IsInRightToLeftText())
aImgItem.SetMirrored(sal_True);
}
rSet.Put(aImgItem);
}
2000-09-18 16:15:01 +00:00
break;
case FN_INSERT_OBJ_CTRL:
if(bWeb)
rSet.DisableItem(nWhich);
else
{
SfxImageItem aImgItem(nWhich, SwView::nInsertObjectCtrlState);
SfxSlotPool& rPool = SfxSlotPool::GetSlotPool( GetViewFrame() );
const SfxSlot* pSlot = rPool.GetSlot( aImgItem.GetValue() );
if(pSlot && pSlot->IsMode( SFX_SLOT_IMAGEROTATION ))
{
if(pWrtShell->IsInVerticalText())
aImgItem.SetRotation(2700);
if(pWrtShell->IsInRightToLeftText())
aImgItem.SetMirrored(sal_True);
}
rSet.Put(aImgItem);
}
2000-09-18 16:15:01 +00:00
break;
case FN_UPDATE_TOX:
if(!pWrtShell->GetTOXCount())
rSet.DisableItem(nWhich);
break;
case FN_EDIT_CURRENT_TOX:
case FN_UPDATE_CUR_TOX:
{
const SwTOXBase* pBase = 0;
if(0 == (pBase = pWrtShell->GetCurTOX()) ||
(FN_EDIT_CURRENT_TOX == nWhich && pBase->IsTOXBaseInReadonly()))
2000-09-18 16:15:01 +00:00
rSet.DisableItem(nWhich);
}
2000-09-18 16:15:01 +00:00
break;
case SID_TWAIN_SELECT:
case SID_TWAIN_TRANSFER:
#if defined WNT || defined UNX
2000-09-18 16:15:01 +00:00
{
if(!SW_MOD()->GetScannerManager().is())
rSet.DisableItem(nWhich);
}
#endif
break;
case RES_PARATR_TABSTOP:
case SID_ATTR_DEFTABSTOP:
{
const SvxTabStopItem& rDefTabs =
(const SvxTabStopItem&)pWrtShell->
GetDefault(RES_PARATR_TABSTOP);
rSet.Put( SfxUInt16Item( nWhich,
(sal_uInt16)::GetTabDist(rDefTabs)));
}
break;
case SID_ATTR_LANGUAGE:
{
rSet.Put((const SvxLanguageItem&)
pWrtShell->GetDefault(RES_CHRATR_LANGUAGE), SID_ATTR_LANGUAGE);
}
break;
2000-11-24 16:20:05 +00:00
case RES_CHRATR_CJK_LANGUAGE:
rSet.Put((const SvxLanguageItem&)
pWrtShell->GetDefault(RES_CHRATR_CJK_LANGUAGE), RES_CHRATR_CJK_LANGUAGE);
break;
case RES_CHRATR_CTL_LANGUAGE:
rSet.Put((const SvxLanguageItem&)
pWrtShell->GetDefault(RES_CHRATR_CTL_LANGUAGE), RES_CHRATR_CTL_LANGUAGE);
break;
case FN_REDLINE_ON:
rSet.Put( SfxBoolItem( nWhich, GetDocShell()->IsChangeRecording() ) );
break;
case FN_REDLINE_PROTECT :
rSet.Put( SfxBoolItem( nWhich, GetDocShell()->HasChangeRecordProtection() ) );
2000-09-18 16:15:01 +00:00
break;
case FN_REDLINE_SHOW:
2000-09-18 16:15:01 +00:00
{
sal_uInt16 nMask = nsRedlineMode_t::REDLINE_SHOW_INSERT | nsRedlineMode_t::REDLINE_SHOW_DELETE;
2000-09-18 16:15:01 +00:00
rSet.Put( SfxBoolItem( nWhich,
(pWrtShell->GetRedlineMode() & nMask) == nMask ));
}
break;
case SID_GALLERY :
case SID_AVMEDIA_PLAYER :
case FN_REDLINE_ACCEPT :
2000-09-18 16:15:01 +00:00
{
SfxViewFrame* pVFrame = GetViewFrame();
if (pVFrame->KnowsChildWindow(nWhich))
rSet.Put(SfxBoolItem( nWhich, pVFrame->HasChildWindow(nWhich)));
else
rSet.DisableItem(nWhich);
CWS-TOOLING: integrate CWS os121 2008-11-28 13:44:51 +0100 os r264551 : Copy Hyperlink Location added 2008-11-28 13:36:20 +0100 os r264547 : Copy Hyperlink Location added 2008-11-25 15:43:53 +0100 os r264311 : label of EditHyperlink fixed 2008-11-25 15:42:42 +0100 os r264310 : use ResetAttr to remove hyperlink 2008-11-25 10:08:02 +0100 os r264276 : edit/remove hyperlink names fixed 2008-11-11 15:47:22 +0100 os r263565 : typo fixed 2008-11-10 18:46:00 +0100 os r263536 : CWS-TOOLING: rebase CWS os121 to trunk@263288 (milestone: DEV300:m35) 2008-11-07 15:34:41 +0100 os r263422 : #i6191# accept/reject changes;#i7311# remove hyperlink 2008-11-07 15:34:05 +0100 os r263421 : #i6191# accept/reject changes;#i7311# remove hyperlink 2008-11-06 17:26:18 +0100 os r263402 : #i43971# words from online help documents must not be added to AutoCompletion 2008-11-06 16:08:27 +0100 os r263397 : #i6191# accept/reject changes added to context menu 2008-11-06 16:07:49 +0100 os r263396 : #i6191# accept/reject changes added to context menu 2008-11-06 16:07:16 +0100 os r263395 : #i6191# accept/reject changes added to context menu 2008-11-06 16:06:18 +0100 os r263394 : #i6191# accept/reject changes added to context menu 2008-10-30 14:31:32 +0100 os r262826 : #i84980# less options changed to fewer options 2008-10-30 11:44:41 +0100 os r262824 : #i95624# don't add paragraph numbering in getString() 2008-10-27 10:46:04 +0100 os r262665 : #i88235# SvCheckListBox::SelectEntryPos() paints a CheckBox to the wrong device if page is not visible, yet - call moved to ::Reset() 2008-10-24 15:49:27 +0200 os r262648 : #i77230# make repeating headers the default 2008-10-23 16:49:42 +0200 os r262625 : #i95350# RTL output of table window fixed 2008-10-23 15:37:40 +0200 os r262623 : #i76723# RTL related patch removed - it is now done by vcl 2008-10-22 14:05:58 +0200 os r262601 : #b6297019#,#i49754# LoadStyles: restore outline settings 2008-10-22 14:05:17 +0200 os r262600 : #b6297019#,#i49754# LoadStyles: restore outline settings 2008-10-20 15:39:18 +0200 os r262323 : #i95059# border attribute: which id of SID_ATTR_BORDER_INNER fixed 2008-10-20 09:30:28 +0200 os r262305 : #i95123# conflict css::util::Color and ::Color solved 2008-10-17 11:44:16 +0200 os r262280 : #i93714# merge to PDF: convert fields to text before export 2008-10-17 10:30:11 +0200 os r262275 : #i94364# 2008-10-17 10:11:56 +0200 os r262274 : +i94536# default font ListBoxes: prevent entry duplication if 'Back' button is pressed
2008-12-09 07:49:49 +00:00
}
break;
case FN_REDLINE_ACCEPT_DIRECT:
case FN_REDLINE_REJECT_DIRECT:
{
// If the selection/cursor start position isn't on a redline, disable
// accepting/rejecting changes.
SwDoc *pDoc = pWrtShell->GetDoc();
SwPaM *pCursor = pWrtShell->GetCrsr();
if (0 == pDoc->GetRedline(*pCursor->Start(), 0))
rSet.DisableItem(nWhich);
2000-09-18 16:15:01 +00:00
}
break;
case FN_REDLINE_NEXT_CHANGE:
case FN_REDLINE_PREV_CHANGE:
{
// Enable change navigation if we have any redlines. Ideally we should disable
// "Next Change" if we're at or past the last change, and similarly for
// "Previous Change"
if (0 == pWrtShell->GetRedlineCount())
rSet.DisableItem(nWhich);
}
break;
case SID_THESAURUS:
2000-09-18 16:15:01 +00:00
{
SwWrtShell &rSh = GetWrtShell();
if (2 <= rSh.GetCrsrCnt()) // multi selection?
rSet.DisableItem(nWhich);
else
{
2001-02-21 16:38:36 +00:00
LanguageType nLang = rSh.GetCurLang();
2000-09-18 16:15:01 +00:00
// disable "Thesaurus" (menu entry and key shortcut) if the
// language is not supported (by default it is enabled)
uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
2000-09-18 16:15:01 +00:00
if (!xThes.is() || nLang == LANGUAGE_NONE ||
!xThes->hasLocale( LanguageTag( nLang ).getLocale() ))
2000-09-18 16:15:01 +00:00
rSet.DisableItem(nWhich);
}
}
break;
case SID_HANGUL_HANJA_CONVERSION:
case SID_CHINESE_CONVERSION:
{
if (!SvtCJKOptions().IsAnyEnabled())
{
GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_False );
rSet.DisableItem(nWhich);
}
else
GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_True );
}
break;
2000-10-31 15:10:00 +00:00
case SID_MAIL_SCROLLBODY_PAGEDOWN:
{
const long nBottom = pWrtShell->GetDocSize().Height() + DOCUMENTBORDER;
const long nAct = GetVisArea().Bottom();
2000-10-31 15:10:00 +00:00
rSet.Put(SfxBoolItem(SID_MAIL_SCROLLBODY_PAGEDOWN, nAct < nBottom ));
}
break;
2000-09-18 16:15:01 +00:00
2000-10-31 15:10:00 +00:00
case SID_DOCUMENT_COMPARE:
case SID_DOCUMENT_MERGE:
if( GetDocShell()->IsA( SwGlobalDocShell::StaticType() ) ||
(SID_DOCUMENT_MERGE == nWhich && pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength()))
2000-10-31 15:10:00 +00:00
rSet.DisableItem(nWhich);
break;
case SID_VIEW_DATA_SOURCE_BROWSER:
if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::E_SDATABASE ) )
rSet.Put( SfxVisibilityItem( nWhich, sal_False ) );
else
rSet.Put( SfxBoolItem( nWhich, GetViewFrame()->HasChildWindow( SID_BROWSER ) ) );
break;
case SID_READONLY_MODE:
rSet.Put(SfxBoolItem(nWhich,
pWrtShell->HasReadonlySel()||GetDocShell()->IsReadOnly()));
break;
case SID_IMAGE_ORIENTATION:
{
SfxImageItem aImageItem(nWhich);
if(pWrtShell->IsInVerticalText())
2002-04-25 13:59:18 +00:00
aImageItem.SetRotation( 2700 );
if(pWrtShell->IsInRightToLeftText())
aImageItem.SetMirrored( sal_True );
rSet.Put(aImageItem);
}
break;
case FN_INSERT_FIELD_DATA_ONLY :
if(!bInMailMerge && !GetViewFrame()->HasChildWindow(nWhich))
rSet.DisableItem(nWhich);
break;
case FN_MAILMERGE_SENDMAIL_CHILDWINDOW:
break;
case FN_MAILMERGE_CHILDWINDOW:
{
if(!GetMailMergeConfigItem())
rSet.DisableItem(nWhich);
}
break;
case SID_ALIGN_ANY_LEFT :
case SID_ALIGN_ANY_HCENTER :
case SID_ALIGN_ANY_RIGHT :
case SID_ALIGN_ANY_JUSTIFIED:
case SID_ALIGN_ANY_TOP :
case SID_ALIGN_ANY_VCENTER :
case SID_ALIGN_ANY_BOTTOM :
case SID_ALIGN_ANY_HDEFAULT :
case SID_ALIGN_ANY_VDEFAULT :
{
if( !pShell )
SelectShell();
sal_uInt16 nAlias = 0;
bool bDraw = false;
if( nSelectionType & (nsSelectionType::SEL_DRW_TXT|nsSelectionType::SEL_TXT) )
{
switch( nWhich )
{
case SID_ALIGN_ANY_LEFT : nAlias = SID_ATTR_PARA_ADJUST_LEFT; break;
case SID_ALIGN_ANY_HCENTER : nAlias = SID_ATTR_PARA_ADJUST_CENTER; break;
case SID_ALIGN_ANY_RIGHT : nAlias = SID_ATTR_PARA_ADJUST_RIGHT; break;
case SID_ALIGN_ANY_JUSTIFIED: nAlias = SID_ATTR_PARA_ADJUST_BLOCK; break;
case SID_ALIGN_ANY_TOP : nAlias = FN_TABLE_VERT_NONE; break;
case SID_ALIGN_ANY_VCENTER : nAlias = FN_TABLE_VERT_CENTER; break;
case SID_ALIGN_ANY_BOTTOM : nAlias = FN_TABLE_VERT_BOTTOM; break;
}
}
else if(nSelectionType & (nsSelectionType::SEL_DRW))
{
//the draw shell cannot provide a status per item - only one for SID_OBJECT_ALIGN
if(nWhich != SID_ALIGN_ANY_JUSTIFIED)
{
const SfxPoolItem* pItem = 0;
GetViewFrame()->GetDispatcher()->QueryState( SID_OBJECT_ALIGN, pItem );
if(pItem)
bDraw = true;
}
}
else
{
switch( nWhich )
{
case SID_ALIGN_ANY_LEFT : nAlias = SID_OBJECT_ALIGN_LEFT ; break;
case SID_ALIGN_ANY_HCENTER : nAlias = SID_OBJECT_ALIGN_CENTER ; break;
case SID_ALIGN_ANY_RIGHT : nAlias = SID_OBJECT_ALIGN_RIGHT ; break;
case SID_ALIGN_ANY_TOP : nAlias = SID_OBJECT_ALIGN_UP ; break;
case SID_ALIGN_ANY_VCENTER : nAlias = SID_OBJECT_ALIGN_MIDDLE ; break;
case SID_ALIGN_ANY_BOTTOM : nAlias = SID_OBJECT_ALIGN_DOWN ; break;
}
}
//these slots are either re-mapped to text or object alignment
const SfxPoolItem* pState = 0;
if(nAlias)
GetViewFrame()->GetDispatcher()->QueryState( nAlias, pState );
if(pState)
rSet.Put(*pState, nWhich);
else if(!bDraw)
rSet.DisableItem(nWhich);
}
break;
2000-09-18 16:15:01 +00:00
}
nWhich = aIter.NextWhich();
}
}
void SwView::GetDrawState(SfxItemSet &rSet)
{
SfxWhichIter aIter(rSet);
bool bWeb = 0 != PTR_CAST(SwWebView, this);
2000-09-18 16:15:01 +00:00
2001-03-16 13:42:55 +00:00
for( sal_uInt16 nWhich = aIter.FirstWhich(); nWhich;
nWhich = aIter.NextWhich() )
2000-09-18 16:15:01 +00:00
switch(nWhich)
{
2001-03-16 13:42:55 +00:00
case SID_INSERT_DRAW:
if ( bWeb )
rSet.DisableItem( nWhich );
2001-03-16 13:42:55 +00:00
else
2000-09-18 16:15:01 +00:00
{
2001-03-16 13:42:55 +00:00
SfxAllEnumItem aEnum(SID_INSERT_DRAW, nDrawSfxId);
if ( !SvtLanguageOptions().IsVerticalTextEnabled() )
{
aEnum.DisableValue( SID_DRAW_CAPTION_VERTICAL );
aEnum.DisableValue( SID_DRAW_TEXT_VERTICAL );
}
2001-03-16 13:42:55 +00:00
rSet.Put(aEnum);
2000-09-18 16:15:01 +00:00
}
break;
2001-03-16 13:42:55 +00:00
case SID_SHOW_HIDDEN:
case SID_SHOW_FORMS:
rSet.DisableItem( nWhich );
break;
2000-09-18 16:15:01 +00:00
2001-03-16 13:42:55 +00:00
case SID_DRAW_TEXT_MARQUEE:
if (::GetHtmlMode(GetDocShell()) & HTMLMODE_SOME_STYLES)
rSet.Put( SfxBoolItem(nWhich, nDrawSfxId == nWhich));
else
rSet.DisableItem(nWhich);
break;
case SID_OBJECT_SELECT:
rSet.Put( SfxBoolItem(nWhich, nDrawSfxId == nWhich ||
nFormSfxId == nWhich));
break;
case SID_FONTWORK_GALLERY_FLOATER :
{
if ( bWeb )
rSet.DisableItem( nWhich );
}
break;
case SID_DRAWTBX_CS_BASIC :
case SID_DRAWTBX_CS_SYMBOL :
case SID_DRAWTBX_CS_ARROW :
case SID_DRAWTBX_CS_FLOWCHART :
case SID_DRAWTBX_CS_CALLOUT :
case SID_DRAWTBX_CS_STAR :
{
if ( bWeb )
rSet.DisableItem( nWhich );
else
rSet.Put(SfxStringItem(nWhich, aCurrShapeEnumCommand[ nWhich - SID_DRAWTBX_CS_BASIC ] ));
}
break;
2000-09-18 16:15:01 +00:00
}
}
sal_Bool SwView::HasUIFeature( sal_uInt32 nFeature )
{
sal_Bool bRet = sal_False;
switch(nFeature)
{
case CHILDWIN_LABEL : bRet = pWrtShell->IsLabelDoc(); break;
case CHILDWIN_MAILMERGE : bRet = 0 != GetMailMergeConfigItem(); break;
}
return bRet;
2000-09-18 16:15:01 +00:00
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */