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