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