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