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 
61 using 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  {
91  SwOutlineNodes::size_type nPos = m_pWrtShell->GetOutlinePos();
92  if (nPos != SwOutlineNodes::npos)
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  {
106  if (s_nMoveType == NID_RECENCY)
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:
150  m_nSelectionType & SelectionType::NumberList ) )
151  {
152  rSet.DisableItem(nWhich);
153  }
154  break;
155  case SID_EDIT_QRCODE:
156  if (!isQRCodeSelected())
157  rSet.DisableItem(nWhich);
158  break;
159  case FN_INSERT_CAPTION:
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()) &&
174  (m_pWrtShell->IsSelObjProtected( FlyProtectFlags::Parent) != FlyProtectFlags::NONE ||
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 
195  case FN_CHANGE_PAGENUM:
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:
207  GetSlotState( nWhich, SfxViewShell::GetInterface(), &rSet );
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:
214  case FN_PARAM_FTN_INFO:
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 
224  rSet.SetParent(&rMaster.GetDoc()->GetDfltFrameFormat()->GetAttrSet());
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;
272  case FN_INSERT_OBJ_CTRL:
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;
284  case FN_EDIT_CURRENT_TOX:
285  case FN_UPDATE_CUR_TOX:
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;
302  case RES_PARATR_TABSTOP:
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  {
317  rSet.Put(m_pWrtShell->GetDefault(RES_CHRATR_CJK_LANGUAGE)
318  .CloneSetWhich(RES_CHRATR_CJK_LANGUAGE));
319  }
320  break;
322  {
323  rSet.Put(m_pWrtShell->GetDefault(RES_CHRATR_CTL_LANGUAGE)
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  }
351  m_bForceChangesToolbar = false;
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::unique_ptr<SwPosition> pSelectionEnd;
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  pSelectionEnd.reset(new SwPosition(*pEndNode));
404  }
405  else
406  pSelectionEnd.reset(
407  new SwPosition(pCursor->End()->nNode, pCursor->End()->nContent));
408 
409  for(; index < table.size(); ++index )
410  {
411  const SwRangeRedline* tmp = table[ index ];
412  if( *tmp->Start() >= *pSelectionEnd )
413  break;
414  if( tmp->HasMark() && tmp->IsVisible())
415  {
416  redline = tmp;
417  break;
418  }
419  }
420  }
421  if( redline == nullptr )
422  bDisable = true;
423  }
424  else
425  {
426  // If the cursor position isn't on a redline, disable
427  // accepting/rejecting changes.
428  SwTableBox* pTableBox;
429  if (nullptr == pDoc->getIDocumentRedlineAccess().GetRedline(*pCursor->Start(), nullptr) &&
430  // except in the case of an inserted or deleted table row
431  ( !m_pWrtShell->IsCursorInTable() ||
432  (pTableBox = pCursor->Start()->nNode.GetNode().GetTableBox() ) == nullptr ||
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.getStr());
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  {
471  LanguageType nLang = rSh.GetCurLang();
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:
635  if ( bWeb || !SvtCJKOptions::IsVerticalTextEnabled() )
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: */
SfxViewFrame * GetViewFrame() const
Starts a section of nodes in the document model.
Definition: node.hxx:313
#define LANGUAGE_NONE
#define FN_UPDATE_TOX
Definition: cmdid.h:515
void SetRotation(Degree10 nValue)
const Value & back() const
SwNodeOffset EndOfSectionIndex() const
Definition: node.hxx:687
Marks a position in the document model.
Definition: pam.hxx:36
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
void SetMirrored(bool bSet)
void GetDrawState(SfxItemSet &rSet)
Definition: viewstat.cxx:592
SwTableBox * GetTableBox() const
If node is in a table return the respective table box.
Definition: node.cxx:754
#define FN_EDIT_FOOTNOTE
Definition: cmdid.h:113
std::unique_ptr< SwWrtShell > m_pWrtShell
Definition: view.hxx:193
constexpr SwTwips DOCUMENTBORDER
Definition: swtypes.hxx:79
SwNodeIndex nNode
Definition: pam.hxx:38
SfxDispatcher * GetDispatcher()
#define FN_INSERT_CAPTION
Definition: cmdid.h:210
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
long Long
constexpr TypedWhichId< SvxPaperBinItem > RES_PAPER_BIN(90)
Check only parents.
Definition: doc.hxx:187
void InvalidateItem(sal_uInt16 nWhich)
sal_uInt16 FirstWhich()
exports com.sun.star. table
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:649
SwNode & GetNode() const
Definition: ndindex.hxx:119
bool IsTOXBaseInReadonly() const
Definition: doctxm.cxx:2091
bool isSignatureLineSigned() const
Definition: viewdlg2.cxx:138
sal_uInt16 NextWhich()
SwWrtShell & GetWrtShell() const
Definition: view.hxx:413
static LanguageType nLang
Definition: srtdlg.cxx:51
size_type size() const
Definition: docary.hxx:267
LanguageType GetCurLang() const
Definition: edattr.cxx:802
Used by the UI to modify the document model.
Definition: wrtsh.hxx:96
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:164
sal_uInt16 m_nFormSfxId
Definition: view.hxx:228
SelectionType m_nSelectionType
Definition: view.hxx:222
void AppendInfoBarWhenReady(const OUString &sId, const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, InfobarType aInfobarType, bool bShowCloseButton=true)
virtual void SelectShell()
Definition: view.cxx:252
SwIndex nContent
Definition: pam.hxx:39
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
#define FN_EDIT_LINK_DLG
Definition: cmdid.h:78
#define FN_EDIT_CURRENT_TOX
Definition: cmdid.h:139
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
#define FN_PARAM_FTN_INFO
Definition: cmdid.h:785
OUString m_sDrawCustom
Definition: view.hxx:227
#define FN_INSERT_FIELD_DATA_ONLY
Definition: cmdid.h:219
#define FN_MAILMERGE_SENDMAIL_CHILDWINDOW
Definition: cmdid.h:280
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:137
#define FN_REDLINE_ACCEPT_DIRECT
Definition: cmdid.h:144
#define FN_CHANGE_PAGENUM
Definition: cmdid.h:506
Style of a layout element.
Definition: frmfmt.hxx:59
#define SW_MOD()
Definition: swmodule.hxx:255
const SfxItemSet * GetParent() const
static constexpr auto npos
Definition: ndarr.hxx:80
const SfxPoolItem * GetSlotState(sal_uInt16 nSlotId, const SfxInterface *pIF=nullptr, SfxItemSet *pStateSet=nullptr)
virtual bool HasUIFeature(SfxShellFeature nFeature) const override
Definition: viewstat.cxx:679
bool GetLandscape() const
Definition: pagedesc.hxx:199
SfxShellFeature
#define FN_REDLINE_ACCEPT_TONEXT
Definition: cmdid.h:152
SfxBindings & GetBindings()
vector_type::size_type size_type
Definition: docary.hxx:222
#define FN_REDLINE_PREV_CHANGE
Definition: cmdid.h:149
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:206
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:63
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:354
#define FN_SCROLL_NEXT
Definition: cmdid.h:188
const SwRangeRedline * FindAtPosition(const SwPosition &startPosition, size_type &tableIndex, bool next=true) const
Find the redline at the given position.
Definition: docredln.cxx:739
sal_uInt16 GetCursorCnt(bool bAll=true) const
Get the number of elements in the ring of cursors.
Definition: crsrsh.cxx:2745
#define FN_SCROLL_PREV
Definition: cmdid.h:187
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:703
#define FN_UPDATE_CUR_TOX
Definition: cmdid.h:516
tuple index
#define NID_RECENCY
Definition: workctrl.hxx:53
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
SfxItemState QueryState(sal_uInt16 nSID, const SfxPoolItem *&rpState)
#define FN_REDLINE_REJECT_TONEXT
Definition: cmdid.h:153
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
#define FN_TOGGLE_OUTLINE_CONTENT_VISIBILITY
Definition: cmdid.h:195
const SwPosition * Start() const
Definition: pam.hxx:213
bool IsVisible() const
Definition: redline.hxx:191
SwDocShell * GetDocShell()
Definition: view.cxx:1132
bool IsReadOnly() const
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:746
constexpr tools::Long Bottom() const
virtual const SwRangeRedline * GetRedline(const SwPosition &rPos, SwRedlineTable::size_type *pFndPos) const =0
void SetParent(const SfxItemSet *pNew)
uno::Reference< linguistic2::XThesaurus > GetThesaurus()
Definition: swtypes.cxx:59
static sal_uInt16 s_nMoveType
Definition: view.hxx:166
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
#define FN_NAV_ELEMENT
Definition: cmdid.h:186
bool HasChildWindow(sal_uInt16)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:335
const SwStartNode * GetSttNd() const
Definition: swtable.hxx:471
void DisableItem(sal_uInt16 nWhich)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
HTMLMODE_SOME_STYLES
void PageDescToItemSet(const SwPageDesc &rPageDesc, SfxItemSet &rSet)
Definition: uitool.cxx:457
#define FN_REDLINE_NEXT_CHANGE
Definition: cmdid.h:148
bool isSignatureLineSelected() const
Definition: viewdlg2.cxx:117
bool KnowsChildWindow(sal_uInt16)
const SwPosition * End() const
Definition: pam.hxx:218
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:418
virtual bool IsChangeRecording() const override
passwword protection for Writer (derived from SfxObjectShell) see also: FN_REDLINE_ON, FN_REDLINE_ON
Definition: docsh.cxx:1343
QPRO_FUNC_TYPE nType
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:367
RedlineType GetRedlineType() const
Definition: swtable.cxx:1768
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:426
virtual SfxInterface * GetInterface() const
bool IsVerticalTextEnabled()
void SetVisibleState(sal_uInt16 nId, bool bShow)
sal_uInt16 m_nDrawSfxId
Definition: view.hxx:226
SfxShell * m_pShell
Definition: view.hxx:196
bool m_bInMailMerge
Definition: view.hxx:240
#define FN_INSERT_OBJ_CTRL
Definition: cmdid.h:265
bool m_bForceChangesToolbar
Definition: view.hxx:240
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
virtual const SwRedlineTable & GetRedlineTable() const =0
std::vector< SwNode * >::size_type size_type
#define FN_REDLINE_SHOW
Definition: cmdid.h:129
SwTableLine * GetUpper()
Definition: swtable.hxx:453
bool IsAnyEnabled()
#define FN_REDLINE_REJECT_DIRECT
Definition: cmdid.h:145
#define FN_REDLINE_ACCEPT
Definition: cmdid.h:137
bool isQRCodeSelected() const
Definition: viewdlg2.cxx:159
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
sal_uInt16 nPos
static css::lang::Locale convertToLocale(LanguageType nLangID, bool bResolveSystem=true)
void GetState(SfxItemSet &)
Definition: viewstat.cxx:63
Base class of the Writer document model elements.
Definition: node.hxx:81