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.getStr());
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* pVFrame = GetViewFrame();
365 if (pVFrame->KnowsChildWindow(nWhich))
366 rSet.Put(SfxBoolItem( nWhich, pVFrame->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->GetUpper()->GetRedlineType() ) )
433 {
434 bDisable = true;
435 }
436 }
437
438 // LibreOfficeKit wants to handle changes by index, so always allow here.
439 if (bDisable)
440 rSet.DisableItem(nWhich);
442 {
443 OString aPayload(".uno:TrackedChangeIndex=");
444 SwRedlineTable::size_type nRedline = 0;
445 if (pDoc->getIDocumentRedlineAccess().GetRedline(*pCursor->Start(), &nRedline))
446 aPayload += OString::number(nRedline);
447 libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
448 }
449 }
450 break;
451
454 {
455 // Enable change navigation if we have any redlines. Ideally we should disable
456 // "Next Change" if we're at or past the last change, and similarly for
457 // "Previous Change"
458 if (0 == m_pWrtShell->GetRedlineCount())
459 rSet.DisableItem(nWhich);
460 }
461 break;
462
463 case SID_THESAURUS:
464 {
465 SwWrtShell &rSh = GetWrtShell();
466 if (2 <= rSh.GetCursorCnt()) // multi selection?
467 rSet.DisableItem(nWhich);
468 else
469 {
471
472 // disable "Thesaurus" (menu entry and key shortcut) if the
473 // language is not supported (by default it is enabled)
474 uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
475 if (!xThes.is() || nLang == LANGUAGE_NONE ||
476 !xThes->hasLocale( LanguageTag::convertToLocale( nLang ) ))
477 rSet.DisableItem(nWhich);
478 }
479 }
480 break;
481 case SID_HANGUL_HANJA_CONVERSION:
482 case SID_CHINESE_CONVERSION:
483 {
485 {
486 GetViewFrame()->GetBindings().SetVisibleState( nWhich, false );
487 rSet.DisableItem(nWhich);
488 }
489 else
490 GetViewFrame()->GetBindings().SetVisibleState( nWhich, true );
491 }
492 break;
493 case SID_MAIL_SCROLLBODY_PAGEDOWN:
494 {
495 const tools::Long nBottom = m_pWrtShell->GetDocSize().Height() + DOCUMENTBORDER;
496 const tools::Long nAct = GetVisArea().Bottom();
497 rSet.Put(SfxBoolItem(SID_MAIL_SCROLLBODY_PAGEDOWN, nAct < nBottom ));
498 }
499 break;
500
501 case SID_DOCUMENT_COMPARE:
502 case SID_DOCUMENT_MERGE:
503 if( dynamic_cast<const SwGlobalDocShell* >(GetDocShell()) != nullptr||
504 (SID_DOCUMENT_MERGE == nWhich && m_pWrtShell->getIDocumentRedlineAccess().GetRedlinePassword().hasElements()))
505 rSet.DisableItem(nWhich);
506 break;
507 case SID_VIEW_DATA_SOURCE_BROWSER:
508 if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
509 rSet.Put( SfxVisibilityItem( nWhich, false ) );
510 else
511 rSet.Put( SfxBoolItem( nWhich, GetViewFrame()->HasChildWindow( SID_BROWSER ) ) );
512 break;
513 case SID_READONLY_MODE:
514 rSet.Put(SfxBoolItem(nWhich,
515 m_pWrtShell->HasReadonlySel()||GetDocShell()->IsReadOnly()));
516 break;
517 case SID_IMAGE_ORIENTATION:
518 {
519 SfxImageItem aImageItem(nWhich);
520 if(m_pWrtShell->IsInVerticalText())
521 aImageItem.SetRotation( 2700_deg10 );
522 if(m_pWrtShell->IsInRightToLeftText())
523 aImageItem.SetMirrored( true );
524 rSet.Put(aImageItem);
525 }
526 break;
528 if(!m_bInMailMerge && !GetViewFrame()->HasChildWindow(nWhich))
529 rSet.DisableItem(nWhich);
530 break;
532 break;
533 case SID_ALIGN_ANY_LEFT :
534 case SID_ALIGN_ANY_HCENTER :
535 case SID_ALIGN_ANY_RIGHT :
536 case SID_ALIGN_ANY_JUSTIFIED:
537 case SID_ALIGN_ANY_TOP :
538 case SID_ALIGN_ANY_VCENTER :
539 case SID_ALIGN_ANY_BOTTOM :
540 case SID_ALIGN_ANY_HDEFAULT :
541 case SID_ALIGN_ANY_VDEFAULT :
542 {
543 if( !m_pShell )
544 SelectShell();
545 sal_uInt16 nAlias = 0;
547 {
548 switch( nWhich )
549 {
550 case SID_ALIGN_ANY_LEFT : nAlias = SID_ATTR_PARA_ADJUST_LEFT; break;
551 case SID_ALIGN_ANY_HCENTER : nAlias = SID_ATTR_PARA_ADJUST_CENTER; break;
552 case SID_ALIGN_ANY_RIGHT : nAlias = SID_ATTR_PARA_ADJUST_RIGHT; break;
553 case SID_ALIGN_ANY_JUSTIFIED: nAlias = SID_ATTR_PARA_ADJUST_BLOCK; break;
554 case SID_ALIGN_ANY_TOP : nAlias = SID_TABLE_VERT_NONE; break;
555 case SID_ALIGN_ANY_VCENTER : nAlias = SID_TABLE_VERT_CENTER; break;
556 case SID_ALIGN_ANY_BOTTOM : nAlias = SID_TABLE_VERT_BOTTOM; break;
557 }
558 }
559 else
560 {
561 switch( nWhich )
562 {
563 case SID_ALIGN_ANY_LEFT : nAlias = SID_OBJECT_ALIGN_LEFT ; break;
564 case SID_ALIGN_ANY_HCENTER : nAlias = SID_OBJECT_ALIGN_CENTER ; break;
565 case SID_ALIGN_ANY_RIGHT : nAlias = SID_OBJECT_ALIGN_RIGHT ; break;
566 case SID_ALIGN_ANY_TOP : nAlias = SID_OBJECT_ALIGN_UP ; break;
567 case SID_ALIGN_ANY_VCENTER : nAlias = SID_OBJECT_ALIGN_MIDDLE ; break;
568 case SID_ALIGN_ANY_BOTTOM : nAlias = SID_OBJECT_ALIGN_DOWN ; break;
569 }
570 }
571 //these slots are either re-mapped to text or object alignment
572 const SfxPoolItem* pState = nullptr;
573 if(nAlias)
574 GetViewFrame()->GetDispatcher()->QueryState( nAlias, pState );
575 if(pState)
576 {
578 {
579 rSet.Put(pState->CloneSetWhich(nWhich));
580 }
581 }
582 else
583 rSet.DisableItem(nWhich);
584 }
585 break;
586 }
587 nWhich = aIter.NextWhich();
588 }
589}
590
592{
593 SfxWhichIter aIter(rSet);
594 bool bWeb = dynamic_cast<SwWebView*>( this ) != nullptr;
595
596 for( sal_uInt16 nWhich = aIter.FirstWhich(); nWhich;
597 nWhich = aIter.NextWhich() )
598 switch(nWhich)
599 {
600 case SID_DRAW_LINE:
601 case SID_DRAW_XLINE:
602 case SID_LINE_ARROW_END:
603 case SID_LINE_ARROW_CIRCLE:
604 case SID_LINE_ARROW_SQUARE:
605 case SID_LINE_ARROW_START:
606 case SID_LINE_CIRCLE_ARROW:
607 case SID_LINE_SQUARE_ARROW:
608 case SID_LINE_ARROWS:
609 case SID_DRAW_MEASURELINE:
610 case SID_DRAW_RECT:
611 case SID_DRAW_ELLIPSE:
612 case SID_DRAW_XPOLYGON_NOFILL:
613 case SID_DRAW_XPOLYGON:
614 case SID_DRAW_POLYGON_NOFILL:
615 case SID_DRAW_POLYGON:
616 case SID_DRAW_BEZIER_NOFILL:
617 case SID_DRAW_BEZIER_FILL:
618 case SID_DRAW_FREELINE_NOFILL:
619 case SID_DRAW_FREELINE:
620 case SID_DRAW_ARC:
621 case SID_DRAW_PIE:
622 case SID_DRAW_CIRCLECUT:
623 case SID_DRAW_TEXT:
624 case SID_DRAW_CAPTION:
625 if ( bWeb )
626 rSet.DisableItem( nWhich );
627 else
628 if (nWhich != SID_DRAW_TEXT) //tdf#113171
629 rSet.Put( SfxBoolItem( nWhich, m_nDrawSfxId == nWhich ) );
630 break;
631
632 case SID_DRAW_TEXT_VERTICAL:
633 case SID_DRAW_CAPTION_VERTICAL:
635 rSet.DisableItem( nWhich );
636 else
637 if (nWhich != SID_DRAW_TEXT_VERTICAL) //tdf#113171
638 rSet.Put( SfxBoolItem( nWhich, m_nDrawSfxId == nWhich ) );
639 break;
640
641 case SID_DRAW_TEXT_MARQUEE:
643 rSet.Put( SfxBoolItem(nWhich, m_nDrawSfxId == nWhich));
644 else
645 rSet.DisableItem(nWhich);
646 break;
647 case SID_OBJECT_SELECT:
648 rSet.Put( SfxBoolItem(nWhich, m_nDrawSfxId == nWhich ||
649 m_nFormSfxId == nWhich));
650 break;
651
652 case SID_INSERT_DRAW:
653 case SID_FONTWORK_GALLERY_FLOATER :
654 case SID_DRAWTBX_ARROWS:
655 {
656 if ( bWeb )
657 rSet.DisableItem( nWhich );
658 }
659 break;
660
661 case SID_DRAWTBX_CS_BASIC :
662 case SID_DRAWTBX_CS_SYMBOL :
663 case SID_DRAWTBX_CS_ARROW :
664 case SID_DRAWTBX_CS_FLOWCHART :
665 case SID_DRAWTBX_CS_CALLOUT :
666 case SID_DRAWTBX_CS_STAR :
667 {
668 if ( bWeb )
669 rSet.DisableItem( nWhich );
670 else
671 rSet.Put( SfxStringItem( nWhich, m_nDrawSfxId == nWhich ? m_sDrawCustom : OUString() ) );
672 }
673 break;
674
675 }
676}
677
679{
680 assert((nFeature & ~SfxShellFeature::SwMask) == SfxShellFeature::NONE);
681 switch(nFeature)
682 {
683 case SfxShellFeature::SwChildWindowLabel:
684 return m_pWrtShell->IsLabelDoc();
685 default:
686 return false;
687 }
688}
689
690/* 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)
SfxViewFrame * GetViewFrame() const
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
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:2752
virtual bool IsChangeRecording() const override
passwword protection for Writer (derived from SfxObjectShell) see also: FN_REDLINE_ON,...
Definition: docsh.cxx:1343
Definition: doc.hxx:194
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:341
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:755
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:62
Base class of the Writer document model elements.
Definition: node.hxx:98
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:742
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
Definition: node.cxx:777
SwNodeOffset EndOfSectionIndex() const
Definition: node.hxx:726
static constexpr auto npos
Definition: ndarr.hxx:81
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
const SwPosition * End() const
Definition: pam.hxx:271
const SwPosition * Start() const
Definition: pam.hxx:266
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:259
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
bool GetLandscape() const
Definition: pagedesc.hxx:199
bool IsVisible() const
Definition: redline.hxx:194
vector_type::size_type size_type
Definition: docary.hxx:222
Starts a section of nodes in the document model.
Definition: node.hxx:348
bool IsTOXBaseInReadonly() const
Definition: doctxm.cxx:2093
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:426
SwTableLine * GetUpper()
Definition: swtable.hxx:460
RedlineType GetRedlineType() const
Definition: swtable.cxx:1782
OUString m_sDrawCustom
Definition: view.hxx:226
SwWrtShell & GetWrtShell() const
Definition: view.hxx:416
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:252
void GetState(SfxItemSet &)
Definition: viewstat.cxx:63
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:429
bool isSignatureLineSigned() const
Definition: viewdlg2.cxx:141
void GetDrawState(SfxItemSet &rSet)
Definition: viewstat.cxx:591
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:678
SwDocShell * GetDocShell()
Definition: view.cxx:1160
bool m_bInMailMerge
Definition: view.hxx:255
sal_uInt16 m_nDrawSfxId
Definition: view.hxx:225
bool m_bForceChangesToolbar
Definition: view.hxx:260
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:519
#define FN_REDLINE_ACCEPT_DIRECT
Definition: cmdid.h:141
#define FN_CHANGE_PAGENUM
Definition: cmdid.h:510
#define FN_EDIT_LINK_DLG
Definition: cmdid.h:78
#define FN_INSERT_CAPTION
Definition: cmdid.h:208
#define FN_NAV_ELEMENT
Definition: cmdid.h:183
#define FN_EDIT_FOOTNOTE
Definition: cmdid.h:113
#define FN_INSERT_OBJ_CTRL
Definition: cmdid.h:267
#define FN_EDIT_CURRENT_TOX
Definition: cmdid.h:136
#define FN_REDLINE_REJECT_DIRECT
Definition: cmdid.h:142
#define FN_REDLINE_NEXT_CHANGE
Definition: cmdid.h:145
#define FN_REDLINE_PREV_CHANGE
Definition: cmdid.h:146
#define FN_REDLINE_ACCEPT_TONEXT
Definition: cmdid.h:149
#define FN_UPDATE_CUR_TOX
Definition: cmdid.h:520
#define FN_INSERT_FIELD_DATA_ONLY
Definition: cmdid.h:217
#define FN_PARAM_FTN_INFO
Definition: cmdid.h:789
#define FN_MAILMERGE_SENDMAIL_CHILDWINDOW
Definition: cmdid.h:282
#define FN_REDLINE_REJECT_TONEXT
Definition: cmdid.h:150
#define FN_REDLINE_ACCEPT
Definition: cmdid.h:134
#define FN_REDLINE_SHOW
Definition: cmdid.h:129
#define FN_SCROLL_NEXT
Definition: cmdid.h:185
#define FN_TOGGLE_OUTLINE_CONTENT_VISIBILITY
Definition: cmdid.h:192
#define FN_SCROLL_PREV
Definition: cmdid.h:184
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< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
constexpr TypedWhichId< SvxPaperBinItem > RES_PAPER_BIN(90)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
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:80
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
#define SW_MOD()
Definition: swmodule.hxx:256
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:457
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:649
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:332
#define NID_RECENCY
Definition: workctrl.hxx:53