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