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 <svl/languageoptions.hxx>
29 #include <sfx2/linkmgr.hxx>
30 #include <editeng/langitem.hxx>
31 #include <editeng/brushitem.hxx>
32 #include <editeng/tstpitem.hxx>
33 #include <sfx2/htmlmode.hxx>
34 #include <swmodule.hxx>
35 #include <tox.hxx>
36 #include <sfx2/dispatch.hxx>
37 #include <view.hxx>
38 #include <wrtsh.hxx>
39 #include <uitool.hxx>
40 #include <viewopt.hxx>
41 #include <pagedesc.hxx>
42 #include <wview.hxx>
43 #include <globdoc.hxx>
44 #include <svl/stritem.hxx>
46 #include <comphelper/lok.hxx>
47 #include <LibreOfficeKit/LibreOfficeKitEnums.h>
48 #include <svl/visitem.hxx>
49 #include <redline.hxx>
50 #include <rootfrm.hxx>
51 #include <docary.hxx>
52 
53 #include <cmdid.h>
55 
56 #include <doc.hxx>
57 #include <workctrl.hxx>
58 
59 using namespace ::com::sun::star;
60 
62 {
63  SfxWhichIter aIter(rSet);
64  sal_uInt16 nWhich = aIter.FirstWhich();
66  bool bGetFrameType = false;
67  bool bWeb = dynamic_cast<SwWebView*>( this ) != nullptr;
68 
69  while(nWhich)
70  {
71  switch(nWhich)
72  {
73  case SID_ZOOM_IN:
74  case SID_ZOOM_OUT:
75  {
76  tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
77  if ((SID_ZOOM_OUT == nWhich && nFact >= tools::Long(600)) ||
78  (SID_ZOOM_IN == nWhich && nFact <= tools::Long(20)))
79  {
80  rSet.DisableItem(nWhich);
81  }
82  }
83  break;
85  {
86  bool bDisable(true);
87  if (m_pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton())
88  {
89  SwOutlineNodes::size_type nPos = m_pWrtShell->GetOutlinePos();
90  if (nPos != SwOutlineNodes::npos)
91  bDisable = false;
92  }
93  if (bDisable)
94  rSet.DisableItem(nWhich);
95  }
96  break;
97  case FN_NAV_ELEMENT:
98  // used to update all instances of this control
99  rSet.InvalidateItem( nWhich );
100  break;
101  case FN_SCROLL_PREV:
102  case FN_SCROLL_NEXT:
103  {
104  if (m_nMoveType == NID_RECENCY)
105  {
106  if (!m_pWrtShell->GetNavigationMgr().forwardEnabled())
108  if (!m_pWrtShell->GetNavigationMgr().backEnabled())
110  }
111  }
112  break;
113  case FN_EDIT_LINK_DLG:
114  if( m_pWrtShell->GetLinkManager().GetLinks().empty() )
115  rSet.DisableItem(nWhich);
116  else if( m_pWrtShell->IsSelFrameMode() &&
118  {
119  rSet.DisableItem(nWhich);
120  }
121  break;
122 
123  case SID_DRAWTBX_LINES:
124  if ( bWeb )
125  rSet.DisableItem(nWhich);
126  break;
127 
128  case SID_INSERT_GRAPHIC:
129  if( m_pWrtShell->CursorInsideInputField() )
130  {
131  rSet.DisableItem(nWhich);
132  }
133  break;
134  case SID_INSERT_SIGNATURELINE:
137  {
138  rSet.DisableItem(nWhich);
139  }
140  break;
141  case SID_EDIT_SIGNATURELINE:
142  case SID_SIGN_SIGNATURELINE:
144  rSet.DisableItem(nWhich);
145  break;
146  case SID_INSERT_QRCODE:
148  m_nSelectionType & SelectionType::NumberList ) )
149  {
150  rSet.DisableItem(nWhich);
151  }
152  break;
153  case SID_EDIT_QRCODE:
154  if (!isQRCodeSelected())
155  rSet.DisableItem(nWhich);
156  break;
157  case FN_INSERT_CAPTION:
158  {
159  // There are captions for graphics, OLE objects, frames and tables
160  if( !bGetFrameType )
161  {
162  eFrameType = m_pWrtShell->GetFrameType(nullptr, true);
163  bGetFrameType = true;
164  }
168  {
169  rSet.DisableItem(nWhich);
170  }
171  else if((m_pWrtShell->IsObjSelected() || m_pWrtShell->IsFrameSelected()) &&
172  (m_pWrtShell->IsSelObjProtected( FlyProtectFlags::Parent) != FlyProtectFlags::NONE ||
174  {
175  rSet.DisableItem(nWhich);
176  }
177  else if( m_pWrtShell->IsTableMode()
179  || m_pWrtShell->CursorInsideInputField() )
180  {
181  rSet.DisableItem(nWhich);
182  }
183  }
184  break;
185 
186  case FN_EDIT_FOOTNOTE:
187  {
188  if( !m_pWrtShell->GetCurFootnote() )
189  rSet.DisableItem(nWhich);
190  }
191  break;
192 
193  case FN_CHANGE_PAGENUM:
194  {
195  FrameTypeFlags nType = m_pWrtShell->GetFrameType(nullptr,true);
198  rSet.DisableItem(nWhich);
199  else
200  rSet.Put(SfxUInt16Item(nWhich, m_pWrtShell->GetPageOffset()));
201  }
202  break;
203  case SID_PRINTDOC:
204  case SID_PRINTDOCDIRECT:
205  GetSlotState( nWhich, SfxViewShell::GetInterface(), &rSet );
206  break;
207  case SID_ATTR_PAGE_ORIENTATION:
208  case SID_ATTR_PAGE:
209  case SID_ATTR_PAGE_SIZE:
210  case SID_ATTR_PAGE_PAPERBIN:
211  case RES_PAPER_BIN:
212  case FN_PARAM_FTN_INFO:
213  {
214  const size_t nCurIdx = m_pWrtShell->GetCurPageDesc();
215  const SwPageDesc& rDesc = m_pWrtShell->GetPageDesc( nCurIdx );
216 
217  // set correct parent to get the XFILL_NONE FillStyle as needed
218  if(!rSet.GetParent())
219  {
220  const SwFrameFormat& rMaster = rDesc.GetMaster();
221 
222  rSet.SetParent(&rMaster.GetDoc()->GetDfltFrameFormat()->GetAttrSet());
223  }
224 
225  ::PageDescToItemSet( rDesc, rSet);
226 
227  if (nWhich == SID_ATTR_PAGE_ORIENTATION && comphelper::LibreOfficeKit::isActive())
228  {
229  OString aPayload = ".uno:Orientation=";
230  if (rDesc.GetLandscape())
231  {
232  aPayload += "IsLandscape";
233  }
234  else
235  {
236  aPayload += "IsPortrait";
237  }
238  libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
239  }
240  }
241  break;
242  case RES_BACKGROUND:
243  case SID_ATTR_BRUSH:
244  {
245  const size_t nCurIdx = m_pWrtShell->GetCurPageDesc();
246  const SwPageDesc& rDesc = m_pWrtShell->GetPageDesc( nCurIdx );
247  const SwFrameFormat& rMaster = rDesc.GetMaster();
248  const SvxBrushItem& rBrush = rMaster.GetFormatAttr(RES_BACKGROUND);
249  rSet.Put(rBrush);
250  }
251  break;
252  case SID_CLEARHISTORY:
253  {
254  rSet.Put(SfxBoolItem(nWhich, m_pWrtShell->GetLastUndoInfo(nullptr, nullptr)));
255  }
256  break;
257  case SID_UNDO:
258  {
259  // which must not be present, so let them create:
260  if( !m_pShell )
261  SelectShell();
262 
263  const SfxPoolItem* pState = m_pShell->GetSlotState(SID_UNDO);
264  if(pState)
265  rSet.Put(*pState);
266  else
267  rSet.DisableItem(nWhich);
268  }
269  break;
270  case FN_INSERT_OBJ_CTRL:
271  if( bWeb
272  || m_pWrtShell->CursorInsideInputField() )
273  {
274  rSet.DisableItem(nWhich);
275  }
276  break;
277 
278  case FN_UPDATE_TOX:
279  if(!m_pWrtShell->GetTOXCount())
280  rSet.DisableItem(nWhich);
281  break;
282  case FN_EDIT_CURRENT_TOX:
283  case FN_UPDATE_CUR_TOX:
284  {
285  const SwTOXBase* pBase = nullptr;
286  if(nullptr == (pBase = m_pWrtShell->GetCurTOX()) ||
287  (FN_EDIT_CURRENT_TOX == nWhich && pBase->IsTOXBaseInReadonly()))
288  rSet.DisableItem(nWhich);
289  }
290  break;
291  case SID_TWAIN_SELECT:
292  case SID_TWAIN_TRANSFER:
293 #if defined(_WIN32) || defined UNX
294  {
295  if(!SW_MOD()->GetScannerManager().is())
296  rSet.DisableItem(nWhich);
297  }
298 #endif
299  break;
300  case RES_PARATR_TABSTOP:
301  case SID_ATTR_DEFTABSTOP:
302  {
303  const SvxTabStopItem& rDefTabs = m_pWrtShell->GetDefault(RES_PARATR_TABSTOP);
304  rSet.Put( SfxUInt16Item( nWhich,
305  static_cast<sal_uInt16>(::GetTabDist(rDefTabs))));
306  }
307  break;
308  case SID_ATTR_LANGUAGE:
309  {
310  rSet.Put(m_pWrtShell->GetDefault(RES_CHRATR_LANGUAGE).CloneSetWhich(SID_ATTR_LANGUAGE));
311  }
312  break;
314  {
315  rSet.Put(m_pWrtShell->GetDefault(RES_CHRATR_CJK_LANGUAGE)
316  .CloneSetWhich(RES_CHRATR_CJK_LANGUAGE));
317  }
318  break;
320  {
321  rSet.Put(m_pWrtShell->GetDefault(RES_CHRATR_CTL_LANGUAGE)
322  .CloneSetWhich(RES_CHRATR_CTL_LANGUAGE));
323  }
324  break;
325  case FN_REDLINE_ON:
326  rSet.Put( SfxBoolItem( nWhich, GetDocShell()->IsChangeRecording() ) );
327  // switch on the disabled Tracked Changes toolbar if the document hasn't
328  // modified, yet (i.e. on load), and if recording of changes is enabled
329  // or if it contains tracked changes. TODO: the toolbar stays there, but
330  // there is no need for it to manage changes only with the menus Edit/View,
331  // keyboard shortcuts or the experimental sidebar, so it's worth to add
332  // a View option for this behaviour.
333  if ( !GetDocShell()->IsModified() && ( GetDocShell()->IsChangeRecording() ||
334  m_pWrtShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().size() ) )
335  {
336  ShowUIElement("private:resource/toolbar/changes");
337  }
338  break;
339  case FN_REDLINE_PROTECT :
340  rSet.Put( SfxBoolItem( nWhich, GetDocShell()->HasChangeRecordProtection() ) );
341  break;
342  case FN_REDLINE_SHOW:
343  {
344  rSet.Put(SfxBoolItem(nWhich, !m_pWrtShell->GetLayout()->IsHideRedlines()));
345  }
346  break;
347  case SID_AVMEDIA_PLAYER :
348  case FN_REDLINE_ACCEPT :
349  {
350  SfxViewFrame* pVFrame = GetViewFrame();
351  if (pVFrame->KnowsChildWindow(nWhich))
352  rSet.Put(SfxBoolItem( nWhich, pVFrame->HasChildWindow(nWhich)));
353  else
354  rSet.DisableItem(nWhich);
355  }
356  break;
361  {
362  SwDoc *pDoc = m_pWrtShell->GetDoc();
363  SwPaM *pCursor = m_pWrtShell->GetCursor();
364  bool bDisable = false;
365  if (GetDocShell()->HasChangeRecordProtection())
366  bDisable = true;
367  else if (pCursor->HasMark())
368  {
369  // If the selection does not contain redlines, disable accepting/rejecting changes.
372  const SwRangeRedline* redline = table.FindAtPosition( *pCursor->Start(), index );
373  if( redline != nullptr && *redline->Start() == *pCursor->End())
374  redline = nullptr;
375  if( redline == nullptr )
376  {
377  for(; index < table.size(); ++index )
378  {
379  const SwRangeRedline* tmp = table[ index ];
380  if( *tmp->Start() >= *pCursor->End())
381  break;
382  if( tmp->HasMark() && tmp->IsVisible())
383  {
384  redline = tmp;
385  break;
386  }
387  }
388  }
389  if( redline == nullptr )
390  bDisable = true;
391  }
392  else
393  {
394  // If the cursor position isn't on a redline, disable
395  // accepting/rejecting changes.
396  if (nullptr == pDoc->getIDocumentRedlineAccess().GetRedline(*pCursor->Start(), nullptr))
397  bDisable = true;
398  }
399 
400  // LibreOfficeKit wants to handle changes by index, so always allow here.
401  if (bDisable)
402  rSet.DisableItem(nWhich);
404  {
405  OString aPayload(".uno:TrackedChangeIndex=");
406  SwRedlineTable::size_type nRedline = 0;
407  if (pDoc->getIDocumentRedlineAccess().GetRedline(*pCursor->Start(), &nRedline))
408  aPayload += OString::number(nRedline);
409  libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
410  }
411  }
412  break;
413 
416  {
417  // Enable change navigation if we have any redlines. Ideally we should disable
418  // "Next Change" if we're at or past the last change, and similarly for
419  // "Previous Change"
420  if (0 == m_pWrtShell->GetRedlineCount())
421  rSet.DisableItem(nWhich);
422  }
423  break;
424 
425  case SID_THESAURUS:
426  {
427  SwWrtShell &rSh = GetWrtShell();
428  if (2 <= rSh.GetCursorCnt()) // multi selection?
429  rSet.DisableItem(nWhich);
430  else
431  {
432  LanguageType nLang = rSh.GetCurLang();
433 
434  // disable "Thesaurus" (menu entry and key shortcut) if the
435  // language is not supported (by default it is enabled)
436  uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
437  if (!xThes.is() || nLang == LANGUAGE_NONE ||
438  !xThes->hasLocale( LanguageTag::convertToLocale( nLang ) ))
439  rSet.DisableItem(nWhich);
440  }
441  }
442  break;
443  case SID_HANGUL_HANJA_CONVERSION:
444  case SID_CHINESE_CONVERSION:
445  {
446  if (!SvtCJKOptions().IsAnyEnabled())
447  {
448  GetViewFrame()->GetBindings().SetVisibleState( nWhich, false );
449  rSet.DisableItem(nWhich);
450  }
451  else
452  GetViewFrame()->GetBindings().SetVisibleState( nWhich, true );
453  }
454  break;
455  case SID_MAIL_SCROLLBODY_PAGEDOWN:
456  {
457  const tools::Long nBottom = m_pWrtShell->GetDocSize().Height() + DOCUMENTBORDER;
458  const tools::Long nAct = GetVisArea().Bottom();
459  rSet.Put(SfxBoolItem(SID_MAIL_SCROLLBODY_PAGEDOWN, nAct < nBottom ));
460  }
461  break;
462 
463  case SID_DOCUMENT_COMPARE:
464  case SID_DOCUMENT_MERGE:
465  if( dynamic_cast<const SwGlobalDocShell* >(GetDocShell()) != nullptr||
466  (SID_DOCUMENT_MERGE == nWhich && m_pWrtShell->getIDocumentRedlineAccess().GetRedlinePassword().hasElements()))
467  rSet.DisableItem(nWhich);
468  break;
469  case SID_VIEW_DATA_SOURCE_BROWSER:
470  if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
471  rSet.Put( SfxVisibilityItem( nWhich, false ) );
472  else
473  rSet.Put( SfxBoolItem( nWhich, GetViewFrame()->HasChildWindow( SID_BROWSER ) ) );
474  break;
475  case SID_READONLY_MODE:
476  rSet.Put(SfxBoolItem(nWhich,
477  m_pWrtShell->HasReadonlySel()||GetDocShell()->IsReadOnly()));
478  break;
479  case SID_IMAGE_ORIENTATION:
480  {
481  SfxImageItem aImageItem(nWhich);
482  if(m_pWrtShell->IsInVerticalText())
483  aImageItem.SetRotation( 2700_deg10 );
484  if(m_pWrtShell->IsInRightToLeftText())
485  aImageItem.SetMirrored( true );
486  rSet.Put(aImageItem);
487  }
488  break;
490  if(!m_bInMailMerge && !GetViewFrame()->HasChildWindow(nWhich))
491  rSet.DisableItem(nWhich);
492  break;
494  break;
495  case SID_ALIGN_ANY_LEFT :
496  case SID_ALIGN_ANY_HCENTER :
497  case SID_ALIGN_ANY_RIGHT :
498  case SID_ALIGN_ANY_JUSTIFIED:
499  case SID_ALIGN_ANY_TOP :
500  case SID_ALIGN_ANY_VCENTER :
501  case SID_ALIGN_ANY_BOTTOM :
502  case SID_ALIGN_ANY_HDEFAULT :
503  case SID_ALIGN_ANY_VDEFAULT :
504  {
505  if( !m_pShell )
506  SelectShell();
507  sal_uInt16 nAlias = 0;
509  {
510  switch( nWhich )
511  {
512  case SID_ALIGN_ANY_LEFT : nAlias = SID_ATTR_PARA_ADJUST_LEFT; break;
513  case SID_ALIGN_ANY_HCENTER : nAlias = SID_ATTR_PARA_ADJUST_CENTER; break;
514  case SID_ALIGN_ANY_RIGHT : nAlias = SID_ATTR_PARA_ADJUST_RIGHT; break;
515  case SID_ALIGN_ANY_JUSTIFIED: nAlias = SID_ATTR_PARA_ADJUST_BLOCK; break;
516  case SID_ALIGN_ANY_TOP : nAlias = SID_TABLE_VERT_NONE; break;
517  case SID_ALIGN_ANY_VCENTER : nAlias = SID_TABLE_VERT_CENTER; break;
518  case SID_ALIGN_ANY_BOTTOM : nAlias = SID_TABLE_VERT_BOTTOM; break;
519  }
520  }
521  else
522  {
523  switch( nWhich )
524  {
525  case SID_ALIGN_ANY_LEFT : nAlias = SID_OBJECT_ALIGN_LEFT ; break;
526  case SID_ALIGN_ANY_HCENTER : nAlias = SID_OBJECT_ALIGN_CENTER ; break;
527  case SID_ALIGN_ANY_RIGHT : nAlias = SID_OBJECT_ALIGN_RIGHT ; break;
528  case SID_ALIGN_ANY_TOP : nAlias = SID_OBJECT_ALIGN_UP ; break;
529  case SID_ALIGN_ANY_VCENTER : nAlias = SID_OBJECT_ALIGN_MIDDLE ; break;
530  case SID_ALIGN_ANY_BOTTOM : nAlias = SID_OBJECT_ALIGN_DOWN ; break;
531  }
532  }
533  //these slots are either re-mapped to text or object alignment
534  const SfxPoolItem* pState = nullptr;
535  if(nAlias)
536  GetViewFrame()->GetDispatcher()->QueryState( nAlias, pState );
537  if(pState)
538  {
540  {
541  rSet.Put(pState->CloneSetWhich(nWhich));
542  }
543  }
544  else
545  rSet.DisableItem(nWhich);
546  }
547  break;
548  }
549  nWhich = aIter.NextWhich();
550  }
551 }
552 
554 {
555  SfxWhichIter aIter(rSet);
556  bool bWeb = dynamic_cast<SwWebView*>( this ) != nullptr;
557 
558  for( sal_uInt16 nWhich = aIter.FirstWhich(); nWhich;
559  nWhich = aIter.NextWhich() )
560  switch(nWhich)
561  {
562  case SID_DRAW_LINE:
563  case SID_DRAW_XLINE:
564  case SID_LINE_ARROW_END:
565  case SID_LINE_ARROW_CIRCLE:
566  case SID_LINE_ARROW_SQUARE:
567  case SID_LINE_ARROW_START:
568  case SID_LINE_CIRCLE_ARROW:
569  case SID_LINE_SQUARE_ARROW:
570  case SID_LINE_ARROWS:
571  case SID_DRAW_MEASURELINE:
572  case SID_DRAW_RECT:
573  case SID_DRAW_ELLIPSE:
574  case SID_DRAW_XPOLYGON_NOFILL:
575  case SID_DRAW_XPOLYGON:
576  case SID_DRAW_POLYGON_NOFILL:
577  case SID_DRAW_POLYGON:
578  case SID_DRAW_BEZIER_NOFILL:
579  case SID_DRAW_BEZIER_FILL:
580  case SID_DRAW_FREELINE_NOFILL:
581  case SID_DRAW_FREELINE:
582  case SID_DRAW_ARC:
583  case SID_DRAW_PIE:
584  case SID_DRAW_CIRCLECUT:
585  case SID_DRAW_TEXT:
586  case SID_DRAW_CAPTION:
587  if ( bWeb )
588  rSet.DisableItem( nWhich );
589  else
590  rSet.Put( SfxBoolItem( nWhich, m_nDrawSfxId == nWhich ) );
591  break;
592 
593  case SID_DRAW_TEXT_VERTICAL:
594  case SID_DRAW_CAPTION_VERTICAL:
595  if ( bWeb || !SvtLanguageOptions().IsVerticalTextEnabled() )
596  rSet.DisableItem( nWhich );
597  else
598  rSet.Put( SfxBoolItem( nWhich, m_nDrawSfxId == nWhich ) );
599  break;
600 
601  case SID_DRAW_TEXT_MARQUEE:
603  rSet.Put( SfxBoolItem(nWhich, m_nDrawSfxId == nWhich));
604  else
605  rSet.DisableItem(nWhich);
606  break;
607  case SID_OBJECT_SELECT:
608  rSet.Put( SfxBoolItem(nWhich, m_nDrawSfxId == nWhich ||
609  m_nFormSfxId == nWhich));
610  break;
611 
612  case SID_INSERT_DRAW:
613  case SID_FONTWORK_GALLERY_FLOATER :
614  case SID_DRAWTBX_ARROWS:
615  {
616  if ( bWeb )
617  rSet.DisableItem( nWhich );
618  }
619  break;
620 
621  case SID_DRAWTBX_CS_BASIC :
622  case SID_DRAWTBX_CS_SYMBOL :
623  case SID_DRAWTBX_CS_ARROW :
624  case SID_DRAWTBX_CS_FLOWCHART :
625  case SID_DRAWTBX_CS_CALLOUT :
626  case SID_DRAWTBX_CS_STAR :
627  {
628  if ( bWeb )
629  rSet.DisableItem( nWhich );
630  else
631  rSet.Put( SfxStringItem( nWhich, m_nDrawSfxId == nWhich ? m_sDrawCustom : OUString() ) );
632  }
633  break;
634 
635  }
636 }
637 
639 {
640  assert((nFeature & ~SfxShellFeature::SwMask) == SfxShellFeature::NONE);
641  switch(nFeature)
642  {
643  case SfxShellFeature::SwChildWindowLabel:
644  return m_pWrtShell->IsLabelDoc();
645  default:
646  return false;
647  }
648 }
649 
650 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxViewFrame * GetViewFrame() const
#define LANGUAGE_NONE
#define FN_UPDATE_TOX
Definition: cmdid.h:503
void SetRotation(Degree10 nValue)
constexpr TypedWhichId< SvxTabStopItem > RES_PARATR_TABSTOP(68)
void SetMirrored(bool bSet)
void GetDrawState(SfxItemSet &rSet)
Definition: viewstat.cxx:553
#define FN_EDIT_FOOTNOTE
Definition: cmdid.h:106
std::unique_ptr< SwWrtShell > m_pWrtShell
Definition: view.hxx:181
SfxDispatcher * GetDispatcher()
#define FN_INSERT_CAPTION
Definition: cmdid.h:201
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
long Long
constexpr TypedWhichId< SvxPaperBinItem > RES_PAPER_BIN(90)
Check only parents.
Definition: doc.hxx:186
void InvalidateItem(sal_uInt16 nWhich)
sal_uInt16 FirstWhich()
exports com.sun.star. table
SW_DLLPUBLIC SwTwips GetTabDist(const SvxTabStopItem &rTabs)
Definition: uitool.cxx:588
bool IsTOXBaseInReadonly() const
Definition: doctxm.cxx:2014
bool isSignatureLineSigned() const
Definition: viewdlg2.cxx:137
sal_uInt16 NextWhich()
SwWrtShell & GetWrtShell() const
Definition: view.hxx:399
static LanguageType nLang
Definition: srtdlg.cxx:51
size_type size() const
Definition: docary.hxx:266
LanguageType GetCurLang() const
Definition: edattr.cxx:815
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
sal_uInt16 m_nFormSfxId
Definition: view.hxx:216
SelectionType m_nSelectionType
Definition: view.hxx:210
virtual void SelectShell()
Definition: view.cxx:240
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
#define FN_EDIT_LINK_DLG
Definition: cmdid.h:71
#define FN_EDIT_CURRENT_TOX
Definition: cmdid.h:132
tools::Long Bottom() const
void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
#define FN_PARAM_FTN_INFO
Definition: cmdid.h:768
OUString m_sDrawCustom
Definition: view.hxx:215
#define FN_INSERT_FIELD_DATA_ONLY
Definition: cmdid.h:210
#define FN_MAILMERGE_SENDMAIL_CHILDWINDOW
Definition: cmdid.h:267
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
#define FN_REDLINE_ACCEPT_DIRECT
Definition: cmdid.h:137
#define FN_CHANGE_PAGENUM
Definition: cmdid.h:495
Style of a layout element.
Definition: frmfmt.hxx:58
#define SW_MOD()
Definition: swmodule.hxx:255
const SfxItemSet * GetParent() const
static constexpr auto npos
Definition: ndarr.hxx:79
const SfxPoolItem * GetSlotState(sal_uInt16 nSlotId, const SfxInterface *pIF=nullptr, SfxItemSet *pStateSet=nullptr)
virtual bool HasUIFeature(SfxShellFeature nFeature) const override
Definition: viewstat.cxx:638
bool GetLandscape() const
Definition: pagedesc.hxx:189
SfxShellFeature
#define FN_REDLINE_ACCEPT_TONEXT
Definition: cmdid.h:145
SfxBindings & GetBindings()
vector_type::size_type size_type
Definition: docary.hxx:228
#define FN_REDLINE_PREV_CHANGE
Definition: cmdid.h:142
bool HasMark() const
A PaM marks a selection if Point and Mark are distinct positions.
Definition: pam.hxx:205
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:62
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:355
void ShowUIElement(const OUString &sElementURL) const
Definition: view.cxx:228
#define FN_SCROLL_NEXT
Definition: cmdid.h:183
const SwRangeRedline * FindAtPosition(const SwPosition &startPosition, size_type &tableIndex, bool next=true) const
Find the redline at the given position.
Definition: docredln.cxx:711
sal_uInt16 GetCursorCnt(bool bAll=true) const
Get the number of elements in the ring of cursors.
Definition: crsrsh.cxx:2732
#define FN_SCROLL_PREV
Definition: cmdid.h:182
#define FN_UPDATE_CUR_TOX
Definition: cmdid.h:504
tuple index
#define NID_RECENCY
Definition: workctrl.hxx:49
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:140
SfxItemState QueryState(sal_uInt16 nSID, const SfxPoolItem *&rpState)
#define FN_REDLINE_REJECT_TONEXT
Definition: cmdid.h:146
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
#define FN_TOGGLE_OUTLINE_CONTENT_VISIBILITY
Definition: cmdid.h:190
const SwPosition * Start() const
Definition: pam.hxx:212
bool IsVisible() const
Definition: redline.hxx:187
SwDocShell * GetDocShell()
Definition: view.cxx:1109
bool IsReadOnly() const
const SwFrameFormat * GetDfltFrameFormat() const
Definition: doc.hxx:746
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
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:216
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
#define FN_NAV_ELEMENT
Definition: cmdid.h:181
bool HasChildWindow(sal_uInt16)
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:335
void DisableItem(sal_uInt16 nWhich)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
HTMLMODE_SOME_STYLES
void PageDescToItemSet(const SwPageDesc &rPageDesc, SfxItemSet &rSet)
Definition: uitool.cxx:412
#define FN_REDLINE_NEXT_CHANGE
Definition: cmdid.h:141
bool isSignatureLineSelected() const
Definition: viewdlg2.cxx:116
bool KnowsChildWindow(sal_uInt16)
const SwPosition * End() const
Definition: pam.hxx:217
QPRO_FUNC_TYPE nType
static sal_uInt16 m_nMoveType
Definition: view.hxx:154
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:382
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:412
virtual SfxInterface * GetInterface() const
void SetVisibleState(sal_uInt16 nId, bool bShow)
sal_uInt16 m_nDrawSfxId
Definition: view.hxx:214
SfxShell * m_pShell
Definition: view.hxx:184
bool m_bInMailMerge
Definition: view.hxx:228
#define FN_INSERT_OBJ_CTRL
Definition: cmdid.h:252
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:137
virtual const SwRedlineTable & GetRedlineTable() const =0
std::vector< SwNode * >::size_type size_type
#define DOCUMENTBORDER
Definition: swtypes.hxx:82
#define FN_REDLINE_SHOW
Definition: cmdid.h:122
#define FN_REDLINE_REJECT_DIRECT
Definition: cmdid.h:138
#define FN_REDLINE_ACCEPT
Definition: cmdid.h:130
bool isQRCodeSelected() const
Definition: viewdlg2.cxx:158
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:61