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 #include <sfx2/infobar.hxx>
53 #include <docsh.hxx>
54 #include <strings.hrc>
55 
56 #include <cmdid.h>
58 
59 #include <doc.hxx>
60 #include <workctrl.hxx>
61 
62 using namespace ::com::sun::star;
63 
65 {
66  SfxWhichIter aIter(rSet);
67  sal_uInt16 nWhich = aIter.FirstWhich();
69  bool bGetFrameType = false;
70  bool bWeb = dynamic_cast<SwWebView*>( this ) != nullptr;
71 
72  while(nWhich)
73  {
74  switch(nWhich)
75  {
76  case SID_ZOOM_IN:
77  case SID_ZOOM_OUT:
78  {
79  tools::Long nFact = m_pWrtShell->GetViewOptions()->GetZoom();
80  if ((SID_ZOOM_OUT == nWhich && nFact >= tools::Long(600)) ||
81  (SID_ZOOM_IN == nWhich && nFact <= tools::Long(20)))
82  {
83  rSet.DisableItem(nWhich);
84  }
85  }
86  break;
88  {
89  bool bDisable(true);
90  if (m_pWrtShell->GetViewOptions()->IsShowOutlineContentVisibilityButton())
91  {
92  SwOutlineNodes::size_type nPos = m_pWrtShell->GetOutlinePos();
93  if (nPos != SwOutlineNodes::npos)
94  bDisable = false;
95  }
96  if (bDisable)
97  rSet.DisableItem(nWhich);
98  }
99  break;
100  case FN_NAV_ELEMENT:
101  // used to update all instances of this control
102  rSet.InvalidateItem( nWhich );
103  break;
104  case FN_SCROLL_PREV:
105  case FN_SCROLL_NEXT:
106  {
107  if (m_nMoveType == NID_RECENCY)
108  {
109  if (!m_pWrtShell->GetNavigationMgr().forwardEnabled())
111  if (!m_pWrtShell->GetNavigationMgr().backEnabled())
113  }
114  }
115  break;
116  case FN_EDIT_LINK_DLG:
117  if( m_pWrtShell->GetLinkManager().GetLinks().empty() )
118  rSet.DisableItem(nWhich);
119  else if( m_pWrtShell->IsSelFrameMode() &&
121  {
122  rSet.DisableItem(nWhich);
123  }
124  break;
125 
126  case SID_DRAWTBX_LINES:
127  if ( bWeb )
128  rSet.DisableItem(nWhich);
129  break;
130 
131  case SID_INSERT_GRAPHIC:
132  if( m_pWrtShell->CursorInsideInputField() )
133  {
134  rSet.DisableItem(nWhich);
135  }
136  break;
137  case SID_INSERT_SIGNATURELINE:
140  {
141  rSet.DisableItem(nWhich);
142  }
143  break;
144  case SID_EDIT_SIGNATURELINE:
145  case SID_SIGN_SIGNATURELINE:
147  rSet.DisableItem(nWhich);
148  break;
149  case SID_INSERT_QRCODE:
151  m_nSelectionType & SelectionType::NumberList ) )
152  {
153  rSet.DisableItem(nWhich);
154  }
155  break;
156  case SID_EDIT_QRCODE:
157  if (!isQRCodeSelected())
158  rSet.DisableItem(nWhich);
159  break;
160  case FN_INSERT_CAPTION:
161  {
162  // There are captions for graphics, OLE objects, frames and tables
163  if( !bGetFrameType )
164  {
165  eFrameType = m_pWrtShell->GetFrameType(nullptr, true);
166  bGetFrameType = true;
167  }
171  {
172  rSet.DisableItem(nWhich);
173  }
174  else if((m_pWrtShell->IsObjSelected() || m_pWrtShell->IsFrameSelected()) &&
175  (m_pWrtShell->IsSelObjProtected( FlyProtectFlags::Parent) != FlyProtectFlags::NONE ||
177  {
178  rSet.DisableItem(nWhich);
179  }
180  else if( m_pWrtShell->IsTableMode()
182  || m_pWrtShell->CursorInsideInputField() )
183  {
184  rSet.DisableItem(nWhich);
185  }
186  }
187  break;
188 
189  case FN_EDIT_FOOTNOTE:
190  {
191  if( !m_pWrtShell->GetCurFootnote() )
192  rSet.DisableItem(nWhich);
193  }
194  break;
195 
196  case FN_CHANGE_PAGENUM:
197  {
198  FrameTypeFlags nType = m_pWrtShell->GetFrameType(nullptr,true);
201  rSet.DisableItem(nWhich);
202  else
203  rSet.Put(SfxUInt16Item(nWhich, m_pWrtShell->GetPageOffset()));
204  }
205  break;
206  case SID_PRINTDOC:
207  case SID_PRINTDOCDIRECT:
208  GetSlotState( nWhich, SfxViewShell::GetInterface(), &rSet );
209  break;
210  case SID_ATTR_PAGE_ORIENTATION:
211  case SID_ATTR_PAGE:
212  case SID_ATTR_PAGE_SIZE:
213  case SID_ATTR_PAGE_PAPERBIN:
214  case RES_PAPER_BIN:
215  case FN_PARAM_FTN_INFO:
216  {
217  const size_t nCurIdx = m_pWrtShell->GetCurPageDesc();
218  const SwPageDesc& rDesc = m_pWrtShell->GetPageDesc( nCurIdx );
219 
220  // set correct parent to get the XFILL_NONE FillStyle as needed
221  if(!rSet.GetParent())
222  {
223  const SwFrameFormat& rMaster = rDesc.GetMaster();
224 
225  rSet.SetParent(&rMaster.GetDoc()->GetDfltFrameFormat()->GetAttrSet());
226  }
227 
228  ::PageDescToItemSet( rDesc, rSet);
229 
230  if (nWhich == SID_ATTR_PAGE_ORIENTATION && comphelper::LibreOfficeKit::isActive())
231  {
232  OString aPayload = ".uno:Orientation=";
233  if (rDesc.GetLandscape())
234  {
235  aPayload += "IsLandscape";
236  }
237  else
238  {
239  aPayload += "IsPortrait";
240  }
241  libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
242  }
243  }
244  break;
245  case RES_BACKGROUND:
246  case SID_ATTR_BRUSH:
247  {
248  const size_t nCurIdx = m_pWrtShell->GetCurPageDesc();
249  const SwPageDesc& rDesc = m_pWrtShell->GetPageDesc( nCurIdx );
250  const SwFrameFormat& rMaster = rDesc.GetMaster();
251  const SvxBrushItem& rBrush = rMaster.GetFormatAttr(RES_BACKGROUND);
252  rSet.Put(rBrush);
253  }
254  break;
255  case SID_CLEARHISTORY:
256  {
257  rSet.Put(SfxBoolItem(nWhich, m_pWrtShell->GetLastUndoInfo(nullptr, nullptr)));
258  }
259  break;
260  case SID_UNDO:
261  {
262  // which must not be present, so let them create:
263  if( !m_pShell )
264  SelectShell();
265 
266  const SfxPoolItem* pState = m_pShell->GetSlotState(SID_UNDO);
267  if(pState)
268  rSet.Put(*pState);
269  else
270  rSet.DisableItem(nWhich);
271  }
272  break;
273  case FN_INSERT_OBJ_CTRL:
274  if( bWeb
275  || m_pWrtShell->CursorInsideInputField() )
276  {
277  rSet.DisableItem(nWhich);
278  }
279  break;
280 
281  case FN_UPDATE_TOX:
282  if(!m_pWrtShell->GetTOXCount())
283  rSet.DisableItem(nWhich);
284  break;
285  case FN_EDIT_CURRENT_TOX:
286  case FN_UPDATE_CUR_TOX:
287  {
288  const SwTOXBase* pBase = nullptr;
289  if(nullptr == (pBase = m_pWrtShell->GetCurTOX()) ||
290  (FN_EDIT_CURRENT_TOX == nWhich && pBase->IsTOXBaseInReadonly()))
291  rSet.DisableItem(nWhich);
292  }
293  break;
294  case SID_TWAIN_SELECT:
295  case SID_TWAIN_TRANSFER:
296 #if defined(_WIN32) || defined UNX
297  {
298  if(!SW_MOD()->GetScannerManager().is())
299  rSet.DisableItem(nWhich);
300  }
301 #endif
302  break;
303  case RES_PARATR_TABSTOP:
304  case SID_ATTR_DEFTABSTOP:
305  {
306  const SvxTabStopItem& rDefTabs = m_pWrtShell->GetDefault(RES_PARATR_TABSTOP);
307  rSet.Put( SfxUInt16Item( nWhich,
308  static_cast<sal_uInt16>(::GetTabDist(rDefTabs))));
309  }
310  break;
311  case SID_ATTR_LANGUAGE:
312  {
313  rSet.Put(m_pWrtShell->GetDefault(RES_CHRATR_LANGUAGE).CloneSetWhich(SID_ATTR_LANGUAGE));
314  }
315  break;
317  {
318  rSet.Put(m_pWrtShell->GetDefault(RES_CHRATR_CJK_LANGUAGE)
319  .CloneSetWhich(RES_CHRATR_CJK_LANGUAGE));
320  }
321  break;
323  {
324  rSet.Put(m_pWrtShell->GetDefault(RES_CHRATR_CTL_LANGUAGE)
325  .CloneSetWhich(RES_CHRATR_CTL_LANGUAGE));
326  }
327  break;
328  case FN_REDLINE_ON:
329  rSet.Put( SfxBoolItem( nWhich, GetDocShell()->IsChangeRecording() ) );
330  // When the view is new (e.g. on load), show the Hidden Track Changes infobar
331  // if Show Changes is disabled, but recording of changes is enabled
332  // or hidden tracked changes are there already in the document.
333  // Note: the infobar won't be shown, if the Track Changes toolbar is already
334  // enabled, see in sfx2.
335  if ( m_bForceChangesToolbar && m_pWrtShell->GetLayout()->IsHideRedlines() )
336  {
337  bool isRecording = GetDocShell()->IsChangeRecording();
338  bool hasRecorded =
339  m_pWrtShell->GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().size();
340  if ( isRecording || hasRecorded )
341  {
343  "hiddentrackchanges", SwResId(STR_HIDDEN_CHANGES),
344  SwResId( (isRecording && hasRecorded)
345  ? STR_HIDDEN_CHANGES_DETAIL
346  : isRecording
347  ? STR_HIDDEN_CHANGES_DETAIL2
348  : STR_HIDDEN_CHANGES_DETAIL3 ),
349  InfobarType::INFO);
350  }
351  }
352  m_bForceChangesToolbar = false;
353  break;
354  case FN_REDLINE_PROTECT :
355  rSet.Put( SfxBoolItem( nWhich, GetDocShell()->HasChangeRecordProtection() ) );
356  break;
357  case FN_REDLINE_SHOW:
358  {
359  rSet.Put(SfxBoolItem(nWhich, !m_pWrtShell->GetLayout()->IsHideRedlines()));
360  }
361  break;
362  case SID_AVMEDIA_PLAYER :
363  case FN_REDLINE_ACCEPT :
364  {
365  SfxViewFrame* pVFrame = GetViewFrame();
366  if (pVFrame->KnowsChildWindow(nWhich))
367  rSet.Put(SfxBoolItem( nWhich, pVFrame->HasChildWindow(nWhich)));
368  else
369  rSet.DisableItem(nWhich);
370  }
371  break;
376  {
377  SwDoc *pDoc = m_pWrtShell->GetDoc();
378  SwPaM *pCursor = m_pWrtShell->GetCursor();
379  bool bDisable = false;
380  if (GetDocShell()->HasChangeRecordProtection())
381  bDisable = true;
382  else if (pCursor->HasMark())
383  {
384  // If the selection does not contain redlines, disable accepting/rejecting changes.
387  const SwRangeRedline* redline = table.FindAtPosition( *pCursor->Start(), index );
388  if( redline != nullptr && *redline->Start() == *pCursor->End())
389  redline = nullptr;
390  if( redline == nullptr )
391  {
392  for(; index < table.size(); ++index )
393  {
394  const SwRangeRedline* tmp = table[ index ];
395  if( *tmp->Start() >= *pCursor->End())
396  break;
397  if( tmp->HasMark() && tmp->IsVisible())
398  {
399  redline = tmp;
400  break;
401  }
402  }
403  }
404  if( redline == nullptr )
405  bDisable = true;
406  }
407  else
408  {
409  // If the cursor position isn't on a redline, disable
410  // accepting/rejecting changes.
411  if (nullptr == pDoc->getIDocumentRedlineAccess().GetRedline(*pCursor->Start(), nullptr))
412  bDisable = true;
413  }
414 
415  // LibreOfficeKit wants to handle changes by index, so always allow here.
416  if (bDisable)
417  rSet.DisableItem(nWhich);
419  {
420  OString aPayload(".uno:TrackedChangeIndex=");
421  SwRedlineTable::size_type nRedline = 0;
422  if (pDoc->getIDocumentRedlineAccess().GetRedline(*pCursor->Start(), &nRedline))
423  aPayload += OString::number(nRedline);
424  libreOfficeKitViewCallback(LOK_CALLBACK_STATE_CHANGED, aPayload.getStr());
425  }
426  }
427  break;
428 
431  {
432  // Enable change navigation if we have any redlines. Ideally we should disable
433  // "Next Change" if we're at or past the last change, and similarly for
434  // "Previous Change"
435  if (0 == m_pWrtShell->GetRedlineCount())
436  rSet.DisableItem(nWhich);
437  }
438  break;
439 
440  case SID_THESAURUS:
441  {
442  SwWrtShell &rSh = GetWrtShell();
443  if (2 <= rSh.GetCursorCnt()) // multi selection?
444  rSet.DisableItem(nWhich);
445  else
446  {
447  LanguageType nLang = rSh.GetCurLang();
448 
449  // disable "Thesaurus" (menu entry and key shortcut) if the
450  // language is not supported (by default it is enabled)
451  uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
452  if (!xThes.is() || nLang == LANGUAGE_NONE ||
453  !xThes->hasLocale( LanguageTag::convertToLocale( nLang ) ))
454  rSet.DisableItem(nWhich);
455  }
456  }
457  break;
458  case SID_HANGUL_HANJA_CONVERSION:
459  case SID_CHINESE_CONVERSION:
460  {
461  if (!SvtCJKOptions().IsAnyEnabled())
462  {
463  GetViewFrame()->GetBindings().SetVisibleState( nWhich, false );
464  rSet.DisableItem(nWhich);
465  }
466  else
467  GetViewFrame()->GetBindings().SetVisibleState( nWhich, true );
468  }
469  break;
470  case SID_MAIL_SCROLLBODY_PAGEDOWN:
471  {
472  const tools::Long nBottom = m_pWrtShell->GetDocSize().Height() + DOCUMENTBORDER;
473  const tools::Long nAct = GetVisArea().Bottom();
474  rSet.Put(SfxBoolItem(SID_MAIL_SCROLLBODY_PAGEDOWN, nAct < nBottom ));
475  }
476  break;
477 
478  case SID_DOCUMENT_COMPARE:
479  case SID_DOCUMENT_MERGE:
480  if( dynamic_cast<const SwGlobalDocShell* >(GetDocShell()) != nullptr||
481  (SID_DOCUMENT_MERGE == nWhich && m_pWrtShell->getIDocumentRedlineAccess().GetRedlinePassword().hasElements()))
482  rSet.DisableItem(nWhich);
483  break;
484  case SID_VIEW_DATA_SOURCE_BROWSER:
485  if ( !SvtModuleOptions().IsModuleInstalled( SvtModuleOptions::EModule::DATABASE ) )
486  rSet.Put( SfxVisibilityItem( nWhich, false ) );
487  else
488  rSet.Put( SfxBoolItem( nWhich, GetViewFrame()->HasChildWindow( SID_BROWSER ) ) );
489  break;
490  case SID_READONLY_MODE:
491  rSet.Put(SfxBoolItem(nWhich,
492  m_pWrtShell->HasReadonlySel()||GetDocShell()->IsReadOnly()));
493  break;
494  case SID_IMAGE_ORIENTATION:
495  {
496  SfxImageItem aImageItem(nWhich);
497  if(m_pWrtShell->IsInVerticalText())
498  aImageItem.SetRotation( 2700_deg10 );
499  if(m_pWrtShell->IsInRightToLeftText())
500  aImageItem.SetMirrored( true );
501  rSet.Put(aImageItem);
502  }
503  break;
505  if(!m_bInMailMerge && !GetViewFrame()->HasChildWindow(nWhich))
506  rSet.DisableItem(nWhich);
507  break;
509  break;
510  case SID_ALIGN_ANY_LEFT :
511  case SID_ALIGN_ANY_HCENTER :
512  case SID_ALIGN_ANY_RIGHT :
513  case SID_ALIGN_ANY_JUSTIFIED:
514  case SID_ALIGN_ANY_TOP :
515  case SID_ALIGN_ANY_VCENTER :
516  case SID_ALIGN_ANY_BOTTOM :
517  case SID_ALIGN_ANY_HDEFAULT :
518  case SID_ALIGN_ANY_VDEFAULT :
519  {
520  if( !m_pShell )
521  SelectShell();
522  sal_uInt16 nAlias = 0;
524  {
525  switch( nWhich )
526  {
527  case SID_ALIGN_ANY_LEFT : nAlias = SID_ATTR_PARA_ADJUST_LEFT; break;
528  case SID_ALIGN_ANY_HCENTER : nAlias = SID_ATTR_PARA_ADJUST_CENTER; break;
529  case SID_ALIGN_ANY_RIGHT : nAlias = SID_ATTR_PARA_ADJUST_RIGHT; break;
530  case SID_ALIGN_ANY_JUSTIFIED: nAlias = SID_ATTR_PARA_ADJUST_BLOCK; break;
531  case SID_ALIGN_ANY_TOP : nAlias = SID_TABLE_VERT_NONE; break;
532  case SID_ALIGN_ANY_VCENTER : nAlias = SID_TABLE_VERT_CENTER; break;
533  case SID_ALIGN_ANY_BOTTOM : nAlias = SID_TABLE_VERT_BOTTOM; break;
534  }
535  }
536  else
537  {
538  switch( nWhich )
539  {
540  case SID_ALIGN_ANY_LEFT : nAlias = SID_OBJECT_ALIGN_LEFT ; break;
541  case SID_ALIGN_ANY_HCENTER : nAlias = SID_OBJECT_ALIGN_CENTER ; break;
542  case SID_ALIGN_ANY_RIGHT : nAlias = SID_OBJECT_ALIGN_RIGHT ; break;
543  case SID_ALIGN_ANY_TOP : nAlias = SID_OBJECT_ALIGN_UP ; break;
544  case SID_ALIGN_ANY_VCENTER : nAlias = SID_OBJECT_ALIGN_MIDDLE ; break;
545  case SID_ALIGN_ANY_BOTTOM : nAlias = SID_OBJECT_ALIGN_DOWN ; break;
546  }
547  }
548  //these slots are either re-mapped to text or object alignment
549  const SfxPoolItem* pState = nullptr;
550  if(nAlias)
551  GetViewFrame()->GetDispatcher()->QueryState( nAlias, pState );
552  if(pState)
553  {
555  {
556  rSet.Put(pState->CloneSetWhich(nWhich));
557  }
558  }
559  else
560  rSet.DisableItem(nWhich);
561  }
562  break;
563  }
564  nWhich = aIter.NextWhich();
565  }
566 }
567 
569 {
570  SfxWhichIter aIter(rSet);
571  bool bWeb = dynamic_cast<SwWebView*>( this ) != nullptr;
572 
573  for( sal_uInt16 nWhich = aIter.FirstWhich(); nWhich;
574  nWhich = aIter.NextWhich() )
575  switch(nWhich)
576  {
577  case SID_DRAW_LINE:
578  case SID_DRAW_XLINE:
579  case SID_LINE_ARROW_END:
580  case SID_LINE_ARROW_CIRCLE:
581  case SID_LINE_ARROW_SQUARE:
582  case SID_LINE_ARROW_START:
583  case SID_LINE_CIRCLE_ARROW:
584  case SID_LINE_SQUARE_ARROW:
585  case SID_LINE_ARROWS:
586  case SID_DRAW_MEASURELINE:
587  case SID_DRAW_RECT:
588  case SID_DRAW_ELLIPSE:
589  case SID_DRAW_XPOLYGON_NOFILL:
590  case SID_DRAW_XPOLYGON:
591  case SID_DRAW_POLYGON_NOFILL:
592  case SID_DRAW_POLYGON:
593  case SID_DRAW_BEZIER_NOFILL:
594  case SID_DRAW_BEZIER_FILL:
595  case SID_DRAW_FREELINE_NOFILL:
596  case SID_DRAW_FREELINE:
597  case SID_DRAW_ARC:
598  case SID_DRAW_PIE:
599  case SID_DRAW_CIRCLECUT:
600  case SID_DRAW_TEXT:
601  case SID_DRAW_CAPTION:
602  if ( bWeb )
603  rSet.DisableItem( nWhich );
604  else
605  rSet.Put( SfxBoolItem( nWhich, m_nDrawSfxId == nWhich ) );
606  break;
607 
608  case SID_DRAW_TEXT_VERTICAL:
609  case SID_DRAW_CAPTION_VERTICAL:
610  if ( bWeb || !SvtLanguageOptions().IsVerticalTextEnabled() )
611  rSet.DisableItem( nWhich );
612  else
613  rSet.Put( SfxBoolItem( nWhich, m_nDrawSfxId == nWhich ) );
614  break;
615 
616  case SID_DRAW_TEXT_MARQUEE:
618  rSet.Put( SfxBoolItem(nWhich, m_nDrawSfxId == nWhich));
619  else
620  rSet.DisableItem(nWhich);
621  break;
622  case SID_OBJECT_SELECT:
623  rSet.Put( SfxBoolItem(nWhich, m_nDrawSfxId == nWhich ||
624  m_nFormSfxId == nWhich));
625  break;
626 
627  case SID_INSERT_DRAW:
628  case SID_FONTWORK_GALLERY_FLOATER :
629  case SID_DRAWTBX_ARROWS:
630  {
631  if ( bWeb )
632  rSet.DisableItem( nWhich );
633  }
634  break;
635 
636  case SID_DRAWTBX_CS_BASIC :
637  case SID_DRAWTBX_CS_SYMBOL :
638  case SID_DRAWTBX_CS_ARROW :
639  case SID_DRAWTBX_CS_FLOWCHART :
640  case SID_DRAWTBX_CS_CALLOUT :
641  case SID_DRAWTBX_CS_STAR :
642  {
643  if ( bWeb )
644  rSet.DisableItem( nWhich );
645  else
646  rSet.Put( SfxStringItem( nWhich, m_nDrawSfxId == nWhich ? m_sDrawCustom : OUString() ) );
647  }
648  break;
649 
650  }
651 }
652 
654 {
655  assert((nFeature & ~SfxShellFeature::SwMask) == SfxShellFeature::NONE);
656  switch(nFeature)
657  {
658  case SfxShellFeature::SwChildWindowLabel:
659  return m_pWrtShell->IsLabelDoc();
660  default:
661  return false;
662  }
663 }
664 
665 /* 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:568
#define FN_EDIT_FOOTNOTE
Definition: cmdid.h:106
std::unique_ptr< SwWrtShell > m_pWrtShell
Definition: view.hxx:193
SfxDispatcher * GetDispatcher()
#define FN_INSERT_CAPTION
Definition: cmdid.h:203
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:619
bool IsTOXBaseInReadonly() const
Definition: doctxm.cxx:2012
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:266
LanguageType GetCurLang() const
Definition: edattr.cxx:815
Used by the UI to modify the document model.
Definition: wrtsh.hxx:91
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:254
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:769
OUString m_sDrawCustom
Definition: view.hxx:227
#define FN_INSERT_FIELD_DATA_ONLY
Definition: cmdid.h:212
#define FN_MAILMERGE_SENDMAIL_CHILDWINDOW
Definition: cmdid.h:269
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:653
bool GetLandscape() const
Definition: pagedesc.hxx:200
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:354
#define FN_SCROLL_NEXT
Definition: cmdid.h:181
const SwRangeRedline * FindAtPosition(const SwPosition &startPosition, size_type &tableIndex, bool next=true) const
Find the redline at the given position.
Definition: docredln.cxx:712
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:180
#define FN_UPDATE_CUR_TOX
Definition: cmdid.h:504
OUString SwResId(const char *pId)
Definition: swmodule.cxx:166
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:123
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:188
const SwPosition * Start() const
Definition: pam.hxx:212
bool IsVisible() const
Definition: redline.hxx:187
SwDocShell * GetDocShell()
Definition: view.cxx:1126
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:239
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
#define FN_NAV_ELEMENT
Definition: cmdid.h:179
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:428
#define FN_REDLINE_NEXT_CHANGE
Definition: cmdid.h:141
bool isSignatureLineSelected() const
Definition: viewdlg2.cxx:117
bool KnowsChildWindow(sal_uInt16)
const SwPosition * End() const
Definition: pam.hxx:217
virtual bool IsChangeRecording() const override
passwword protection for Writer (derived from SfxObjectShell) see also: FN_REDLINE_ON, FN_REDLINE_ON
Definition: docsh.cxx:1329
QPRO_FUNC_TYPE nType
static sal_uInt16 m_nMoveType
Definition: view.hxx:166
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:369
const tools::Rectangle & GetVisArea() const
Definition: view.hxx:426
virtual SfxInterface * GetInterface() const
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:254
bool m_bForceChangesToolbar
Definition: view.hxx:240
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:120
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: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:64