LibreOffice Module sw (master)  1
basesh.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 <config_features.h>
21 #include <config_fuzzers.h>
22 
23 #include <sal/config.h>
24 
25 #include <hintids.hxx>
26 #include <svl/languageoptions.hxx>
27 #include <sfx2/linkmgr.hxx>
28 #include <sfx2/htmlmode.hxx>
29 #include <svx/imapdlg.hxx>
30 #include <sfx2/dispatch.hxx>
31 #include <sfx2/viewfrm.hxx>
32 #include <sfx2/request.hxx>
33 #include <svl/whiter.hxx>
34 #include <svl/visitem.hxx>
35 #include <editeng/langitem.hxx>
36 #include <svx/clipfmtitem.hxx>
37 #include <svx/contdlg.hxx>
38 #include <vcl/graph.hxx>
39 #include <vcl/inputctx.hxx>
40 #include <svl/slstitm.hxx>
41 #include <svl/ptitem.hxx>
42 #include <svl/stritem.hxx>
43 #include <editeng/colritem.hxx>
44 #include <editeng/fhgtitem.hxx>
45 #include <editeng/fontitem.hxx>
46 #include <editeng/shaditem.hxx>
47 #include <editeng/boxitem.hxx>
48 #include <editeng/brushitem.hxx>
49 #include <editeng/opaqitem.hxx>
50 #include <editeng/sizeitem.hxx>
51 #include <svx/flagsdef.hxx>
53 #include <sfx2/objface.hxx>
54 #include <fmturl.hxx>
55 #include <fmthdft.hxx>
56 #include <fmtclds.hxx>
57 #include <docsh.hxx>
58 #include <wrtsh.hxx>
59 #include <view.hxx>
60 #include <swmodule.hxx>
61 #include <swundo.hxx>
62 #include <fldbas.hxx>
63 #include <uitool.hxx>
64 #include <basesh.hxx>
65 #include <viewopt.hxx>
66 #include <fontcfg.hxx>
67 #include <fmtsrnd.hxx>
68 #include <fldmgr.hxx>
69 #include <frmmgr.hxx>
70 #include <tablemgr.hxx>
71 #include <mdiexp.hxx>
72 #include <swdtflvr.hxx>
73 #include <pagedesc.hxx>
74 #include <fmtcol.hxx>
75 #include <edtwin.hxx>
76 #include <tblafmt.hxx>
77 #include <swwait.hxx>
78 #include <cmdid.h>
79 #include <strings.hrc>
80 #include <unotxdoc.hxx>
81 #include <doc.hxx>
83 #include <IDocumentUndoRedo.hxx>
84 #include <swabstdlg.hxx>
85 #include <modcfg.hxx>
86 #include <svx/fmshell.hxx>
87 #include <SwRewriter.hxx>
88 #include <svx/galleryitem.hxx>
90 #include <com/sun/star/gallery/GalleryItemType.hpp>
91 #include <memory>
92 
95 #include <comphelper/lok.hxx>
96 #include <osl/diagnose.h>
97 
98 #include <svx/svxdlg.hxx>
99 
100 #include <shellres.hxx>
101 #include <UndoTable.hxx>
102 
103 #include <ndtxt.hxx>
104 
106 
107 // These variables keep the state of Gallery (slot SID_GALLERY_BG_BRUSH)
108 // detected by GetGalleryState() for the subsequent ExecuteGallery() call.
109 
120 
121 #define ShellClass_SwBaseShell
122 #include <sfx2/msg.hxx>
123 #include <swslots.hxx>
124 
125 #include <AccessibilityCheck.hxx>
127 
128 namespace
129 {
130  SvxContourDlg* GetContourDlg(SwView const &rView)
131  {
132  SfxChildWindow *pWnd = rView.GetViewFrame()->GetChildWindow(SvxContourDlgChildWindow::GetChildWindowId());
133  return pWnd ? static_cast<SvxContourDlg*>(pWnd->GetController().get()) : nullptr;
134  }
135 
136  SvxIMapDlg* GetIMapDlg(SwView const &rView)
137  {
138  SfxChildWindow* pWnd = rView.GetViewFrame()->GetChildWindow(SvxIMapDlgChildWindow::GetChildWindowId());
139  return pWnd ? static_cast<SvxIMapDlg*>(pWnd->GetController().get()) : nullptr;
140  }
141 }
142 
143 using namespace ::com::sun::star;
144 using namespace ::com::sun::star::uno;
145 using namespace ::com::sun::star::frame;
146 using namespace ::com::sun::star::lang;
147 
149 
150 void SwBaseShell::InitInterface_Impl()
151 {
152  GetStaticInterface()->RegisterChildWindow(SvxIMapDlgChildWindow::GetChildWindowId());
153  GetStaticInterface()->RegisterChildWindow(SvxContourDlgChildWindow::GetChildWindowId());
154  GetStaticInterface()->RegisterChildWindow(DevelopmentToolChildWindow::GetChildWindowId());
155 }
156 
157 static void lcl_UpdateIMapDlg( SwWrtShell& rSh )
158 {
159  Graphic aGrf( rSh.GetIMapGraphic() );
160  GraphicType nGrfType = aGrf.GetType();
161  void* pEditObj = GraphicType::NONE != nGrfType && GraphicType::Default != nGrfType
162  ? rSh.GetIMapInventor() : nullptr;
163  TargetList aList;
165 
167  rSh.GetFlyFrameAttr( aSet );
168  const SwFormatURL &rURL = aSet.Get( RES_URL );
170  aGrf, rURL.GetMap(), &aList, pEditObj );
171 }
172 
174 {
175  Graphic aGraf( rSh.GetIMapGraphic() );
176  GraphicType nGrfType = aGraf.GetType();
177  bool bRet = GraphicType::NONE != nGrfType && GraphicType::Default != nGrfType;
178  if( bRet )
179  {
180  OUString aGrfName;
181  if ( nSel & SelectionType::Graphic )
182  rSh.GetGrfNms( &aGrfName, nullptr );
183 
184  SvxContourDlg *pDlg = GetContourDlg(rSh.GetView());
185  if (pDlg)
186  {
187  pDlg->Update(aGraf, !aGrfName.isEmpty(),
188  rSh.GetGraphicPolygon(), rSh.GetIMapInventor());
189  }
190  }
191  return bRet;
192 }
193 
195 {
196  SwWrtShell &rSh = GetShell();
197  SwEditWin& rTmpEditWin = GetView().GetEditWin();
198  switch(rReq.GetSlot())
199  {
200  case SID_DELETE:
202  {
203  // Disallow if the cursor is at the end of a paragraph and the document model
204  // node at this position is an outline node with folded content or the next node
205  // is an outline node with folded content.
206  if (rSh.IsEndPara())
207  {
208  SwNodeIndex aIdx(rSh.GetCursor()->GetNode());
209  if (aIdx.GetNode().IsTextNode())
210  {
211  bool bVisible = true;
212  aIdx.GetNode().GetTextNode()->GetAttrOutlineContentVisible(bVisible);
213  if (!bVisible)
214  break;
215  ++aIdx;
216  if (aIdx.GetNode().IsTextNode())
217  {
218  bVisible = true;
219  aIdx.GetNode().GetTextNode()->GetAttrOutlineContentVisible(bVisible);
220  if (!bVisible)
221  break;
222  }
223  }
224  }
225  }
226  rSh.DelRight();
227  break;
228 
229  case FN_BACKSPACE:
231  {
232  // Disallow if the cursor is at the start of a paragraph and the document model
233  // node at this position is an outline node with folded content or the previous
234  // node is a content node without a layout frame.
235  if (rSh.IsSttPara())
236  {
237  SwNodeIndex aIdx(rSh.GetCursor()->GetNode());
238  if (aIdx.GetNode().IsTextNode())
239  {
240  bool bVisible = true;
241  aIdx.GetNode().GetTextNode()->GetAttrOutlineContentVisible(bVisible);
242  if (!bVisible)
243  break;
244  --aIdx;
245  if (aIdx.GetNode().IsContentNode() &&
246  !aIdx.GetNode().GetContentNode()->getLayoutFrame(rSh.GetLayout()))
247  break;
248  }
249  }
250  }
251  if( rSh.IsNoNum() )
252  {
253  rSh.SttCursorMove();
254  bool bLeft = rSh.Left( CRSR_SKIP_CHARS, true, 1, false );
255  if( bLeft )
256  {
257  rSh.DelLeft();
258  }
259  else
260  // JP 15.07.96: If it no longer goes forward, cancel
261  // the numbering. For example at the beginning
262  // of a doc, frame, table or an area.
263  rSh.DelNumRules();
264 
265  rSh.EndCursorMove();
266  break;
267  }
268 
269  [[fallthrough]]; // otherwise call DelLeft
270  case FN_SHIFT_BACKSPACE:
271  rSh.DelLeft();
272  break;
273  default:
274  OSL_FAIL("wrong Dispatcher");
275  return;
276  }
277  rReq.Done();
278 
279  //#i42732# - notify the edit window that from now on we do not use the input language
280  rTmpEditWin.SetUseInputLanguage( false );
281 }
282 
284 {
285  // Attention: At risk of suicide!
286  // After paste, paste special the shell can be destroy.
287 
288  SwWrtShell &rSh = GetShell();
289  sal_uInt16 nId = rReq.GetSlot();
290  bool bIgnore = false;
292 
293  switch( nId )
294  {
295  case SID_CUT:
296  case SID_COPY:
298  if ( rSh.HasSelection() )
299  {
300  rtl::Reference<SwTransferable> pTransfer = new SwTransferable( rSh );
301 
303  pTransfer->Cut();
304  else
305  {
306  const bool bLockedView = rSh.IsViewLocked();
307  rSh.LockView( true ); //lock visible section
308  pTransfer->Copy();
309  rSh.LockView( bLockedView );
310  }
311  break;
312  }
313  return;
314 
318  switch ( nId )
319  {
321  ePasteTable = PasteTableType::PASTE_TABLE;
322  break;
324  ePasteTable = PasteTableType::PASTE_ROW;
325  break;
327  ePasteTable = PasteTableType::PASTE_COLUMN;
328  break;
329  default:
330  ;
331  }
332  [[fallthrough]];
333  case SID_PASTE:
334  {
335  TransferableDataHelper aDataHelper(
337  if( aDataHelper.GetXTransferable().is()
338  && SwTransferable::IsPaste( rSh, aDataHelper ) )
339  {
340  // Temporary variables, because the shell could already be
341  // destroyed after the paste.
342  SwView* pView = &rView;
343 
344  RndStdIds nAnchorType = RndStdIds::FLY_AT_PARA;
345  const SfxUInt16Item* pAnchorType = rReq.GetArg<SfxUInt16Item>(FN_PARAM_1);
346  if (pAnchorType)
347  nAnchorType = static_cast<RndStdIds>(pAnchorType->GetValue());
348  bool bIgnoreComments = false;
349  const SfxBoolItem* pIgnoreComments = rReq.GetArg<SfxBoolItem>(FN_PARAM_2);
350  if (pIgnoreComments)
351  bIgnoreComments = pIgnoreComments->GetValue();
352  SwTransferable::Paste(rSh, aDataHelper, nAnchorType, bIgnoreComments, ePasteTable);
353 
354  if( rSh.IsFrameSelected() || rSh.IsObjSelected() )
355  rSh.EnterSelFrameMode();
356  pView->AttrChangedNotify(nullptr);
357 
358  // Fold pasted outlines that have outline content visible attribute false
360  }
361  else
362  return;
363  }
364  break;
365 
366  case SID_CLIPBOARD_FORMAT_ITEMS:
367  {
368  const SfxItemSet* pArgs = rReq.GetArgs();
369  const SfxPoolItem* pFormat;
370  if( pArgs && SfxItemState::SET == pArgs->GetItemState( nId, false, &pFormat ) )
371  {
372  TransferableDataHelper aDataHelper(
374  &rSh.GetView().GetEditWin()) );
375  if( aDataHelper.GetXTransferable().is()
376  /*&& SwTransferable::IsPaste( rSh, aDataHelper )*/ )
377  {
378  // Temporary variables, because the shell could already be
379  // destroyed after the paste.
380  SwView* pView = &rView;
381 
382  SwTransferable::PasteFormat( rSh, aDataHelper,
383  static_cast<SotClipboardFormatId>(static_cast<const SfxUInt32Item*>(pFormat)->GetValue()) );
384 
385  //Done() has to be called before the shell has been removed
386  rReq.Done();
387  bIgnore = true;
388  if( rSh.IsFrameSelected() || rSh.IsObjSelected())
389  rSh.EnterSelFrameMode();
390  pView->AttrChangedNotify(nullptr);
391 
392  // Fold pasted outlines that have outline content visible attribute false
394  }
395  }
396  }
397  break;
398 
399  case SID_PASTE_UNFORMATTED:
400  {
401  TransferableDataHelper aDataHelper(
403  if( aDataHelper.GetXTransferable().is()
404  && SwTransferable::IsPaste( rSh, aDataHelper ) )
405  {
406  // Temporary variables, because the shell could already be
407  // destroyed after the paste.
408  SwView* pView = &rView;
409  rReq.Ignore();
410  bIgnore = true;
411  if(SwTransferable::PasteUnformatted( rSh, aDataHelper ))
412  {
413  SfxViewFrame* pViewFrame = pView->GetViewFrame();
414  uno::Reference< frame::XDispatchRecorder > xRecorder =
415  pViewFrame->GetBindings().GetRecorder();
416  if(xRecorder.is()) {
417  SfxRequest aReq( pViewFrame, SID_CLIPBOARD_FORMAT_ITEMS );
418  aReq.AppendItem( SfxUInt32Item( SID_CLIPBOARD_FORMAT_ITEMS, static_cast<sal_uInt32>(SotClipboardFormatId::STRING) ) );
419  aReq.Done();
420  }
421  }
422 
423  if (rSh.IsFrameSelected() || rSh.IsObjSelected())
424  rSh.EnterSelFrameMode();
425  pView->AttrChangedNotify(nullptr);
426 
427  // Fold pasted outlines that have outline content visible attribute false
429  }
430  else
431  return;
432  }
433  break;
434 
435  case SID_PASTE_SPECIAL:
436  {
437  std::shared_ptr<TransferableDataHelper> aDataHelper =
438  std::make_shared<TransferableDataHelper>(TransferableDataHelper::CreateFromSystemClipboard( &rSh.GetView().GetEditWin()));
439 
440  if( aDataHelper->GetXTransferable().is()
441  && SwTransferable::IsPaste( rSh, *aDataHelper )
442  && !rSh.CursorInsideInputField() )
443  {
444  rReq.Ignore();
445  bIgnore = true;
446 
448  VclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( rReq.GetFrameWeld() ));
449 
450  // Prepare the dialog
451  SwTransferable::PrePasteSpecial(rSh, *aDataHelper, pDlg);
452  pDlg->PreGetFormat(*aDataHelper);
453 
454 
455  pDlg->StartExecuteAsync([aDataHelper, pDlg, &rSh, this](sal_Int32 nResult){
456  if (nResult == RET_OK)
457  {
458  // Temporary variables, because the shell could already be
459  // destroyed after the paste.
460  SwView* pView = &rView;
461  bool bRet = false;
462  SotClipboardFormatId nFormatId = pDlg->GetFormatOnly();
463 
464  if( nFormatId != SotClipboardFormatId::NONE )
465  bRet = SwTransferable::PasteFormat( rSh, *aDataHelper, nFormatId );
466 
467  if (bRet)
468  {
469  SfxViewFrame* pViewFrame = pView->GetViewFrame();
470  uno::Reference< frame::XDispatchRecorder > xRecorder =
471  pViewFrame->GetBindings().GetRecorder();
472  if(xRecorder.is()) {
473  SfxRequest aReq( pViewFrame, SID_CLIPBOARD_FORMAT_ITEMS );
474  aReq.AppendItem( SfxUInt32Item( SID_CLIPBOARD_FORMAT_ITEMS, static_cast<sal_uInt32>(nFormatId) ) );
475  aReq.Done();
476  }
477  }
478 
479  if (rSh.IsFrameSelected() || rSh.IsObjSelected())
480  rSh.EnterSelFrameMode();
481  pView->AttrChangedNotify(nullptr);
482 
483  // Fold pasted outlines that have outline content visible attribute false
485  }
486 
487  pDlg->disposeOnce();
488 
489  });
490  }
491  else
492  return;
493  }
494  break;
495 
496  default:
497  OSL_FAIL("wrong Dispatcher");
498  return;
499  }
500  if(!bIgnore)
501  rReq.Done();
502 }
503 
504 // ClipBoard state
505 
507 {
508  SwWrtShell &rSh = GetShell();
509  SfxWhichIter aIter(rSet);
510 
511  const bool bCopy = rSh.HasSelection();
512 
513  sal_uInt16 nWhich = aIter.FirstWhich();
514 
515  while(nWhich)
516  {
517  switch(nWhich)
518  {
519  case SID_CUT:
521  {
522  rSet.DisableItem( nWhich );
523  break;
524  }
525  [[fallthrough]];
526  case SID_COPY:
527  if( !bCopy || GetObjectShell()->isContentExtractionLocked())
528  rSet.DisableItem( nWhich );
529  break;
530 
534  if( !rSh.IsCursorInTable()
536  || rSh.CursorInsideInputField()
537  // disable if not a native Writer table and not a spreadsheet format
539  {
540  rSet.DisableItem( nWhich );
541  }
542  break;
543 
544  case SID_PASTE:
545  if( !GetView().IsPasteAllowed() )
546  {
547  rSet.DisableItem( nWhich );
548  }
549  break;
550 
551  case SID_PASTE_SPECIAL:
552  if( !GetView().IsPasteSpecialAllowed()
553  || rSh.CursorInsideInputField() )
554  {
555  rSet.DisableItem( nWhich );
556  }
557  break;
558 
559  case SID_PASTE_UNFORMATTED:
560  if( !GetView().IsPasteSpecialAllowed() )
561  {
562  rSet.DisableItem( nWhich );
563  }
564  break;
565 
566  case SID_CLIPBOARD_FORMAT_ITEMS:
567  {
568  TransferableDataHelper aDataHelper(
570  &rSh.GetView().GetEditWin()) );
571 
572  SvxClipboardFormatItem aFormatItem( nWhich );
573  SwTransferable::FillClipFormatItem( rSh, aDataHelper, aFormatItem );
574  rSet.Put( aFormatItem );
575  }
576  break;
577  }
578  nWhich = aIter.NextWhich();
579  }
580 }
581 
582 // Perform undo
583 
585 {
587 
588  SwWrtShell &rWrtShell = GetShell();
589 
590  SwUndoId nUndoId(SwUndoId::EMPTY);
591  sal_uInt16 nId = rReq.GetSlot(), nCnt = 1;
592  const SfxItemSet* pArgs = rReq.GetArgs();
593  const SfxPoolItem* pItem;
594  if( pArgs && SfxItemState::SET == pArgs->GetItemState( nId, false, &pItem ))
595  nCnt = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
596 
597  // Repair mode: allow undo/redo of all undo actions, even if access would
598  // be limited based on the view shell ID.
599  bool bRepair = false;
600  if (pArgs && pArgs->GetItemState(SID_REPAIRPACKAGE, false, &pItem) == SfxItemState::SET)
601  bRepair = static_cast<const SfxBoolItem*>(pItem)->GetValue();
602 
603  // #i106349#: save pointer: undo/redo may delete the shell, i.e., this!
604  SfxViewFrame *const pViewFrame( GetView().GetViewFrame() );
605 
606  IDocumentUndoRedo& rUndoRedo = rWrtShell.GetIDocumentUndoRedo();
607  bool bWasRepair = rUndoRedo.DoesRepair();
608  rUndoRedo.DoRepair(bRepair);
609  comphelper::ScopeGuard aGuard([&rUndoRedo, bWasRepair]()
610  {
611  rUndoRedo.DoRepair(bWasRepair);
612  });
613 
614  switch( nId )
615  {
616  case SID_UNDO:
617  if (rUndoRedo.GetLastUndoInfo(nullptr, &nUndoId, &rWrtShell.GetView()))
618  {
619  for (SwViewShell& rShell : rWrtShell.GetRingContainer())
620  rShell.LockPaint();
621  rWrtShell.Do( SwWrtShell::UNDO, nCnt );
622  for (SwViewShell& rShell : rWrtShell.GetRingContainer())
623  rShell.UnlockPaint();
624 
625  // tdf#141613 FIXME: Disable redoing header/footer changes for now.
626  // The proper solution would be to write a SwUndoHeaderFooter class
627  // to represent the addition of a header or footer to the current page.
628  if (nUndoId == SwUndoId::HEADER_FOOTER)
629  rUndoRedo.ClearRedo();
630  }
631  break;
632 
633  case SID_REDO:
634  if (rUndoRedo.GetFirstRedoInfo(nullptr, &nUndoId, &rWrtShell.GetView()))
635  {
636  for (SwViewShell& rShell : rWrtShell.GetRingContainer())
637  rShell.LockPaint();
638  rWrtShell.Do( SwWrtShell::REDO, nCnt );
639  for (SwViewShell& rShell : rWrtShell.GetRingContainer())
640  rShell.UnlockPaint();
641  }
642  break;
643 
644  case SID_REPEAT:
645  rWrtShell.Do( SwWrtShell::REPEAT );
646  break;
647  default:
648  OSL_FAIL("wrong Dispatcher");
649  }
650 
651  if (nUndoId == SwUndoId::CONFLICT)
652  {
653  rReq.SetReturnValue( SfxUInt32Item(nId, static_cast<sal_uInt32>(SID_REPAIRPACKAGE)) );
654  }
655  else if (nUndoId == SwUndoId::INSFMTATTR)
656  {
657  rWrtShell.GetDoc()->GetDocShell()->GetStyleSheetPool()->Broadcast(SfxHint(SfxHintId::StyleSheetModified));
658  }
659 
660  if (pViewFrame) { pViewFrame->GetBindings().InvalidateAll(false); }
661 }
662 
663 // State of undo
664 
666 {
667  SwUndoId nUndoId(SwUndoId::EMPTY);
668  SwWrtShell &rSh = GetShell();
669  SfxWhichIter aIter(rSet);
670  sal_uInt16 nWhich = aIter.FirstWhich();
671  while(nWhich)
672  {
673  switch(nWhich)
674  {
675  case SID_UNDO:
676  {
677  if (rSh.GetLastUndoInfo(nullptr, &nUndoId, &rSh.GetView()))
678  {
679  rSet.Put( SfxStringItem(nWhich,
681  }
682  else if (nUndoId == SwUndoId::CONFLICT)
683  {
684  rSet.Put( SfxUInt32Item(nWhich, static_cast<sal_uInt32>(SID_REPAIRPACKAGE)) );
685  }
686  else
687  rSet.DisableItem(nWhich);
688 
689  break;
690  }
691  case SID_REDO:
692  {
693  if (rSh.GetFirstRedoInfo(nullptr, &nUndoId, &rSh.GetView()))
694  {
695  rSet.Put(SfxStringItem(nWhich,
697  }
698  else if (nUndoId == SwUndoId::CONFLICT)
699  {
700  rSet.Put( SfxInt32Item(nWhich, static_cast<sal_uInt32>(SID_REPAIRPACKAGE)) );
701  }
702  else
703  rSet.DisableItem(nWhich);
704  break;
705  }
706  case SID_REPEAT:
707  { // Repeat is only possible if no REDO is possible - UI-Restriction
708  if ((!rSh.GetFirstRedoInfo(nullptr, nullptr)) &&
709  !rSh.IsSelFrameMode() &&
710  (SwUndoId::EMPTY != rSh.GetRepeatInfo(nullptr)))
711  {
712  rSet.Put(SfxStringItem(nWhich, rSh.GetRepeatString()));
713  }
714  else
715  rSet.DisableItem(nWhich);
716  break;
717  }
718 
719  case SID_GETUNDOSTRINGS:
720  if (rSh.GetLastUndoInfo(nullptr, nullptr))
721  {
722  SfxStringListItem aStrLst( nWhich );
723  rSh.GetDoStrings( SwWrtShell::UNDO, aStrLst );
724  rSet.Put( aStrLst );
725  }
726  else
727  rSet.DisableItem( nWhich );
728  break;
729 
730  case SID_GETREDOSTRINGS:
731  if (rSh.GetFirstRedoInfo(nullptr, nullptr))
732  {
733  SfxStringListItem aStrLst( nWhich );
734  rSh.GetDoStrings( SwWrtShell::REDO, aStrLst );
735  rSet.Put( aStrLst );
736  }
737  else
738  rSet.DisableItem( nWhich );
739  break;
740  }
741  nWhich = aIter.NextWhich();
742  }
743 }
744 
745 // Evaluate respectively dispatching the slot Id
746 
748 {
749  const SfxPoolItem *pItem;
750  SwWrtShell &rSh = GetShell();
751  const SfxItemSet* pArgs = rReq.GetArgs();
752  bool bMore = false;
753 
754  sal_uInt16 nSlot = rReq.GetSlot();
755  switch(nSlot)
756  {
757  case FN_REPAGINATE:
758  {
759  Reference < XModel > xModel = GetView().GetDocShell()->GetModel();
760  auto pDoc = comphelper::getFromUnoTunnel<SwXTextDocument>(xModel);
761  pDoc->NotifyRefreshListeners();
762  rSh.CalcLayout();
763  }
764  break;
765  case FN_UPDATE_FIELDS:
766  {
767  rSh.UpdateDocStat();
768  rSh.EndAllTableBoxEdit();
769  rSh.SwViewShell::UpdateFields(true);
770 
771  if( rSh.IsCursorInTable() )
772  {
773  if( !rSh.IsTableComplexForChart() )
774  SwTableFUNC( &rSh ).UpdateChart();
775  rSh.ClearTableBoxContent();
776  rSh.SaveTableBoxContent();
777  }
778  }
779  break;
780  case FN_UPDATE_CHARTS:
781  {
782  SwWait aWait( *rView.GetDocShell(), true );
783  rSh.UpdateAllCharts();
784  }
785  break;
786 
787  case FN_UPDATE_ALL:
788  {
789  comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer
791  rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true);
792 
793  SwView& rTempView = GetView();
794  rSh.EnterStdMode();
795  if( !rSh.GetLinkManager().GetLinks().empty() )
796  {
797  rSh.StartAllAction();
798  rSh.GetLinkManager().UpdateAllLinks( false, true, nullptr );
799  rSh.EndAllAction();
800  }
801  SfxDispatcher &rDis = *rTempView.GetViewFrame()->GetDispatcher();
802  rDis.Execute( FN_UPDATE_FIELDS );
803  rDis.Execute( FN_UPDATE_TOX );
804  rDis.Execute( FN_UPDATE_CHARTS );
805  rSh.Reformat();
806  }
807  break;
808 
810  rSh.UpdateInputFields();
811  break;
812 
813  case FN_PREV_BOOKMARK:
814  rReq.SetReturnValue(SfxBoolItem( nSlot, rSh.GoPrevBookmark()));
815  break;
816  case FN_NEXT_BOOKMARK:
817  rReq.SetReturnValue(SfxBoolItem( nSlot, rSh.GoNextBookmark()));
818  break;
819 
820  case FN_GOTO_NEXT_MARK:
821  case FN_GOTO_PREV_MARK:
822  {
823  SwFieldMgr aFieldMgr;
824  SwFieldType* pFieldType = aFieldMgr.GetFieldType(SwFieldIds::JumpEdit);
825 
826  if (pFieldType)
827  {
828  if (rSh.IsSelFrameMode())
829  {
830  rSh.UnSelectFrame();
831  rSh.LeaveSelFrameMode();
832  }
833 
834  if (rSh.HasMark())
835  {
836  SwMvContext aMvContext(&rSh);
837  if (rSh.IsCursorPtAtEnd())
838  rSh.SwapPam();
839  rSh.ClearMark();
840  rSh.EndSelect();
841  }
842  bool bRet = rSh.MoveFieldType( pFieldType, nSlot == FN_GOTO_NEXT_MARK );
843  SwField* pCurField = bRet ? rSh.GetCurField() : nullptr;
844  if (pCurField)
845  rSh.ClickToField(*pCurField, /*bExecHyperlinks=*/false);
846  rReq.SetReturnValue(SfxBoolItem( nSlot, bRet));
847  }
848  }
849  break;
850 
851  case FN_START_DOC_DIRECT:
852  case FN_END_DOC_DIRECT:
853  {
854  if (rSh.IsSelFrameMode())
855  {
856  rSh.UnSelectFrame();
857  rSh.LeaveSelFrameMode();
858  }
859  rSh.EnterStdMode();
860  nSlot == FN_START_DOC_DIRECT ?
861  rSh.SttEndDoc(true) :
862  rSh.SttEndDoc(false);
863  }
864  break;
865  case FN_GOTO_PREV_OBJ:
866  case FN_GOTO_NEXT_OBJ:
867  {
868  bool bSuccess = rSh.GotoObj( nSlot == FN_GOTO_NEXT_OBJ );
869  rReq.SetReturnValue(SfxBoolItem(nSlot, bSuccess));
870  if (bSuccess && !rSh.IsSelFrameMode())
871  {
872  rSh.HideCursor();
873  rSh.EnterSelFrameMode();
874  GetView().AttrChangedNotify(nullptr);
875  }
876  }
877  break;
878  case SID_GALLERY_FORMATS:
879  {
880  const SvxGalleryItem* pGalleryItem = SfxItemSet::GetItem<SvxGalleryItem>(pArgs, SID_GALLERY_FORMATS, false);
881  if ( !pGalleryItem )
882  break;
883 
884  const SelectionType nSelType = rSh.GetSelectionType();
885  sal_Int8 nGalleryItemType( pGalleryItem->GetType() );
886 
887  if ( (!rSh.IsSelFrameMode() || nSelType & SelectionType::Graphic) &&
888  nGalleryItemType == css::gallery::GalleryItemType::GRAPHIC )
889  {
890  SwWait aWait( *rView.GetDocShell(), true );
891 
892  OUString aGrfName, aFltName;
893  const Graphic aGrf( pGalleryItem->GetGraphic() );
894 
895  if ( nSelType & SelectionType::Graphic )
896  rSh.ReRead( aGrfName, aFltName, &aGrf );
897  else
898  rSh.Insert( aGrfName, aFltName, aGrf );
899 
901  }
902  else if(!rSh.IsSelFrameMode() &&
903  nGalleryItemType == css::gallery::GalleryItemType::MEDIA )
904  {
905  const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, pGalleryItem->GetURL() );
907  SID_INSERT_AVMEDIA, SfxCallMode::SYNCHRON,
908  { &aMediaURLItem });
909  }
910  }
911  break;
913  {
914  if (pArgs)
915  {
916  // Determine the current PageDescriptor and fill the set with that.
917  const size_t nCurIdx = rSh.GetCurPageDesc();
918  SwPageDesc aPageDesc(rSh.GetPageDesc(nCurIdx));
919 
920  SwFrameFormat &rFormat = aPageDesc.GetMaster();
921 
922  SwFormatCol aFormatCol = rFormat.GetCol();
923 
924  sal_uInt16 nCount;
925  if(SfxItemState::SET == pArgs->GetItemState(nSlot))
926  nCount = static_cast<const SfxUInt16Item &>(pArgs->Get(nSlot)).GetValue();
927  else
928  nCount = pArgs->Get(SID_ATTR_COLUMNS).GetValue();
929  sal_uInt16 nGutterWidth = DEF_GUTTER_WIDTH;
930 
931  aFormatCol.Init(nCount ? nCount : 1, nGutterWidth, USHRT_MAX);
932  aFormatCol.SetWishWidth(USHRT_MAX);
933  aFormatCol.SetGutterWidth(nGutterWidth, USHRT_MAX);
934 
935  rFormat.SetFormatAttr(aFormatCol);
936 
937  rSh.ChgPageDesc(nCurIdx, aPageDesc);
938  }
939  else
941  }
942  break;
946  {
947  sal_Unicode cDelim = 0;
948  bool bToTable = false;
949  if( nSlot == FN_CONVERT_TEXT_TO_TABLE ||
950  ( nSlot == FN_CONVERT_TEXT_TABLE && nullptr == rSh.GetTableFormat() ))
951  bToTable = true;
952  SwInsertTableOptions aInsTableOpts( SwInsertTableFlags::All, 1 );
953  SwTableAutoFormat const* pTAFormat = nullptr;
954  std::unique_ptr<SwTableAutoFormatTable> pAutoFormatTable;
955  bool bDeleteFormat = true;
956  if(pArgs && SfxItemState::SET == pArgs->GetItemState( FN_PARAM_1, true, &pItem))
957  {
958  aInsTableOpts.mnInsMode = SwInsertTableFlags::NONE;
959  // Delimiter
960  OUString sDelim = static_cast< const SfxStringItem* >(pItem)->GetValue();
961  if(!sDelim.isEmpty())
962  cDelim = sDelim[0];
963  // AutoFormat
964  if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_2, true, &pItem))
965  {
966  OUString sAutoFormat = static_cast< const SfxStringItem* >(pItem)->GetValue();
967 
968  pAutoFormatTable.reset(new SwTableAutoFormatTable);
969  pAutoFormatTable->Load();
970 
971  for( sal_uInt16 i = 0, nCount = pAutoFormatTable->size(); i < nCount; i++ )
972  {
973  SwTableAutoFormat const*const pFormat = &(*pAutoFormatTable)[ i ];
974  if( pFormat->GetName() == sAutoFormat )
975  {
976  pTAFormat = pFormat;
977  bDeleteFormat = false;
978  break;
979  }
980  }
981  }
982  //WithHeader
983  if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_3, true, &pItem) &&
984  static_cast< const SfxBoolItem* >(pItem)->GetValue())
985  aInsTableOpts.mnInsMode |= SwInsertTableFlags::Headline;
986  // RepeatHeaderLines
987  if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_4, true, &pItem))
988  aInsTableOpts.mnRowsToRepeat =
989  o3tl::narrowing<sal_uInt16>(static_cast< const SfxInt16Item* >(pItem)->GetValue());
990  //WithBorder
991  if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_5, true, &pItem) &&
992  static_cast< const SfxBoolItem* >(pItem)->GetValue())
994  //DontSplitTable
995  if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_6, true, &pItem) &&
996  !static_cast< const SfxBoolItem* >(pItem)->GetValue() )
998  }
999  else
1000  {
1003  if( RET_OK == pDlg->Execute() )
1004  {
1005  pDlg->GetValues( cDelim, aInsTableOpts, pTAFormat );
1006 
1007  }
1008  }
1009 
1010  if( cDelim )
1011  {
1012  //Shell change!
1013  SwView& rSaveView = rView;
1014  bool bInserted = false;
1015  //recording:
1016  SfxViewFrame* pViewFrame = GetView().GetViewFrame();
1017  if( SfxRequest::HasMacroRecorder(pViewFrame) )
1018  {
1019  SfxRequest aReq( pViewFrame, nSlot);
1020  aReq.AppendItem( SfxStringItem( FN_PARAM_1, OUString(cDelim) ));
1021  if(bToTable)
1022  {
1023  if(pTAFormat)
1024  aReq.AppendItem( SfxStringItem( FN_PARAM_2, pTAFormat->GetName()));
1025  aReq.AppendItem( SfxBoolItem ( FN_PARAM_3, bool(aInsTableOpts.mnInsMode & SwInsertTableFlags::Headline)));
1026  aReq.AppendItem( SfxInt16Item( FN_PARAM_4, static_cast<short>(aInsTableOpts.mnRowsToRepeat) ));
1027  aReq.AppendItem( SfxBoolItem ( FN_PARAM_5, bool(aInsTableOpts.mnInsMode & SwInsertTableFlags::DefaultBorder) ));
1028  aReq.AppendItem( SfxBoolItem ( FN_PARAM_6, !(aInsTableOpts.mnInsMode & SwInsertTableFlags::SplitLayout)));
1029  }
1030  aReq.Done();
1031  }
1032 
1033  if( !bToTable )
1034  rSh.TableToText( cDelim );
1035  else
1036  {
1037  bInserted = rSh.TextToTable( aInsTableOpts, cDelim, pTAFormat );
1038  }
1039  rSh.EnterStdMode();
1040 
1041  if( bInserted )
1042  rSaveView.AutoCaption( TABLE_CAP );
1043  }
1044  if(bDeleteFormat)
1045  delete pTAFormat;
1046  }
1047  break;
1048  case SID_STYLE_WATERCAN:
1049  case SID_STYLE_UPDATE_BY_EXAMPLE:
1050  case SID_STYLE_NEW_BY_EXAMPLE:
1051  case SID_STYLE_APPLY:
1052  {
1054  if ( ShellMode::Draw != eMode &&
1055  ShellMode::DrawForm != eMode &&
1056  ShellMode::DrawText != eMode &&
1057  ShellMode::Bezier != eMode )
1058  {
1059  // oj #107754#
1060  if ( SID_STYLE_WATERCAN == nSlot )
1061  {
1062  const bool bLockedView = rSh.IsViewLocked();
1063  rSh.LockView( true ); //lock visible section
1064 
1065  GetView().GetDocShell()->ExecStyleSheet(rReq);
1066 
1067  rSh.LockView( bLockedView );
1068  }
1069  else
1070  // Will be recorded from the DocShell
1071  GetView().GetDocShell()->ExecStyleSheet(rReq);
1072  }
1073  }
1074  break;
1075  case SID_CLASSIFICATION_APPLY:
1076  {
1077  GetView().GetDocShell()->Execute(rReq);
1078  }
1079  break;
1080  case SID_CLASSIFICATION_DIALOG:
1081  {
1082  GetView().GetDocShell()->Execute(rReq);
1083  }
1084  break;
1085  case SID_PARAGRAPH_SIGN_CLASSIFY_DLG:
1086  {
1087  GetView().GetDocShell()->Execute(rReq);
1088  }
1089  break;
1090  case SID_WATERMARK:
1091  {
1092  GetView().GetDocShell()->Execute(rReq);
1093  }
1094  break;
1095  case FN_ESCAPE:
1096  GetView().ExecuteSlot(rReq);
1097  break;
1098  case SID_IMAP:
1099  {
1100  sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
1101 
1102  SfxViewFrame* pVFrame = GetView().GetViewFrame();
1103  pVFrame->ToggleChildWindow( nId );
1104  pVFrame->GetBindings().Invalidate( SID_IMAP );
1105 
1106  if ( pVFrame->HasChildWindow( nId ) && rSh.IsFrameSelected() )
1107  lcl_UpdateIMapDlg( rSh );
1108  }
1109  break;
1110  case SID_IMAP_EXEC:
1111  {
1112  SvxIMapDlg* pDlg = GetIMapDlg(GetView());
1113 
1114  // Check, if the allocation is useful or allowed at all.
1115  if ( rSh.IsFrameSelected() &&
1116  pDlg->GetEditingObject() == rSh.GetIMapInventor() )
1117  {
1119  rSh.GetFlyFrameAttr( aSet );
1120  SwFormatURL aURL( aSet.Get( RES_URL ) );
1121  aURL.SetMap( &pDlg->GetImageMap() );
1122  aSet.Put( aURL );
1123  rSh.SetFlyFrameAttr( aSet );
1124  }
1125  }
1126  break;
1130  {
1131  SwViewOption aViewOption = *rSh.GetViewOptions();
1132  bool bAllInText = FN_SET_TRACKED_CHANGES_IN_TEXT == nSlot;
1133  aViewOption.SetShowChangesInMargin( !bAllInText );
1134  if ( !bAllInText )
1136  rSh.ApplyViewOptions( aViewOption );
1137 
1138  // tdf#140982 restore annotation ranges stored in temporary bookmarks
1139  // (only remove temporary bookmarks during file saving to avoid possible
1140  // conflict with lazy deletion of the bookmarks of the moved tracked deletions)
1141  if ( bAllInText || FN_SET_TRACKED_INSERTIONS_IN_MARGIN == nSlot )
1143  }
1144  break;
1145  case SID_CONTOUR_DLG:
1146  {
1147  sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
1148 
1149  SfxViewFrame* pVFrame = GetView().GetViewFrame();
1150  pVFrame->ToggleChildWindow( nId );
1151  pVFrame->GetBindings().Invalidate( SID_CONTOUR_DLG );
1152 
1153  SelectionType nSel = rSh.GetSelectionType();
1154  if ( pVFrame->HasChildWindow( nId ) &&
1156  {
1157  lcl_UpdateContourDlg( rSh, nSel );
1158  }
1159  }
1160  break;
1161  case SID_CONTOUR_EXEC:
1162  {
1163  SvxContourDlg *pDlg = GetContourDlg(GetView());
1164  // Check, if the allocation is useful or allowed at all.
1165  SelectionType nSel = rSh.GetSelectionType();
1167  {
1168  if (pDlg && pDlg->GetEditingObject() == rSh.GetIMapInventor())
1169  {
1170  rSh.StartAction();
1172  rSh.GetFlyFrameAttr( aSet );
1173  SwFormatSurround aSur( aSet.Get( RES_SURROUND ) );
1174  if ( !aSur.IsContour() )
1175  {
1176  aSur.SetContour( true );
1177  if ( aSur.GetSurround() == css::text::WrapTextMode_NONE )
1178  aSur.SetSurround( css::text::WrapTextMode_PARALLEL );
1179  aSet.Put( aSur );
1180  rSh.SetFlyFrameAttr( aSet );
1181  }
1182  const tools::PolyPolygon aPoly( pDlg->GetPolyPolygon() );
1183  rSh.SetGraphicPolygon( &aPoly );
1184  if ( pDlg->IsGraphicChanged() )
1185  rSh.ReRead( OUString(), OUString(), &pDlg->GetGraphic());
1186  rSh.EndAction();
1187  }
1188  }
1189  }
1190  break;
1191  case FN_FRAME_TO_ANCHOR:
1192  {
1193  rSh.GotoFlyAnchor();
1194  rSh.EnterStdMode();
1195  rSh.CallChgLnk();
1196  }
1197  break;
1198  case FN_TOOL_ANCHOR_PAGE:
1200  case FN_TOOL_ANCHOR_CHAR:
1202  case FN_TOOL_ANCHOR_FRAME:
1203  {
1204  RndStdIds eSet = nSlot == FN_TOOL_ANCHOR_PAGE
1205  ? RndStdIds::FLY_AT_PAGE
1206  : nSlot == FN_TOOL_ANCHOR_PARAGRAPH
1207  ? RndStdIds::FLY_AT_PARA
1208  : nSlot == FN_TOOL_ANCHOR_FRAME
1209  ? RndStdIds::FLY_AT_FLY
1210  : nSlot == FN_TOOL_ANCHOR_CHAR
1211  ? RndStdIds::FLY_AS_CHAR
1212  : RndStdIds::FLY_AT_CHAR;
1213  rSh.StartUndo();
1214  if (rSh.IsObjSelected())
1215  rSh.ChgAnchor(eSet);
1216  else if (rSh.IsFrameSelected())
1217  {
1218  SwFormatAnchor aAnc(eSet, rSh.GetPhyPageNum());
1220  rSh.SetFlyFrameAttr(aSet);
1221  }
1222  // if new anchor is 'as char' and it is a Math object and the usual
1223  // pre-conditions are met then align the formula to the baseline of the text
1224  const uno::Reference < embed::XEmbeddedObject > xObj( rSh.GetOleRef() );
1225  const bool bDoMathBaselineAlignment = xObj.is() && SotExchange::IsMath( xObj->getClassID() )
1226  && RndStdIds::FLY_AS_CHAR == eSet && rSh.GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT );
1227  if (bDoMathBaselineAlignment)
1228  rSh.AlignFormulaToBaseline( xObj );
1229 
1230  sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
1231  if( nHtmlMode )
1232  {
1234  rSh.GetFlyFrameAttr(aSet);
1235 
1236  const SwFormatSurround& rSurround = aSet.Get(RES_SURROUND);
1237  const SwFormatVertOrient& rVert = aSet.Get(RES_VERT_ORIENT);
1238  const SwFormatHoriOrient& rHori = aSet.Get(RES_HORI_ORIENT);
1239  sal_Int16 eVOrient = rVert.GetVertOrient();
1240  sal_Int16 eHOrient = rHori.GetHoriOrient();
1241  css::text::WrapTextMode eSurround = rSurround.GetSurround();
1242 
1243  switch( eSet )
1244  {
1245  case RndStdIds::FLY_AT_FLY:
1246  case RndStdIds::FLY_AT_PAGE:
1247  //Wrap through, left or from left, top, from top
1248  if(eSurround != css::text::WrapTextMode_THROUGH)
1249  aSet.Put(SwFormatSurround(css::text::WrapTextMode_THROUGH));
1250 
1251  if( eVOrient != text::VertOrientation::TOP && eVOrient != text::VertOrientation::NONE)
1252  aSet.Put(SwFormatVertOrient(0, text::VertOrientation::TOP));
1253 
1254  if (eHOrient != text::HoriOrientation::NONE && eHOrient != text::HoriOrientation::LEFT)
1255  aSet.Put(SwFormatHoriOrient(0, text::HoriOrientation::LEFT));
1256  break;
1257 
1258  case RndStdIds::FLY_AT_PARA:
1259  // left, from left, right, top, no wrap, wrap left and right
1260  if (eSurround != css::text::WrapTextMode_LEFT && eSurround != css::text::WrapTextMode_RIGHT)
1261  aSet.Put(SwFormatSurround(css::text::WrapTextMode_LEFT));
1262 
1263  if( eVOrient != text::VertOrientation::TOP)
1264  aSet.Put(SwFormatVertOrient(0, text::VertOrientation::TOP));
1265 
1266  if (eHOrient != text::HoriOrientation::NONE && eHOrient != text::HoriOrientation::LEFT && eHOrient != text::HoriOrientation::RIGHT)
1267  aSet.Put(SwFormatHoriOrient(0, text::HoriOrientation::LEFT));
1268  break;
1269 
1270  case RndStdIds::FLY_AT_CHAR:
1271  // left, from left, right, top, wrap through
1272  if(eSurround != css::text::WrapTextMode_THROUGH)
1273  aSet.Put(SwFormatSurround(css::text::WrapTextMode_THROUGH));
1274 
1275  if( eVOrient != text::VertOrientation::TOP)
1276  aSet.Put(SwFormatVertOrient(0, text::VertOrientation::TOP));
1277 
1278  if (eHOrient != text::HoriOrientation::NONE && eHOrient != text::HoriOrientation::LEFT && eHOrient != text::HoriOrientation::RIGHT)
1279  aSet.Put(SwFormatHoriOrient(0, text::HoriOrientation::LEFT));
1280  break;
1281 
1282  default:
1283  ;
1284  }
1285 
1286  if( aSet.Count() )
1287  rSh.SetFlyFrameAttr( aSet );
1288  }
1289  rSh.EndUndo();
1290 
1291  GetView().GetViewFrame()->GetBindings().Invalidate( SID_ANCHOR_MENU );
1292  }
1293  break;
1294 
1295  case FN_FRAME_NOWRAP:
1296  case FN_FRAME_WRAP:
1297  case FN_FRAME_WRAP_IDEAL:
1298  case FN_FRAME_WRAPTHRU:
1301  case FN_FRAME_WRAP_CONTOUR:
1302  case FN_WRAP_ANCHOR_ONLY:
1303  case FN_FRAME_WRAP_LEFT:
1304  case FN_FRAME_WRAP_RIGHT:
1305  SetWrapMode( nSlot );
1306  break;
1307 
1308  case FN_UPDATE_ALL_LINKS:
1309  {
1310  if( !rSh.GetLinkManager().GetLinks().empty() )
1311  {
1312  rSh.EnterStdMode();
1313  rSh.StartAllAction();
1314  rSh.GetLinkManager().UpdateAllLinks( false, false, nullptr );
1315  rSh.EndAllAction();
1316  }
1317  }
1318  break;
1319 
1320  case FN_XFORMS_DESIGN_MODE:
1321  if (pArgs && pArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET)
1322  {
1323  if (const SfxBoolItem* pBoolItem = dynamic_cast<const SfxBoolItem*>(pItem))
1324  {
1325  bool bDesignMode = pBoolItem->GetValue();
1326 
1327  // set from design mode
1328  OSL_ENSURE( GetView().GetFormShell() != nullptr, "form shell?" );
1329  SfxRequest aReq( GetView().GetViewFrame(), SID_FM_DESIGN_MODE );
1330  aReq.AppendItem( SfxBoolItem( SID_FM_DESIGN_MODE, bDesignMode ) );
1331  GetView().GetFormShell()->Execute( aReq );
1332  aReq.Done();
1333 
1334  // also set suitable view options
1335  SwViewOption aViewOption = *rSh.GetViewOptions();
1336  aViewOption.SetFormView( ! bDesignMode );
1337  rSh.ApplyViewOptions( aViewOption );
1338  }
1339  }
1340  break;
1341 
1342  default:
1343  bMore = true;
1344  }
1345 
1346 
1347  if(!bMore || !pArgs)
1348  return;
1349 
1350  pItem = nullptr;
1351  pArgs->GetItemState(GetPool().GetWhich(nSlot), false, &pItem);
1352  if(!pItem)
1353  return;
1354 
1355  switch(nSlot)
1356  {
1357  case SID_ATTR_BRUSH:
1358  case SID_ATTR_BORDER_SHADOW:
1359  case RES_SHADOW:
1360  {
1361  rSh.StartAllAction();
1362  // Table cell(s) selected?
1363  if ( rSh.IsTableMode() )
1364  {
1365  SwFrameFormat *pFormat = rSh.GetTableFormat();
1366  pFormat->SetFormatAttr( *pItem );
1367  }
1368  else if ( rSh.IsFrameSelected() )
1369  {
1370  // Set border attributes via Frame-Manager.
1371  SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE, nullptr );
1372  aMgr.SetAttrSet( *pArgs );
1373  aMgr.UpdateFlyFrame();
1374  }
1375  else
1376  {
1377  rSh.SetAttrSet( *pArgs );
1378  }
1379  rSh.EndAllAction();
1380  }
1381  break;
1387  {
1388  OSL_FAIL("not implemented");
1389  }
1390  break;
1391 
1392  case SID_ATTR_BORDER_OUTER:
1393  {
1394  // Table cell(s) selected?
1395  if ( rSh.IsTableMode() )
1396  {
1397  // Set border attributes Get/SetTabBorders()
1398  rSh.SetTabBorders(*pArgs);
1399  }
1400  else if ( rSh.IsFrameSelected() )
1401  {
1402  // Set border attributes via Frame-Manager.
1403  SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE, nullptr );
1404  aMgr.SetAttrSet(*pArgs);
1405  aMgr.UpdateFlyFrame();
1406  }
1407  else
1408  {
1409  // Set border attributes via shell quite normally.
1410  rSh.SetAttrItem( *pItem );
1411  }
1412  }
1413  break;
1414  default:
1415  OSL_FAIL("wrong Dispatcher");
1416  }
1417 }
1418 
1419 // Here the state for SID_IMAP / SID_CONTOUR will be handled
1420 // until the swapping of the graphic is finished.
1421 
1422 IMPL_LINK_NOARG(SwBaseShell, GraphicArrivedHdl, SwCursorShell&, void)
1423 {
1424  SwWrtShell &rSh = GetShell();
1425  if (CNT_GRF != rSh.SwEditShell::GetCntType())
1426  return;
1427  GraphicType const nGrfType(rSh.GetGraphicType());
1428  if (GraphicType::NONE == nGrfType || aGrfUpdateSlots.empty())
1429  return;
1430 
1432  SfxViewFrame* pVFrame = GetView().GetViewFrame();
1433  for( const auto nSlot : aGrfUpdateSlots )
1434  {
1435  bool bSetState = false;
1436  bool bState = false;
1437  switch( nSlot )
1438  {
1439  case SID_IMAP:
1440  case SID_IMAP_EXEC:
1441  {
1442  sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
1443  SfxChildWindow *pChildWindow = pVFrame->HasChildWindow(nId) ?
1444  pVFrame->GetChildWindow(nId) : nullptr;
1445  SvxIMapDlg *pDlg = pChildWindow ?
1446  static_cast<SvxIMapDlg*>(pChildWindow->GetController().get()) : nullptr;
1447 
1448  if( pDlg && ( SID_IMAP_EXEC == nSlot ||
1449  ( SID_IMAP == nSlot && !bProtect)) &&
1450  pDlg->GetEditingObject() != rSh.GetIMapInventor())
1451  lcl_UpdateIMapDlg( rSh );
1452 
1453  if( !bProtect && SID_IMAP == nSlot )
1454  {
1455  bSetState = true;
1456  bState = nullptr != pDlg;
1457  }
1458  }
1459  break;
1460 
1461  case SID_CONTOUR_DLG:
1462  if( !bProtect )
1463  {
1464  sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
1465  SfxChildWindow *pChildWindow = pVFrame->HasChildWindow(nId) ?
1466  pVFrame->GetChildWindow(nId) : nullptr;
1467  SvxIMapDlg *pDlg = pChildWindow ?
1468  static_cast<SvxIMapDlg*>(pChildWindow->GetController().get()) : nullptr;
1469  if( pDlg && pDlg->GetEditingObject() !=
1470  rSh.GetIMapInventor() )
1472 
1473  bSetState = true;
1474  bState = nullptr != pDlg;
1475  }
1476  break;
1477 
1478  case FN_FRAME_WRAP_CONTOUR:
1479  if( !bProtect )
1480  {
1482  rSh.GetFlyFrameAttr(aSet);
1483  const SwFormatSurround& rWrap = aSet.Get(RES_SURROUND);
1484  bSetState = true;
1485  bState = rWrap.IsContour();
1486  }
1487  break;
1488 
1489  case SID_GRFFILTER:
1490  case SID_GRFFILTER_INVERT:
1491  case SID_GRFFILTER_SMOOTH:
1492  case SID_GRFFILTER_SHARPEN:
1493  case SID_GRFFILTER_REMOVENOISE:
1494  case SID_GRFFILTER_SOBEL:
1495  case SID_GRFFILTER_MOSAIC:
1496  case SID_GRFFILTER_EMBOSS:
1497  case SID_GRFFILTER_POSTER:
1498  case SID_GRFFILTER_POPART:
1499  case SID_GRFFILTER_SEPIA:
1500  case SID_GRFFILTER_SOLARIZE:
1501  bSetState = bState = GraphicType::Bitmap == nGrfType;
1502  break;
1503  }
1504 
1505  if( bSetState )
1506  {
1507  SfxBoolItem aBool( nSlot, bState );
1508  if( pGetStateSet )
1509  pGetStateSet->Put( aBool );
1510  else
1511  pVFrame->GetBindings().SetState( aBool );
1512  }
1513  }
1514  aGrfUpdateSlots.clear();
1515 }
1516 
1518 {
1519  SwWrtShell &rSh = GetShell();
1520  SfxViewFrame* pVFrame = GetView().GetViewFrame();
1521  SfxWhichIter aIter( rSet );
1522  sal_uInt16 nWhich = aIter.FirstWhich();
1523  pGetStateSet = &rSet;
1524  while ( nWhich )
1525  {
1526  switch ( nWhich )
1527  {
1528  case SID_GALLERY_FORMATS:
1529  if ( rSh.IsObjSelected() ||
1530  (rSh.IsSelFrameMode() &&
1532  rSet.DisableItem( nWhich );
1533  break;
1534  case SID_GALLERY_ENABLE_ADDCOPY:
1535  // #108230# allow copy from gallery in Writer AND Writer/Web!
1536  rSet.Put( SfxBoolItem( SID_GALLERY_ENABLE_ADDCOPY, true ) );
1537  break;
1538  case FN_EDIT_REGION:
1539  if( !rSh.IsAnySectionInDoc() )
1540  rSet.DisableItem(nWhich);
1541  break;
1542 
1544  //tdf#112808 if cursor is in an index, don't show the edit section.
1545  if( !rSh.GetCurrSection() ||
1548  {
1549  rSet.DisableItem(nWhich);
1550  }
1551  break;
1552 
1553  case FN_INSERT_REGION:
1554  if( rSh.CursorInsideInputField()
1555  || rSh.IsSelFrameMode()
1556  || !rSh.IsInsRegionAvailable() )
1557  {
1558  rSet.DisableItem( nWhich );
1559  }
1560  break;
1561 
1563  {
1564  FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,true);
1565  if( (eFrameType & FrameTypeFlags::FOOTNOTE) ||
1566  !rSh.GetTableFormat() )
1567  rSet.DisableItem( nWhich );
1568  }
1569  break;
1571  {
1572  FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,true);
1573  if( (eFrameType & FrameTypeFlags::FOOTNOTE) ||
1574  !rSh.IsTextToTableAvailable() )
1575  rSet.DisableItem( nWhich );
1576  }
1577  break;
1578  case FN_CONVERT_TEXT_TABLE:
1579  {
1580  FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,true);
1581  if( (eFrameType & FrameTypeFlags::FOOTNOTE) ||
1582  (!rSh.GetTableFormat() && !rSh.IsTextToTableAvailable() ) )
1583  rSet.DisableItem( nWhich );
1584  }
1585  break;
1586  case RES_SHADOW:
1587  {
1589 
1590  // Table cell(s) selected?
1591  if ( rSh.IsTableMode() )
1592  {
1593  SwFrameFormat *pFormat = rSh.GetTableFormat();
1594  aSet.Put(pFormat->GetFormatAttr( nWhich ));
1595  }
1596  else if( rSh.IsFrameSelected() )
1597  {
1598  SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE, nullptr );
1599  aSet.Put( aMgr.GetAttrSet() );
1600  }
1601  else
1602  rSh.GetCurAttr( aSet );
1603 
1604  const SvxShadowItem& rShItem = static_cast<const SvxShadowItem&>(aSet.Get(nWhich));
1605  rSet.Put(rShItem);
1606  }
1607  break;
1608  case SID_IMAP:
1609  {
1610  // #i59688#
1611  // Improve efficiency:
1612  // If selected object is protected, item has to disabled.
1614  if ( bProtect )
1615  {
1616  rSet.DisableItem( nWhich );
1617  }
1618  else
1619  {
1620  const sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
1621  const bool bHas = pVFrame->HasChildWindow( nId );
1622  const bool bFrameSel = rSh.IsFrameSelected();
1623  const bool bIsGraphicSelection =
1625 
1626  // #i59688#
1627  // Avoid unnecessary loading of selected graphic.
1628  // The graphic is only needed, if the dialog is open.
1629  // If the swapping of the graphic is finished, the status
1630  // must be determined asynchronously, until this the slot
1631  // will be disabled.
1632  if ( bHas && bIsGraphicSelection && rSh.IsLinkedGrfSwapOut() )
1633  {
1634  if( AddGrfUpdateSlot( nWhich ))
1635  rSh.GetGraphic(false); // start the loading
1636  }
1637  else
1638  {
1639  if ( !bHas &&
1640  ( !bFrameSel ||
1641  ( bIsGraphicSelection &&
1642  rSh.GetGraphicType() == GraphicType::NONE ) ) )
1643  {
1644  rSet.DisableItem( nWhich );
1645  }
1646  else
1647  {
1648  SfxBoolItem aBool(nWhich, bHas);
1649  if ( bHas && bFrameSel )
1650  lcl_UpdateIMapDlg( rSh );
1651  rSet.Put(aBool);
1652  }
1653  }
1654  }
1655  }
1656  break;
1657  case SID_IMAP_EXEC:
1658  {
1659  bool bDisable = false;
1660  if( !rSh.IsFrameSelected())
1661  bDisable = true;
1662  sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
1663  if(!bDisable && pVFrame->HasChildWindow( nId ))
1664  {
1666  && rSh.IsLinkedGrfSwapOut())
1667  {
1668  if( AddGrfUpdateSlot( nWhich ))
1669  rSh.GetGraphic(false); // start the loading
1670  }
1671  else
1672  {
1673  SvxIMapDlg *pDlg = GetIMapDlg(GetView());
1674  if (pDlg && pDlg->GetEditingObject() != rSh.GetIMapInventor())
1675  lcl_UpdateIMapDlg( rSh );
1676  }
1677  }
1678  rSet.Put(SfxBoolItem(nWhich, bDisable));
1679  }
1680  break;
1681 
1682  case FN_BACKSPACE:
1683  case SID_DELETE:
1684  if ( ( rSh.HasReadonlySel() && !rSh.CursorInsideInputField() )
1686  {
1687  rSet.DisableItem( nWhich );
1688  }
1689  break;
1690 
1691  case SID_CONTOUR_DLG:
1692  {
1694 
1695  if( bParentCntProt || 0 != (HTMLMODE_ON & ::GetHtmlMode(
1696  GetView().GetDocShell() )) )
1697  rSet.DisableItem( nWhich );
1698  else
1699  {
1700  sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
1701  bool bHas = GetView().GetViewFrame()->HasChildWindow( nId );
1702  SelectionType nSel = rSh.GetSelectionType();
1703  bool bOk(nSel & (SelectionType::Graphic|SelectionType::Ole));
1704 
1705  bool bDisable = false;
1706  if( !bHas && !bOk )
1707  bDisable = true;
1708  // #i59688#
1709  // Avoid unnecessary loading of selected graphic.
1710  // The graphic is only needed, if the dialog is open.
1711  // If the swapping of the graphic is finished, the status
1712  // must be determined asynchronously, until this the slot
1713  // will be disabled.
1714  else if ( bHas && (nSel & SelectionType::Graphic) &&
1715  rSh.IsLinkedGrfSwapOut() )
1716  {
1717  if( AddGrfUpdateSlot( nWhich ))
1718  rSh.GetGraphic(false); // start the loading
1719  // #i75481#
1720  bDisable = true;
1721  }
1722  else if( bHas && bOk )
1723  bDisable = !lcl_UpdateContourDlg( rSh, nSel );
1724  else if( bOk )
1725  {
1726  // #i75481#
1727  // apply fix #i59688# only for selected graphics
1728  if ( nSel & SelectionType::Graphic )
1729  bDisable = GraphicType::NONE == rSh.GetGraphicType();
1730  else
1731  bDisable = GraphicType::NONE == rSh.GetIMapGraphic().GetType();
1732  }
1733 
1734  if( bDisable )
1735  rSet.DisableItem( nWhich );
1736  else
1737  rSet.Put( SfxBoolItem(nWhich, bHas) );
1738  }
1739  }
1740  break;
1741  case SID_CONTOUR_EXEC:
1742  {
1743  bool bDisable = false;
1744  SelectionType nSel = rSh.GetSelectionType();
1745  if( !(nSel & (SelectionType::Graphic|SelectionType::Ole)) )
1746  bDisable = true;
1747  sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
1748  if( !bDisable && GetView().GetViewFrame()->HasChildWindow( nId ))
1749  {
1750  SvxContourDlg *pDlg = GetContourDlg(GetView());
1751  if (pDlg && pDlg->GetEditingObject() != rSh.GetIMapInventor())
1752  bDisable = true;
1753  }
1754  rSet.Put(SfxBoolItem(nWhich, bDisable));
1755  }
1756  break;
1757 
1758  case SID_ANCHOR_MENU:
1759  case FN_TOOL_ANCHOR_PAGE:
1761  case FN_TOOL_ANCHOR_CHAR:
1763  case FN_TOOL_ANCHOR_FRAME:
1764  {
1765  bool bObj = 0 != rSh.IsObjSelected();
1767 
1768  if( !bParentCntProt && (bObj || rSh.IsFrameSelected()))
1769  {
1771  if(bObj)
1772  rSh.GetObjAttr(aSet);
1773  else
1774  rSh.GetFlyFrameAttr(aSet);
1775  RndStdIds eSet = aSet.Get(RES_ANCHOR).GetAnchorId();
1776  const bool bSet =
1777  ((nWhich == FN_TOOL_ANCHOR_PAGE) &&
1778  (eSet == RndStdIds::FLY_AT_PAGE))
1779  || ((nWhich == FN_TOOL_ANCHOR_PARAGRAPH) &&
1780  (eSet == RndStdIds::FLY_AT_PARA))
1781  || ((nWhich == FN_TOOL_ANCHOR_FRAME) &&
1782  (eSet == RndStdIds::FLY_AT_FLY))
1783  || ((nWhich == FN_TOOL_ANCHOR_AT_CHAR) &&
1784  (eSet == RndStdIds::FLY_AT_CHAR))
1785  || ((nWhich == FN_TOOL_ANCHOR_CHAR) &&
1786  (eSet == RndStdIds::FLY_AS_CHAR));
1787 
1788  if( nWhich == FN_TOOL_ANCHOR_FRAME && !rSh.IsFlyInFly() )
1789  rSet.DisableItem(nWhich);
1790  else if(nWhich != SID_ANCHOR_MENU)
1791  rSet.Put(SfxBoolItem(nWhich, bSet));
1792 
1794  {
1795  if (nWhich == FN_TOOL_ANCHOR_PAGE || nWhich == FN_TOOL_ANCHOR_FRAME)
1796  {
1797  rSet.DisableItem(nWhich);
1798  }
1799  }
1800  }
1801  else
1802  rSet.DisableItem( nWhich );
1803  }
1804  break;
1805  case FN_FRAME_NOWRAP:
1806  case FN_FRAME_WRAP:
1807  case FN_FRAME_WRAP_IDEAL:
1808  case FN_FRAME_WRAPTHRU:
1811  case FN_FRAME_WRAP_CONTOUR:
1812  case FN_WRAP_ANCHOR_ONLY:
1813  case FN_FRAME_WRAP_LEFT:
1814  case FN_FRAME_WRAP_RIGHT:
1815  {
1816  bool bObj = 0 != rSh.IsObjSelected();
1818 
1819  if( !bParentCntProt && (bObj || rSh.IsFrameSelected()))
1820  {
1822  RndStdIds nAnchorType;
1823  if(bObj)
1824  {
1825  rSh.GetObjAttr(aSet);
1826  nAnchorType = rSh.GetAnchorId();
1827  }
1828  else
1829  {
1830  rSh.GetFlyFrameAttr(aSet);
1831  nAnchorType = aSet.Get(RES_ANCHOR).GetAnchorId();
1832  }
1833  const SwFormatSurround& rWrap = aSet.Get(RES_SURROUND);
1834 
1835  const SvxOpaqueItem& rOpaque = aSet.Get(RES_OPAQUE);
1836  bool bOpaque = rOpaque.GetValue();
1837  css::text::WrapTextMode nSurround = rWrap.GetSurround();
1838  bool bSet = false;
1839 
1840  bool bDisable =
1841  (nAnchorType == RndStdIds::UNKNOWN) || (nAnchorType == RndStdIds::FLY_AS_CHAR);
1842  const bool bHtmlMode =
1843  0 != ::GetHtmlMode(GetView().GetDocShell());
1844 
1845  switch( nWhich )
1846  {
1847  case FN_FRAME_NOWRAP:
1848  bDisable |=
1849  ( (nAnchorType != RndStdIds::FLY_AT_PARA)
1850  && (nAnchorType != RndStdIds::FLY_AT_CHAR)
1851  && (nAnchorType != RndStdIds::FLY_AT_PAGE));
1852  bSet = nSurround == css::text::WrapTextMode_NONE;
1853  break;
1854  case FN_FRAME_WRAP:
1855  bDisable |= bHtmlMode;
1856  bSet = nSurround == css::text::WrapTextMode_PARALLEL;
1857  break;
1858  case FN_FRAME_WRAP_IDEAL:
1859  bDisable |= bHtmlMode;
1860  bSet = nSurround == css::text::WrapTextMode_DYNAMIC;
1861  break;
1862  case FN_FRAME_WRAPTHRU:
1863  bDisable |= (bHtmlMode ||
1864  ( (nAnchorType != RndStdIds::FLY_AT_PARA)
1865  && (nAnchorType != RndStdIds::FLY_AT_CHAR)
1866  && (nAnchorType != RndStdIds::FLY_AT_PAGE)));
1867  if(bObj)
1868  bSet = nSurround == css::text::WrapTextMode_THROUGH && rSh.GetLayerId();
1869  else
1870  bSet = nSurround == css::text::WrapTextMode_THROUGH && bOpaque;
1871  break;
1874  bDisable |= bHtmlMode;
1875  if(bObj)
1876  bSet = nSurround == css::text::WrapTextMode_THROUGH && !rSh.GetLayerId();
1877  else
1878  bSet = nSurround == css::text::WrapTextMode_THROUGH && !bOpaque;
1879  break;
1880  case FN_FRAME_WRAP_CONTOUR:
1881  bDisable |= bHtmlMode;
1882  //no contour available whenn no wrap or wrap through is set
1883  bDisable |= (nSurround == css::text::WrapTextMode_NONE || nSurround == css::text::WrapTextMode_THROUGH);
1884  if( !bDisable )
1885  {
1886  SelectionType nSel = rSh.GetSelectionType();
1887  if( (nSel & SelectionType::Graphic) &&
1888  rSh.IsLinkedGrfSwapOut())
1889  {
1890  if( AddGrfUpdateSlot( nWhich ))
1891  rSh.GetGraphic(false); // start the loading
1892  }
1893  else if( rSh.IsFrameSelected() )
1894  {
1895  // #i102253# applied patch from OD (see task)
1896  bDisable =
1897  nSel & SelectionType::Frame ||
1898  GraphicType::NONE == rSh.GetIMapGraphic().GetType();
1899  }
1900  }
1901  bSet = !bDisable && rWrap.IsContour();
1902 
1903  break;
1904  case FN_WRAP_ANCHOR_ONLY:
1905  bDisable |= (bHtmlMode ||
1906  (nAnchorType != RndStdIds::FLY_AT_PARA));
1907  bSet = rWrap.IsAnchorOnly();
1908  break;
1909  case FN_FRAME_WRAP_LEFT:
1910  bSet = nSurround == css::text::WrapTextMode_LEFT;
1911  break;
1912  case FN_FRAME_WRAP_RIGHT:
1913  bSet = nSurround == css::text::WrapTextMode_RIGHT;
1914  break;
1915  }
1916 
1917  if(bDisable)
1918  rSet.DisableItem(nWhich);
1919  else
1920  rSet.Put(SfxBoolItem(nWhich, bSet));
1921  }
1922  else
1923  rSet.DisableItem(nWhich);
1924  }
1925  break;
1926  case FN_UPDATE_CHARTS:
1927  if( !rSh.HasCharts() )
1928  rSet.DisableItem( nWhich );
1929  break;
1930  case FN_UPDATE_ALL_LINKS:
1931  if ( rSh.GetLinkManager().GetLinks().empty() )
1932  rSet.DisableItem(nWhich);
1933  break;
1934  case FN_XFORMS_DESIGN_MODE:
1935  // enable if in XForms document
1936  if( rSh.GetDoc()->isXForms() )
1937  {
1938  // determine current state from view options
1939  bool bValue = ! rSh.GetViewOptions()->IsFormView();
1940  rSet.Put( SfxBoolItem( nWhich, bValue ) );
1941  }
1942  else
1943  rSet.Put( SfxVisibilityItem( nWhich, false ) );
1944  break;
1945  }
1946  nWhich = aIter.NextWhich();
1947  }
1948  pGetStateSet = nullptr;
1949 }
1950 
1951 // Disable the slots with this status method
1952 
1954 {
1955  SfxWhichIter aIter(rSet);
1956  sal_uInt16 nWhich = aIter.FirstWhich();
1957 
1958  while (nWhich)
1959  {
1960  rSet.DisableItem( nWhich );
1961  nWhich = aIter.NextWhich();
1962  }
1963 }
1964 
1965 // Disable the slots with this status method
1966 
1968 {
1971 
1972  if ( bParentCntProt ||
1973  ShellMode::Draw == eMode ||
1974  ShellMode::DrawForm == eMode ||
1975  ShellMode::DrawText == eMode ||
1976  ShellMode::Bezier == eMode )
1977  {
1978  SfxWhichIter aIter( rSet );
1979  sal_uInt16 nWhich = aIter.FirstWhich();
1980  while ( nWhich )
1981  {
1982  rSet.DisableItem( nWhich );
1983  nWhich = aIter.NextWhich();
1984  }
1985  }
1986  else
1988 }
1989 
1990 void SwBaseShell::SetWrapMode( sal_uInt16 nSlot )
1991 {
1992  SwWrtShell &rSh = GetShell();
1993  bool bObj = 0 != rSh.IsObjSelected();
1994  if( !bObj && !rSh.IsFrameSelected())
1995  return;
1996 
1998  if(bObj)
1999  rSh.GetObjAttr(aSet);
2000  else
2001  rSh.GetFlyFrameAttr(aSet);
2002  SwFormatSurround aWrap( aSet.Get(RES_SURROUND) );
2003  css::text::WrapTextMode nOldSurround(aWrap.GetSurround());
2004  css::text::WrapTextMode nSurround = css::text::WrapTextMode_PARALLEL;
2005 
2006  switch (nSlot)
2007  {
2008  case FN_FRAME_NOWRAP:
2009  nSurround = css::text::WrapTextMode_NONE;
2010  if (aWrap.IsContour())
2011  aWrap.SetContour(false);
2012  break;
2013  case FN_FRAME_WRAP_IDEAL:
2014  nSurround = css::text::WrapTextMode_DYNAMIC;
2015  break;
2016  case FN_WRAP_ANCHOR_ONLY:
2017  aWrap.SetAnchorOnly(!aWrap.IsAnchorOnly());
2018 
2019  // keep previous wrapping
2020 
2021  // switch to wrap css::text::WrapTextMode_PARALLEL, if previous wrap is css::text::WrapTextMode_NONE
2022  if ( nOldSurround != css::text::WrapTextMode_NONE )
2023  {
2024  nSurround = nOldSurround;
2025  }
2026  break;
2027  case FN_FRAME_WRAP_CONTOUR:
2028  aWrap.SetContour(!aWrap.IsContour());
2029  // Contour is meaningless in no-wrap or wrap-through context. Otherwise keep existing wrap.
2030  if ( !aWrap.IsContour() ||
2031  ( nOldSurround != css::text::WrapTextMode_NONE &&
2032  nOldSurround != css::text::WrapTextMode_THROUGH ) )
2033  {
2034  nSurround = nOldSurround;
2035  }
2036  break;
2039  if (aWrap.IsContour())
2040  aWrap.SetContour(false);
2041  [[fallthrough]];
2042  case FN_FRAME_WRAPTHRU:
2043  nSurround = css::text::WrapTextMode_THROUGH;
2044  break;
2045 
2046  case FN_FRAME_WRAP_LEFT:
2047  nSurround = css::text::WrapTextMode_LEFT;
2048  break;
2049 
2050  case FN_FRAME_WRAP_RIGHT:
2051  nSurround = css::text::WrapTextMode_RIGHT;
2052  break;
2053 
2054  default:
2055  break;
2056  }
2057  aWrap.SetSurround(nSurround);
2058 
2059  if (nSlot != FN_FRAME_WRAP_CONTOUR)
2060  {
2061  // Defaulting the contour wrap on draw objects.
2062  if (bObj && nOldSurround != nSurround &&
2063  (nOldSurround == css::text::WrapTextMode_NONE || nOldSurround == css::text::WrapTextMode_THROUGH))
2064  {
2065  aWrap.SetContour(true);
2066  }
2067  }
2068 
2069  aSet.Put( aWrap );
2070 
2071  bool bOpaque = nSlot != FN_FRAME_WRAPTHRU_TRANSP && nSlot != FN_FRAME_WRAPTHRU_TOGGLE;
2072  if( nSlot == FN_FRAME_WRAPTHRU_TOGGLE )
2073  {
2074  if( bObj )
2075  bOpaque = !rSh.GetLayerId();
2076  else
2077  {
2078  const SvxOpaqueItem& aOpaque( aSet.Get(RES_OPAQUE) );
2079  bOpaque = !aOpaque.GetValue();
2080  }
2081  }
2082  aSet.Put(SvxOpaqueItem(RES_OPAQUE, bOpaque ));
2083 
2084  if(bObj)
2085  {
2086  rSh.SetObjAttr(aSet);
2087  if ( bOpaque )
2088  rSh.SelectionToHeaven();
2089  else
2090  rSh.SelectionToHell();
2091  }
2092  else
2093  rSh.SetFlyFrameAttr(aSet);
2094 
2095 }
2096 
2097 //Force update of the status line
2098 
2100 {
2101  eFrameMode = eMode;
2102  SfxBindings &rBnd = pSh->GetView().GetViewFrame()->GetBindings();
2103 
2104  if( eMode == FLY_DRAG || pSh->IsFrameSelected() || pSh->IsObjSelected() )
2105  {
2106  const SfxPointItem aTmp1( SID_ATTR_POSITION, pSh->GetAnchorObjDiff());
2107  const SvxSizeItem aTmp2( SID_ATTR_SIZE, pSh->GetObjSize());
2108  rBnd.SetState( aTmp1 );
2109  rBnd.SetState( aTmp2 );
2110  }
2111  else if( eMode == FLY_DRAG_END )
2112  {
2113  static sal_uInt16 aInval[] =
2114  {
2115  SID_ATTR_POSITION, SID_ATTR_SIZE, 0
2116  };
2117  rBnd.Invalidate(aInval);
2118  }
2119 }
2120 
2122  SfxShell( &rVw ),
2123  rView(rVw),
2124  pGetStateSet(nullptr)
2125 {
2126  SwWrtShell& rWrtSh = rView.GetWrtShell();
2127 
2128  SetPool(&rWrtSh.GetAttrPool());
2129  SetName("Base");
2130  rWrtSh.SetGrfArrivedLnk( LINK( this, SwBaseShell, GraphicArrivedHdl));
2131 }
2132 
2134 {
2135  if( rView.GetCurShell() == this )
2136  rView.ResetSubShell();
2137 
2138  Link<SwCursorShell&,void> aTmp( LINK( this, SwBaseShell, GraphicArrivedHdl));
2139  if( aTmp == rView.GetWrtShell().GetGrfArrivedLnk() )
2141 }
2142 
2144 {
2145  const SfxItemSet *pArgs = rReq.GetArgs();
2146 
2147  if( pArgs)
2148  {
2149  SwWrtShell &rSh = GetShell();
2150  std::unique_ptr<SvxScriptSetItem> pSSetItem;
2151  sal_uInt16 nSlot = rReq.GetSlot();
2152  SfxItemPool& rPool = rSh.GetAttrPool();
2153  sal_uInt16 nWhich = rPool.GetWhich( nSlot );
2154  SvtScriptType nScripts = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX;
2157  RES_CHRATR_CTL_FONTSIZE, RES_CHRATR_CTL_FONTSIZE>
2158  aHeightSet( GetPool() );
2159 
2160  switch( nSlot )
2161  {
2162  case SID_ATTR_CHAR_FONT:
2163  {
2164  nScripts = rSh.GetScriptType();
2165  // #i42732# input language should be preferred over
2166  // current cursor position to detect script type
2167  if(!rSh.HasSelection())
2168  {
2169  LanguageType nInputLang = GetView().GetEditWin().GetInputLanguage();
2170  if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM)
2171  nScripts = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang );
2172  }
2173  [[fallthrough]];
2174  }
2175  case SID_ATTR_CHAR_POSTURE:
2176  case SID_ATTR_CHAR_WEIGHT:
2177  {
2178  pSSetItem.reset(new SvxScriptSetItem( nSlot, rPool ));
2179  pSSetItem->PutItemForScriptType( nScripts, pArgs->Get( nWhich ));
2180  pArgs = &pSSetItem->GetItemSet();
2181  }
2182  break;
2183  case SID_ATTR_CHAR_FONTHEIGHT:
2184  {
2185  if(rSh.HasSelection())
2186  {
2187  pSSetItem.reset(new SvxScriptSetItem( nSlot, rPool ));
2188  pSSetItem->PutItemForScriptType( nScripts, pArgs->Get( nWhich ));
2189  pArgs = &pSSetItem->GetItemSet();
2190  }
2191  else
2192  {
2193  nScripts = rSh.GetScriptType();
2194  LanguageType nInputLang = GetView().GetEditWin().GetInputLanguage();
2195  if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM)
2196  nScripts = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang );
2197  sal_uInt32 nHeight = static_cast< const SvxFontHeightItem& >(pArgs->Get( nWhich )).GetHeight();
2198  SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig();
2199 
2202  RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_LANGUAGE>
2203  aLangSet( GetPool() );
2204  rSh.GetCurAttr( aLangSet );
2205 
2206  sal_Int32 nWesternSize =
2208  aLangSet.Get( RES_CHRATR_LANGUAGE).GetLanguage());
2209  sal_Int32 nCJKSize =
2211  aLangSet.Get( RES_CHRATR_CJK_LANGUAGE).GetLanguage());
2212  sal_Int32 nCTLSize =
2214  aLangSet.Get( RES_CHRATR_CTL_LANGUAGE).GetLanguage());
2215 
2216  switch(nScripts)
2217  {
2218  case SvtScriptType::LATIN:
2219  nCJKSize = nHeight * nCJKSize / nWesternSize;
2220  nCTLSize = nHeight * nCTLSize / nWesternSize;
2221  nWesternSize = static_cast<sal_Int32>(nHeight);
2222  break;
2223  case SvtScriptType::ASIAN:
2224  nCTLSize = nHeight* nCTLSize / nCJKSize;
2225  nWesternSize = nHeight * nWesternSize / nCJKSize;
2226  nCJKSize = static_cast<sal_Int32>(nHeight);
2227  break;
2228  case SvtScriptType::COMPLEX:
2229  nCJKSize = nHeight * nCJKSize / nCTLSize;
2230  nWesternSize = nHeight * nWesternSize / nCTLSize;
2231  nCTLSize = static_cast<sal_Int32>(nHeight);
2232  break;
2233  default: break;
2234  }
2235  aHeightSet.Put( SvxFontHeightItem( static_cast<sal_uInt32>(nWesternSize), 100, RES_CHRATR_FONTSIZE ));
2236  aHeightSet.Put( SvxFontHeightItem( static_cast<sal_uInt32>(nCJKSize), 100, RES_CHRATR_CJK_FONTSIZE ));
2237  aHeightSet.Put( SvxFontHeightItem( static_cast<sal_uInt32>(nCTLSize), 100, RES_CHRATR_CTL_FONTSIZE ));
2238  pArgs = &aHeightSet;
2239  }
2240  }
2241  break;
2242  }
2243 
2244  if( pArgs )
2245  {
2246  bool bAuto = false;
2247  if ( !isCHRATR(nWhich) ||
2248  ( rSh.HasSelection() && rSh.IsSelFullPara() ) )
2249  {
2250  SwTextFormatColl * pColl = rSh.GetCurTextFormatColl();
2251  if ( pColl && pColl->IsAutoUpdateFormat() )
2252  {
2253  rSh.AutoUpdatePara( pColl, *pArgs );
2254  bAuto = true;
2255  }
2256  }
2257 
2258  if (!bAuto)
2259  {
2260  rSh.SetAttrSet( *pArgs );
2261  }
2262  }
2263  }
2264  else
2265  GetView().GetViewFrame()->GetDispatcher()->Execute( SID_CHAR_DLG );
2266  rReq.Done();
2267 }
2268 
2270 {
2271  SwWrtShell &rSh = GetShell();
2272  rSh.GetCurAttr( rSet );
2273 }
2274 
2276 {
2277  SwWrtShell &rSh = GetShell();
2278  bool bFirst = true;
2279  std::optional<SfxItemSet> pFntCoreSet;
2280  SvtScriptType nScriptType = SvtScriptType::LATIN;
2281  SfxWhichIter aIter( rSet );
2282  sal_uInt16 nWhich = aIter.FirstWhich();
2283  while( nWhich )
2284  {
2285  switch( nWhich )
2286  {
2287  case RES_CHRATR_FONT:
2288  case RES_CHRATR_FONTSIZE:
2289  case RES_CHRATR_WEIGHT:
2290  case RES_CHRATR_POSTURE:
2291  {
2292  if( !pFntCoreSet )
2293  {
2294  pFntCoreSet.emplace( *rSet.GetPool(),
2296  rSh.GetCurAttr( *pFntCoreSet );
2297  nScriptType = rSh.GetScriptType();
2298  // #i42732# input language should be preferred over
2299  // current cursor position to detect script type
2300  SwEditWin& rEditWin = GetView().GetEditWin();
2301  if( rEditWin.IsUseInputLanguage() )
2302  {
2303  if(!rSh.HasSelection() && (
2304  nWhich == RES_CHRATR_FONT ||
2305  nWhich == RES_CHRATR_FONTSIZE ))
2306  {
2307  LanguageType nInputLang = rEditWin.GetInputLanguage();
2308  if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM)
2309  nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang );
2310  }
2311  }
2312  }
2313  SfxItemPool& rPool = *rSet.GetPool();
2314  SvxScriptSetItem aSetItem( rPool.GetSlotId( nWhich ), rPool );
2315  aSetItem.GetItemSet().Put( *pFntCoreSet, false );
2316  const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType );
2317  if( pI )
2318  {
2319  rSet.Put( pI->CloneSetWhich(nWhich) );
2320  }
2321  else
2322  rSet.InvalidateItem( nWhich );
2323  // Set input context of the SwEditWin according to the selected font and script type
2324  if(RES_CHRATR_FONT == nWhich)
2325  {
2326  vcl::Font aFont;
2327  if (const SvxFontItem* pFontItem = dynamic_cast<const SvxFontItem*>(pI))
2328  {
2329  aFont.SetFamilyName(pFontItem->GetFamilyName());
2330  aFont.SetStyleName(pFontItem->GetStyleName());
2331  aFont.SetFamily(pFontItem->GetFamily());
2332  aFont.SetPitch(pFontItem->GetPitch());
2333  aFont.SetCharSet(pFontItem->GetCharSet());
2334  }
2335 
2336  bool bVertical = rSh.IsInVerticalText();
2337  aFont.SetOrientation(Degree10(bVertical ? 2700 : 0));
2338  aFont.SetVertical(bVertical);
2339  GetView().GetEditWin().SetInputContext( InputContext( aFont, InputContextFlags::Text |
2340  InputContextFlags::ExtText ) );
2341  }
2342  }
2343  break;
2344 
2345  default:
2346  if( bFirst )
2347  {
2348  rSh.GetCurAttr( rSet );
2349  bFirst = false;
2350  }
2351  }
2352  nWhich = aIter.NextWhich();
2353  }
2354 }
2355 
2357 {
2358  SwWrtShell &rSh = GetShell();
2359  SfxWhichIter aIter(rSet);
2360  sal_uInt16 nWhich(aIter.FirstWhich());
2361  SelectionType nSelType(rSh.GetSelectionType());
2362  std::unique_ptr<SvxBrushItem> aBrushItem(std::make_unique<SvxBrushItem>(RES_BACKGROUND));
2363 
2364  if( nWhich == SID_TABLE_CELL_BACKGROUND_COLOR )
2365  {
2366  rSh.GetBoxBackground( aBrushItem );
2367  }
2368  else
2369  {
2370  // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set
2372 
2373  aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet());
2374 
2375  if(nSelType & SelectionType::Graphic || SelectionType::Frame & nSelType)
2376  {
2377  rSh.GetFlyFrameAttr(aCoreSet);
2378  }
2379  else
2380  {
2381  rSh.GetCurAttr(aCoreSet);
2382  }
2383 
2384  aBrushItem = getSvxBrushItemFromSourceSet(aCoreSet, RES_BACKGROUND);
2385  }
2386 
2387  while(nWhich)
2388  {
2389  switch(nWhich)
2390  {
2391  case SID_BACKGROUND_COLOR:
2392  case SID_TABLE_CELL_BACKGROUND_COLOR:
2393  {
2394  SvxColorItem aColorItem(aBrushItem->GetColor(), nWhich);
2395  rSet.Put(aColorItem);
2396  break;
2397  }
2398  case SID_ATTR_BRUSH:
2399  case RES_BACKGROUND:
2400  {
2401  // if this was intended to have a independent copy of the Item to be set
2402  // this is not needed due to the ItemSet/Pool cloning Items which get set anyways.
2403  // Keeping code as reference - it may have had other reasons I do notz see (?!?)
2404  // std::unique_ptr<SfxPoolItem> pNewItem(aBrushItem.CloneSetWhich(GetPool().GetWhich(nWhich)));
2405  rSet.Put(*aBrushItem);
2406  break;
2407  }
2408  }
2409 
2410  nWhich = aIter.NextWhich();
2411  }
2412 }
2413 
2415 {
2416  SwWrtShell &rSh = GetShell();
2417  SelectionType nSelType(rSh.GetSelectionType());
2418  const SfxItemSet* pArgs = rReq.GetArgs();
2419  sal_uInt16 nSlot(rReq.GetSlot());
2420 
2421  if (!pArgs && nSlot != SID_BACKGROUND_COLOR && nSlot != SID_TABLE_CELL_BACKGROUND_COLOR)
2422  {
2423  return;
2424  }
2425 
2426  std::unique_ptr<SvxBrushItem> aBrushItem(std::make_unique<SvxBrushItem>(RES_BACKGROUND));
2427 
2428  if ( nSlot == SID_TABLE_CELL_BACKGROUND_COLOR )
2429  {
2430  rSh.GetBoxBackground( aBrushItem );
2431  }
2432  else
2433  {
2434  // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set
2436 
2437  aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet());
2438 
2439  if((SelectionType::Frame & nSelType) || (SelectionType::Graphic & nSelType))
2440  {
2441  rSh.GetFlyFrameAttr(aCoreSet);
2442  }
2443  else
2444  {
2445  rSh.GetCurAttr(aCoreSet);
2446  }
2447 
2448  aBrushItem = getSvxBrushItemFromSourceSet(aCoreSet, RES_BACKGROUND);
2449  }
2450 
2451  switch(nSlot)
2452  {
2453  case SID_BACKGROUND_COLOR:
2454  case SID_TABLE_CELL_BACKGROUND_COLOR:
2455  {
2456  const SfxPoolItem* pColorStringItem = nullptr;
2457  bool bIsTransparent = false;
2458 
2459  aBrushItem->SetGraphicPos(GPOS_NONE);
2460 
2461  sal_uInt16 nSlotId = (nSlot == SID_BACKGROUND_COLOR) ? SID_BACKGROUND_COLOR : SID_TABLE_CELL_BACKGROUND_COLOR;
2462  if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem))
2463  {
2464  OUString sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue();
2465  if (sColor == "transparent")
2466  {
2467  bIsTransparent = true;
2468  }
2469  else
2470  {
2471  Color aColor(ColorTransparency, sColor.toInt32(16));
2472 
2473  aBrushItem->SetColor(aColor);
2474 
2475  SvxColorItem aNewColorItem(nSlotId);
2476  aNewColorItem.SetValue(aColor);
2477 
2478  GetView().GetViewFrame()->GetBindings().SetState(aNewColorItem);
2479  }
2480  }
2481  else if (pArgs)
2482  {
2483  const SvxColorItem& rNewColorItem = static_cast<const SvxColorItem&>(pArgs->Get(nSlotId));
2484  const Color& rNewColor = rNewColorItem.GetValue();
2485  aBrushItem->SetColor(rNewColor);
2486  GetView().GetViewFrame()->GetBindings().SetState(rNewColorItem);
2487  }
2488  else
2489  {
2490  bIsTransparent = true;
2491  }
2492 
2493  if (bIsTransparent)
2494  {
2495  aBrushItem->SetColor(COL_TRANSPARENT);
2497  }
2498  break;
2499  }
2500 
2501  case SID_ATTR_BRUSH:
2502  case RES_BACKGROUND:
2503  {
2504  assert(pArgs && "only SID_BACKGROUND_COLOR can have !pArgs, checked at entry");
2505  aBrushItem.reset(static_cast<SvxBrushItem*>(pArgs->Get(GetPool().GetWhich(nSlot)).Clone()));
2506  break;
2507  }
2508  default:
2509  {
2510  rReq.Ignore();
2511  OSL_FAIL("unknown message in ExecuteAttr!" );
2512  return;
2513  }
2514  }
2515 
2516  if ( nSlot == SID_TABLE_CELL_BACKGROUND_COLOR )
2517  {
2518  rSh.SetBoxBackground( *aBrushItem );
2519  }
2520  else
2521  {
2522  // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set
2524 
2525  aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet());
2526  setSvxBrushItemAsFillAttributesToTargetSet(*aBrushItem, aCoreSet);
2527 
2528  if((SelectionType::Frame & nSelType) || (SelectionType::Graphic & nSelType))
2529  {
2530  // Template autoupdate
2531  SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat();
2532 
2533  if(pFormat && pFormat->IsAutoUpdateFormat())
2534  {
2535  rSh.AutoUpdateFrame(pFormat, aCoreSet);
2536  }
2537  else
2538  {
2539  rSh.SetFlyFrameAttr(aCoreSet);
2540  }
2541  }
2542  else
2543  {
2544  SwTextFormatColl* pColl = rSh.GetCurTextFormatColl();
2545 
2546  if(pColl && pColl->IsAutoUpdateFormat())
2547  {
2548  rSh.AutoUpdatePara(pColl, aCoreSet);
2549  }
2550  else
2551  {
2552  rSh.SetAttrSet(aCoreSet);
2553  }
2554  }
2555  }
2556 
2557  rReq.Done();
2558 }
2559 
2561 {
2562  SwWrtShell &rSh = GetShell();
2563  // Table cell(s) selected?
2564  bool bPrepare = true;
2565  bool bTableMode = rSh.IsTableMode();
2566  if ( bTableMode )
2567  {
2569  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> aCoreSet( GetPool() );
2570  SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
2571  aCoreSet.Put( aBoxInfo );
2572  rSh.GetTabBorders( aCoreSet );
2573  rSet.Put( aCoreSet );
2574  }
2575  else if ( rSh.IsFrameSelected() )
2576  {
2577  SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE, nullptr );
2578  rSet.Put( aMgr.GetAttrSet() );
2579  bPrepare = false;
2580  }
2581  else
2582  // Get border attributes via shell quite normal
2583  rSh.GetCurAttr( rSet );
2584  if ( bPrepare )
2585  ::PrepareBoxInfo( rSet, rSh );
2586  // Switch the border toolbox controller mode
2587  rSet.Put( SfxBoolItem( SID_BORDER_REDUCED_MODE, !bTableMode ));
2588 }
2589 
2591 {
2592  SwWrtShell &rSh = GetShell();
2593  weld::Window* pMDI = GetView().GetFrameWeld();
2594  // So that from the basic no dialogues for the background views are called:
2595  bool bBackground = (&GetView() != GetActiveView());
2596  const SfxPoolItem* pItem = nullptr;
2597  const SfxItemSet* pArgs = rReq.GetArgs();
2598 
2599  sal_uInt16 nSlot = rReq.GetSlot();
2600  const SfxItemSet* pOutSet = nullptr;
2601  bool bDone = false;
2602  if(pArgs)
2603  pArgs->GetItemState( GetPool().GetWhich(nSlot), false, &pItem );
2604 
2605  switch ( nSlot )
2606  {
2608  {
2612  aContext.maEndDialogFn = [](sal_Int32){};
2613  pDlg->StartExecuteAsync(aContext);
2614  }
2615  break;
2616  case FN_FORMAT_PAGE_DLG:
2619  {
2620  if( !bBackground )
2621  {
2622  const size_t nCurIdx = rSh.GetCurPageDesc();
2623  const SwPageDesc& rPageDesc = rSh.GetPageDesc( nCurIdx );
2624  // Temporary view, because the shell does not need to be valid after the dialog
2625  // for example disable header
2626  SwView& rTempView = GetView();
2627 
2628  OString sPageId;
2629  switch (nSlot)
2630  {
2632  sPageId = "columns";
2633  break;
2635  sPageId = "page";
2636  break;
2637  case FN_FORMAT_PAGE_DLG:
2638  if (pItem)
2639  sPageId = OUStringToOString(static_cast<const SfxStringItem*>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8);
2640  break;
2641  }
2642  rTempView.GetDocShell()->FormatPage(rPageDesc.GetName(), sPageId, rSh, &rReq);
2643  rTempView.InvalidateRulerPos();
2644 
2645  bDone = true; // FormatPage() takes care of calling Done()
2646  }
2647  }
2648  break;
2649  case FN_FORMAT_BORDER_DLG:
2650  {
2652  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> aSet( rSh.GetAttrPool() );
2654  // Table cell(s) selected?
2655  if ( rSh.IsTableMode() )
2656  {
2657  // Set border attributes Get/SetTabBorders()
2658  ::PrepareBoxInfo( aSet, rSh );
2659  rSh.GetTabBorders( aSet );
2661  pDlg.disposeAndReset(pFact->CreateSwBorderDlg(pMDI, aSet, SwBorderModes::TABLE));
2662  if ( pDlg->Execute() == RET_OK )
2663  {
2664  rSh.SetTabBorders( *pDlg->GetOutputItemSet() );
2665  pOutSet = pDlg->GetOutputItemSet();
2666  }
2667  }
2668  else if ( rSh.IsFrameSelected() )
2669  {
2670  // Set border attributes via Frame-Manager
2671  SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE, nullptr );
2672  aSet.Put( aMgr.GetAttrSet() );
2673 
2675  pDlg.disposeAndReset(pFact->CreateSwBorderDlg(pMDI, aSet, SwBorderModes::FRAME));
2676  if ( pDlg->Execute() == RET_OK )
2677  {
2678  aMgr.SetAttrSet( *pDlg->GetOutputItemSet() );
2679  aMgr.UpdateFlyFrame();
2680  pOutSet = pDlg->GetOutputItemSet();
2681  }
2682  }
2683  else
2684  {
2685  // Set border attributes via Shell quite normal
2686  rSh.GetCurAttr( aSet );
2687  ::PrepareBoxInfo( aSet, rSh );
2688 
2690  pDlg.disposeAndReset(pFact->CreateSwBorderDlg(pMDI, aSet, SwBorderModes::PARA));
2691  if ( pDlg->Execute() == RET_OK )
2692  {
2693  rSh.SetAttrSet( *pDlg->GetOutputItemSet() );
2694  pOutSet = pDlg->GetOutputItemSet();
2695  }
2696  }
2697  if(pOutSet)
2698  {
2699  rReq.Done(*pOutSet);
2700  bDone = true;
2701  }
2702  }
2703  break;
2705  {
2708 
2711 
2712  // Table cell(s) selected?
2713  if ( rSh.IsTableMode() )
2714  {
2715  // Get background attributes of the table and put it in the set
2716  // tdf#144843 calling GetBoxBackground *requires* an incarnation to be handed over
2717  std::unique_ptr<SvxBrushItem> aBrush(std::make_unique<SvxBrushItem>(RES_BACKGROUND));
2718  rSh.GetBoxBackground( aBrush );
2719  pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
2720  aSet.Put( *aBrush );
2721  if ( pDlg->Execute() == RET_OK )
2722  {
2723 
2724  rSh.SetBoxBackground( pDlg->GetOutputItemSet()->Get( RES_BACKGROUND ) );
2725  pOutSet = pDlg->GetOutputItemSet();
2726  }
2727  }
2728  else if ( rSh.IsFrameSelected() )
2729  {
2730 
2731  rSh.GetFlyFrameAttr( aSet );
2732 
2733  pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
2734  if ( pDlg->Execute() == RET_OK )
2735  {
2736  rSh.SetFlyFrameAttr(const_cast<SfxItemSet &>(*pDlg->GetOutputItemSet()) );
2737  pOutSet = pDlg->GetOutputItemSet();
2738  }
2739  }
2740  else
2741  {
2742  // Set border attributes Umrandungsattribute with the shell quite normal.
2743  rSh.GetCurAttr( aSet );
2744 
2745  pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
2746  if ( pDlg->Execute() == RET_OK )
2747  {
2748  rSh.SetAttrSet( *pDlg->GetOutputItemSet() );
2749  pOutSet = pDlg->GetOutputItemSet();
2750  }
2751  }
2752  if(pOutSet)
2753  {
2754  rReq.Done(*pOutSet);
2755  bDone = true;
2756  }
2757  }
2758  break;
2759  case SID_ACCESSIBILITY_CHECK:
2760  {
2761  sw::AccessibilityCheck aCheck(rSh.GetDoc());
2762  aCheck.check();
2763  svx::AccessibilityCheckDialog aDialog(pMDI, aCheck.getIssueCollection());
2764  aDialog.run();
2765  }
2766  break;
2767  default:OSL_FAIL("wrong Dispatcher (basesh.cxx)");
2768  }
2769  if(!bDone)
2770  rReq.Done();
2771 }
2772 
2774 {
2775  return rView.GetWrtShell();
2776 }
2777 
2779 {
2780  return rView.GetWrtShellPtr();
2781 }
2782 
2783 static void EndUndo(SwWrtShell& rSh)
2784 {
2785  SwRewriter aRewriter;
2786 
2787  if (rSh.GetTableFormat())
2788  {
2789  aRewriter.AddRule(UndoArg1, SwResId(STR_START_QUOTE));
2790  aRewriter.AddRule(UndoArg2, rSh.GetTableFormat()->GetName());
2791  aRewriter.AddRule(UndoArg3, SwResId(STR_END_QUOTE));
2792 
2793  }
2794  rSh.EndUndo(SwUndoId::INSTABLE, &aRewriter); // If possible change the Shell
2795 }
2796 
2797 static void InsertTableImpl(SwWrtShell& rSh,
2798  SwView &rTempView,
2799  const OUString& aTableName,
2800  sal_uInt16 nRows,
2801  sal_uInt16 nCols,
2802  SwInsertTableOptions aInsTableOpts,
2803  const OUString& aAutoName,
2804  const std::unique_ptr<SwTableAutoFormat>& pTAFormat)
2805 {
2807 
2808  rSh.StartAllAction();
2809  if( rSh.HasSelection() )
2810  rSh.DelRight();
2811 
2812  rSh.InsertTable( aInsTableOpts, nRows, nCols, pTAFormat.get() );
2814 
2815  if( !aTableName.isEmpty() && !rSh.GetTableStyle( aTableName ) )
2816  rSh.GetTableFormat()->SetName( aTableName );
2817 
2818  if( pTAFormat != nullptr && !aAutoName.isEmpty()
2819  && aAutoName != SwViewShell::GetShellRes()->aStrNone )
2820  {
2821  SwTableNode* pTableNode = const_cast<SwTableNode*>( rSh.IsCursorInTable() );
2822  if ( pTableNode )
2823  {
2824  pTableNode->GetTable().SetTableStyleName( aAutoName );
2825  SwUndoTableAutoFormat* pUndo = new SwUndoTableAutoFormat( *pTableNode, *pTAFormat );
2826  if ( pUndo )
2827  rSh.GetIDocumentUndoRedo().AppendUndo( std::unique_ptr<SwUndo>(pUndo) );
2828  }
2829  }
2830 
2831  rSh.EndAllAction();
2832  rTempView.AutoCaption(TABLE_CAP);
2833 }
2834 
2836 {
2837  const SfxItemSet* pArgs = _rRequest.GetArgs();
2838  SwWrtShell& rSh = GetShell();
2839 
2840  if ( rSh.GetFrameType( nullptr, true ) & FrameTypeFlags::FOOTNOTE )
2841  return;
2842 
2843  SwView &rTempView = GetView(); // Because GetView() does not work after the shell exchange
2844  bool bHTMLMode = 0 != (::GetHtmlMode(rTempView.GetDocShell())&HTMLMODE_ON);
2845  bool bCallEndUndo = false;
2846 
2847  if( !pArgs && rSh.IsSelection() && !rSh.IsInClickToEdit() &&
2848  !rSh.IsTableMode() )
2849  {
2850  const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
2851  SwInsertTableOptions aInsTableOpts = pModOpt->GetInsTableFlags(bHTMLMode);
2852 
2854  bCallEndUndo = true;
2855 
2856  bool bInserted = rSh.TextToTable( aInsTableOpts, '\t' );
2857  rSh.EnterStdMode();
2858  if (bInserted)
2859  rTempView.AutoCaption(TABLE_CAP);
2860  _rRequest.Done();
2861  }
2862  else
2863  {
2864  sal_uInt16 nColsIn = 0;
2865  sal_uInt16 nRowsIn = 0;
2866  SwInsertTableOptions aInsTableOptsIn( SwInsertTableFlags::All, 1 );
2867  OUString aTableNameIn;
2868  OUString aAutoNameIn;
2869  std::unique_ptr<SwTableAutoFormat> pTAFormatIn;
2870 
2871  if( pArgs && pArgs->Count() >= 2 )
2872  {
2874  const SfxUInt16Item* pCols = _rRequest.GetArg<SfxUInt16Item>(SID_ATTR_TABLE_COLUMN);
2875  const SfxUInt16Item* pRows = _rRequest.GetArg<SfxUInt16Item>(SID_ATTR_TABLE_ROW);
2876  const SfxInt32Item* pFlags = _rRequest.GetArg<SfxInt32Item>(FN_PARAM_1);
2877  const SfxStringItem* pAuto = _rRequest.GetArg<SfxStringItem>(FN_PARAM_2);
2878 
2879  if ( pName )
2880  aTableNameIn = pName->GetValue();
2881  if ( pCols )
2882  nColsIn = pCols->GetValue();
2883  if ( pRows )
2884  nRowsIn = pRows->GetValue();
2885  if ( pAuto )
2886  {
2887  aAutoNameIn = pAuto->GetValue();
2888  if ( !aAutoNameIn.isEmpty() )
2889  {
2890  SwTableAutoFormatTable aTableTable;
2891  aTableTable.Load();
2892  for ( size_t n=0; n<aTableTable.size(); n++ )
2893  {
2894  if ( aTableTable[n].GetName() == aAutoNameIn )
2895  {
2896  pTAFormatIn.reset(new SwTableAutoFormat( aTableTable[n] ));
2897  break;
2898  }
2899  }
2900  }
2901  }
2902 
2903  if ( pFlags )
2904  aInsTableOptsIn.mnInsMode = static_cast<SwInsertTableFlags>(pFlags->GetValue());
2905  else
2906  {
2907  const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
2908  aInsTableOptsIn = pModOpt->GetInsTableFlags(bHTMLMode);
2909  }
2910  }
2911 
2912  if( !nColsIn || !nRowsIn )
2913  {
2915  std::shared_ptr<AbstractInsTableDlg> pAbstractDialog(pFact->CreateInsTableDlg(rTempView));
2916  std::shared_ptr<weld::DialogController> pDialogController(pAbstractDialog->getDialogController());
2917 
2918  weld::DialogController::runAsync(pDialogController,
2919  [pAbstractDialog, &rSh, &rTempView, aTableNameIn, nRowsIn, nColsIn, aInsTableOptsIn, aAutoNameIn] (sal_Int32 nResult) {
2920  if( RET_OK == nResult )
2921  {
2922  sal_uInt16 nCols = nColsIn;
2923  sal_uInt16 nRows = nRowsIn;
2924  SwInsertTableOptions aInsTableOpts = aInsTableOptsIn;
2925  OUString aTableName = aTableNameIn;
2926  OUString aAutoName = aAutoNameIn;
2927  std::unique_ptr<SwTableAutoFormat> pTAFormat;
2928 
2929  pAbstractDialog->GetValues( aTableName, nRows, nCols, aInsTableOpts, aAutoName, pTAFormat );
2930 
2931  if( nCols && nRows )
2932  {
2933  InsertTableImpl( rSh, rTempView, aTableName, nRows, nCols, aInsTableOpts, aAutoName, pTAFormat );
2934  EndUndo(rSh);
2935  }
2936  }
2937  }
2938  );
2939  }
2940  else
2941  {
2942  // record before shell change
2943  _rRequest.AppendItem( SfxStringItem( FN_INSERT_TABLE, aTableNameIn ) );
2944  if ( !aAutoNameIn.isEmpty() )
2945  _rRequest.AppendItem( SfxStringItem( FN_PARAM_2, aAutoNameIn ) );
2946  _rRequest.AppendItem( SfxUInt16Item( SID_ATTR_TABLE_COLUMN, nColsIn ) );
2947  _rRequest.AppendItem( SfxUInt16Item( SID_ATTR_TABLE_ROW, nRowsIn ) );
2948  _rRequest.AppendItem( SfxInt32Item( FN_PARAM_1, static_cast<sal_Int32>(aInsTableOptsIn.mnInsMode) ) );
2949  _rRequest.Done();
2950 
2951  InsertTableImpl( rSh, rTempView, aTableNameIn, nRowsIn, nColsIn, aInsTableOptsIn, aAutoNameIn, pTAFormatIn );
2952 
2953  bCallEndUndo = true;
2954  }
2955  }
2956 
2957  if( bCallEndUndo )
2958  EndUndo(rSh);
2959 }
2960 
2962 {
2963  SwWrtShell &rSh = GetShell();
2964  SfxWhichIter aIter( rSet );
2965  sal_uInt16 nWhich = aIter.FirstWhich();
2966  switch ( nWhich )
2967  {
2968  case SID_GALLERY_BG_BRUSH:
2969  {
2970  SelectionType nSel = rSh.GetSelectionType();
2971  SfxStringListItem aLst( nWhich );
2972  std::vector<OUString> &rLst = aLst.GetList();
2975  nHeaderPos = nFooterPos = 0;
2976  sal_uInt8 nPos = 1;
2977  rLst.push_back( SwResId( STR_SWBG_PAGE ) );
2978  nPagePos = nPos++;
2979  sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
2980  bool bHtmlMode = 0 != (nHtmlMode & HTMLMODE_ON);
2981 
2982  if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_FULL_STYLES)) &&
2983  (nSel & SelectionType::Text) )
2984  {
2985  rLst.push_back( SwResId( STR_SWBG_PARAGRAPH ) );
2986  nParagraphPos = nPos++;
2987  }
2988  if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_SOME_STYLES)) &&
2990  {
2991  rLst.push_back( SwResId( STR_SWBG_TABLE ) );
2992  nTablePos = nPos++;
2993 
2994  if(!bHtmlMode)
2995  {
2996  rLst.push_back( SwResId( STR_SWBG_TABLE_ROW ) );
2997  nTableRowPos = nPos++;
2998  }
2999 
3000  rLst.push_back( SwResId( STR_SWBG_TABLE_CELL) );
3001  nTableCellPos = nPos++;
3002  }
3003  if(!bHtmlMode)
3004  {
3005  if ( nSel & SelectionType::Frame )
3006  {
3007  rLst.push_back( SwResId( STR_SWBG_FRAME ) );
3008  nFramePos = nPos++;
3009  }
3010  if ( nSel & SelectionType::Graphic )
3011  {
3012  rLst.push_back( SwResId( STR_SWBG_GRAPHIC ) );
3013  nGraphicPos = nPos++;
3014  }
3015  if ( nSel & SelectionType::Ole )
3016  {
3017  rLst.push_back( SwResId( STR_SWBG_OLE ) );
3018  nOlePos = nPos++;
3019  }
3020  const FrameTypeFlags nType = rSh.GetFrameType(nullptr,true);
3021  if ( nType & FrameTypeFlags::HEADER )
3022  {
3023  rLst.push_back( SwResId( STR_SWBG_HEADER ) );
3024  nHeaderPos = nPos++;
3025  }
3026  if ( nType & FrameTypeFlags::FOOTER )
3027  {
3028  rLst.push_back( SwResId( STR_SWBG_FOOTER ) );
3029  nFooterPos = nPos;
3030  }
3031  }
3032  if ( rLst.empty() )
3033  rSet.DisableItem( nWhich );
3034  else
3035  rSet.Put( aLst );
3036  break;
3037  }
3038  }
3039 }
3040 
3042 {
3043  SwWrtShell &rSh = GetShell();
3044  rSh.StartAction();
3045  const SfxItemSet* pArgs = rReq.GetArgs();
3046  sal_uInt16 nSlot = rReq.GetSlot();
3047  switch(nSlot)
3048  {
3049  case SID_GALLERY_BG_BRUSH:
3050  {
3051  if ( !pArgs )
3052  break;
3053 
3054  SelectionType nSel = rSh.GetSelectionType();
3055  if ( nSel & SelectionType::DrawObjectEditMode )
3056  break;
3057 
3058  const SfxUInt16Item* pPos = rReq.GetArg<SfxUInt16Item>(SID_GALLERY_BG_POS);
3059  const SvxBrushItem* pBrush = rReq.GetArg<SvxBrushItem>(SID_GALLERY_BG_BRUSH);
3060  if ( !pPos || !pBrush )
3061  break;
3062 
3063  sal_uInt8 nPos = pPos->GetValue();
3064  ++nPos;
3065 
3066  SvxBrushItem aBrush( *pBrush );
3067  aBrush.SetWhich( RES_BACKGROUND );
3068  if ( nPos == nParagraphPos )
3069  rSh.SetAttrItem( aBrush );
3070  else if ( nPos == nTablePos )
3071  rSh.SetTabBackground( aBrush );
3072  else if ( nPos == nTableRowPos )
3073  rSh.SetRowBackground( aBrush );
3074  else if ( nPos == nTableCellPos )
3075  rSh.SetBoxBackground( aBrush );
3076  else if ( nPos == nFramePos || nPos == nGraphicPos || nPos == nOlePos )
3077  {
3079  aCoreSet.Put( aBrush );
3080  rSh.SetFlyFrameAttr( aCoreSet );
3081  }
3082  else if ( nPos == nPagePos || nPos == nHeaderPos || nPos == nFooterPos )
3083  {
3084  sal_uInt16 nDesc = rSh.GetCurPageDesc();
3085  SwPageDesc aDesc( rSh.GetPageDesc( nDesc ) );
3086  if ( nPos == nPagePos )
3087  aDesc.GetMaster().SetFormatAttr( aBrush );
3088  else if ( nPos == nHeaderPos )
3089  {
3090  SwFormatHeader aHead( aDesc.GetMaster().GetHeader() );
3091  aHead.GetHeaderFormat()->SetFormatAttr( aBrush );
3092  aDesc.GetMaster().SetFormatAttr( aHead );
3093  }
3094  else if ( nPos == nFooterPos )
3095  {
3096  SwFormatFooter aFoot( aDesc.GetMaster().GetFooter() );
3097  aFoot.GetFooterFormat()->SetFormatAttr( aBrush );
3098  aDesc.GetMaster().SetFormatAttr( aFoot );
3099  }
3100  rSh.ChgPageDesc( nDesc, aDesc );
3101  }
3102  break;
3103  }
3104  }
3105  rSh.EndAction();
3106  rReq.Done();
3107 }
3108 
3110 {
3111  sal_uInt16 nSlot = rReq.GetSlot();
3112  switch( nSlot )
3113  {
3114 #if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
3115  case FN_CHANGE_DBFIELD:
3116  {
3119  pDlg->Execute();
3120  }
3121  break;
3122 #endif
3123  default:
3124  OSL_FAIL("wrong dispatcher");
3125  }
3126 }
3127 
3128 std::shared_ptr<std::vector<std::unique_ptr<SwPaM>>> SwBaseShell::CopyPaMRing(SwPaM& rOrig)
3129 {
3130  auto vCursors = std::make_shared<std::vector<std::unique_ptr<SwPaM>>>();
3131  vCursors->emplace_back(std::make_unique<SwPaM>(rOrig, nullptr));
3132  for (auto& rCursor : rOrig.GetRingContainer())
3133  {
3134  if (&rCursor != &rOrig)
3135  vCursors->emplace_back(std::make_unique<SwPaM>(rCursor, vCursors->front().get()));
3136  }
3137  return vCursors;
3138 }
3139 
3140 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetFamily(FontFamily)
const SfxPoolItem * ExecuteSlot(SfxRequest &rReq, const SfxInterface *pIF=nullptr)
std::shared_ptr< SfxDialogController > & GetController()
#define FN_SET_TRACKED_DELETIONS_IN_MARGIN
Definition: cmdid.h:192
SwFieldType * GetFieldType(SwFieldIds nResId, size_t nField=0) const
Definition: fldmgr.cxx:414
SfxViewFrame * GetViewFrame() const
SFX_IMPL_SUPERCLASS_INTERFACE(DrawDocShell, SfxObjectShell)
static sal_uInt8 nOlePos
Definition: basesh.cxx:112
bool GetValue() const
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:241
#define FN_PAGE_STYLE_SET_COLS
Definition: cmdid.h:384
bool IsContour() const
Definition: fmtsrnd.hxx:53
#define FN_FRAME_WRAP_RIGHT
Definition: cmdid.h:413
#define FN_UPDATE_ALL_LINKS
Definition: cmdid.h:120
#define FONT_GROUP_CTL
Definition: fontcfg.hxx:48
void SetWishWidth(sal_uInt16 nNew)
Definition: fmtclds.hxx:134
bool IsInClickToEdit() const
Definition: wrtsh.hxx:648
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(101)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
#define FN_UPDATE_TOX
Definition: cmdid.h:504
URL aURL
const css::uno::Reference< css::graphic::XGraphic > & GetGraphic() const
SwNode & GetNode(bool bPoint=true) const
Definition: pam.hxx:224
SwTextFormatColl * GetCurTextFormatColl() const
Get the named paragraph format of the current selection.
Definition: edattr.cxx:238
#define FN_FRAME_WRAP
Definition: cmdid.h:329
FlyMode
Definition: mdiexp.hxx:40
void SetGrfArrivedLnk(const Link< SwCursorShell &, void > &rLnk)
Definition: crsrsh.hxx:487
bool bVisible
Represents the style of a paragraph.
Definition: fmtcol.hxx:56
bool IsInVerticalText(const Point *pPt=nullptr) const
Definition: crsrsh.cxx:3434
#define FN_EDIT_REGION
Definition: cmdid.h:108
static sal_uInt8 nGraphicPos
Definition: basesh.cxx:111
bool IsPasteSpecialAllowed()
Definition: view.cxx:1841
void GetTextCtrlState(SfxItemSet &rSet)
Definition: basesh.cxx:2269
void ChgAnchor(RndStdIds eAnchorId, bool bSameOnly=false, bool bPosCorr=true)
frmatr.hxx.
Definition: feshview.cxx:2349
SfxChildWindow * GetChildWindow(sal_uInt16)
#define FONT_STANDARD
Definition: fontcfg.hxx:27
SwView & GetView()
Definition: basesh.hxx:59
void ExecTextCtrl(SfxRequest &rReq)
Definition: basesh.cxx:2143
void GetGalleryState(SfxItemSet &)
Definition: basesh.cxx:2961
void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId=nullptr)
Definition: viewdlg2.cxx:180
bool HasCharts() const
Definition: viewsh.cxx:729
const Link< SwCursorShell &, void > & GetGrfArrivedLnk() const
Definition: crsrsh.hxx:488
#define FN_GOTO_NEXT_OBJ
Definition: cmdid.h:679
OUString GetRepeatString() const
Definition: wrtundo.cxx:138
#define FN_FRAME_TO_ANCHOR
Definition: cmdid.h:697
virtual std::shared_ptr< AbstractInsTableDlg > CreateInsTableDlg(SwView &rView)=0
virtual void DoRepair(bool bRepair)=0
Enable repair mode.
void SaveTableBoxContent(const SwPosition *pPos=nullptr)
Definition: trvltbl.cxx:870
bool isCHRATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:476
static std::shared_ptr< std::vector< std::unique_ptr< SwPaM > > > CopyPaMRing(SwPaM &rOrig)
Definition: basesh.cxx:3128
SwView * GetActiveView()
Definition: swmodul1.cxx:116
void ReRead(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic=nullptr)
Re-read if graphic is not ok. Current graphic is replaced by the new one.
Definition: editsh.cxx:295
void SetState(const SfxItemSet &rSet)
static constexpr auto Items
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2601
bool GotoPrevTable(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosTable, bool bInReadOnly)
Definition: trvltbl.cxx:481
static void GetDefaultTargetList(TargetList &)
bool SttEndDoc(bool bStt)
Definition: crsrsh.cxx:573
SwUndoId
Definition: swundo.hxx:29
SwDocShell * GetDocShell()
Definition: doc.hxx:1352
virtual VclPtr< VclAbstractDialog > CreateSwChangeDBDlg(SwView &rVw)=0
sfx2::LinkManager & GetLinkManager()
Definition: editsh.cxx:593
void ClearTableBoxContent()
Definition: trvltbl.cxx:909
std::string GetValue
void UpdateChart()
Definition: tablemgr.cxx:172
void SetRowBackground(const SvxBrushItem &rNew)
Definition: fetab.cxx:770
std::unique_ptr< SvxBrushItem > getSvxBrushItemFromSourceSet(const SfxItemSet &rSourceSet, sal_uInt16 nBackgroundID, bool bSearchInParents, bool bXMLImportHack)
static SfxItemSetFixed< RES_VERT_ORIENT, RES_ANCHOR > makeItemSetFromFormatAnchor(SfxItemPool &rPool, const SwFormatAnchor &rAnchor)
Definition: fefly1.cxx:1139
signed char sal_Int8
bool IsPasteSpreadsheet(bool bHasOwnTableCopied)
Definition: view.cxx:1867
void ExecuteGallery(SfxRequest &)
Definition: basesh.cxx:3041
void * GetIMapInventor() const
Unique identification of object (for ImageMapDlg).
Definition: editsh.cxx:598
bool IsTableMode() const
Definition: crsrsh.hxx:643
GPOS_NONE
bool IsSttPara() const
Definition: crsrsh.cxx:1094
bool MoveFieldType(const SwFieldType *pFieldType, const bool bNext, const SwFieldIds nResType=SwFieldIds::Unknown, const bool bAddSetExpressionFieldsToInputFields=true)
Definition: crstrvl.cxx:694
SwWrtShell * GetShellPtr()
Definition: basesh.cxx:2778
SfxDispatcher * GetDispatcher()
SwWrtShell & GetShell()
Definition: basesh.cxx:2773
void SelectionToHeaven()
Above document.
Definition: feshview.cxx:1230
static SvxAbstractDialogFactory * Create()
void SetWrapMode(sal_uInt16 nSlot)
Definition: basesh.cxx:1990
static bool IsPaste(const SwWrtShell &, const TransferableDataHelper &)
Definition: swdtflvr.cxx:1384
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
constexpr::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
Size GetObjSize() const
Definition: feshview.cxx:2380
virtual short run() override
#define CNT_GRF
Definition: editsh.hxx:130
bool GetLastUndoInfo(OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const
Definition: edws.cxx:237
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
#define FN_TOOL_ANCHOR_PAGE
Definition: cmdid.h:224
Base class of all fields.
Definition: fldbas.hxx:290
static sal_uInt8 nTableCellPos
Definition: basesh.cxx:116
void SetAttrSet(const SfxItemSet &, SetAttrMode nFlags=SetAttrMode::DEFAULT, SwPaM *pCursor=nullptr, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:151
#define FN_INSERT_REGION
Definition: cmdid.h:281
SwInsertTableFlags mnInsMode
Definition: itabenum.hxx:40
sal_Int64 n
Check only parents.
GraphicType
css::uno::Reference< css::frame::XModel3 > GetModel() const
static bool PasteFormat(SwWrtShell &rSh, TransferableDataHelper &rData, SotClipboardFormatId nFormat)
Definition: swdtflvr.cxx:3345
sal_uInt16 GetValue() const
virtual void restoreAnnotationMarks(bool bDelete=true)=0
void InvalidateItem(sal_uInt16 nWhich)
sal_Int16 nId
sal_uInt16 FirstWhich()
virtual VclPtr< SfxAbstractDialog > CreateSwBackgroundDialog(weld::Window *pParent, const SfxItemSet &rSet)=0
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
void UpdateAllCharts()
update all charts for which any table exists
Definition: viewsh.cxx:722
void GetTextFontCtrlState(SfxItemSet &rSet)
Definition: basesh.cxx:2275
void UpdateInputFields(SwInputFieldList *pLst=nullptr)
Definition: wrtsh2.cxx:143
bool TextToTable(const SwInsertTableOptions &rInsTableOpts, sal_Unicode cCh, const SwTableAutoFormat *pTAFormat=nullptr)
Definition: edtab.cxx:132
void GetDoStrings(DoType eDoType, SfxStringListItem &rStrLstItem) const
Definition: wrtundo.cxx:115
void EnterStdMode()
Definition: select.cxx:551
void ExecClpbrd(SfxRequest &)
Definition: basesh.cxx:283
#define FN_XFORMS_DESIGN_MODE
Definition: cmdid.h:595
SwEditWin & GetEditWin()
Definition: view.hxx:416
bool IsSelFullPara() const
Definition: crsrsh.cxx:3398
void Done(bool bRemove=false)
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(99)
void SetCharSet(rtl_TextEncoding)
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1790
void AutoUpdatePara(SwTextFormatColl *pColl, const SfxItemSet &rStyleSet, SwPaM *pPaM=nullptr)
Definition: wrtsh1.cxx:1710
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
virtual void PreGetFormat(const TransferableDataHelper &aHelper)=0
void ResetSubShell()
Definition: view.hxx:582
sal_Int32 GetFontHeight(sal_uInt8 nFont, sal_uInt8 nScriptType, LanguageType eLang)
Definition: fontcfg.cxx:299
void EndAllAction()
Definition: edws.cxx:97
static sal_uInt8 nTableRowPos
Definition: basesh.cxx:115
#define FN_PASTE_NESTED_TABLE
Definition: cmdid.h:298
void SetContour(bool bNew)
Definition: fmtsrnd.hxx:57
void FlushInBuffer()
Character buffer is inserted into the document.
Definition: edtwin.cxx:872
sal_uInt16 mnRowsToRepeat
Definition: itabenum.hxx:41
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
SfxShell * GetCurShell()
Definition: view.hxx:575
void SetUseInputLanguage(bool bNew)
#i42732# display status of font size/name depending on either the input language or the selection pos...
Definition: edtwin.cxx:6387
#define FN_FRAME_WRAP_IDEAL
Definition: cmdid.h:400
void ExecBckCol(SfxRequest &rReq)
Definition: basesh.cxx:2414
sal_uInt16 NextWhich()
void StateStyle(SfxItemSet &)
Definition: basesh.cxx:1967
SwInsertTableFlags
Definition: itabenum.hxx:25
bool DelRight()
Definition: delete.cxx:295
constexpr SwTwips DEF_GUTTER_WIDTH
Definition: swtypes.hxx:66
const OUString & GetName() const
Definition: pagedesc.hxx:196
SwWrtShell & GetWrtShell() const
Definition: view.hxx:413
const SwSection * GetCurrSection() const
Definition: edsect.cxx:71
#define FONT_GROUP_DEFAULT
Definition: fontcfg.hxx:46
void SwapPam()
Definition: crsrsh.cxx:975
void SetTabBackground(const SvxBrushItem &rNew)
Definition: fetab.cxx:851
static sal_uInt8 nPagePos
Definition: basesh.cxx:117
#define FN_PAGE_STYLE_SET_PAPER_BIN
Definition: cmdid.h:382
Used by the UI to modify the document model.
Definition: wrtsh.hxx:93
void ToggleChildWindow(sal_uInt16)
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:165
static bool runAsync(const std::shared_ptr< DialogController > &rController, const std::function< void(sal_Int32)> &)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(102)
SfxItemSet * pGetStateSet
Definition: basesh.hxx:48
sal_uInt16 sal_Unicode
#define FN_SET_TRACKED_INSERTIONS_IN_MARGIN
Definition: cmdid.h:193
const SwTable & InsertTable(const SwInsertTableOptions &rInsTableOpts, sal_uInt16 nRows, sal_uInt16 nCols, const SwTableAutoFormat *pTAFormat=nullptr)
Definition: edtab.cxx:101
const SwView & GetView() const
Definition: wrtsh.hxx:431
const Graphic & GetGraphic() const
const SwFrameFormat * IsFlyInFly()
Is selected frame within another frame?
Definition: fefly1.cxx:312
void SttCursorMove()
Definition: crsrsh.cxx:301
virtual bool GetFirstRedoInfo(OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const =0
Get Id and comment of first Redo action.
constexpr TypedWhichId< SwFormatHoriOrient > RES_HORI_ORIENT(103)
#define FN_EDIT_CURRENT_REGION
Definition: cmdid.h:110
SvxIMapDlg * GetIMapDlg()
void ExecStyleSheet(SfxRequest &)
Definition: docst.cxx:292
#define FN_PAGE_STYLE_SET_PAPER_SIZE
Definition: cmdid.h:381
const tools::PolyPolygon * GetGraphicPolygon() const
Definition: editsh.cxx:319
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CTL_LANGUAGE(29)
OUString aStrNone
Definition: shellres.hxx:46
void ExecDlg(SfxRequest &)
Definition: basesh.cxx:2590
#define FN_PAGE_STYLE_SET_NUMBER_FORMAT
Definition: cmdid.h:383
const OUString & GetName() const
Definition: format.hxx:115
SwField * GetCurField(const bool bIncludeInputFieldAtStart=false) const
Definition: crstrvl.cxx:929
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
int nCount
#define FN_FRAME_WRAP_LEFT
Definition: cmdid.h:412
#define FN_TOOL_ANCHOR_CHAR
Definition: cmdid.h:247
virtual void SetName(const OUString &rNewName, bool bBroadcast=false) override
Definition: atrfrm.cxx:2570
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
sal_Int8 GetType() const
Point GetAnchorObjDiff() const
Methods for status line.
Definition: feshview.cxx:2393
bool IsAnchorOnly() const
Definition: fmtsrnd.hxx:52
#define FN_GOTO_NEXT_MARK
Definition: cmdid.h:711
const SfxItemSet & GetAttrSet() const
Definition: frmmgr.hxx:124
Mode eMode
static bool HasMacroRecorder(SfxViewFrame const *pFrame)
const SwTable & GetTable() const
Definition: node.hxx:500
static bool Paste(SwWrtShell &, TransferableDataHelper &, RndStdIds nAnchorType=RndStdIds::FLY_AT_PARA, bool bIgnoreComments=false, PasteTableType ePasteTable=PasteTableType::PASTE_DEFAULT)
Definition: swdtflvr.cxx:1460
SwDoc * GetDoc() const
Definition: viewsh.hxx:282
void GetGrfNms(OUString *pGrfName, OUString *pFltName, const SwFlyFrameFormat *=nullptr) const
Returns the name and the filter name of a graphic if the pointer is on a graphic. ...
Definition: editsh.cxx:305
void ExecField(SfxRequest const &rReq)
Definition: basesh.cxx:3109
tools::PolyPolygon GetPolyPolygon()
SotClipboardFormatId
#define FN_FRAME_WRAPTHRU_TOGGLE
Definition: cmdid.h:401
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
SwFrameFormat * GetTableStyle(std::u16string_view rFormatName)
Definition: wrtsh1.cxx:1659
const OUString & GetName() const
bool IsGraphicChanged() const
ShellMode
Definition: view.hxx:85
void DelNumRules()
Delete, split enumeration list.
Definition: ednumber.cxx:272
OUString GetDoString(DoType eDoType) const
Definition: wrtundo.cxx:95
static sal_uInt16 IsMath(const SvGlobalName &rName)
const sal_Unicode cDelim
void Insert(SwField const &, SwPaM *pAnnotationRange=nullptr)
Definition: wrtsh2.cxx:62
void GetBorderState(SfxItemSet &rSet)
Definition: basesh.cxx:2560
const OUStringLiteral sColor
#define FN_PAGE_STYLE_SET_LR_MARGIN
Definition: cmdid.h:379
void SetShowChangesInMargin(bool b)
Definition: viewopt.hxx:296
static sal_uInt8 nTablePos
Definition: basesh.cxx:114
css::uno::Reference< css::embed::XEmbeddedObject > GetOleRef() const
get reference to OLE object (if there is one) for selected FlyFrame
Definition: fefly1.cxx:1493
void Execute(SfxRequest &)
Definition: basesh.cxx:747
const void * GetEditingObject() const
void SetPitch(FontPitch ePitch)
SfxItemPool & GetPool() const
IMPL_LINK_NOARG(SwBaseShell, GraphicArrivedHdl, SwCursorShell &, void)
Definition: basesh.cxx:1422
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
void SelectionToHell()
Below document.
Definition: feshview.cxx:1235
#define FN_NEXT_BOOKMARK
Definition: cmdid.h:113
static sal_uInt8 nFramePos
Definition: basesh.cxx:113
const ImageMap & GetImageMap() const
bool IsShowOutlineContentVisibilityButton() const
Definition: viewopt.cxx:99
bool GetFlyFrameAttr(SfxItemSet &rSet) const
Definition: fefly1.cxx:1062
void EndCursorMove(const bool bIdleEnd=false)
Definition: crsrsh.cxx:310
#define FN_TABLE_PASTE_ROW_BEFORE
Definition: cmdid.h:299
virtual VclPtr< AbstractSwConvertTableDlg > CreateSwConvertTableDlg(SwView &rView, bool bToTable)=0
static bool lcl_UpdateContourDlg(SwWrtShell &rSh, SelectionType nSel)
Definition: basesh.cxx:173
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:137
void EndSelect()
Definition: select.cxx:425
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:613
bool IsSelection() const
Definition: crsrsh.hxx:876
void SetTabBorders(const SfxItemSet &rSet)
Definition: fetab.cxx:783
void SetBoxBackground(const SvxBrushItem &rNew)
Definition: fetab.cxx:806
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
static void EndUndo(SwWrtShell &rSh)
Definition: basesh.cxx:2783
sal_uInt16 char * pName
virtual void ClearRedo()=0
Delete all Redo actions.
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:578
const SwTableNode * IsCursorInTable() const
Definition: crsrsh.hxx:886
SvtScriptType
Style of a layout element.
Definition: frmfmt.hxx:59
void SetFormView(bool bSet)
Definition: viewopt.hxx:470
SvtScriptType GetScriptType() const
returns the script type of the selection
Definition: edattr.cxx:663
bool HasSelection() const
Definition: wrtsh.hxx:144
#define SW_MOD()
Definition: swmodule.hxx:256
void SetFamilyName(const OUString &rFamilyName)
void SetInputContext(const InputContext &rInputContext)
void AlignFormulaToBaseline(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj)
for starmath formulas anchored 'as char' it aligns it baseline to baseline changing the previous vert...
Definition: fefly1.cxx:2050
bool IsInsRegionAvailable() const
Definition: edsect.cxx:58
Shell * GetShell()
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define FN_CHANGE_DBFIELD
Definition: cmdid.h:201
static void InsertTableImpl(SwWrtShell &rSh, SwView &rTempView, const OUString &aTableName, sal_uInt16 nRows, sal_uInt16 nCols, SwInsertTableOptions aInsTableOpts, const OUString &aAutoName, const std::unique_ptr< SwTableAutoFormat > &pTAFormat)
Definition: basesh.cxx:2797
const SvBaseLinks & GetLinks() const
int i
#define FN_INSERT_TABLE
Definition: cmdid.h:216
GraphicType GetGraphicType() const
Definition: editsh.cxx:271
uno_Any a
bool GetObjAttr(SfxItemSet &rSet) const
Attention: Ambiguities if multiple selections.
Definition: feshview.cxx:2751
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
GraphicType GetType() const
bool IsAnySectionInDoc() const
Definition: edsect.cxx:119
bool IsFormView() const
Definition: viewopt.hxx:469
bool EndAllTableBoxEdit()
Definition: trvltbl.cxx:916
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
bool GoNextBookmark()
Definition: wrtsh3.cxx:139
#define FN_UPDATE_CHARTS
Definition: cmdid.h:134
#define FN_FORMAT_PAGE_SETTING_DLG
Definition: cmdid.h:312
css::uno::Reference< css::datatransfer::XTransferable > GetXTransferable() const
#define LANGUAGE_SYSTEM
SelectionType
void SetOrientation(Degree10 nLineOrientation)
constexpr TypedWhichId< SwFormatURL > RES_URL(111)
sal_uInt16 GetPhyPageNum() const
Phy: real page count.
Definition: fews.cxx:335
static void PrePasteSpecial(const SwWrtShell &rSh, TransferableDataHelper &, const VclPtr< SfxAbstractPasteDialog > &pDlg)
PrePasteSpecial Prepares the given dialog without actually running it.
Definition: swdtflvr.cxx:3435
SfxBindings & GetBindings()
bool HasMark() const
Definition: crsrsh.hxx:874
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:112
void Reformat()
Invalidates complete Layout (ApplyViewOption).
Definition: viewsh.cxx:1012
const OUString & GetValue() const
sal_uInt16 Count() const
FlyAnchors.
Definition: fmtanchr.hxx:34
const SwPageDesc & GetPageDesc(size_t i) const
Definition: fedesc.cxx:126
HTMLMODE_ON
bool SetFlyFrameAttr(SfxItemSet &rSet)
Definition: fefly1.cxx:1105
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:62
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:354
size_t size() const
Definition: tblafmt.cxx:916
const T * GetArg(sal_uInt16 nSlotId) const
#define FN_REPAGINATE
Definition: cmdid.h:105
void SetAttrSet(const SfxItemSet &rSet)
Definition: frmmgr.cxx:621
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
void SetPool(SfxItemPool *pNewPool)
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
Definition: docsh.cxx:1142
static void UpdateIMapDlg(const Graphic &rGraphic, const ImageMap *pImageMap, const TargetList *pTargetList, void *pEditingObj)
#define FN_UPDATE_FIELDS
Definition: cmdid.h:75
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:25
#define FN_WRAP_ANCHOR_ONLY
Definition: cmdid.h:415
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:87
SvtScriptType GetScriptTypeOfLanguage(LanguageType nLang)
#define LANGUAGE_DONTKNOW
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem &rBrush, SfxItemSet &rToSet)
bool IsUseInputLanguage() const
Definition: edtwin.hxx:266
void Execute(SfxRequest &)
Dispatcher.
Definition: docsh2.cxx:393
#define FN_FORMAT_TITLEPAGE_DLG
Definition: cmdid.h:343
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
static void SetFrameMode(FlyMode eMode, SwWrtShell *pShell)
Definition: basesh.cxx:2099
virtual comphelper::EmbeddedObjectContainer & getEmbeddedObjectContainer() const override
Marks a node in the document model.
Definition: ndindex.hxx:32
static void StateDisableItems(SfxItemSet &)
Definition: basesh.cxx:1953
static sal_uInt8 nParagraphPos
Definition: basesh.cxx:110
virtual ~SwBaseShell() override
Definition: basesh.cxx:2133
ColorTransparency
ring_container GetRingContainer()
Definition: ring.hxx:240
sal_uInt16 GetSlotId(sal_uInt16 nWhich) const
static void lcl_UpdateIMapDlg(SwWrtShell &rSh)
Definition: basesh.cxx:157
bool DelLeft()
Definition: delete.cxx:135
void ExecUndo(SfxRequest &)
Definition: basesh.cxx:584
void SetName(const OUString &rName)
Graphic GetIMapGraphic() const
Remove default parameter, because method always called this default value.
Definition: editsh.cxx:605
bool IsAutoUpdateFormat() const
Query / set bAutoUpdateFormat-flag.
Definition: format.hxx:172
#define FN_TOOL_ANCHOR_FRAME
Definition: cmdid.h:229
bool HasReadonlySel() const
Definition: crsrsh.cxx:3344
bool StartExecuteAsync(const std::function< void(sal_Int32)> &rEndDialogFn)
void GrabFocus()
RndStdIds GetAnchorId() const
Anchor type of selected object, RndStdIds::UNKNOWN if ambiguous or in case of frame selection...
Definition: feshview.cxx:2319
std::unique_ptr< SfxPoolItem > CloneSetWhich(sal_uInt16 nNewWhich) const
bool isXForms() const
Definition: docxforms.cxx:44
const Graphic * GetGraphic(bool bWait=true) const
Definition: editsh.cxx:239
SfxItemPool * GetPool() const
std::vector< OUString > & GetList()
#define FONT_GROUP_CJK
Definition: fontcfg.hxx:47
FlyProtectFlags IsSelObjProtected(FlyProtectFlags eType) const
Which Protection is set at selected object?
Definition: feshview.cxx:2683
static sal_uInt8 nFooterPos
Definition: basesh.cxx:119
bool GoPrevBookmark()
Definition: wrtsh3.cxx:160
SwDocShell * GetDocShell()
Definition: view.cxx:1127
SwFrameFormat * GetTableFormat()
Definition: edws.cxx:183
const void * GetEditingObject() const
#define FN_FORMAT_BORDER_DLG
Definition: cmdid.h:314
#define FN_FRAME_WRAPTHRU_TRANSP
Definition: cmdid.h:402
SwFrameFormat * GetSelectedFrameFormat() const
If frame then frame style, else 0.
Definition: fefly1.cxx:1215
void SetShowChangesInMargin2(bool b)
Definition: viewopt.hxx:302
void StartAction()
Definition: crsrsh.cxx:226
static void FillClipFormatItem(const SwWrtShell &rSh, const TransferableDataHelper &rData, SvxClipboardFormatItem &rToFill)
Definition: swdtflvr.cxx:3491
void StateClpbrd(SfxItemSet &)
Definition: basesh.cxx:506
void SetParent(const SfxItemSet *pNew)
const ImageMap * GetMap() const
Definition: fmturl.hxx:68
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:450
void GetBckColState(SfxItemSet &rSet)
Definition: basesh.cxx:2356
void SetReturnValue(const SfxPoolItem &)
weld::Window * GetFrameWeld() const
void InsertTable(SfxRequest &_rRequest)
Definition: basesh.cxx:2835
const OUString & GetName() const
Definition: tblafmt.hxx:204
SdrLayerID GetLayerId() const
1 Heaven, 0 Hell, SDRLAYER_NOTFOUND Ambiguous.
Definition: feshview.cxx:1164
void CallChgLnk()
Definition: crsrsh.cxx:2526
#define FN_TOOL_ANCHOR_AT_CHAR
Definition: cmdid.h:275
bool GotoObj(bool bNext, GotoObjFlags eType=GotoObjFlags::DrawAny)
Definition: feshview.cxx:1739
#define FN_UPDATE_ALL
Definition: cmdid.h:125
IDocumentUndoRedo const & GetIDocumentUndoRedo() const
Provides access to the document undo/redo interface.
Definition: viewsh.cxx:2734
Class for automated call of Start- and EndCursorMove().
Definition: editsh.hxx:1021
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:238
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
#define FN_FRAME_WRAPTHRU
Definition: cmdid.h:330
static FlyMode eFrameMode
Definition: basesh.hxx:44
void GetState(SfxItemSet &)
Definition: basesh.cxx:1517
sal_uInt16 GetSlot() const
SwBaseShell(SwView &rShell)
Definition: basesh.cxx:2121
void Broadcast(const SfxHint &rHint)
bool HasChildWindow(sal_uInt16)
void SetGraphicPolygon(const tools::PolyPolygon *pPoly)
Definition: editsh.cxx:325
void SetStyleName(const OUString &rStyleName)
const css::uno::Reference< css::frame::XDispatchRecorder > & GetRecorder() const
const OUString & GetURL() const
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:414
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:194
#define FN_FORMAT_BACKGROUND_DLG
Definition: cmdid.h:316
void DisableItem(sal_uInt16 nWhich)
constexpr sal_uInt16 RES_CHRATR_BEGIN(HINT_BEGIN)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(105)
weld::Window * GetFrameWeld() const
#define FN_FORMAT_PAGE_COLUMN_DLG
Definition: cmdid.h:315
bool Left(sal_uInt16 nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
Definition: move.cxx:110
SwMoveFnCollection const & fnTableStart
Definition: paminit.cxx:52
HTMLMODE_SOME_STYLES
SwUndoId GetRepeatInfo(OUString *const o_pStr) const
Definition: edws.cxx:251
#define FN_CONVERT_TEXT_TABLE
Definition: cmdid.h:346
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
sal_uInt16 GetWhich(sal_uInt16 nSlot, bool bDeep=true) const
virtual bool GetLastUndoInfo(OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const =0
Get Id and comment of last Undo action.
void UpdateAllLinks(bool bAskUpdate, bool bUpdateGrfLinks, weld::Window *pParentWin)
unsigned char sal_uInt8
void LockView(bool b)
Definition: viewsh.hxx:463
#define GetWhich(nSlot)
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:424
bool MoveTable(SwWhichTable, SwMoveFnCollection const &)
Definition: trvltbl.cxx:682
void Do(DoType eDoType, sal_uInt16 nCnt=1)
Definition: wrtundo.cxx:33
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:891
bool IsTextToTableAvailable() const
Definition: edtab.cxx:198
void SetTableStyleName(const OUString &rName)
Set the new table style name for this table.
Definition: swtable.hxx:195
bool TableToText(sal_Unicode cCh)
Definition: edtab.cxx:149
RET_OK
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:176
static sal_uInt8 nHeaderPos
Definition: basesh.cxx:118
#define FN_BACKSPACE
Definition: cmdid.h:661
void ChgPageDesc(size_t i, const SwPageDesc &)
Definition: fedesc.cxx:111
#define FN_TABLE_PASTE_COL_BEFORE
Definition: cmdid.h:300
size_t IsObjSelected() const
Definition: feshview.cxx:1240
bool IsNoNum(bool bChkStart=true) const
Definition: ednumber.cxx:675
virtual bool DoesRepair() const =0
Is repair mode active?
void UnSelectFrame()
Definition: select.cxx:323
QPRO_FUNC_TYPE nType
void StateUndo(SfxItemSet &)
Definition: basesh.cxx:665
void ClickToField(const SwField &rField, bool bExecHyperlinks)
Definition: wrtsh2.cxx:339
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
PasteTableType
Definition: swdtflvr.hxx:67
void AutoUpdateFrame(SwFrameFormat *pFormat, const SfxItemSet &rStyleSet)
Definition: wrtsh1.cxx:1747
#define FN_FORMAT_PAGE_DLG
Definition: cmdid.h:317
#define FN_CONVERT_TEXT_TO_TABLE
Definition: cmdid.h:374
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:54
void InvalidateRulerPos()
Definition: viewport.cxx:107
#define FN_TOOL_ANCHOR_PARAGRAPH
Definition: cmdid.h:225
#define FN_PAGE_STYLE_SET_UL_MARGIN
Definition: cmdid.h:380
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
bool GetFirstRedoInfo(OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const
Definition: edws.cxx:244
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
void ClearMark()
Definition: crsrsh.cxx:938
bool GetCurAttr(SfxItemSet &, const bool bMergeIndentValuesOfNumRule=false) const
Definition: edattr.cxx:171
constexpr sal_uInt16 RES_CHRATR_END(46)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(106)
void SetObjAttr(const SfxItemSet &rSet)
Definition: feshview.cxx:2774
virtual void CalcLayout() override
To enable set up of StartActions and EndActions.
Definition: edws.cxx:108
void GetTabBorders(SfxItemSet &rSet) const
Definition: fetab.cxx:801
void Execute(SfxRequest &)
void LeaveSelFrameMode()
Definition: select.cxx:720
void SetVertical(bool bVertical)
virtual VclPtr< VclAbstractDialog > CreateTitlePageDlg(weld::Window *pParent)=0
#define FN_UPDATE_INPUTFIELDS
Definition: cmdid.h:96
SW_DLLPUBLIC void PrepareBoxInfo(SfxItemSet &rSet, const SwWrtShell &rSh)
Definition: uitool.cxx:81
void UpdateDocStat()
Document - Statistics.
Definition: editsh.cxx:426
#define FN_SET_TRACKED_CHANGES_IN_TEXT
Definition: cmdid.h:191
#define FN_SHIFT_BACKSPACE
Definition: cmdid.h:676
const sal_uInt16 CRSR_SKIP_CHARS
Definition: swcrsr.hxx:65
void InvalidateAll(bool bWithMsg)
HTMLMODE_FULL_STYLES
void AppendItem(const SfxPoolItem &)
bool IsTableComplexForChart()
Definition: trvltbl.cxx:726
bool AddGrfUpdateSlot(sal_uInt16 nSlot)
Definition: basesh.hxx:61
#define FN_GOTO_PREV_MARK
Definition: cmdid.h:712
void Update(const Graphic &rGraphic, bool bGraphicLinked, const tools::PolyPolygon *pPolyPoly, void *pEditingObj)
Reference< XModel > xModel
RndStdIds
SwView & rView
Definition: basesh.hxx:41
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLBACKGROUND)
virtual SotClipboardFormatId GetFormatOnly()=0
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
Definition: select.cxx:702
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
bool IsEndPara() const
Definition: crsrsh.cxx:1113
void GotoFlyAnchor()
jump from the frame to the anchor
Definition: trvlfnfl.cxx:354
#define FN_CONVERT_TABLE_TO_TEXT
Definition: cmdid.h:375
SectionType GetType() const
Definition: section.hxx:170
void FormatPage(const OUString &rPage, const OString &rPageId, SwWrtShell &rActShell, SfxRequest *pRequest=nullptr)
Show page style format dialog.
Definition: docst.cxx:1624
static bool PasteUnformatted(SwWrtShell &rSh, TransferableDataHelper &)
Definition: swdtflvr.cxx:3429
const SwInsertTableOptions & GetInsTableFlags(bool bHTML) const
Definition: modcfg.hxx:303
LanguageType GetInputLanguage() const
void Init(sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This function allows to (repeatedly) initialize the columns.
Definition: atrfrm.cxx:969
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1525
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: wrtsh1.cxx:1921
#define FN_ESCAPE
Definition: cmdid.h:675
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
bool IsLinkedGrfSwapOut() const
Definition: editsh.cxx:250
#define FN_PREV_BOOKMARK
Definition: cmdid.h:114
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2122
bool GetTableCopied() const
Definition: fesh.hxx:648
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
ShellMode GetShellMode() const
Definition: view0.cxx:106
void Ignore()
size_t GetCurPageDesc(const bool bCalcFrame=true) const
Definition: fedesc.cxx:167
void SetGutterWidth(sal_uInt16 nNew, sal_uInt16 nAct)
Adjusts borders for columns in aColumns.
Definition: atrfrm.cxx:949
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
void StateStyleSheet(SfxItemSet &, SwWrtShell *pSh=nullptr)
Definition: docst.cxx:86
#define FN_FRAME_NOWRAP
Definition: cmdid.h:328
::std::vector< OUString > TargetList
#define FN_GOTO_PREV_OBJ
Definition: cmdid.h:680
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Definition: fews.cxx:237
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
bool IsFrameSelected() const
Definition: feshview.cxx:1248
bool GetBoxBackground(std::unique_ptr< SvxBrushItem > &rToFill) const
FALSE ambiguous.
Definition: fetab.cxx:814
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
virtual SfxObjectShell * GetObjectShell()
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(107)
bool IsViewLocked() const
Definition: viewsh.hxx:462
void HideCursor()
Definition: crsrsh.cxx:2407
#define FN_FRAME_WRAP_CONTOUR
Definition: cmdid.h:420
Definition: view.hxx:144
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
const Color & GetValue() const
sal_uInt16 nPos
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(104)
bool IsSelFrameMode() const
Definition: wrtsh.hxx:173
void UpdateFlyFrame()
Definition: frmmgr.cxx:160
void SetValue(const Color &rNewColor)
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:243
virtual VclPtr< SfxAbstractDialog > CreateSwBorderDlg(weld::Window *pParent, SfxItemSet &rSet, SwBorderModes nType)=0
void ExecDelete(SfxRequest &)
Definition: basesh.cxx:194
SAL_DLLPRIVATE bool Load(SvStream &rStream)
Definition: tblafmt.cxx:1047
bool CursorInsideInputField() const
Definition: crstrvl.cxx:950