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