1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #include <hintids.hxx>
23 #include <com/sun/star/linguistic2/XThesaurus.hpp>
24 #include <svl/whiter.hxx>
25 #include <svl/cjkoptions.hxx>
26 #include <sfx2/viewfrm.hxx>
27 #include <svl/imageitm.hxx>
28 #include <sfx2/linkmgr.hxx>
29 #include <editeng/langitem.hxx>
30 #include <editeng/brushitem.hxx>
31 #include <editeng/tstpitem.hxx>
32 #include <sfx2/htmlmode.hxx>
33 #include <swmodule.hxx>
35 #include <sfx2/dispatch.hxx>
39 #include <viewopt.hxx>
40 #include <pagedesc.hxx>
42 #include <globdoc.hxx>
43 #include <svl/stritem.hxx>
44 #include <unotools/moduleoptions.hxx>
45 #include <comphelper/lok.hxx>
46 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
47 #include <svl/visitem.hxx>
48 #include <redline.hxx>
49 #include <rootfrm.hxx>
51 #include <sfx2/infobar.hxx>
53 #include <strings.hrc>
56 #include <IDocumentRedlineAccess.hxx>
59 #include <workctrl.hxx>
61 using namespace ::com::sun::star
;
63 void SwView::GetState(SfxItemSet
&rSet
)
65 SfxWhichIter
aIter(rSet
);
66 sal_uInt16 nWhich
= aIter
.FirstWhich();
67 FrameTypeFlags eFrameType
= FrameTypeFlags::NONE
;
68 bool bGetFrameType
= false;
69 bool bWeb
= dynamic_cast<SwWebView
*>( this ) != nullptr;
78 tools::Long nFact
= m_pWrtShell
->GetViewOptions()->GetZoom();
79 if ((SID_ZOOM_IN
== nWhich
&& nFact
>= tools::Long(600)) ||
80 (SID_ZOOM_OUT
== nWhich
&& nFact
<= tools::Long(20)))
82 rSet
.DisableItem(nWhich
);
86 case FN_TOGGLE_OUTLINE_CONTENT_VISIBILITY
:
89 if (m_pWrtShell
->GetViewOptions()->IsShowOutlineContentVisibilityButton())
91 SwOutlineNodes::size_type nPos
= m_pWrtShell
->GetOutlinePos();
92 if (nPos
!= SwOutlineNodes::npos
)
96 rSet
.DisableItem(nWhich
);
100 // used to update all instances of this control
101 rSet
.InvalidateItem( nWhich
);
106 if (s_nMoveType
== NID_RECENCY
)
108 if (!m_pWrtShell
->GetNavigationMgr().forwardEnabled())
109 rSet
.DisableItem(FN_SCROLL_NEXT
);
110 if (!m_pWrtShell
->GetNavigationMgr().backEnabled())
111 rSet
.DisableItem(FN_SCROLL_PREV
);
115 case FN_EDIT_LINK_DLG
:
116 if( m_pWrtShell
->GetLinkManager().GetLinks().empty() )
117 rSet
.DisableItem(nWhich
);
118 else if( m_pWrtShell
->IsSelFrameMode() &&
119 m_pWrtShell
->IsSelObjProtected(FlyProtectFlags::Content
) != FlyProtectFlags::NONE
)
121 rSet
.DisableItem(nWhich
);
125 case SID_DRAWTBX_LINES
:
127 rSet
.DisableItem(nWhich
);
130 case SID_INSERT_GRAPHIC
:
131 if( m_pWrtShell
->CursorInsideInputField() )
133 rSet
.DisableItem(nWhich
);
136 case SID_INSERT_SIGNATURELINE
:
137 if( !( m_nSelectionType
& SelectionType::Text
||
138 m_nSelectionType
& SelectionType::NumberList
) )
140 rSet
.DisableItem(nWhich
);
143 case SID_EDIT_SIGNATURELINE
:
144 case SID_SIGN_SIGNATURELINE
:
145 if (!isSignatureLineSelected() || isSignatureLineSigned())
146 rSet
.DisableItem(nWhich
);
148 case SID_INSERT_QRCODE
:
149 if( !( m_nSelectionType
& SelectionType::Text
||
150 m_nSelectionType
& SelectionType::NumberList
) )
152 rSet
.DisableItem(nWhich
);
155 case SID_EDIT_QRCODE
:
156 if (!isQRCodeSelected())
157 rSet
.DisableItem(nWhich
);
159 case FN_INSERT_CAPTION
:
161 // There are captions for graphics, OLE objects, frames and tables
164 eFrameType
= m_pWrtShell
->GetFrameType(nullptr, true);
165 bGetFrameType
= true;
167 if (! ( ((eFrameType
& FrameTypeFlags::FLY_ANY
) && m_nSelectionType
!= SelectionType::DrawObjectEditMode
)||
168 m_nSelectionType
& SelectionType::Table
||
169 m_nSelectionType
& SelectionType::DrawObject
) )
171 rSet
.DisableItem(nWhich
);
173 else if((m_pWrtShell
->IsObjSelected() || m_pWrtShell
->IsFrameSelected()) &&
174 (m_pWrtShell
->IsSelObjProtected( FlyProtectFlags::Parent
) != FlyProtectFlags::NONE
||
175 m_pWrtShell
->IsSelObjProtected( FlyProtectFlags::Content
) != FlyProtectFlags::NONE
))
177 rSet
.DisableItem(nWhich
);
179 else if( m_pWrtShell
->IsTableMode()
180 || isSignatureLineSelected()
181 || m_pWrtShell
->CursorInsideInputField() )
183 rSet
.DisableItem(nWhich
);
188 case FN_EDIT_FOOTNOTE
:
190 if( !m_pWrtShell
->GetCurFootnote() )
191 rSet
.DisableItem(nWhich
);
195 case FN_CHANGE_PAGENUM
:
197 FrameTypeFlags nType
= m_pWrtShell
->GetFrameType(nullptr,true);
198 if( ( FrameTypeFlags::FLY_ANY
| FrameTypeFlags::HEADER
| FrameTypeFlags::FOOTER
|
199 FrameTypeFlags::FOOTNOTE
| FrameTypeFlags::DRAWOBJ
) & nType
)
200 rSet
.DisableItem(nWhich
);
202 rSet
.Put(SfxUInt16Item(nWhich
, m_pWrtShell
->GetPageOffset()));
206 case SID_PRINTDOCDIRECT
:
207 GetSlotState( nWhich
, SfxViewShell::GetInterface(), &rSet
);
209 case SID_ATTR_PAGE_ORIENTATION
:
211 case SID_ATTR_PAGE_SIZE
:
212 case SID_ATTR_PAGE_PAPERBIN
:
214 case FN_PARAM_FTN_INFO
:
216 const size_t nCurIdx
= m_pWrtShell
->GetCurPageDesc();
217 const SwPageDesc
& rDesc
= m_pWrtShell
->GetPageDesc( nCurIdx
);
219 // set correct parent to get the XFILL_NONE FillStyle as needed
220 if(!rSet
.GetParent())
222 const SwFrameFormat
& rMaster
= rDesc
.GetMaster();
224 rSet
.SetParent(&rMaster
.GetDoc()->GetDfltFrameFormat()->GetAttrSet());
227 ::PageDescToItemSet( rDesc
, rSet
);
229 if (nWhich
== SID_ATTR_PAGE_ORIENTATION
&& comphelper::LibreOfficeKit::isActive())
231 OString aPayload
= ".uno:Orientation=";
232 if (rDesc
.GetLandscape())
234 aPayload
+= "IsLandscape";
238 aPayload
+= "IsPortrait";
240 libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED
, aPayload
);
247 const size_t nCurIdx
= m_pWrtShell
->GetCurPageDesc();
248 const SwPageDesc
& rDesc
= m_pWrtShell
->GetPageDesc( nCurIdx
);
249 const SwFrameFormat
& rMaster
= rDesc
.GetMaster();
250 const SvxBrushItem
& rBrush
= rMaster
.GetFormatAttr(RES_BACKGROUND
);
254 case SID_CLEARHISTORY
:
256 rSet
.Put(SfxBoolItem(nWhich
, m_pWrtShell
->GetLastUndoInfo(nullptr, nullptr)));
261 // which must not be present, so let them create:
265 const SfxPoolItem
* pState
= m_pShell
->GetSlotState(SID_UNDO
);
269 rSet
.DisableItem(nWhich
);
272 case FN_INSERT_OBJ_CTRL
:
274 || m_pWrtShell
->CursorInsideInputField() )
276 rSet
.DisableItem(nWhich
);
281 if(!m_pWrtShell
->GetTOXCount())
282 rSet
.DisableItem(nWhich
);
284 case FN_EDIT_CURRENT_TOX
:
285 case FN_UPDATE_CUR_TOX
:
287 const SwTOXBase
* pBase
= nullptr;
288 if(nullptr == (pBase
= m_pWrtShell
->GetCurTOX()) ||
289 (FN_EDIT_CURRENT_TOX
== nWhich
&& pBase
->IsTOXBaseInReadonly()))
290 rSet
.DisableItem(nWhich
);
293 case SID_TWAIN_SELECT
:
294 case SID_TWAIN_TRANSFER
:
295 #if defined(_WIN32) || defined UNX
297 if(!SW_MOD()->GetScannerManager().is())
298 rSet
.DisableItem(nWhich
);
302 case RES_PARATR_TABSTOP
:
303 case SID_ATTR_DEFTABSTOP
:
305 const SvxTabStopItem
& rDefTabs
= m_pWrtShell
->GetDefault(RES_PARATR_TABSTOP
);
306 rSet
.Put( SfxUInt16Item( nWhich
,
307 o3tl::narrowing
<sal_uInt16
>(::GetTabDist(rDefTabs
))));
310 case SID_ATTR_LANGUAGE
:
312 rSet
.Put(m_pWrtShell
->GetDefault(RES_CHRATR_LANGUAGE
).CloneSetWhich(SID_ATTR_LANGUAGE
));
315 case RES_CHRATR_CJK_LANGUAGE
:
317 rSet
.Put(m_pWrtShell
->GetDefault(RES_CHRATR_CJK_LANGUAGE
)
318 .CloneSetWhich(RES_CHRATR_CJK_LANGUAGE
));
321 case RES_CHRATR_CTL_LANGUAGE
:
323 rSet
.Put(m_pWrtShell
->GetDefault(RES_CHRATR_CTL_LANGUAGE
)
324 .CloneSetWhich(RES_CHRATR_CTL_LANGUAGE
));
328 rSet
.Put( SfxBoolItem( nWhich
, GetDocShell()->IsChangeRecording() ) );
329 // When the view is new (e.g. on load), show the Hidden Track Changes infobar
330 // if Show Changes is disabled, but recording of changes is enabled
331 // or hidden tracked changes are there already in the document.
332 // Note: the infobar won't be shown, if the Track Changes toolbar is already
333 // enabled, see in sfx2.
334 if ( m_bForceChangesToolbar
&& m_pWrtShell
->GetLayout()->IsHideRedlines() )
336 bool isRecording
= GetDocShell()->IsChangeRecording();
338 m_pWrtShell
->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().size();
339 if ( isRecording
|| hasRecorded
)
341 GetDocShell()->AppendInfoBarWhenReady(
342 "hiddentrackchanges", SwResId(STR_HIDDEN_CHANGES
),
343 SwResId( (isRecording
&& hasRecorded
)
344 ? STR_HIDDEN_CHANGES_DETAIL
346 ? STR_HIDDEN_CHANGES_DETAIL2
347 : STR_HIDDEN_CHANGES_DETAIL3
),
351 m_bForceChangesToolbar
= false;
353 case FN_REDLINE_PROTECT
:
354 rSet
.Put( SfxBoolItem( nWhich
, GetDocShell()->HasChangeRecordProtection() ) );
356 case FN_REDLINE_SHOW
:
358 rSet
.Put(SfxBoolItem(nWhich
, !m_pWrtShell
->GetLayout()->IsHideRedlines()));
361 case SID_AVMEDIA_PLAYER
:
362 case FN_REDLINE_ACCEPT
:
364 SfxViewFrame
& rVFrame
= GetViewFrame();
365 if (rVFrame
.KnowsChildWindow(nWhich
))
366 rSet
.Put(SfxBoolItem( nWhich
, rVFrame
.HasChildWindow(nWhich
)));
368 rSet
.DisableItem(nWhich
);
371 case FN_REDLINE_ACCEPT_DIRECT
:
372 case FN_REDLINE_REJECT_DIRECT
:
373 case FN_REDLINE_ACCEPT_TONEXT
:
374 case FN_REDLINE_REJECT_TONEXT
:
376 SwDoc
*pDoc
= m_pWrtShell
->GetDoc();
377 SwPaM
*pCursor
= m_pWrtShell
->GetCursor();
378 bool bDisable
= false;
379 if (GetDocShell()->HasChangeRecordProtection())
381 else if (pCursor
->HasMark())
383 // If the selection does not contain redlines, disable accepting/rejecting changes.
384 SwRedlineTable::size_type index
= 0;
385 const SwRedlineTable
& table
= pDoc
->getIDocumentRedlineAccess().GetRedlineTable();
386 const SwRangeRedline
* redline
= table
.FindAtPosition( *pCursor
->Start(), index
);
387 if( redline
!= nullptr && *redline
->Start() == *pCursor
->End())
389 if( redline
== nullptr )
391 // for table selections, GetCursor() gives only PaM of the first cell,
392 // so extend the redline limit to end of last cell of the selection
393 // TODO: adjust this for column selections, where the selected columns
394 // don't contain any redlines and any tracked row changes, but the
395 // adjacent not selected columns do to avoid false Enable
396 std::optional
<SwPosition
> oSelectionEnd
;
397 if ( m_pWrtShell
->IsTableMode() &&
398 m_pWrtShell
->GetTableCursor()->GetSelectedBoxesCount() )
400 const SwSelBoxes
& rBoxes
= m_pWrtShell
->GetTableCursor()->GetSelectedBoxes();
401 const SwStartNode
*pSttNd
= rBoxes
.back()->GetSttNd();
402 const SwNode
* pEndNode
= pSttNd
->GetNodes()[pSttNd
->EndOfSectionIndex()];
403 oSelectionEnd
.emplace(*pEndNode
);
406 oSelectionEnd
.emplace(*pCursor
->End());
408 for(; index
< table
.size(); ++index
)
410 const SwRangeRedline
* tmp
= table
[ index
];
411 if( *tmp
->Start() >= *oSelectionEnd
)
413 if( tmp
->HasMark() && tmp
->IsVisible())
420 if( redline
== nullptr )
425 // If the cursor position isn't on a redline, disable
426 // accepting/rejecting changes.
427 SwTableBox
* pTableBox
;
428 if (nullptr == pDoc
->getIDocumentRedlineAccess().GetRedline(*pCursor
->Start(), nullptr) &&
429 // except in the case of an inserted or deleted table row
430 ( !m_pWrtShell
->IsCursorInTable() ||
431 (pTableBox
= pCursor
->Start()->GetNode().GetTableBox() ) == nullptr ||
432 (RedlineType::None
== pTableBox
->GetRedlineType() &&
433 RedlineType::None
== pTableBox
->GetUpper()->GetRedlineType()) ) )
439 // LibreOfficeKit wants to handle changes by index, so always allow here.
441 rSet
.DisableItem(nWhich
);
442 if (comphelper::LibreOfficeKit::isActive())
444 OString
aPayload(".uno:TrackedChangeIndex=");
445 SwRedlineTable::size_type nRedline
= 0;
446 if (pDoc
->getIDocumentRedlineAccess().GetRedline(*pCursor
->Start(), &nRedline
))
447 aPayload
+= OString::number(nRedline
);
448 libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED
, aPayload
);
453 case FN_REDLINE_NEXT_CHANGE
:
454 case FN_REDLINE_PREV_CHANGE
:
456 // Enable change navigation if we have any redlines. Ideally we should disable
457 // "Next Change" if we're at or past the last change, and similarly for
459 if (0 == m_pWrtShell
->GetRedlineCount())
460 rSet
.DisableItem(nWhich
);
466 SwWrtShell
&rSh
= GetWrtShell();
467 if (2 <= rSh
.GetCursorCnt()) // multi selection?
468 rSet
.DisableItem(nWhich
);
471 LanguageType nLang
= rSh
.GetCurLang();
473 // disable "Thesaurus" (menu entry and key shortcut) if the
474 // language is not supported (by default it is enabled)
475 uno::Reference
< linguistic2::XThesaurus
> xThes( ::GetThesaurus() );
476 if (!xThes
.is() || nLang
== LANGUAGE_NONE
||
477 !xThes
->hasLocale( LanguageTag::convertToLocale( nLang
) ))
478 rSet
.DisableItem(nWhich
);
482 case SID_HANGUL_HANJA_CONVERSION
:
483 case SID_CHINESE_CONVERSION
:
485 if (!SvtCJKOptions::IsAnyEnabled())
487 GetViewFrame().GetBindings().SetVisibleState( nWhich
, false );
488 rSet
.DisableItem(nWhich
);
491 GetViewFrame().GetBindings().SetVisibleState( nWhich
, true );
494 case SID_MAIL_SCROLLBODY_PAGEDOWN
:
496 const tools::Long nBottom
= m_pWrtShell
->GetDocSize().Height() + DOCUMENTBORDER
;
497 const tools::Long nAct
= GetVisArea().Bottom();
498 rSet
.Put(SfxBoolItem(SID_MAIL_SCROLLBODY_PAGEDOWN
, nAct
< nBottom
));
502 case SID_DOCUMENT_COMPARE
:
503 case SID_DOCUMENT_MERGE
:
504 if( dynamic_cast<const SwGlobalDocShell
* >(GetDocShell()) != nullptr||
505 (SID_DOCUMENT_MERGE
== nWhich
&& m_pWrtShell
->getIDocumentRedlineAccess().GetRedlinePassword().hasElements()))
506 rSet
.DisableItem(nWhich
);
508 case SID_VIEW_DATA_SOURCE_BROWSER
:
509 if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE
) )
510 rSet
.Put( SfxVisibilityItem( nWhich
, false ) );
512 rSet
.Put( SfxBoolItem( nWhich
, GetViewFrame().HasChildWindow( SID_BROWSER
) ) );
514 case SID_READONLY_MODE
:
515 rSet
.Put(SfxBoolItem(nWhich
,
516 m_pWrtShell
->HasReadonlySel()||GetDocShell()->IsReadOnly()));
518 case SID_IMAGE_ORIENTATION
:
520 SfxImageItem
aImageItem(nWhich
);
521 if(m_pWrtShell
->IsInVerticalText())
522 aImageItem
.SetRotation( 2700_deg10
);
523 if(m_pWrtShell
->IsInRightToLeftText())
524 aImageItem
.SetMirrored( true );
525 rSet
.Put(aImageItem
);
528 case FN_INSERT_FIELD_DATA_ONLY
:
529 if(!m_bInMailMerge
&& !GetViewFrame().HasChildWindow(nWhich
))
530 rSet
.DisableItem(nWhich
);
532 case FN_MAILMERGE_SENDMAIL_CHILDWINDOW
:
534 case SID_ALIGN_ANY_LEFT
:
535 case SID_ALIGN_ANY_HCENTER
:
536 case SID_ALIGN_ANY_RIGHT
:
537 case SID_ALIGN_ANY_JUSTIFIED
:
538 case SID_ALIGN_ANY_TOP
:
539 case SID_ALIGN_ANY_VCENTER
:
540 case SID_ALIGN_ANY_BOTTOM
:
541 case SID_ALIGN_ANY_HDEFAULT
:
542 case SID_ALIGN_ANY_VDEFAULT
:
546 sal_uInt16 nAlias
= 0;
547 if( m_nSelectionType
& (SelectionType::DrawObjectEditMode
|SelectionType::Text
) )
551 case SID_ALIGN_ANY_LEFT
: nAlias
= SID_ATTR_PARA_ADJUST_LEFT
; break;
552 case SID_ALIGN_ANY_HCENTER
: nAlias
= SID_ATTR_PARA_ADJUST_CENTER
; break;
553 case SID_ALIGN_ANY_RIGHT
: nAlias
= SID_ATTR_PARA_ADJUST_RIGHT
; break;
554 case SID_ALIGN_ANY_JUSTIFIED
: nAlias
= SID_ATTR_PARA_ADJUST_BLOCK
; break;
555 case SID_ALIGN_ANY_TOP
: nAlias
= SID_TABLE_VERT_NONE
; break;
556 case SID_ALIGN_ANY_VCENTER
: nAlias
= SID_TABLE_VERT_CENTER
; break;
557 case SID_ALIGN_ANY_BOTTOM
: nAlias
= SID_TABLE_VERT_BOTTOM
; break;
564 case SID_ALIGN_ANY_LEFT
: nAlias
= SID_OBJECT_ALIGN_LEFT
; break;
565 case SID_ALIGN_ANY_HCENTER
: nAlias
= SID_OBJECT_ALIGN_CENTER
; break;
566 case SID_ALIGN_ANY_RIGHT
: nAlias
= SID_OBJECT_ALIGN_RIGHT
; break;
567 case SID_ALIGN_ANY_TOP
: nAlias
= SID_OBJECT_ALIGN_UP
; break;
568 case SID_ALIGN_ANY_VCENTER
: nAlias
= SID_OBJECT_ALIGN_MIDDLE
; break;
569 case SID_ALIGN_ANY_BOTTOM
: nAlias
= SID_OBJECT_ALIGN_DOWN
; break;
572 //these slots are either re-mapped to text or object alignment
573 const SfxPoolItem
* pState
= nullptr;
575 GetViewFrame().GetDispatcher()->QueryState( nAlias
, pState
);
578 if (!(m_nSelectionType
& SelectionType::DrawObject
))
580 rSet
.Put(pState
->CloneSetWhich(nWhich
));
584 rSet
.DisableItem(nWhich
);
588 nWhich
= aIter
.NextWhich();
592 void SwView::GetDrawState(SfxItemSet
&rSet
)
594 SfxWhichIter
aIter(rSet
);
595 bool bWeb
= dynamic_cast<SwWebView
*>( this ) != nullptr;
597 for( sal_uInt16 nWhich
= aIter
.FirstWhich(); nWhich
;
598 nWhich
= aIter
.NextWhich() )
603 case SID_LINE_ARROW_END
:
604 case SID_LINE_ARROW_CIRCLE
:
605 case SID_LINE_ARROW_SQUARE
:
606 case SID_LINE_ARROW_START
:
607 case SID_LINE_CIRCLE_ARROW
:
608 case SID_LINE_SQUARE_ARROW
:
609 case SID_LINE_ARROWS
:
610 case SID_DRAW_MEASURELINE
:
612 case SID_DRAW_ELLIPSE
:
613 case SID_DRAW_XPOLYGON_NOFILL
:
614 case SID_DRAW_XPOLYGON
:
615 case SID_DRAW_POLYGON_NOFILL
:
616 case SID_DRAW_POLYGON
:
617 case SID_DRAW_BEZIER_NOFILL
:
618 case SID_DRAW_BEZIER_FILL
:
619 case SID_DRAW_FREELINE_NOFILL
:
620 case SID_DRAW_FREELINE
:
623 case SID_DRAW_CIRCLECUT
:
625 case SID_DRAW_CAPTION
:
627 rSet
.DisableItem( nWhich
);
629 if (nWhich
!= SID_DRAW_TEXT
) //tdf#113171
630 rSet
.Put( SfxBoolItem( nWhich
, m_nDrawSfxId
== nWhich
) );
633 case SID_DRAW_TEXT_VERTICAL
:
634 case SID_DRAW_CAPTION_VERTICAL
:
635 if ( bWeb
|| !SvtCJKOptions::IsVerticalTextEnabled() )
636 rSet
.DisableItem( nWhich
);
638 if (nWhich
!= SID_DRAW_TEXT_VERTICAL
) //tdf#113171
639 rSet
.Put( SfxBoolItem( nWhich
, m_nDrawSfxId
== nWhich
) );
642 case SID_DRAW_TEXT_MARQUEE
:
643 if (::GetHtmlMode(GetDocShell()) & HTMLMODE_SOME_STYLES
)
644 rSet
.Put( SfxBoolItem(nWhich
, m_nDrawSfxId
== nWhich
));
646 rSet
.DisableItem(nWhich
);
648 case SID_OBJECT_SELECT
:
649 rSet
.Put( SfxBoolItem(nWhich
, m_nDrawSfxId
== nWhich
||
650 m_nFormSfxId
== nWhich
));
653 case SID_INSERT_DRAW
:
654 case SID_FONTWORK_GALLERY_FLOATER
:
655 case SID_DRAWTBX_ARROWS
:
658 rSet
.DisableItem( nWhich
);
662 case SID_DRAWTBX_CS_BASIC
:
663 case SID_DRAWTBX_CS_SYMBOL
:
664 case SID_DRAWTBX_CS_ARROW
:
665 case SID_DRAWTBX_CS_FLOWCHART
:
666 case SID_DRAWTBX_CS_CALLOUT
:
667 case SID_DRAWTBX_CS_STAR
:
670 rSet
.DisableItem( nWhich
);
672 rSet
.Put( SfxStringItem( nWhich
, m_nDrawSfxId
== nWhich
? m_sDrawCustom
: OUString() ) );
679 bool SwView::HasUIFeature(SfxShellFeature nFeature
) const
681 assert((nFeature
& ~SfxShellFeature::SwMask
) == SfxShellFeature::NONE
);
684 case SfxShellFeature::SwChildWindowLabel
:
685 return m_pWrtShell
->IsLabelDoc();
691 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */