LibreOffice Module sw (master) 1
viewstat.cxx
Go to the documentation of this file.
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 <memory>
21
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>
34#include <tox.hxx>
35#include <sfx2/dispatch.hxx>
36#include <view.hxx>
37#include <wrtsh.hxx>
38#include <uitool.hxx>
39#include <viewopt.hxx>
40#include <pagedesc.hxx>
41#include <wview.hxx>
42#include <globdoc.hxx>
43#include <svl/stritem.hxx>
45#include <comphelper/lok.hxx>
46#include <LibreOfficeKit/LibreOfficeKitEnums.h>
47#include <svl/visitem.hxx>
48#include <redline.hxx>
49#include <rootfrm.hxx>
50#include <docary.hxx>
51#include <sfx2/infobar.hxx>
52#include <docsh.hxx>
53#include <strings.hrc>
54
55#include <cmdid.h>
57
58#include <doc.hxx>
59#include <workctrl.hxx>
60
61using namespace ::com::sun::star;
62
64{
65 SfxWhichIter aIter(rSet);
66 sal_uInt16 nWhich = aIter.FirstWhich();
68 bool bGetFrameType = false;
69 bool bWeb = dynamic_cast<SwWebView*>( this ) != nullptr;
70
71 while(nWhich)
72 {
73 switch(nWhich)
74 {
75 case SID_ZOOM_IN:
76 case SID_ZOOM_OUT:
77 {
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)))
81 {
82 rSet.DisableItem(nWhich);
83 }
84 }
85 break;
87 {
88 bool bDisable(true);
89 if (m_pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton())
90 {
93 bDisable = false;
94 }
95 if (bDisable)
96 rSet.DisableItem(nWhich);
97 }
98 break;
99 case FN_NAV_ELEMENT:
100 // used to update all instances of this control
101 rSet.InvalidateItem( nWhich );
102 break;
103 case FN_SCROLL_PREV:
104 case FN_SCROLL_NEXT:
105 {
107 {
108 if (!m_pWrtShell->GetNavigationMgr().forwardEnabled())
110 if (!m_pWrtShell->GetNavigationMgr().backEnabled())
112 }
113 }
114 break;
115 case FN_EDIT_LINK_DLG:
116 if( m_pWrtShell->GetLinkManager().GetLinks().empty() )
117 rSet.DisableItem(nWhich);
118 else if( m_pWrtShell->IsSelFrameMode() &&
120 {
121 rSet.DisableItem(nWhich);
122 }
123 break;
124
125 case SID_DRAWTBX_LINES:
126 if ( bWeb )
127 rSet.DisableItem(nWhich);
128 break;
129
130 case SID_INSERT_GRAPHIC:
131 if( m_pWrtShell->CursorInsideInputField() )
132 {
133 rSet.DisableItem(nWhich);
134 }
135 break;
136 case SID_INSERT_SIGNATURELINE:
139 {
140 rSet.DisableItem(nWhich);
141 }
142 break;
143 case SID_EDIT_SIGNATURELINE:
144 case SID_SIGN_SIGNATURELINE:
146 rSet.DisableItem(nWhich);
147 break;
148 case SID_INSERT_QRCODE:
151 {
152 rSet.DisableItem(nWhich);
153 }
154 break;
155 case SID_EDIT_QRCODE:
156 if (!isQRCodeSelected())
157 rSet.DisableItem(nWhich);
158 break;
160 {
161 // There are captions for graphics, OLE objects, frames and tables
162 if( !bGetFrameType )
163 {
164 eFrameType = m_pWrtShell->GetFrameType(nullptr, true);
165 bGetFrameType = true;
166 }
170 {
171 rSet.DisableItem(nWhich);
172 }
173 else if((m_pWrtShell->IsObjSelected() || m_pWrtShell->IsFrameSelected()) &&
176 {
177 rSet.DisableItem(nWhich);
178 }
179 else if( m_pWrtShell->IsTableMode()
181 || m_pWrtShell->CursorInsideInputField() )
182 {
183 rSet.DisableItem(nWhich);
184 }
185 }
186 break;
187
188 case FN_EDIT_FOOTNOTE:
189 {
190 if( !m_pWrtShell->GetCurFootnote() )
191 rSet.DisableItem(nWhich);
192 }
193 break;
194
196 {
197 FrameTypeFlags nType = m_pWrtShell->GetFrameType(nullptr,true);
200 rSet.DisableItem(nWhich);
201 else
202 rSet.Put(SfxUInt16Item(nWhich, m_pWrtShell->GetPageOffset()));
203 }
204 break;
205 case SID_PRINTDOC:
206 case SID_PRINTDOCDIRECT:
208 break;
209 case SID_ATTR_PAGE_ORIENTATION:
210 case SID_ATTR_PAGE:
211 case SID_ATTR_PAGE_SIZE:
212 case SID_ATTR_PAGE_PAPERBIN:
213 case RES_PAPER_BIN:
215 {
216 const size_t nCurIdx = m_pWrtShell->GetCurPageDesc();
217 const SwPageDesc& rDesc = m_pWrtShell->GetPageDesc( nCurIdx );
218
219 // set correct parent to get the XFILL_NONE FillStyle as needed
220 if(!rSet.GetParent())
221 {
222 const SwFrameFormat& rMaster = rDesc.GetMaster();
223
225 }
226
227 ::PageDescToItemSet( rDesc, rSet);
228
229 if (nWhich == SID_ATTR_PAGE_ORIENTATION && comphelper::LibreOfficeKit::isActive())
230 {
231 OString aPayload = ".uno:Orientation=";
232 if (rDesc.GetLandscape())
233 {
234 aPayload += "IsLandscape";
235 }
236 else
237 {
238 aPayload += "IsPortrait";
239 }
240 libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload);
241 }
242 }
243 break;
244 case RES_BACKGROUND:
245 case SID_ATTR_BRUSH:
246 {
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);
251 rSet.Put(rBrush);
252 }
253 break;
254 case SID_CLEARHISTORY:
255 {
256 rSet.Put(SfxBoolItem(nWhich, m_pWrtShell->GetLastUndoInfo(nullptr, nullptr)));
257 }
258 break;
259 case SID_UNDO:
260 {
261 // which must not be present, so let them create:
262 if( !m_pShell )
263 SelectShell();
264
265 const SfxPoolItem* pState = m_pShell->GetSlotState(SID_UNDO);
266 if(pState)
267 rSet.Put(*pState);
268 else
269 rSet.DisableItem(nWhich);
270 }
271 break;
273 if( bWeb
274 || m_pWrtShell->CursorInsideInputField() )
275 {
276 rSet.DisableItem(nWhich);
277 }
278 break;
279
280 case FN_UPDATE_TOX:
281 if(!m_pWrtShell->GetTOXCount())
282 rSet.DisableItem(nWhich);
283 break;
286 {
287 const SwTOXBase* pBase = nullptr;
288 if(nullptr == (pBase = m_pWrtShell->GetCurTOX()) ||
289 (FN_EDIT_CURRENT_TOX == nWhich && pBase->IsTOXBaseInReadonly()))
290 rSet.DisableItem(nWhich);
291 }
292 break;
293 case SID_TWAIN_SELECT:
294 case SID_TWAIN_TRANSFER:
295#if defined(_WIN32) || defined UNX
296 {
297 if(!SW_MOD()->GetScannerManager().is())
298 rSet.DisableItem(nWhich);
299 }
300#endif
301 break;
303 case SID_ATTR_DEFTABSTOP:
304 {
305 const SvxTabStopItem& rDefTabs = m_pWrtShell->GetDefault(RES_PARATR_TABSTOP);
306 rSet.Put( SfxUInt16Item( nWhich,
307 o3tl::narrowing<sal_uInt16>(::GetTabDist(rDefTabs))));
308 }
309 break;
310 case SID_ATTR_LANGUAGE:
311 {
312 rSet.Put(m_pWrtShell->GetDefault(RES_CHRATR_LANGUAGE).CloneSetWhich(SID_ATTR_LANGUAGE));
313 }
314 break;
316 {
318 .CloneSetWhich(RES_CHRATR_CJK_LANGUAGE));
319 }
320 break;
322 {
324 .CloneSetWhich(RES_CHRATR_CTL_LANGUAGE));
325 }
326 break;
327 case FN_REDLINE_ON:
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() )
335 {
336 bool isRecording = GetDocShell()->IsChangeRecording();
337 bool hasRecorded =
338 m_pWrtShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().size();
339 if ( isRecording || hasRecorded )
340 {
342 "hiddentrackchanges", SwResId(STR_HIDDEN_CHANGES),
343 SwResId( (isRecording && hasRecorded)
344 ? STR_HIDDEN_CHANGES_DETAIL
345 : isRecording
346 ? STR_HIDDEN_CHANGES_DETAIL2
347 : STR_HIDDEN_CHANGES_DETAIL3 ),
348 InfobarType::INFO);
349 }
350 }
352 break;
353 case FN_REDLINE_PROTECT :
354 rSet.Put( SfxBoolItem( nWhich, GetDocShell()->HasChangeRecordProtection() ) );
355 break;
356 case FN_REDLINE_SHOW:
357 {
358 rSet.Put(SfxBoolItem(nWhich, !m_pWrtShell->GetLayout()->IsHideRedlines()));
359 }
360 break;
361 case SID_AVMEDIA_PLAYER :
362 case FN_REDLINE_ACCEPT :
363 {
364 SfxViewFrame& rVFrame = GetViewFrame();
365 if (rVFrame.KnowsChildWindow(nWhich))
366 rSet.Put(SfxBoolItem( nWhich, rVFrame.HasChildWindow(nWhich)));
367 else
368 rSet.DisableItem(nWhich);
369 }
370 break;
375 {
376 SwDoc *pDoc = m_pWrtShell->GetDoc();
377 SwPaM *pCursor = m_pWrtShell->GetCursor();
378 bool bDisable = false;
379 if (GetDocShell()->HasChangeRecordProtection())
380 bDisable = true;
381 else if (pCursor->HasMark())
382 {
383 // If the selection does not contain redlines, disable accepting/rejecting changes.
386 const SwRangeRedline* redline = table.FindAtPosition( *pCursor->Start(), index );
387 if( redline != nullptr && *redline->Start() == *pCursor->End())
388 redline = nullptr;
389 if( redline == nullptr )
390 {
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() )
399 {
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);
404 }
405 else
406 oSelectionEnd.emplace(*pCursor->End());
407
408 for(; index < table.size(); ++index )
409 {
410 const SwRangeRedline* tmp = table[ index ];
411 if( *tmp->Start() >= *oSelectionEnd )
412 break;
413 if( tmp->HasMark() && tmp->IsVisible())
414 {
415 redline = tmp;
416 break;
417 }
418 }
419 }
420 if( redline == nullptr )
421 bDisable = true;
422 }
423 else
424 {
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()) ) )
434 {
435 bDisable = true;
436 }
437 }
438
439 // LibreOfficeKit wants to handle changes by index, so always allow here.
440 if (bDisable)
441 rSet.DisableItem(nWhich);
443 {
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);
449 }
450 }
451 break;
452
455 {
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
458 // "Previous Change"
459 if (0 == m_pWrtShell->GetRedlineCount())
460 rSet.DisableItem(nWhich);
461 }
462 break;
463
464 case SID_THESAURUS:
465 {
466 SwWrtShell &rSh = GetWrtShell();
467 if (2 <= rSh.GetCursorCnt()) // multi selection?
468 rSet.DisableItem(nWhich);
469 else
470 {
472
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);
479 }
480 }
481 break;
482 case SID_HANGUL_HANJA_CONVERSION:
483 case SID_CHINESE_CONVERSION:
484 {
486 {
487 GetViewFrame().GetBindings().SetVisibleState( nWhich, false );
488 rSet.DisableItem(nWhich);
489 }
490 else
491 GetViewFrame().GetBindings().SetVisibleState( nWhich, true );
492 }
493 break;
494 case SID_MAIL_SCROLLBODY_PAGEDOWN:
495 {
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 ));
499 }
500 break;
501
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);
507 break;
508 case SID_VIEW_DATA_SOURCE_BROWSER:
509 if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
510 rSet.Put( SfxVisibilityItem( nWhich, false ) );
511 else
512 rSet.Put( SfxBoolItem( nWhich, GetViewFrame().HasChildWindow( SID_BROWSER ) ) );
513 break;
514 case SID_READONLY_MODE:
515 rSet.Put(SfxBoolItem(nWhich,
516 m_pWrtShell->HasReadonlySel()||GetDocShell()->IsReadOnly()));
517 break;
518 case SID_IMAGE_ORIENTATION:
519 {
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);
526 }
527 break;
529 if(!m_bInMailMerge && !GetViewFrame().HasChildWindow(nWhich))
530 rSet.DisableItem(nWhich);
531 break;
533 break;
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 :
543 {
544 if( !m_pShell )
545 SelectShell();
546 sal_uInt16 nAlias = 0;
548 {
549 switch( nWhich )
550 {
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;
558 }
559 }
560 else
561 {
562 switch( nWhich )
563 {
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;
570 }
571 }
572 //these slots are either re-mapped to text or object alignment
573 const SfxPoolItem* pState = nullptr;
574 if(nAlias)
575 GetViewFrame().GetDispatcher()->QueryState( nAlias, pState );
576 if(pState)
577 {
579 {
580 rSet.Put(pState->CloneSetWhich(nWhich));
581 }
582 }
583 else
584 rSet.DisableItem(nWhich);
585 }
586 break;
587 }
588 nWhich = aIter.NextWhich();
589 }
590}
591
593{
594 SfxWhichIter aIter(rSet);
595 bool bWeb = dynamic_cast<SwWebView*>( this ) != nullptr;
596
597 for( sal_uInt16 nWhich = aIter.FirstWhich(); nWhich;
598 nWhich = aIter.NextWhich() )
599 switch(nWhich)
600 {
601 case SID_DRAW_LINE:
602 case SID_DRAW_XLINE:
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:
611 case SID_DRAW_RECT:
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:
621 case SID_DRAW_ARC:
622 case SID_DRAW_PIE:
623 case SID_DRAW_CIRCLECUT:
624 case SID_DRAW_TEXT:
625 case SID_DRAW_CAPTION:
626 if ( bWeb )
627 rSet.DisableItem( nWhich );
628 else
629 if (nWhich != SID_DRAW_TEXT) //tdf#113171
630 rSet.Put( SfxBoolItem( nWhich, m_nDrawSfxId == nWhich ) );
631 break;
632
633 case SID_DRAW_TEXT_VERTICAL:
634 case SID_DRAW_CAPTION_VERTICAL:
636 rSet.DisableItem( nWhich );
637 else
638 if (nWhich != SID_DRAW_TEXT_VERTICAL) //tdf#113171
639 rSet.Put( SfxBoolItem( nWhich, m_nDrawSfxId == nWhich ) );
640 break;
641
642 case SID_DRAW_TEXT_MARQUEE:
644 rSet.Put( SfxBoolItem(nWhich, m_nDrawSfxId == nWhich));
645 else
646 rSet.DisableItem(nWhich);
647 break;
648 case SID_OBJECT_SELECT:
649 rSet.Put( SfxBoolItem(nWhich, m_nDrawSfxId == nWhich ||
650 m_nFormSfxId == nWhich));
651 break;
652
653 case SID_INSERT_DRAW:
654 case SID_FONTWORK_GALLERY_FLOATER :
655 case SID_DRAWTBX_ARROWS:
656 {
657 if ( bWeb )
658 rSet.DisableItem( nWhich );
659 }
660 break;
661
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 :
668 {
669 if ( bWeb )
670 rSet.DisableItem( nWhich );
671 else
672 rSet.Put( SfxStringItem( nWhich, m_nDrawSfxId == nWhich ? m_sDrawCustom : OUString() ) );
673 }
674 break;
675
676 }
677}
678
680{
681 assert((nFeature & ~SfxShellFeature::SwMask) == SfxShellFeature::NONE);
682 switch(nFeature)
683 {
684 case SfxShellFeature::SwChildWindowLabel:
685 return m_pWrtShell->IsLabelDoc();
686 default:
687 return false;
688 }
689}
690
691/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual const SwRedlineTable & GetRedlineTable() const =0
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
void SetVisibleState(sal_uInt16 nId, bool bShow)
SfxItemState QueryState(sal_uInt16 nSID, const SfxPoolItem *&rpState)
void SetRotation(Degree10 nValue)
void SetMirrored(bool bSet)
void SetParent(const SfxItemSet *pNew)
const SfxItemSet * GetParent() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void DisableItem(sal_uInt16 nWhich)
void InvalidateItem(sal_uInt16 nWhich)
void AppendInfoBarWhenReady(const OUString &sId, const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, InfobarType aInfobarType, bool bShowCloseButton=true)
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
const SfxPoolItem * GetSlotState(sal_uInt16 nSlotId, const SfxInterface *pIF=nullptr, SfxItemSet *pStateSet=nullptr)
virtual SfxInterface * GetInterface() const
SfxBindings & GetBindings()
bool HasChildWindow(sal_uInt16)
SfxDispatcher * GetDispatcher()
bool KnowsChildWindow(sal_uInt16)
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
SfxViewFrame & GetViewFrame() const
sal_uInt16 FirstWhich()
sal_uInt16 NextWhich()
sal_uInt16 GetCursorCnt(bool bAll=true) const
Get the number of elements in the ring of cursors.
Definition: crsrsh.cxx:3055
virtual bool IsChangeRecording() const override
passwword protection for Writer (derived from SfxObjectShell) see also: FN_REDLINE_ON,...
Definition: docsh.cxx:1341
Definition: doc.hxx:197
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:349
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:762
LanguageType GetCurLang() const
Definition: edattr.cxx:801
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:366
Style of a layout element.
Definition: frmfmt.hxx:72
Base class of the Writer document model elements.
Definition: node.hxx:98
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:706
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
Definition: node.cxx:772
SwNodeOffset EndOfSectionIndex() const
Definition: node.hxx:691
static constexpr auto npos
Definition: ndarr.hxx:81
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:188
const SwPosition * End() const
Definition: pam.hxx:263
const SwPosition * Start() const
Definition: pam.hxx:258
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:251
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
bool GetLandscape() const
Definition: pagedesc.hxx:199
bool IsVisible() const
Definition: redline.hxx:200
vector_type::size_type size_type
Definition: docary.hxx:223
Starts a section of nodes in the document model.
Definition: node.hxx:348
bool IsTOXBaseInReadonly() const
Definition: doctxm.cxx:2095
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:443
SwTableLine * GetUpper()
Definition: swtable.hxx:477
RedlineType GetRedlineType() const
Definition: swtable.cxx:3025
RedlineType GetRedlineType() const
Definition: swtable.cxx:1954
OUString m_sDrawCustom
Definition: view.hxx:226
SwWrtShell & GetWrtShell() const
Definition: view.hxx:423
sal_uInt16 m_nFormSfxId
Definition: view.hxx:227
SfxShell * m_pShell
Definition: view.hxx:197
static sal_uInt16 s_nMoveType
Definition: view.hxx:167
std::unique_ptr< SwWrtShell > m_pWrtShell
Definition: view.hxx:194
virtual void SelectShell()
Definition: view.cxx:253
void GetState(SfxItemSet &)
Definition: viewstat.cxx:63
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:436
bool isSignatureLineSigned() const
Definition: viewdlg2.cxx:141
void GetDrawState(SfxItemSet &rSet)
Definition: viewstat.cxx:592
bool isSignatureLineSelected() const
Definition: viewdlg2.cxx:120
SelectionType m_nSelectionType
Definition: view.hxx:221
bool isQRCodeSelected() const
Definition: viewdlg2.cxx:162
virtual bool HasUIFeature(SfxShellFeature nFeature) const override
Definition: viewstat.cxx:679
SwDocShell * GetDocShell()
Definition: view.cxx:1193
bool m_bInMailMerge
Definition: view.hxx:257
sal_uInt16 m_nDrawSfxId
Definition: view.hxx:225
bool m_bForceChangesToolbar
Definition: view.hxx:262
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
const Value & back() const
constexpr tools::Long Bottom() const
#define FN_UPDATE_TOX
Definition: cmdid.h:537
#define FN_REDLINE_ACCEPT_DIRECT
Definition: cmdid.h:143
#define FN_CHANGE_PAGENUM
Definition: cmdid.h:528
#define FN_EDIT_LINK_DLG
Definition: cmdid.h:78
#define FN_INSERT_CAPTION
Definition: cmdid.h:214
#define FN_NAV_ELEMENT
Definition: cmdid.h:188
#define FN_EDIT_FOOTNOTE
Definition: cmdid.h:115
#define FN_INSERT_OBJ_CTRL
Definition: cmdid.h:274
#define FN_EDIT_CURRENT_TOX
Definition: cmdid.h:138
#define FN_REDLINE_REJECT_DIRECT
Definition: cmdid.h:144
#define FN_REDLINE_NEXT_CHANGE
Definition: cmdid.h:147
#define FN_REDLINE_PREV_CHANGE
Definition: cmdid.h:148
#define FN_REDLINE_ACCEPT_TONEXT
Definition: cmdid.h:151
#define FN_UPDATE_CUR_TOX
Definition: cmdid.h:538
#define FN_INSERT_FIELD_DATA_ONLY
Definition: cmdid.h:223
#define FN_PARAM_FTN_INFO
Definition: cmdid.h:808
#define FN_MAILMERGE_SENDMAIL_CHILDWINDOW
Definition: cmdid.h:289
#define FN_REDLINE_REJECT_TONEXT
Definition: cmdid.h:152
#define FN_REDLINE_ACCEPT
Definition: cmdid.h:136
#define FN_REDLINE_SHOW
Definition: cmdid.h:131
#define FN_SCROLL_NEXT
Definition: cmdid.h:190
#define FN_TOGGLE_OUTLINE_CONTENT_VISIBILITY
Definition: cmdid.h:197
#define FN_SCROLL_PREV
Definition: cmdid.h:189
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:63
@ Parent
Check only parents.
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SvxPaperBinItem > RES_PAPER_BIN(90)
HTMLMODE_SOME_STYLES
#define LANGUAGE_NONE
sal_uInt16 nPos
bool IsVerticalTextEnabled()
bool IsAnyEnabled()
index
long Long
QPRO_FUNC_TYPE nType
static SfxItemSet & rSet
SfxShellFeature
static LanguageType nLang
Definition: srtdlg.cxx:51
SwNode & GetNode() const
Definition: pam.hxx:81
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
#define SW_MOD()
Definition: swmodule.hxx:254
uno::Reference< linguistic2::XThesaurus > GetThesaurus()
Definition: swtypes.cxx:59
constexpr SwTwips DOCUMENTBORDER
Definition: swtypes.hxx:79
void PageDescToItemSet(const SwPageDesc &rPageDesc, SfxItemSet &rSet)
Definition: uitool.cxx:458
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:650
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:415
#define NID_RECENCY
Definition: workctrl.hxx:53