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  SwView& rTempView = GetView();
720  rSh.EnterStdMode();
721  if( !rSh.GetLinkManager().GetLinks().empty() )
722  {
723  rSh.StartAllAction();
724  rSh.GetLinkManager().UpdateAllLinks( false, true, nullptr );
725  rSh.EndAllAction();
726  }
727  SfxDispatcher &rDis = *rTempView.GetViewFrame()->GetDispatcher();
728  rDis.Execute( FN_UPDATE_FIELDS );
729  rDis.Execute( FN_UPDATE_TOX );
730  rDis.Execute( FN_UPDATE_CHARTS );
731  rSh.CalcLayout();
732  }
733  break;
734 
736  rSh.UpdateInputFields();
737  break;
738 
739  case FN_PREV_BOOKMARK:
740  rReq.SetReturnValue(SfxBoolItem( nSlot, rSh.GoPrevBookmark()));
741  break;
742  case FN_NEXT_BOOKMARK:
743  rReq.SetReturnValue(SfxBoolItem( nSlot, rSh.GoNextBookmark()));
744  break;
745 
746  case FN_GOTO_NEXT_MARK:
747  case FN_GOTO_PREV_MARK:
748  {
749  SwFieldMgr aFieldMgr;
750  SwFieldType* pFieldType = aFieldMgr.GetFieldType(SwFieldIds::JumpEdit);
751 
752  if (pFieldType)
753  {
754  if (rSh.IsSelFrameMode())
755  {
756  rSh.UnSelectFrame();
757  rSh.LeaveSelFrameMode();
758  }
759 
760  if (rSh.HasMark())
761  {
762  SwMvContext aMvContext(&rSh);
763  if (rSh.IsCursorPtAtEnd())
764  rSh.SwapPam();
765  rSh.ClearMark();
766  rSh.EndSelect();
767  }
768  bool bRet = rSh.MoveFieldType( pFieldType, nSlot == FN_GOTO_NEXT_MARK );
769  SwField* pCurField = bRet ? rSh.GetCurField() : nullptr;
770  if (pCurField)
771  rSh.ClickToField(*pCurField);
772  rReq.SetReturnValue(SfxBoolItem( nSlot, bRet));
773  }
774  }
775  break;
776 
777  case FN_START_DOC_DIRECT:
778  case FN_END_DOC_DIRECT:
779  {
780  if (rSh.IsSelFrameMode())
781  {
782  rSh.UnSelectFrame();
783  rSh.LeaveSelFrameMode();
784  }
785  rSh.EnterStdMode();
786  nSlot == FN_START_DOC_DIRECT ?
787  rSh.SttEndDoc(true) :
788  rSh.SttEndDoc(false);
789  }
790  break;
791  case FN_GOTO_PREV_OBJ:
792  case FN_GOTO_NEXT_OBJ:
793  {
794  bool bSuccess = rSh.GotoObj( nSlot == FN_GOTO_NEXT_OBJ );
795  rReq.SetReturnValue(SfxBoolItem(nSlot, bSuccess));
796  if (bSuccess && !rSh.IsSelFrameMode())
797  {
798  rSh.HideCursor();
799  rSh.EnterSelFrameMode();
800  GetView().AttrChangedNotify(nullptr);
801  }
802  }
803  break;
804  case SID_GALLERY_FORMATS:
805  {
806  const SvxGalleryItem* pGalleryItem = SfxItemSet::GetItem<SvxGalleryItem>(pArgs, SID_GALLERY_FORMATS, false);
807  if ( !pGalleryItem )
808  break;
809 
810  const SelectionType nSelType = rSh.GetSelectionType();
811  sal_Int8 nGalleryItemType( pGalleryItem->GetType() );
812 
813  if ( (!rSh.IsSelFrameMode() || nSelType & SelectionType::Graphic) &&
814  nGalleryItemType == css::gallery::GalleryItemType::GRAPHIC )
815  {
816  SwWait aWait( *rView.GetDocShell(), true );
817 
818  OUString aGrfName, aFltName;
819  const Graphic aGrf( pGalleryItem->GetGraphic() );
820 
821  if ( nSelType & SelectionType::Graphic )
822  rSh.ReRead( aGrfName, aFltName, &aGrf );
823  else
824  rSh.Insert( aGrfName, aFltName, aGrf );
825 
827  }
828  else if(!rSh.IsSelFrameMode() &&
829  nGalleryItemType == css::gallery::GalleryItemType::MEDIA )
830  {
831  const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, pGalleryItem->GetURL() );
833  SID_INSERT_AVMEDIA, SfxCallMode::SYNCHRON,
834  { &aMediaURLItem });
835  }
836  }
837  break;
839  {
840  if (pArgs)
841  {
842  // Determine the current PageDescriptor and fill the set with that.
843  const size_t nCurIdx = rSh.GetCurPageDesc();
844  SwPageDesc aPageDesc(rSh.GetPageDesc(nCurIdx));
845 
846  SwFrameFormat &rFormat = aPageDesc.GetMaster();
847 
848  SwFormatCol aFormatCol = rFormat.GetCol();
849 
850  sal_uInt16 nCount;
851  if(SfxItemState::SET == pArgs->GetItemState(nSlot))
852  nCount = static_cast<const SfxUInt16Item &>(pArgs->Get(nSlot)).GetValue();
853  else
854  nCount = pArgs->Get(SID_ATTR_COLUMNS).GetValue();
855  sal_uInt16 nGutterWidth = DEF_GUTTER_WIDTH;
856 
857  aFormatCol.Init(nCount ? nCount : 1, nGutterWidth, USHRT_MAX);
858  aFormatCol.SetWishWidth(USHRT_MAX);
859  aFormatCol.SetGutterWidth(nGutterWidth, USHRT_MAX);
860 
861  rFormat.SetFormatAttr(aFormatCol);
862 
863  rSh.ChgPageDesc(nCurIdx, aPageDesc);
864  }
865  else
867  }
868  break;
872  {
873  sal_Unicode cDelim = 0;
874  bool bToTable = false;
875  if( nSlot == FN_CONVERT_TEXT_TO_TABLE ||
876  ( nSlot == FN_CONVERT_TEXT_TABLE && nullptr == rSh.GetTableFormat() ))
877  bToTable = true;
878  SwInsertTableOptions aInsTableOpts( SwInsertTableFlags::All, 1 );
879  SwTableAutoFormat const* pTAFormat = nullptr;
880  std::unique_ptr<SwTableAutoFormatTable> pAutoFormatTable;
881  bool bDeleteFormat = true;
882  if(pArgs && SfxItemState::SET == pArgs->GetItemState( FN_PARAM_1, true, &pItem))
883  {
884  aInsTableOpts.mnInsMode = SwInsertTableFlags::NONE;
885  // Delimiter
886  OUString sDelim = static_cast< const SfxStringItem* >(pItem)->GetValue();
887  if(!sDelim.isEmpty())
888  cDelim = sDelim[0];
889  // AutoFormat
890  if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_2, true, &pItem))
891  {
892  OUString sAutoFormat = static_cast< const SfxStringItem* >(pItem)->GetValue();
893 
894  pAutoFormatTable.reset(new SwTableAutoFormatTable);
895  pAutoFormatTable->Load();
896 
897  for( sal_uInt16 i = 0, nCount = pAutoFormatTable->size(); i < nCount; i++ )
898  {
899  SwTableAutoFormat const*const pFormat = &(*pAutoFormatTable)[ i ];
900  if( pFormat->GetName() == sAutoFormat )
901  {
902  pTAFormat = pFormat;
903  bDeleteFormat = false;
904  break;
905  }
906  }
907  }
908  //WithHeader
909  if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_3, true, &pItem) &&
910  static_cast< const SfxBoolItem* >(pItem)->GetValue())
911  aInsTableOpts.mnInsMode |= SwInsertTableFlags::Headline;
912  // RepeatHeaderLines
913  if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_4, true, &pItem))
914  aInsTableOpts.mnRowsToRepeat =
915  static_cast<sal_uInt16>(static_cast< const SfxInt16Item* >(pItem)->GetValue());
916  //WithBorder
917  if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_5, true, &pItem) &&
918  static_cast< const SfxBoolItem* >(pItem)->GetValue())
920  //DontSplitTable
921  if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_6, true, &pItem) &&
922  !static_cast< const SfxBoolItem* >(pItem)->GetValue() )
924  }
925  else
926  {
929  if( RET_OK == pDlg->Execute() )
930  {
931  pDlg->GetValues( cDelim, aInsTableOpts, pTAFormat );
932 
933  }
934  }
935 
936  if( cDelim )
937  {
938  //Shell change!
939  SwView& rSaveView = rView;
940  bool bInserted = false;
941  //recording:
942  SfxViewFrame* pViewFrame = GetView().GetViewFrame();
943  if( SfxRequest::HasMacroRecorder(pViewFrame) )
944  {
945  SfxRequest aReq( pViewFrame, nSlot);
946  aReq.AppendItem( SfxStringItem( FN_PARAM_1, OUString(cDelim) ));
947  if(bToTable)
948  {
949  if(pTAFormat)
950  aReq.AppendItem( SfxStringItem( FN_PARAM_2, pTAFormat->GetName()));
951  aReq.AppendItem( SfxBoolItem ( FN_PARAM_3, bool(aInsTableOpts.mnInsMode & SwInsertTableFlags::Headline)));
952  aReq.AppendItem( SfxInt16Item( FN_PARAM_4, static_cast<short>(aInsTableOpts.mnRowsToRepeat) ));
953  aReq.AppendItem( SfxBoolItem ( FN_PARAM_5, bool(aInsTableOpts.mnInsMode & SwInsertTableFlags::DefaultBorder) ));
954  aReq.AppendItem( SfxBoolItem ( FN_PARAM_6, !(aInsTableOpts.mnInsMode & SwInsertTableFlags::SplitLayout)));
955  }
956  aReq.Done();
957  }
958 
959  if( !bToTable )
960  rSh.TableToText( cDelim );
961  else
962  {
963  bInserted = rSh.TextToTable( aInsTableOpts, cDelim, pTAFormat );
964  }
965  rSh.EnterStdMode();
966 
967  if( bInserted )
968  rSaveView.AutoCaption( TABLE_CAP );
969  }
970  if(bDeleteFormat)
971  delete pTAFormat;
972  }
973  break;
974  case SID_STYLE_WATERCAN:
975  case SID_STYLE_UPDATE_BY_EXAMPLE:
976  case SID_STYLE_NEW_BY_EXAMPLE:
977  case SID_STYLE_APPLY:
978  {
980  if ( ShellMode::Draw != eMode &&
981  ShellMode::DrawForm != eMode &&
982  ShellMode::DrawText != eMode &&
983  ShellMode::Bezier != eMode )
984  {
985  // oj #107754#
986  if ( SID_STYLE_WATERCAN == nSlot )
987  {
988  const bool bLockedView = rSh.IsViewLocked();
989  rSh.LockView( true ); //lock visible section
990 
992 
993  rSh.LockView( bLockedView );
994  }
995  else
996  // Will be recorded from the DocShell
998  }
999  }
1000  break;
1001  case SID_CLASSIFICATION_APPLY:
1002  {
1003  GetView().GetDocShell()->Execute(rReq);
1004  }
1005  break;
1006  case SID_CLASSIFICATION_DIALOG:
1007  {
1008  GetView().GetDocShell()->Execute(rReq);
1009  }
1010  break;
1011  case SID_PARAGRAPH_SIGN_CLASSIFY_DLG:
1012  {
1013  GetView().GetDocShell()->Execute(rReq);
1014  }
1015  break;
1016  case SID_WATERMARK:
1017  {
1018  GetView().GetDocShell()->Execute(rReq);
1019  }
1020  break;
1021  case FN_ESCAPE:
1022  GetView().ExecuteSlot(rReq);
1023  break;
1024  case SID_IMAP:
1025  {
1026  sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
1027 
1028  SfxViewFrame* pVFrame = GetView().GetViewFrame();
1029  pVFrame->ToggleChildWindow( nId );
1030  pVFrame->GetBindings().Invalidate( SID_IMAP );
1031 
1032  if ( pVFrame->HasChildWindow( nId ) && rSh.IsFrameSelected() )
1033  lcl_UpdateIMapDlg( rSh );
1034  }
1035  break;
1036  case SID_IMAP_EXEC:
1037  {
1038  SvxIMapDlg* pDlg = GetIMapDlg(GetView());
1039 
1040  // Check, if the allocation is useful or allowed at all.
1041  if ( rSh.IsFrameSelected() &&
1042  pDlg->GetEditingObject() == rSh.GetIMapInventor() )
1043  {
1045  rSh.GetFlyFrameAttr( aSet );
1046  SwFormatURL aURL( aSet.Get( RES_URL ) );
1047  aURL.SetMap( &pDlg->GetImageMap() );
1048  aSet.Put( aURL );
1049  rSh.SetFlyFrameAttr( aSet );
1050  }
1051  }
1052  break;
1053  case SID_CONTOUR_DLG:
1054  {
1055  sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
1056 
1057  SfxViewFrame* pVFrame = GetView().GetViewFrame();
1058  pVFrame->ToggleChildWindow( nId );
1059  pVFrame->GetBindings().Invalidate( SID_CONTOUR_DLG );
1060 
1061  SelectionType nSel = rSh.GetSelectionType();
1062  if ( pVFrame->HasChildWindow( nId ) &&
1064  {
1065  lcl_UpdateContourDlg( rSh, nSel );
1066  }
1067  }
1068  break;
1069  case SID_CONTOUR_EXEC:
1070  {
1071  SvxContourDlg *pDlg = GetContourDlg(GetView());
1072  // Check, if the allocation is useful or allowed at all.
1073  SelectionType nSel = rSh.GetSelectionType();
1075  {
1076  if (pDlg && pDlg->GetEditingObject() == rSh.GetIMapInventor())
1077  {
1078  rSh.StartAction();
1080  rSh.GetFlyFrameAttr( aSet );
1081  SwFormatSurround aSur( aSet.Get( RES_SURROUND ) );
1082  if ( !aSur.IsContour() )
1083  {
1084  aSur.SetContour( true );
1085  if ( aSur.GetSurround() == css::text::WrapTextMode_NONE )
1086  aSur.SetSurround( css::text::WrapTextMode_PARALLEL );
1087  aSet.Put( aSur );
1088  rSh.SetFlyFrameAttr( aSet );
1089  }
1090  const tools::PolyPolygon aPoly( pDlg->GetPolyPolygon() );
1091  rSh.SetGraphicPolygon( &aPoly );
1092  if ( pDlg->IsGraphicChanged() )
1093  rSh.ReRead( OUString(), OUString(), &pDlg->GetGraphic());
1094  rSh.EndAction();
1095  }
1096  }
1097  }
1098  break;
1099  case FN_FRAME_TO_ANCHOR:
1100  {
1101  rSh.GotoFlyAnchor();
1102  rSh.EnterStdMode();
1103  rSh.CallChgLnk();
1104  }
1105  break;
1106  case FN_TOOL_ANCHOR_PAGE:
1108  case FN_TOOL_ANCHOR_CHAR:
1110  case FN_TOOL_ANCHOR_FRAME:
1111  {
1112  RndStdIds eSet = nSlot == FN_TOOL_ANCHOR_PAGE
1113  ? RndStdIds::FLY_AT_PAGE
1114  : nSlot == FN_TOOL_ANCHOR_PARAGRAPH
1115  ? RndStdIds::FLY_AT_PARA
1116  : nSlot == FN_TOOL_ANCHOR_FRAME
1117  ? RndStdIds::FLY_AT_FLY
1118  : nSlot == FN_TOOL_ANCHOR_CHAR
1119  ? RndStdIds::FLY_AS_CHAR
1120  : RndStdIds::FLY_AT_CHAR;
1121  rSh.StartUndo();
1122  if (rSh.IsObjSelected())
1123  rSh.ChgAnchor(eSet);
1124  else if (rSh.IsFrameSelected())
1125  {
1126  SwFormatAnchor aAnc(eSet, rSh.GetPhyPageNum());
1128  rSh.SetFlyFrameAttr(aSet);
1129  }
1130  // if new anchor is 'as char' and it is a Math object and the usual
1131  // pre-conditions are met then align the formula to the baseline of the text
1132  const uno::Reference < embed::XEmbeddedObject > xObj( rSh.GetOleRef() );
1133  const bool bDoMathBaselineAlignment = xObj.is() && SotExchange::IsMath( xObj->getClassID() )
1134  && RndStdIds::FLY_AS_CHAR == eSet && rSh.GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT );
1135  if (bDoMathBaselineAlignment)
1136  rSh.AlignFormulaToBaseline( xObj );
1137 
1138  sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
1139  if( nHtmlMode )
1140  {
1142  rSh.GetFlyFrameAttr(aSet);
1143 
1144  const SwFormatSurround& rSurround = aSet.Get(RES_SURROUND);
1145  const SwFormatVertOrient& rVert = aSet.Get(RES_VERT_ORIENT);
1146  const SwFormatHoriOrient& rHori = aSet.Get(RES_HORI_ORIENT);
1147  sal_Int16 eVOrient = rVert.GetVertOrient();
1148  sal_Int16 eHOrient = rHori.GetHoriOrient();
1149  css::text::WrapTextMode eSurround = rSurround.GetSurround();
1150 
1151  switch( eSet )
1152  {
1153  case RndStdIds::FLY_AT_FLY:
1154  case RndStdIds::FLY_AT_PAGE:
1155  //Wrap through, left or from left, top, from top
1156  if(eSurround != css::text::WrapTextMode_THROUGH)
1157  aSet.Put(SwFormatSurround(css::text::WrapTextMode_THROUGH));
1158 
1159  if( eVOrient != text::VertOrientation::TOP && eVOrient != text::VertOrientation::NONE)
1160  aSet.Put(SwFormatVertOrient(0, text::VertOrientation::TOP));
1161 
1162  if (eHOrient != text::HoriOrientation::NONE && eHOrient != text::HoriOrientation::LEFT)
1163  aSet.Put(SwFormatHoriOrient(0, text::HoriOrientation::LEFT));
1164  break;
1165 
1166  case RndStdIds::FLY_AT_PARA:
1167  // left, from left, right, top, no wrap, wrap left and right
1168  if (eSurround != css::text::WrapTextMode_LEFT && eSurround != css::text::WrapTextMode_RIGHT)
1169  aSet.Put(SwFormatSurround(css::text::WrapTextMode_LEFT));
1170 
1171  if( eVOrient != text::VertOrientation::TOP)
1172  aSet.Put(SwFormatVertOrient(0, text::VertOrientation::TOP));
1173 
1174  if (eHOrient != text::HoriOrientation::NONE && eHOrient != text::HoriOrientation::LEFT && eHOrient != text::HoriOrientation::RIGHT)
1175  aSet.Put(SwFormatHoriOrient(0, text::HoriOrientation::LEFT));
1176  break;
1177 
1178  case RndStdIds::FLY_AT_CHAR:
1179  // left, from left, right, top, wrap through
1180  if(eSurround != css::text::WrapTextMode_THROUGH)
1181  aSet.Put(SwFormatSurround(css::text::WrapTextMode_THROUGH));
1182 
1183  if( eVOrient != text::VertOrientation::TOP)
1184  aSet.Put(SwFormatVertOrient(0, text::VertOrientation::TOP));
1185 
1186  if (eHOrient != text::HoriOrientation::NONE && eHOrient != text::HoriOrientation::LEFT && eHOrient != text::HoriOrientation::RIGHT)
1187  aSet.Put(SwFormatHoriOrient(0, text::HoriOrientation::LEFT));
1188  break;
1189 
1190  default:
1191  ;
1192  }
1193 
1194  if( aSet.Count() )
1195  rSh.SetFlyFrameAttr( aSet );
1196  }
1197  rSh.EndUndo();
1198 
1199  GetView().GetViewFrame()->GetBindings().Invalidate( SID_ANCHOR_MENU );
1200  }
1201  break;
1202 
1203  case FN_FRAME_NOWRAP:
1204  case FN_FRAME_WRAP:
1205  case FN_FRAME_WRAP_IDEAL:
1206  case FN_FRAME_WRAPTHRU:
1209  case FN_FRAME_WRAP_CONTOUR:
1210  case FN_WRAP_ANCHOR_ONLY:
1211  case FN_FRAME_WRAP_LEFT:
1212  case FN_FRAME_WRAP_RIGHT:
1213  SetWrapMode( nSlot );
1214  break;
1215 
1216  case FN_UPDATE_ALL_LINKS:
1217  {
1218  if( !rSh.GetLinkManager().GetLinks().empty() )
1219  {
1220  rSh.EnterStdMode();
1221  rSh.StartAllAction();
1222  rSh.GetLinkManager().UpdateAllLinks( false, false, nullptr );
1223  rSh.EndAllAction();
1224  }
1225  }
1226  break;
1227 
1228  case FN_XFORMS_DESIGN_MODE:
1229  if (pArgs && pArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET)
1230  {
1231  if (const SfxBoolItem* pBoolItem = dynamic_cast<const SfxBoolItem*>(pItem))
1232  {
1233  bool bDesignMode = pBoolItem->GetValue();
1234 
1235  // set from design mode
1236  OSL_ENSURE( GetView().GetFormShell() != nullptr, "form shell?" );
1237  SfxRequest aReq( GetView().GetViewFrame(), SID_FM_DESIGN_MODE );
1238  aReq.AppendItem( SfxBoolItem( SID_FM_DESIGN_MODE, bDesignMode ) );
1239  GetView().GetFormShell()->Execute( aReq );
1240  aReq.Done();
1241 
1242  // also set suitable view options
1243  SwViewOption aViewOption = *rSh.GetViewOptions();
1244  aViewOption.SetFormView( ! bDesignMode );
1245  rSh.ApplyViewOptions( aViewOption );
1246  }
1247  }
1248  break;
1249 
1250  default:
1251  bMore = true;
1252  }
1253 
1254 
1255  if(!bMore || !pArgs)
1256  return;
1257 
1258  pItem = nullptr;
1259  pArgs->GetItemState(GetPool().GetWhich(nSlot), false, &pItem);
1260  if(pItem)
1261  switch(nSlot)
1262  {
1263  case SID_ATTR_BRUSH:
1264  case SID_ATTR_BORDER_SHADOW:
1265  case RES_SHADOW:
1266  {
1267  rSh.StartAllAction();
1268  // Tabele cell(s) selected?
1269  if ( rSh.IsTableMode() )
1270  {
1271  SwFrameFormat *pFormat = rSh.GetTableFormat();
1272  pFormat->SetFormatAttr( *pItem );
1273  }
1274  else if ( rSh.IsFrameSelected() )
1275  {
1276  // Set border attributes via Frame-Manager.
1277  SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE );
1278  aMgr.SetAttrSet( *pArgs );
1279  aMgr.UpdateFlyFrame();
1280  }
1281  else
1282  {
1283  rSh.SetAttrSet( *pArgs );
1284  }
1285  rSh.EndAllAction();
1286  }
1287  break;
1293  {
1294  OSL_FAIL("not implemented");
1295  }
1296  break;
1297 
1298  case SID_ATTR_BORDER_OUTER:
1299  {
1300  // Tabele cell(s) selected?
1301  if ( rSh.IsTableMode() )
1302  {
1303  // Set border attributes Get/SetTabBorders()
1304  rSh.SetTabBorders(*pArgs);
1305  }
1306  else if ( rSh.IsFrameSelected() )
1307  {
1308  // Set border attributes via Frame-Manager.
1309  SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE );
1310  aMgr.SetAttrSet(*pArgs);
1311  aMgr.UpdateFlyFrame();
1312  }
1313  else
1314  {
1315  // Set border attributes via shell quite normally.
1316  rSh.SetAttrItem( *pItem );
1317  }
1318  }
1319  break;
1320  default:
1321  OSL_FAIL("wrong Dispatcher");
1322  }
1323 }
1324 
1325 // Here the state for SID_IMAP / SID_CONTOUR will be handled
1326 // until the swapping of the graphic is finished.
1327 
1328 IMPL_LINK_NOARG(SwBaseShell, GraphicArrivedHdl, SwCursorShell&, void)
1329 {
1330  SwWrtShell &rSh = GetShell();
1331  if (CNT_GRF != rSh.SwEditShell::GetCntType())
1332  return;
1333  GraphicType const nGrfType(rSh.GetGraphicType());
1334  if (GraphicType::NONE != nGrfType &&
1335  !aGrfUpdateSlots.empty() )
1336  {
1338  SfxViewFrame* pVFrame = GetView().GetViewFrame();
1339  for( const auto nSlot : aGrfUpdateSlots )
1340  {
1341  bool bSetState = false;
1342  bool bState = false;
1343  switch( nSlot )
1344  {
1345  case SID_IMAP:
1346  case SID_IMAP_EXEC:
1347  {
1348  sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
1349  SfxChildWindow *pChildWindow = pVFrame->HasChildWindow(nId) ?
1350  pVFrame->GetChildWindow(nId) : nullptr;
1351  SvxIMapDlg *pDlg = pChildWindow ?
1352  static_cast<SvxIMapDlg*>(pChildWindow->GetController().get()) : nullptr;
1353 
1354  if( pDlg && ( SID_IMAP_EXEC == nSlot ||
1355  ( SID_IMAP == nSlot && !bProtect)) &&
1356  pDlg->GetEditingObject() != rSh.GetIMapInventor())
1357  lcl_UpdateIMapDlg( rSh );
1358 
1359  if( !bProtect && SID_IMAP == nSlot )
1360  {
1361  bSetState = true;
1362  bState = nullptr != pDlg;
1363  }
1364  }
1365  break;
1366 
1367  case SID_CONTOUR_DLG:
1368  if( !bProtect )
1369  {
1370  sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
1371  SfxChildWindow *pChildWindow = pVFrame->HasChildWindow(nId) ?
1372  pVFrame->GetChildWindow(nId) : nullptr;
1373  SvxIMapDlg *pDlg = pChildWindow ?
1374  static_cast<SvxIMapDlg*>(pChildWindow->GetController().get()) : nullptr;
1375  if( pDlg && pDlg->GetEditingObject() !=
1376  rSh.GetIMapInventor() )
1378 
1379  bSetState = true;
1380  bState = nullptr != pDlg;
1381  }
1382  break;
1383 
1384  case FN_FRAME_WRAP_CONTOUR:
1385  if( !bProtect )
1386  {
1388  rSh.GetFlyFrameAttr(aSet);
1389  const SwFormatSurround& rWrap = aSet.Get(RES_SURROUND);
1390  bSetState = true;
1391  bState = rWrap.IsContour();
1392  }
1393  break;
1394 
1395  case SID_GRFFILTER:
1396  case SID_GRFFILTER_INVERT:
1397  case SID_GRFFILTER_SMOOTH:
1398  case SID_GRFFILTER_SHARPEN:
1399  case SID_GRFFILTER_REMOVENOISE:
1400  case SID_GRFFILTER_SOBEL:
1401  case SID_GRFFILTER_MOSAIC:
1402  case SID_GRFFILTER_EMBOSS:
1403  case SID_GRFFILTER_POSTER:
1404  case SID_GRFFILTER_POPART:
1405  case SID_GRFFILTER_SEPIA:
1406  case SID_GRFFILTER_SOLARIZE:
1407  bSetState = bState = GraphicType::Bitmap == nGrfType;
1408  break;
1409  }
1410 
1411  if( bSetState )
1412  {
1413  SfxBoolItem aBool( nSlot, bState );
1414  if( pGetStateSet )
1415  pGetStateSet->Put( aBool );
1416  else
1417  pVFrame->GetBindings().SetState( aBool );
1418  }
1419  }
1420  aGrfUpdateSlots.clear();
1421  }
1422 }
1423 
1425 {
1426  SwWrtShell &rSh = GetShell();
1427  SfxViewFrame* pVFrame = GetView().GetViewFrame();
1428  SfxWhichIter aIter( rSet );
1429  sal_uInt16 nWhich = aIter.FirstWhich();
1430  pGetStateSet = &rSet;
1431  while ( nWhich )
1432  {
1433  switch ( nWhich )
1434  {
1435  case SID_GALLERY_FORMATS:
1436  if ( rSh.IsObjSelected() ||
1437  (rSh.IsSelFrameMode() &&
1439  rSet.DisableItem( nWhich );
1440  break;
1441  case SID_GALLERY_ENABLE_ADDCOPY:
1442  // #108230# allow copy from gallery in Writer AND Writer/Web!
1443  rSet.Put( SfxBoolItem( SID_GALLERY_ENABLE_ADDCOPY, true ) );
1444  break;
1445  case FN_EDIT_REGION:
1446  if( !rSh.IsAnySectionInDoc() )
1447  rSet.DisableItem(nWhich);
1448  break;
1449 
1451  //tdf#112808 if cursor is in an index, don't show the edit section.
1452  if( !rSh.GetCurrSection() ||
1455  {
1456  rSet.DisableItem(nWhich);
1457  }
1458  break;
1459 
1460  case FN_INSERT_REGION:
1461  if( rSh.CursorInsideInputField()
1462  || rSh.IsSelFrameMode()
1463  || !rSh.IsInsRegionAvailable() )
1464  {
1465  rSet.DisableItem( nWhich );
1466  }
1467  break;
1468 
1470  {
1471  FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,true);
1472  if( (eFrameType & FrameTypeFlags::FOOTNOTE) ||
1473  !rSh.GetTableFormat() )
1474  rSet.DisableItem( nWhich );
1475  }
1476  break;
1478  {
1479  FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,true);
1480  if( (eFrameType & FrameTypeFlags::FOOTNOTE) ||
1481  !rSh.IsTextToTableAvailable() )
1482  rSet.DisableItem( nWhich );
1483  }
1484  break;
1485  case FN_CONVERT_TEXT_TABLE:
1486  {
1487  FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,true);
1488  if( (eFrameType & FrameTypeFlags::FOOTNOTE) ||
1489  (!rSh.GetTableFormat() && !rSh.IsTextToTableAvailable() ) )
1490  rSet.DisableItem( nWhich );
1491  }
1492  break;
1493  case RES_SHADOW:
1494  {
1495  SfxItemSet aSet( rSh.GetAttrPool(),
1497 
1498  // Table cell(s) selected?
1499  if ( rSh.IsTableMode() )
1500  {
1501  SwFrameFormat *pFormat = rSh.GetTableFormat();
1502  aSet.Put(pFormat->GetFormatAttr( nWhich ));
1503  }
1504  else if( rSh.IsFrameSelected() )
1505  {
1506  SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE );
1507  aSet.Put( aMgr.GetAttrSet() );
1508  }
1509  else
1510  rSh.GetCurAttr( aSet );
1511 
1512  const SvxShadowItem& rShItem = static_cast<const SvxShadowItem&>(aSet.Get(nWhich));
1513  rSet.Put(rShItem);
1514  }
1515  break;
1516  case SID_IMAP:
1517  {
1518  // #i59688#
1519  // Improve efficiency:
1520  // If selected object is protected, item has to disabled.
1522  if ( bProtect )
1523  {
1524  rSet.DisableItem( nWhich );
1525  }
1526  else
1527  {
1528  const sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
1529  const bool bHas = pVFrame->HasChildWindow( nId );
1530  const bool bFrameSel = rSh.IsFrameSelected();
1531  const bool bIsGraphicSelection =
1533 
1534  // #i59688#
1535  // Avoid unnecessary loading of selected graphic.
1536  // The graphic is only needed, if the dialog is open.
1537  // If the swapping of the graphic is finished, the status
1538  // must be determined asynchronously, until this the slot
1539  // will be disabled.
1540  if ( bHas && bIsGraphicSelection && rSh.IsLinkedGrfSwapOut() )
1541  {
1542  if( AddGrfUpdateSlot( nWhich ))
1543  rSh.GetGraphic(false); // start the loading
1544  }
1545  else
1546  {
1547  if ( !bHas &&
1548  ( !bFrameSel ||
1549  ( bIsGraphicSelection &&
1550  rSh.GetGraphicType() == GraphicType::NONE ) ) )
1551  {
1552  rSet.DisableItem( nWhich );
1553  }
1554  else
1555  {
1556  SfxBoolItem aBool(nWhich, bHas);
1557  if ( bHas && bFrameSel )
1558  lcl_UpdateIMapDlg( rSh );
1559  rSet.Put(aBool);
1560  }
1561  }
1562  }
1563  }
1564  break;
1565  case SID_IMAP_EXEC:
1566  {
1567  bool bDisable = false;
1568  if( !rSh.IsFrameSelected())
1569  bDisable = true;
1570  sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
1571  if(!bDisable && pVFrame->HasChildWindow( nId ))
1572  {
1574  && rSh.IsLinkedGrfSwapOut())
1575  {
1576  if( AddGrfUpdateSlot( nWhich ))
1577  rSh.GetGraphic(false); // start the loading
1578  }
1579  else
1580  {
1581  SvxIMapDlg *pDlg = GetIMapDlg(GetView());
1582  if (pDlg && pDlg->GetEditingObject() != rSh.GetIMapInventor())
1583  lcl_UpdateIMapDlg( rSh );
1584  }
1585  }
1586  rSet.Put(SfxBoolItem(nWhich, bDisable));
1587  }
1588  break;
1589 
1590  case FN_BACKSPACE:
1591  case SID_DELETE:
1592  if ( ( rSh.HasReadonlySel() && !rSh.CursorInsideInputField() )
1594  {
1595  rSet.DisableItem( nWhich );
1596  }
1597  break;
1598 
1599  case SID_CONTOUR_DLG:
1600  {
1602 
1603  if( bParentCntProt || 0 != (HTMLMODE_ON & ::GetHtmlMode(
1604  GetView().GetDocShell() )) )
1605  rSet.DisableItem( nWhich );
1606  else
1607  {
1608  sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
1609  bool bHas = GetView().GetViewFrame()->HasChildWindow( nId );
1610  SelectionType nSel = rSh.GetSelectionType();
1611  bool bOk(nSel & (SelectionType::Graphic|SelectionType::Ole));
1612 
1613  bool bDisable = false;
1614  if( !bHas && !bOk )
1615  bDisable = true;
1616  // #i59688#
1617  // Avoid unnecessary loading of selected graphic.
1618  // The graphic is only needed, if the dialog is open.
1619  // If the swapping of the graphic is finished, the status
1620  // must be determined asynchronously, until this the slot
1621  // will be disabled.
1622  else if ( bHas && (nSel & SelectionType::Graphic) &&
1623  rSh.IsLinkedGrfSwapOut() )
1624  {
1625  if( AddGrfUpdateSlot( nWhich ))
1626  rSh.GetGraphic(false); // start the loading
1627  // #i75481#
1628  bDisable = true;
1629  }
1630  else if( bHas && bOk )
1631  bDisable = !lcl_UpdateContourDlg( rSh, nSel );
1632  else if( bOk )
1633  {
1634  // #i75481#
1635  // apply fix #i59688# only for selected graphics
1636  if ( nSel & SelectionType::Graphic )
1637  bDisable = GraphicType::NONE == rSh.GetGraphicType();
1638  else
1639  bDisable = GraphicType::NONE == rSh.GetIMapGraphic().GetType();
1640  }
1641 
1642  if( bDisable )
1643  rSet.DisableItem( nWhich );
1644  else
1645  rSet.Put( SfxBoolItem(nWhich, bHas) );
1646  }
1647  }
1648  break;
1649  case SID_CONTOUR_EXEC:
1650  {
1651  bool bDisable = false;
1652  SelectionType nSel = rSh.GetSelectionType();
1653  if( !(nSel & (SelectionType::Graphic|SelectionType::Ole)) )
1654  bDisable = true;
1655  sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
1656  if( !bDisable && GetView().GetViewFrame()->HasChildWindow( nId ))
1657  {
1658  SvxContourDlg *pDlg = GetContourDlg(GetView());
1659  if (pDlg && pDlg->GetEditingObject() != rSh.GetIMapInventor())
1660  bDisable = true;
1661  }
1662  rSet.Put(SfxBoolItem(nWhich, bDisable));
1663  }
1664  break;
1665 
1666  case SID_ANCHOR_MENU:
1667  case FN_TOOL_ANCHOR_PAGE:
1669  case FN_TOOL_ANCHOR_CHAR:
1671  case FN_TOOL_ANCHOR_FRAME:
1672  {
1673  bool bObj = 0 != rSh.IsObjSelected();
1675 
1676  if( !bParentCntProt && (bObj || rSh.IsFrameSelected()))
1677  {
1679  if(bObj)
1680  rSh.GetObjAttr(aSet);
1681  else
1682  rSh.GetFlyFrameAttr(aSet);
1683  RndStdIds eSet = aSet.Get(RES_ANCHOR).GetAnchorId();
1684  const bool bSet =
1685  ((nWhich == FN_TOOL_ANCHOR_PAGE) &&
1686  (eSet == RndStdIds::FLY_AT_PAGE))
1687  || ((nWhich == FN_TOOL_ANCHOR_PARAGRAPH) &&
1688  (eSet == RndStdIds::FLY_AT_PARA))
1689  || ((nWhich == FN_TOOL_ANCHOR_FRAME) &&
1690  (eSet == RndStdIds::FLY_AT_FLY))
1691  || ((nWhich == FN_TOOL_ANCHOR_AT_CHAR) &&
1692  (eSet == RndStdIds::FLY_AT_CHAR))
1693  || ((nWhich == FN_TOOL_ANCHOR_CHAR) &&
1694  (eSet == RndStdIds::FLY_AS_CHAR));
1695 
1696  if( nWhich == FN_TOOL_ANCHOR_FRAME && !rSh.IsFlyInFly() )
1697  rSet.DisableItem(nWhich);
1698  else if(nWhich != SID_ANCHOR_MENU)
1699  rSet.Put(SfxBoolItem(nWhich, bSet));
1700 
1702  {
1703  if (nWhich == FN_TOOL_ANCHOR_PAGE || nWhich == FN_TOOL_ANCHOR_PARAGRAPH
1704  || nWhich == FN_TOOL_ANCHOR_FRAME)
1705  {
1706  rSet.DisableItem(nWhich);
1707  }
1708  }
1709  }
1710  else
1711  rSet.DisableItem( nWhich );
1712  }
1713  break;
1714  case FN_FRAME_NOWRAP:
1715  case FN_FRAME_WRAP:
1716  case FN_FRAME_WRAP_IDEAL:
1717  case FN_FRAME_WRAPTHRU:
1720  case FN_FRAME_WRAP_CONTOUR:
1721  case FN_WRAP_ANCHOR_ONLY:
1722  case FN_FRAME_WRAP_LEFT:
1723  case FN_FRAME_WRAP_RIGHT:
1724  {
1725  bool bObj = 0 != rSh.IsObjSelected();
1727 
1728  if( !bParentCntProt && (bObj || rSh.IsFrameSelected()))
1729  {
1731  RndStdIds nAnchorType;
1732  if(bObj)
1733  {
1734  rSh.GetObjAttr(aSet);
1735  nAnchorType = rSh.GetAnchorId();
1736  }
1737  else
1738  {
1739  rSh.GetFlyFrameAttr(aSet);
1740  nAnchorType = aSet.Get(RES_ANCHOR).GetAnchorId();
1741  }
1742  const SwFormatSurround& rWrap = aSet.Get(RES_SURROUND);
1743 
1744  const SvxOpaqueItem& rOpaque = aSet.Get(RES_OPAQUE);
1745  bool bOpaque = rOpaque.GetValue();
1746  css::text::WrapTextMode nSurround = rWrap.GetSurround();
1747  bool bSet = false;
1748 
1749  bool bDisable =
1750  (nAnchorType == RndStdIds::UNKNOWN) || (nAnchorType == RndStdIds::FLY_AS_CHAR);
1751  const bool bHtmlMode =
1752  0 != ::GetHtmlMode(GetView().GetDocShell());
1753 
1754  switch( nWhich )
1755  {
1756  case FN_FRAME_NOWRAP:
1757  bDisable |=
1758  ( (nAnchorType != RndStdIds::FLY_AT_PARA)
1759  && (nAnchorType != RndStdIds::FLY_AT_CHAR)
1760  && (nAnchorType != RndStdIds::FLY_AT_PAGE));
1761  bSet = nSurround == css::text::WrapTextMode_NONE;
1762  break;
1763  case FN_FRAME_WRAP:
1764  bDisable |= bHtmlMode;
1765  bSet = nSurround == css::text::WrapTextMode_PARALLEL;
1766  break;
1767  case FN_FRAME_WRAP_IDEAL:
1768  bDisable |= bHtmlMode;
1769  bSet = nSurround == css::text::WrapTextMode_DYNAMIC;
1770  break;
1771  case FN_FRAME_WRAPTHRU:
1772  bDisable |= (bHtmlMode ||
1773  ( (nAnchorType != RndStdIds::FLY_AT_PARA)
1774  && (nAnchorType != RndStdIds::FLY_AT_CHAR)
1775  && (nAnchorType != RndStdIds::FLY_AT_PAGE)));
1776  if(bObj)
1777  bSet = nSurround == css::text::WrapTextMode_THROUGH && rSh.GetLayerId();
1778  else
1779  bSet = nSurround == css::text::WrapTextMode_THROUGH && bOpaque;
1780  break;
1783  bDisable |= bHtmlMode;
1784  if(bObj)
1785  bSet = nSurround == css::text::WrapTextMode_THROUGH && !rSh.GetLayerId();
1786  else
1787  bSet = nSurround == css::text::WrapTextMode_THROUGH && !bOpaque;
1788  break;
1789  case FN_FRAME_WRAP_CONTOUR:
1790  bDisable |= bHtmlMode;
1791  //no contour available whenn no wrap or wrap through is set
1792  bDisable |= (nSurround == css::text::WrapTextMode_NONE || nSurround == css::text::WrapTextMode_THROUGH);
1793  if( !bDisable )
1794  {
1795  SelectionType nSel = rSh.GetSelectionType();
1796  if( (nSel & SelectionType::Graphic) &&
1797  rSh.IsLinkedGrfSwapOut())
1798  {
1799  if( AddGrfUpdateSlot( nWhich ))
1800  rSh.GetGraphic(false); // start the loading
1801  }
1802  else if( rSh.IsFrameSelected() )
1803  {
1804  // #i102253# applied patch from OD (see task)
1805  bDisable =
1806  nSel & SelectionType::Frame ||
1807  GraphicType::NONE == rSh.GetIMapGraphic().GetType();
1808  }
1809  }
1810  bSet = !bDisable && rWrap.IsContour();
1811 
1812  break;
1813  case FN_WRAP_ANCHOR_ONLY:
1814  bDisable |= (bHtmlMode ||
1815  (nAnchorType != RndStdIds::FLY_AT_PARA));
1816  bSet = rWrap.IsAnchorOnly();
1817  break;
1818  case FN_FRAME_WRAP_LEFT:
1819  bSet = nSurround == css::text::WrapTextMode_LEFT;
1820  break;
1821  case FN_FRAME_WRAP_RIGHT:
1822  bSet = nSurround == css::text::WrapTextMode_RIGHT;
1823  break;
1824  }
1825 
1826  if(bDisable)
1827  rSet.DisableItem(nWhich);
1828  else
1829  rSet.Put(SfxBoolItem(nWhich, bSet));
1830  }
1831  else
1832  rSet.DisableItem(nWhich);
1833  }
1834  break;
1835  case FN_UPDATE_CHARTS:
1836  if( !rSh.HasCharts() )
1837  rSet.DisableItem( nWhich );
1838  break;
1839  case FN_UPDATE_ALL_LINKS:
1840  if ( rSh.GetLinkManager().GetLinks().empty() )
1841  rSet.DisableItem(nWhich);
1842  break;
1843  case FN_XFORMS_DESIGN_MODE:
1844  // enable if in XForms document
1845  if( rSh.GetDoc()->isXForms() )
1846  {
1847  // determine current state from view options
1848  bool bValue = ! rSh.GetViewOptions()->IsFormView();
1849  rSet.Put( SfxBoolItem( nWhich, bValue ) );
1850  }
1851  else
1852  rSet.Put( SfxVisibilityItem( nWhich, false ) );
1853  break;
1854  }
1855  nWhich = aIter.NextWhich();
1856  }
1857  pGetStateSet = nullptr;
1858 }
1859 
1860 // Disable the slots with this status method
1861 
1863 {
1864  SfxWhichIter aIter(rSet);
1865  sal_uInt16 nWhich = aIter.FirstWhich();
1866 
1867  while (nWhich)
1868  {
1869  rSet.DisableItem( nWhich );
1870  nWhich = aIter.NextWhich();
1871  }
1872 }
1873 
1874 // Disable the slots with this status method
1875 
1877 {
1880 
1881  if ( bParentCntProt ||
1882  ShellMode::Draw == eMode ||
1883  ShellMode::DrawForm == eMode ||
1884  ShellMode::DrawText == eMode ||
1885  ShellMode::Bezier == eMode )
1886  {
1887  SfxWhichIter aIter( rSet );
1888  sal_uInt16 nWhich = aIter.FirstWhich();
1889  while ( nWhich )
1890  {
1891  rSet.DisableItem( nWhich );
1892  nWhich = aIter.NextWhich();
1893  }
1894  }
1895  else
1897 }
1898 
1899 void SwBaseShell::SetWrapMode( sal_uInt16 nSlot )
1900 {
1901  SwWrtShell &rSh = GetShell();
1902  bool bObj = 0 != rSh.IsObjSelected();
1903  if( !bObj && !rSh.IsFrameSelected())
1904  return;
1905 
1907  if(bObj)
1908  rSh.GetObjAttr(aSet);
1909  else
1910  rSh.GetFlyFrameAttr(aSet);
1911  SwFormatSurround aWrap( aSet.Get(RES_SURROUND) );
1912  css::text::WrapTextMode nOldSurround(aWrap.GetSurround());
1913  css::text::WrapTextMode nSurround = css::text::WrapTextMode_PARALLEL;
1914 
1915  switch (nSlot)
1916  {
1917  case FN_FRAME_NOWRAP:
1918  nSurround = css::text::WrapTextMode_NONE;
1919  if (aWrap.IsContour())
1920  aWrap.SetContour(false);
1921  break;
1922  case FN_FRAME_WRAP_IDEAL:
1923  nSurround = css::text::WrapTextMode_DYNAMIC;
1924  break;
1925  case FN_WRAP_ANCHOR_ONLY:
1926  aWrap.SetAnchorOnly(!aWrap.IsAnchorOnly());
1927 
1928  // keep previous wrapping
1929 
1930  // switch to wrap css::text::WrapTextMode_PARALLEL, if previous wrap is css::text::WrapTextMode_NONE
1931  if ( nOldSurround != css::text::WrapTextMode_NONE )
1932  {
1933  nSurround = nOldSurround;
1934  }
1935  break;
1936  case FN_FRAME_WRAP_CONTOUR:
1937  aWrap.SetContour(!aWrap.IsContour());
1938  break;
1941  if (aWrap.IsContour())
1942  aWrap.SetContour(false);
1943  [[fallthrough]];
1944  case FN_FRAME_WRAPTHRU:
1945  nSurround = css::text::WrapTextMode_THROUGH;
1946  break;
1947 
1948  case FN_FRAME_WRAP_LEFT:
1949  nSurround = css::text::WrapTextMode_LEFT;
1950  break;
1951 
1952  case FN_FRAME_WRAP_RIGHT:
1953  nSurround = css::text::WrapTextMode_RIGHT;
1954  break;
1955 
1956  default:
1957  break;
1958  }
1959  aWrap.SetSurround(nSurround);
1960 
1961  if (nSlot != FN_FRAME_WRAP_CONTOUR)
1962  {
1963  // Defaulting the contour wrap on draw objects.
1964  if (bObj && nOldSurround != nSurround &&
1965  (nOldSurround == css::text::WrapTextMode_NONE || nOldSurround == css::text::WrapTextMode_THROUGH))
1966  {
1967  aWrap.SetContour(true);
1968  }
1969  }
1970 
1971  aSet.Put( aWrap );
1972 
1973  bool bOpaque = nSlot != FN_FRAME_WRAPTHRU_TRANSP && nSlot != FN_FRAME_WRAPTHRU_TOGGLE;
1974  if( nSlot == FN_FRAME_WRAPTHRU_TOGGLE )
1975  {
1976  if( bObj )
1977  bOpaque = !rSh.GetLayerId();
1978  else
1979  {
1980  const SvxOpaqueItem& aOpaque( aSet.Get(RES_OPAQUE) );
1981  bOpaque = !aOpaque.GetValue();
1982  }
1983  }
1984  aSet.Put(SvxOpaqueItem(RES_OPAQUE, bOpaque ));
1985 
1986  if(bObj)
1987  {
1988  rSh.SetObjAttr(aSet);
1989  if ( bOpaque )
1990  rSh.SelectionToHeaven();
1991  else
1992  rSh.SelectionToHell();
1993  }
1994  else
1995  rSh.SetFlyFrameAttr(aSet);
1996 
1997 }
1998 
1999 //Force update of the status line
2000 
2002 {
2003  eFrameMode = eMode;
2004  SfxBindings &rBnd = pSh->GetView().GetViewFrame()->GetBindings();
2005 
2006  if( eMode == FLY_DRAG || pSh->IsFrameSelected() || pSh->IsObjSelected() )
2007  {
2008  const SfxPointItem aTmp1( SID_ATTR_POSITION, pSh->GetAnchorObjDiff());
2009  const SvxSizeItem aTmp2( SID_ATTR_SIZE, pSh->GetObjSize());
2010  rBnd.SetState( aTmp1 );
2011  rBnd.SetState( aTmp2 );
2012  }
2013  else if( eMode == FLY_DRAG_END )
2014  {
2015  static sal_uInt16 aInval[] =
2016  {
2017  SID_ATTR_POSITION, SID_ATTR_SIZE, 0
2018  };
2019  rBnd.Invalidate(aInval);
2020  }
2021 }
2022 
2024  SfxShell( &rVw ),
2025  rView(rVw),
2026  pGetStateSet(nullptr)
2027 {
2028  SwWrtShell& rWrtSh = rView.GetWrtShell();
2029 
2030  SetPool(&rWrtSh.GetAttrPool());
2031  SetName("Base");
2032  rWrtSh.SetGrfArrivedLnk( LINK( this, SwBaseShell, GraphicArrivedHdl));
2033 }
2034 
2036 {
2037  if( rView.GetCurShell() == this )
2038  rView.ResetSubShell();
2039 
2040  Link<SwCursorShell&,void> aTmp( LINK( this, SwBaseShell, GraphicArrivedHdl));
2041  if( aTmp == rView.GetWrtShell().GetGrfArrivedLnk() )
2043 }
2044 
2046 {
2047  const SfxItemSet *pArgs = rReq.GetArgs();
2048 
2049  if( pArgs)
2050  {
2051  SwWrtShell &rSh = GetShell();
2052  std::unique_ptr<SvxScriptSetItem> pSSetItem;
2053  sal_uInt16 nSlot = rReq.GetSlot();
2054  SfxItemPool& rPool = rSh.GetAttrPool();
2055  sal_uInt16 nWhich = rPool.GetWhich( nSlot );
2056  SvtScriptType nScripts = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX;
2060 
2061  switch( nSlot )
2062  {
2063  case SID_ATTR_CHAR_FONT:
2064  {
2065  nScripts = rSh.GetScriptType();
2066  // #i42732# input language should be preferred over
2067  // current cursor position to detect script type
2068  if(!rSh.HasSelection())
2069  {
2070  LanguageType nInputLang = GetView().GetEditWin().GetInputLanguage();
2071  if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM)
2072  nScripts = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang );
2073  }
2074  [[fallthrough]];
2075  }
2076  case SID_ATTR_CHAR_POSTURE:
2077  case SID_ATTR_CHAR_WEIGHT:
2078  {
2079  pSSetItem.reset(new SvxScriptSetItem( nSlot, rPool ));
2080  pSSetItem->PutItemForScriptType( nScripts, pArgs->Get( nWhich ));
2081  pArgs = &pSSetItem->GetItemSet();
2082  }
2083  break;
2084  case SID_ATTR_CHAR_FONTHEIGHT:
2085  {
2086  if(rSh.HasSelection())
2087  {
2088  pSSetItem.reset(new SvxScriptSetItem( nSlot, rPool ));
2089  pSSetItem->PutItemForScriptType( nScripts, pArgs->Get( nWhich ));
2090  pArgs = &pSSetItem->GetItemSet();
2091  }
2092  else
2093  {
2094  nScripts = rSh.GetScriptType();
2095  LanguageType nInputLang = GetView().GetEditWin().GetInputLanguage();
2096  if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM)
2097  nScripts = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang );
2098  sal_uInt32 nHeight = static_cast< const SvxFontHeightItem& >(pArgs->Get( nWhich )).GetHeight();
2099  SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig();
2100 
2104  rSh.GetCurAttr( aLangSet );
2105 
2106  sal_Int32 nWesternSize =
2108  aLangSet.Get( RES_CHRATR_LANGUAGE).GetLanguage());
2109  sal_Int32 nCJKSize =
2111  aLangSet.Get( RES_CHRATR_CJK_LANGUAGE).GetLanguage());
2112  sal_Int32 nCTLSize =
2114  aLangSet.Get( RES_CHRATR_CTL_LANGUAGE).GetLanguage());
2115 
2116  switch(nScripts)
2117  {
2118  case SvtScriptType::LATIN:
2119  nCJKSize = nHeight * nCJKSize / nWesternSize;
2120  nCTLSize = nHeight * nCTLSize / nWesternSize;
2121  nWesternSize = static_cast<sal_Int32>(nHeight);
2122  break;
2123  case SvtScriptType::ASIAN:
2124  nCTLSize = nHeight* nCTLSize / nCJKSize;
2125  nWesternSize = nHeight * nWesternSize / nCJKSize;
2126  nCJKSize = static_cast<sal_Int32>(nHeight);
2127  break;
2128  case SvtScriptType::COMPLEX:
2129  nCJKSize = nHeight * nCJKSize / nCTLSize;
2130  nWesternSize = nHeight * nWesternSize / nCTLSize;
2131  nCTLSize = static_cast<sal_Int32>(nHeight);
2132  break;
2133  default: break;
2134  }
2135  aHeightSet.Put( SvxFontHeightItem( static_cast<sal_uInt32>(nWesternSize), 100, RES_CHRATR_FONTSIZE ));
2136  aHeightSet.Put( SvxFontHeightItem( static_cast<sal_uInt32>(nCJKSize), 100, RES_CHRATR_CJK_FONTSIZE ));
2137  aHeightSet.Put( SvxFontHeightItem( static_cast<sal_uInt32>(nCTLSize), 100, RES_CHRATR_CTL_FONTSIZE ));
2138  pArgs = &aHeightSet;
2139  }
2140  }
2141  break;
2142  }
2143 
2144  if( pArgs )
2145  {
2146  bool bAuto = false;
2147  if ( !isCHRATR(nWhich) ||
2148  ( rSh.HasSelection() && rSh.IsSelFullPara() ) )
2149  {
2150  SwTextFormatColl * pColl = rSh.GetCurTextFormatColl();
2151  if ( pColl && pColl->IsAutoUpdateFormat() )
2152  {
2153  rSh.AutoUpdatePara( pColl, *pArgs );
2154  bAuto = true;
2155  }
2156  }
2157 
2158  if (!bAuto)
2159  {
2160  rSh.SetAttrSet( *pArgs );
2161  }
2162  }
2163  }
2164  else
2165  GetView().GetViewFrame()->GetDispatcher()->Execute( SID_CHAR_DLG );
2166  rReq.Done();
2167 }
2168 
2170 {
2171  SwWrtShell &rSh = GetShell();
2172  rSh.GetCurAttr( rSet );
2173 }
2174 
2176 {
2177  SwWrtShell &rSh = GetShell();
2178  bool bFirst = true;
2179  std::unique_ptr<SfxItemSet> pFntCoreSet;
2180  SvtScriptType nScriptType = SvtScriptType::LATIN;
2181  SfxWhichIter aIter( rSet );
2182  sal_uInt16 nWhich = aIter.FirstWhich();
2183  while( nWhich )
2184  {
2185  switch( nWhich )
2186  {
2187  case RES_CHRATR_FONT:
2188  case RES_CHRATR_FONTSIZE:
2189  case RES_CHRATR_WEIGHT:
2190  case RES_CHRATR_POSTURE:
2191  {
2192  if( !pFntCoreSet )
2193  {
2194  pFntCoreSet.reset(new SfxItemSet( *rSet.GetPool(),
2196  rSh.GetCurAttr( *pFntCoreSet );
2197  nScriptType = rSh.GetScriptType();
2198  // #i42732# input language should be preferred over
2199  // current cursor position to detect script type
2200  SwEditWin& rEditWin = GetView().GetEditWin();
2201  if( rEditWin.IsUseInputLanguage() )
2202  {
2203  if(!rSh.HasSelection() && (
2204  nWhich == RES_CHRATR_FONT ||
2205  nWhich == RES_CHRATR_FONTSIZE ))
2206  {
2207  LanguageType nInputLang = rEditWin.GetInputLanguage();
2208  if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM)
2209  nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang );
2210  }
2211  }
2212  }
2213  SfxItemPool& rPool = *rSet.GetPool();
2214  SvxScriptSetItem aSetItem( rPool.GetSlotId( nWhich ), rPool );
2215  aSetItem.GetItemSet().Put( *pFntCoreSet, false );
2216  const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType );
2217  if( pI )
2218  {
2219  rSet.Put( pI->CloneSetWhich(nWhich) );
2220  }
2221  else
2222  rSet.InvalidateItem( nWhich );
2223  // Set input context of the SwEditWin according to the selected font and script type
2224  if(RES_CHRATR_FONT == nWhich)
2225  {
2226  vcl::Font aFont;
2227  if (const SvxFontItem* pFontItem = dynamic_cast<const SvxFontItem*>(pI))
2228  {
2229  aFont.SetFamilyName(pFontItem->GetFamilyName());
2230  aFont.SetStyleName(pFontItem->GetStyleName());
2231  aFont.SetFamily(pFontItem->GetFamily());
2232  aFont.SetPitch(pFontItem->GetPitch());
2233  aFont.SetCharSet(pFontItem->GetCharSet());
2234  }
2235 
2236  bool bVertical = rSh.IsInVerticalText();
2237  aFont.SetOrientation(bVertical ? 2700 : 0);
2238  aFont.SetVertical(bVertical);
2239  GetView().GetEditWin().SetInputContext( InputContext( aFont, InputContextFlags::Text |
2240  InputContextFlags::ExtText ) );
2241  }
2242  }
2243  break;
2244 
2245  default:
2246  if( bFirst )
2247  {
2248  rSh.GetCurAttr( rSet );
2249  bFirst = false;
2250  }
2251  }
2252  nWhich = aIter.NextWhich();
2253  }
2254 }
2255 
2257 {
2258  SwWrtShell &rSh = GetShell();
2259  SfxWhichIter aIter(rSet);
2260  sal_uInt16 nWhich(aIter.FirstWhich());
2261  SelectionType nSelType(rSh.GetSelectionType());
2262  std::unique_ptr<SvxBrushItem> aBrushItem(std::make_unique<SvxBrushItem>(RES_BACKGROUND));
2263 
2264  if( nWhich == SID_TABLE_CELL_BACKGROUND_COLOR )
2265  {
2266  rSh.GetBoxBackground( aBrushItem );
2267  }
2268  else
2269  {
2270  // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set
2272 
2273  aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet());
2274 
2275  if(nSelType & SelectionType::Graphic || SelectionType::Frame & nSelType)
2276  {
2277  rSh.GetFlyFrameAttr(aCoreSet);
2278  }
2279  else
2280  {
2281  rSh.GetCurAttr(aCoreSet);
2282  }
2283 
2284  aBrushItem = getSvxBrushItemFromSourceSet(aCoreSet, RES_BACKGROUND);
2285  }
2286 
2287  while(nWhich)
2288  {
2289  switch(nWhich)
2290  {
2291  case SID_BACKGROUND_COLOR:
2292  case SID_TABLE_CELL_BACKGROUND_COLOR:
2293  {
2294  SvxColorItem aColorItem(aBrushItem->GetColor(), nWhich);
2295  rSet.Put(aColorItem);
2296  break;
2297  }
2298  case SID_ATTR_BRUSH:
2299  case RES_BACKGROUND:
2300  {
2301  // if this was intended to have a independent copy of the Item to be set
2302  // this is not needed due to the ItemSet/Pool cloning Items which get set anyways.
2303  // Keeping code as reference - it may have had other reasons I do notz see (?!?)
2304  // std::unique_ptr<SfxPoolItem> pNewItem(aBrushItem.CloneSetWhich(GetPool().GetWhich(nWhich)));
2305  rSet.Put(*aBrushItem);
2306  break;
2307  }
2308  }
2309 
2310  nWhich = aIter.NextWhich();
2311  }
2312 }
2313 
2315 {
2316  SwWrtShell &rSh = GetShell();
2317  SelectionType nSelType(rSh.GetSelectionType());
2318  const SfxItemSet* pArgs = rReq.GetArgs();
2319  sal_uInt16 nSlot(rReq.GetSlot());
2320 
2321  if (!pArgs && nSlot != SID_BACKGROUND_COLOR && nSlot != SID_TABLE_CELL_BACKGROUND_COLOR)
2322  {
2323  return;
2324  }
2325 
2326  std::unique_ptr<SvxBrushItem> aBrushItem(std::make_unique<SvxBrushItem>(RES_BACKGROUND));
2327 
2328  if ( nSlot == SID_TABLE_CELL_BACKGROUND_COLOR )
2329  {
2330  rSh.GetBoxBackground( aBrushItem );
2331  }
2332  else
2333  {
2334  // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set
2336 
2337  aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet());
2338 
2339  if((SelectionType::Frame & nSelType) || (SelectionType::Graphic & nSelType))
2340  {
2341  rSh.GetFlyFrameAttr(aCoreSet);
2342  }
2343  else
2344  {
2345  rSh.GetCurAttr(aCoreSet);
2346  }
2347 
2348  aBrushItem = getSvxBrushItemFromSourceSet(aCoreSet, RES_BACKGROUND);
2349  }
2350 
2351  switch(nSlot)
2352  {
2353  case SID_BACKGROUND_COLOR:
2354  case SID_TABLE_CELL_BACKGROUND_COLOR:
2355  {
2356  const SfxPoolItem* pColorStringItem = nullptr;
2357  bool bIsTransparent = false;
2358 
2359  aBrushItem->SetGraphicPos(GPOS_NONE);
2360 
2361  sal_uInt16 nSlotId = (nSlot == SID_BACKGROUND_COLOR) ? SID_BACKGROUND_COLOR : SID_TABLE_CELL_BACKGROUND_COLOR;
2362  if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_ATTR_COLOR_STR, false, &pColorStringItem))
2363  {
2364  OUString sColor = static_cast<const SfxStringItem*>(pColorStringItem)->GetValue();
2365  if (sColor == "transparent")
2366  {
2367  bIsTransparent = true;
2368  }
2369  else
2370  {
2371  Color aColor(sColor.toInt32(16));
2372 
2373  aBrushItem->SetColor(aColor);
2374 
2375  SvxColorItem aNewColorItem(nSlotId);
2376  aNewColorItem.SetValue(aColor);
2377 
2378  GetView().GetViewFrame()->GetBindings().SetState(aNewColorItem);
2379  }
2380  }
2381  else if (pArgs)
2382  {
2383  const SvxColorItem& rNewColorItem = static_cast<const SvxColorItem&>(pArgs->Get(nSlotId));
2384  const Color& rNewColor = rNewColorItem.GetValue();
2385  aBrushItem->SetColor(rNewColor);
2386  GetView().GetViewFrame()->GetBindings().SetState(rNewColorItem);
2387  }
2388  else
2389  {
2390  bIsTransparent = true;
2391  }
2392 
2393  if (bIsTransparent)
2394  {
2395  aBrushItem->SetColor(COL_TRANSPARENT);
2397  }
2398  break;
2399  }
2400 
2401  case SID_ATTR_BRUSH:
2402  case RES_BACKGROUND:
2403  {
2404  assert(pArgs && "only SID_BACKGROUND_COLOR can have !pArgs, checked at entry");
2405  aBrushItem.reset(static_cast<SvxBrushItem*>(pArgs->Get(GetPool().GetWhich(nSlot)).Clone()));
2406  break;
2407  }
2408  default:
2409  {
2410  rReq.Ignore();
2411  OSL_FAIL("unknown message in ExecuteAttr!" );
2412  return;
2413  }
2414  }
2415 
2416  if ( nSlot == SID_TABLE_CELL_BACKGROUND_COLOR )
2417  {
2418  rSh.SetBoxBackground( *aBrushItem );
2419  }
2420  else
2421  {
2422  // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set
2424 
2425  aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet());
2426  setSvxBrushItemAsFillAttributesToTargetSet(*aBrushItem, aCoreSet);
2427 
2428  if((SelectionType::Frame & nSelType) || (SelectionType::Graphic & nSelType))
2429  {
2430  // Template autoupdate
2431  SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat();
2432 
2433  if(pFormat && pFormat->IsAutoUpdateFormat())
2434  {
2435  rSh.AutoUpdateFrame(pFormat, aCoreSet);
2436  }
2437  else
2438  {
2439  rSh.SetFlyFrameAttr(aCoreSet);
2440  }
2441  }
2442  else
2443  {
2444  SwTextFormatColl* pColl = rSh.GetCurTextFormatColl();
2445 
2446  if(pColl && pColl->IsAutoUpdateFormat())
2447  {
2448  rSh.AutoUpdatePara(pColl, aCoreSet);
2449  }
2450  else
2451  {
2452  rSh.SetAttrSet(aCoreSet);
2453  }
2454  }
2455  }
2456 
2457  rReq.Done();
2458 }
2459 
2461 {
2462  SwWrtShell &rSh = GetShell();
2463  // Tabele cell(s) selected?
2464  bool bPrepare = true;
2465  bool bTableMode = rSh.IsTableMode();
2466  if ( bTableMode )
2467  {
2468  SfxItemSet aCoreSet( GetPool(),
2470  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{} );
2471  SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
2472  aCoreSet.Put( aBoxInfo );
2473  rSh.GetTabBorders( aCoreSet );
2474  rSet.Put( aCoreSet );
2475  }
2476  else if ( rSh.IsFrameSelected() )
2477  {
2478  SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE );
2479  rSet.Put( aMgr.GetAttrSet() );
2480  bPrepare = false;
2481  }
2482  else
2483  // Get border attributes via shell quite normal
2484  rSh.GetCurAttr( rSet );
2485  if ( bPrepare )
2486  ::PrepareBoxInfo( rSet, rSh );
2487  // Switch the border toolbox controller mode
2488  rSet.Put( SfxBoolItem( SID_BORDER_REDUCED_MODE, !bTableMode ));
2489 }
2490 
2492 {
2493  SwWrtShell &rSh = GetShell();
2494  weld::Window* pMDI = GetView().GetFrameWeld();
2495  // So that from the basic no dialogues for the background views are called:
2496  bool bBackground = (&GetView() != GetActiveView());
2497  const SfxPoolItem* pItem = nullptr;
2498  const SfxItemSet* pArgs = rReq.GetArgs();
2499 
2500  sal_uInt16 nSlot = rReq.GetSlot();
2501  const SfxItemSet* pOutSet = nullptr;
2502  bool bDone = false;
2503  if(pArgs)
2504  pArgs->GetItemState( GetPool().GetWhich(nSlot), false, &pItem );
2505 
2506  switch ( nSlot )
2507  {
2509  {
2512  pDlg->Execute();
2513  }
2514  break;
2515  case FN_FORMAT_PAGE_DLG:
2518  {
2519  if( !bBackground )
2520  {
2521  const size_t nCurIdx = rSh.GetCurPageDesc();
2522  const SwPageDesc& rPageDesc = rSh.GetPageDesc( nCurIdx );
2523  // Temporary view, because the shell does not need to be valid after the dialogue
2524  // for example disable header
2525  SwView& rTempView = GetView();
2526 
2527  OString sPageId;
2528  switch (nSlot)
2529  {
2531  sPageId = "columns";
2532  break;
2534  sPageId = "page";
2535  break;
2536  case FN_FORMAT_PAGE_DLG:
2537  if (pItem)
2538  sPageId = OUStringToOString(static_cast<const SfxStringItem*>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8);
2539  break;
2540  }
2541  rTempView.GetDocShell()->FormatPage(rPageDesc.GetName(), sPageId, rSh, &rReq);
2542  rTempView.InvalidateRulerPos();
2543 
2544  bDone = true; // FormatPage() takes care of calling Done()
2545  }
2546  }
2547  break;
2548  case FN_FORMAT_BORDER_DLG:
2549  {
2550  SfxItemSet aSet( rSh.GetAttrPool(),
2552  SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER>{} );
2554  // Table cell(s) selected?
2555  if ( rSh.IsTableMode() )
2556  {
2557  // Set border attributes Get/SetTabBorders()
2558  ::PrepareBoxInfo( aSet, rSh );
2559  rSh.GetTabBorders( aSet );
2561  pDlg.disposeAndReset(pFact->CreateSwBorderDlg(pMDI, aSet, SwBorderModes::TABLE));
2562  if ( pDlg->Execute() == RET_OK )
2563  {
2564  rSh.SetTabBorders( *pDlg->GetOutputItemSet() );
2565  pOutSet = pDlg->GetOutputItemSet();
2566  }
2567  }
2568  else if ( rSh.IsFrameSelected() )
2569  {
2570  // Set border attributes via Frame-Manager
2571  SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE );
2572  aSet.Put( aMgr.GetAttrSet() );
2573 
2575  pDlg.disposeAndReset(pFact->CreateSwBorderDlg(pMDI, aSet, SwBorderModes::FRAME));
2576  if ( pDlg->Execute() == RET_OK )
2577  {
2578  aMgr.SetAttrSet( *pDlg->GetOutputItemSet() );
2579  aMgr.UpdateFlyFrame();
2580  pOutSet = pDlg->GetOutputItemSet();
2581  }
2582  }
2583  else
2584  {
2585  // Set border attributes via Shell quite normal
2586  rSh.GetCurAttr( aSet );
2587  ::PrepareBoxInfo( aSet, rSh );
2588 
2590  pDlg.disposeAndReset(pFact->CreateSwBorderDlg(pMDI, aSet, SwBorderModes::PARA));
2591  if ( pDlg->Execute() == RET_OK )
2592  {
2593  rSh.SetAttrSet( *pDlg->GetOutputItemSet() );
2594  pOutSet = pDlg->GetOutputItemSet();
2595  }
2596  }
2597  if(pOutSet)
2598  {
2599  rReq.Done(*pOutSet);
2600  bDone = true;
2601  }
2602  }
2603  break;
2605  {
2606  SfxItemSet aSet( rSh.GetAttrPool(),
2609 
2612 
2613  // Table cell(s) selected?
2614  if ( rSh.IsTableMode() )
2615  {
2616  // Get background attributes of the table and put it in the set
2617  std::unique_ptr<SvxBrushItem> aBrush;
2618  rSh.GetBoxBackground( aBrush );
2619  pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
2620  aSet.Put( *aBrush );
2621  if ( pDlg->Execute() == RET_OK )
2622  {
2623 
2624  rSh.SetBoxBackground( pDlg->GetOutputItemSet()->Get( RES_BACKGROUND ) );
2625  pOutSet = pDlg->GetOutputItemSet();
2626  }
2627  }
2628  else if ( rSh.IsFrameSelected() )
2629  {
2630 
2631  rSh.GetFlyFrameAttr( aSet );
2632 
2633  pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
2634  if ( pDlg->Execute() == RET_OK )
2635  {
2636  rSh.SetFlyFrameAttr(const_cast<SfxItemSet &>(*pDlg->GetOutputItemSet()) );
2637  pOutSet = pDlg->GetOutputItemSet();
2638  }
2639  }
2640  else
2641  {
2642  // Set border attributes Umrandungsattribute with the shell quite normal.
2643  rSh.GetCurAttr( aSet );
2644 
2645  pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
2646  if ( pDlg->Execute() == RET_OK )
2647  {
2648  rSh.SetAttrSet( *pDlg->GetOutputItemSet() );
2649  pOutSet = pDlg->GetOutputItemSet();
2650  }
2651  }
2652  if(pOutSet)
2653  {
2654  rReq.Done(*pOutSet);
2655  bDone = true;
2656  }
2657  }
2658  break;
2659  case SID_ACCESSIBILITY_CHECK:
2660  {
2661  sw::AccessibilityCheck aCheck(rSh.GetDoc());
2662  aCheck.check();
2663  svx::AccessibilityCheckDialog aDialog(pMDI, aCheck.getIssueCollecton());
2664  aDialog.run();
2665  }
2666  break;
2667  default:OSL_FAIL("wrong Dispatcher (basesh.cxx)");
2668  }
2669  if(!bDone)
2670  rReq.Done();
2671 }
2672 
2674 {
2675  return rView.GetWrtShell();
2676 }
2677 
2679 {
2680  return rView.GetWrtShellPtr();
2681 }
2682 
2684 {
2685  const SfxItemSet* pArgs = _rRequest.GetArgs();
2686  SwWrtShell& rSh = GetShell();
2687 
2688  if ( !( rSh.GetFrameType( nullptr, true ) & FrameTypeFlags::FOOTNOTE ) )
2689  {
2690  SwView &rTempView = GetView(); // Because GetView() does not work after the shell exchange
2691  bool bHTMLMode = 0 != (::GetHtmlMode(rTempView.GetDocShell())&HTMLMODE_ON);
2692  bool bCallEndUndo = false;
2693 
2694  if( !pArgs && rSh.IsSelection() && !rSh.IsInClickToEdit() &&
2695  !rSh.IsTableMode() )
2696  {
2697  const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
2698  SwInsertTableOptions aInsTableOpts = pModOpt->GetInsTableFlags(bHTMLMode);
2699 
2701  bCallEndUndo = true;
2702 
2703  bool bInserted = rSh.TextToTable( aInsTableOpts, '\t' );
2704  rSh.EnterStdMode();
2705  if (bInserted)
2706  rTempView.AutoCaption(TABLE_CAP);
2707  _rRequest.Done();
2708  }
2709  else
2710  {
2711  sal_uInt16 nCols = 0;
2712  sal_uInt16 nRows = 0;
2713  SwInsertTableOptions aInsTableOpts( SwInsertTableFlags::All, 1 );
2714  OUString aTableName;
2715  OUString aAutoName;
2716  std::unique_ptr<SwTableAutoFormat> pTAFormat;
2717 
2718  if( pArgs && pArgs->Count() >= 2 )
2719  {
2721  const SfxUInt16Item* pCols = _rRequest.GetArg<SfxUInt16Item>(SID_ATTR_TABLE_COLUMN);
2722  const SfxUInt16Item* pRows = _rRequest.GetArg<SfxUInt16Item>(SID_ATTR_TABLE_ROW);
2723  const SfxInt32Item* pFlags = _rRequest.GetArg<SfxInt32Item>(FN_PARAM_1);
2724  const SfxStringItem* pAuto = _rRequest.GetArg<SfxStringItem>(FN_PARAM_2);
2725 
2726  if ( pName )
2727  aTableName = pName->GetValue();
2728  if ( pCols )
2729  nCols = pCols->GetValue();
2730  if ( pRows )
2731  nRows = pRows->GetValue();
2732  if ( pAuto )
2733  {
2734  aAutoName = pAuto->GetValue();
2735  if ( !aAutoName.isEmpty() )
2736  {
2737  SwTableAutoFormatTable aTableTable;
2738  aTableTable.Load();
2739  for ( size_t n=0; n<aTableTable.size(); n++ )
2740  {
2741  if ( aTableTable[n].GetName() == aAutoName )
2742  {
2743  pTAFormat.reset(new SwTableAutoFormat( aTableTable[n] ));
2744  break;
2745  }
2746  }
2747  }
2748  }
2749 
2750  if ( pFlags )
2751  aInsTableOpts.mnInsMode = static_cast<SwInsertTableFlags>(pFlags->GetValue());
2752  else
2753  {
2754  const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
2755  aInsTableOpts = pModOpt->GetInsTableFlags(bHTMLMode);
2756  }
2757  }
2758 
2759  if( !nCols || !nRows )
2760  {
2762  ScopedVclPtr<AbstractInsTableDlg> pDlg(pFact->CreateInsTableDlg(rTempView));
2763  if( RET_OK == pDlg->Execute() )
2764  {
2765  pDlg->GetValues( aTableName, nRows, nCols, aInsTableOpts, aAutoName, pTAFormat );
2766  }
2767  else
2768  _rRequest.Ignore();
2769  }
2770 
2771  if( nCols && nRows )
2772  {
2773  // record before shell change
2774  _rRequest.AppendItem( SfxStringItem( FN_INSERT_TABLE, aTableName ) );
2775  if ( !aAutoName.isEmpty() )
2776  _rRequest.AppendItem( SfxStringItem( FN_PARAM_2, aAutoName ) );
2777  _rRequest.AppendItem( SfxUInt16Item( SID_ATTR_TABLE_COLUMN, nCols ) );
2778  _rRequest.AppendItem( SfxUInt16Item( SID_ATTR_TABLE_ROW, nRows ) );
2779  _rRequest.AppendItem( SfxInt32Item( FN_PARAM_1, static_cast<sal_Int32>(aInsTableOpts.mnInsMode) ) );
2780  _rRequest.Done();
2781 
2783  bCallEndUndo = true;
2784 
2785  rSh.StartAllAction();
2786  if( rSh.HasSelection() )
2787  rSh.DelRight();
2788 
2789  rSh.InsertTable( aInsTableOpts, nRows, nCols, pTAFormat.get() );
2791 
2792  if( !aTableName.isEmpty() && !rSh.GetTableStyle( aTableName ) )
2793  rSh.GetTableFormat()->SetName( aTableName );
2794 
2795  if( pTAFormat != nullptr && !aAutoName.isEmpty()
2796  && aAutoName != SwViewShell::GetShellRes()->aStrNone )
2797  {
2798  SwTableNode* pTableNode = const_cast<SwTableNode*>( rSh.IsCursorInTable() );
2799  if ( pTableNode )
2800  {
2801  pTableNode->GetTable().SetTableStyleName( aAutoName );
2802  SwUndoTableAutoFormat* pUndo = new SwUndoTableAutoFormat( *pTableNode, *pTAFormat );
2803  if ( pUndo )
2804  rSh.GetIDocumentUndoRedo().AppendUndo( std::unique_ptr<SwUndo>(pUndo) );
2805  }
2806  }
2807 
2808  rSh.EndAllAction();
2809  rTempView.AutoCaption(TABLE_CAP);
2810  }
2811  }
2812 
2813  if( bCallEndUndo )
2814  {
2815  SwRewriter aRewriter;
2816 
2817  if (rSh.GetTableFormat())
2818  {
2819  aRewriter.AddRule(UndoArg1, SwResId(STR_START_QUOTE));
2820  aRewriter.AddRule(UndoArg2, rSh.GetTableFormat()->GetName());
2821  aRewriter.AddRule(UndoArg3, SwResId(STR_END_QUOTE));
2822 
2823  }
2824  rSh.EndUndo(SwUndoId::INSTABLE, &aRewriter); // If possible change the Shell
2825  }
2826  }
2827 }
2828 
2830 {
2831  SwWrtShell &rSh = GetShell();
2832  SfxWhichIter aIter( rSet );
2833  sal_uInt16 nWhich = aIter.FirstWhich();
2834  switch ( nWhich )
2835  {
2836  case SID_GALLERY_BG_BRUSH:
2837  {
2838  SelectionType nSel = rSh.GetSelectionType();
2839  SfxStringListItem aLst( nWhich );
2840  std::vector<OUString> &rLst = aLst.GetList();
2843  nHeaderPos = nFooterPos = 0;
2844  sal_uInt8 nPos = 1;
2845  rLst.push_back( SwResId( STR_SWBG_PAGE ) );
2846  nPagePos = nPos++;
2847  sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
2848  bool bHtmlMode = 0 != (nHtmlMode & HTMLMODE_ON);
2849 
2850  if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_FULL_STYLES)) &&
2851  (nSel & SelectionType::Text) )
2852  {
2853  rLst.push_back( SwResId( STR_SWBG_PARAGRAPH ) );
2854  nParagraphPos = nPos++;
2855  }
2856  if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_SOME_STYLES)) &&
2858  {
2859  rLst.push_back( SwResId( STR_SWBG_TABLE ) );
2860  nTablePos = nPos++;
2861 
2862  if(!bHtmlMode)
2863  {
2864  rLst.push_back( SwResId( STR_SWBG_TABLE_ROW ) );
2865  nTableRowPos = nPos++;
2866  }
2867 
2868  rLst.push_back( SwResId( STR_SWBG_TABLE_CELL) );
2869  nTableCellPos = nPos++;
2870  }
2871  if(!bHtmlMode)
2872  {
2873  if ( nSel & SelectionType::Frame )
2874  {
2875  rLst.push_back( SwResId( STR_SWBG_FRAME ) );
2876  nFramePos = nPos++;
2877  }
2878  if ( nSel & SelectionType::Graphic )
2879  {
2880  rLst.push_back( SwResId( STR_SWBG_GRAPHIC ) );
2881  nGraphicPos = nPos++;
2882  }
2883  if ( nSel & SelectionType::Ole )
2884  {
2885  rLst.push_back( SwResId( STR_SWBG_OLE ) );
2886  nOlePos = nPos++;
2887  }
2888  const FrameTypeFlags nType = rSh.GetFrameType(nullptr,true);
2889  if ( nType & FrameTypeFlags::HEADER )
2890  {
2891  rLst.push_back( SwResId( STR_SWBG_HEADER ) );
2892  nHeaderPos = nPos++;
2893  }
2894  if ( nType & FrameTypeFlags::FOOTER )
2895  {
2896  rLst.push_back( SwResId( STR_SWBG_FOOTER ) );
2897  nFooterPos = nPos;
2898  }
2899  }
2900  if ( rLst.empty() )
2901  rSet.DisableItem( nWhich );
2902  else
2903  rSet.Put( aLst );
2904  break;
2905  }
2906  }
2907 }
2908 
2910 {
2911  SwWrtShell &rSh = GetShell();
2912  rSh.StartAction();
2913  const SfxItemSet* pArgs = rReq.GetArgs();
2914  sal_uInt16 nSlot = rReq.GetSlot();
2915  switch(nSlot)
2916  {
2917  case SID_GALLERY_BG_BRUSH:
2918  {
2919  if ( !pArgs )
2920  break;
2921 
2922  SelectionType nSel = rSh.GetSelectionType();
2923  if ( nSel & SelectionType::DrawObjectEditMode )
2924  break;
2925 
2926  const SfxUInt16Item* pPos = rReq.GetArg<SfxUInt16Item>(SID_GALLERY_BG_POS);
2927  const SvxBrushItem* pBrush = rReq.GetArg<SvxBrushItem>(SID_GALLERY_BG_BRUSH);
2928  if ( !pPos || !pBrush )
2929  break;
2930 
2931  sal_uInt8 nPos = pPos->GetValue();
2932  ++nPos;
2933 
2934  SvxBrushItem aBrush( *pBrush );
2935  aBrush.SetWhich( RES_BACKGROUND );
2936  if ( nPos == nParagraphPos )
2937  rSh.SetAttrItem( aBrush );
2938  else if ( nPos == nTablePos )
2939  rSh.SetTabBackground( aBrush );
2940  else if ( nPos == nTableRowPos )
2941  rSh.SetRowBackground( aBrush );
2942  else if ( nPos == nTableCellPos )
2943  rSh.SetBoxBackground( aBrush );
2944  else if ( nPos == nFramePos || nPos == nGraphicPos || nPos == nOlePos )
2945  {
2947  aCoreSet.Put( aBrush );
2948  rSh.SetFlyFrameAttr( aCoreSet );
2949  }
2950  else if ( nPos == nPagePos || nPos == nHeaderPos || nPos == nFooterPos )
2951  {
2952  sal_uInt16 nDesc = rSh.GetCurPageDesc();
2953  SwPageDesc aDesc( rSh.GetPageDesc( nDesc ) );
2954  if ( nPos == nPagePos )
2955  aDesc.GetMaster().SetFormatAttr( aBrush );
2956  else if ( nPos == nHeaderPos )
2957  {
2958  SwFormatHeader aHead( aDesc.GetMaster().GetHeader() );
2959  aHead.GetHeaderFormat()->SetFormatAttr( aBrush );
2960  aDesc.GetMaster().SetFormatAttr( aHead );
2961  }
2962  else if ( nPos == nFooterPos )
2963  {
2964  SwFormatFooter aFoot( aDesc.GetMaster().GetFooter() );
2965  aFoot.GetFooterFormat()->SetFormatAttr( aBrush );
2966  aDesc.GetMaster().SetFormatAttr( aFoot );
2967  }
2968  rSh.ChgPageDesc( nDesc, aDesc );
2969  }
2970  break;
2971  }
2972  }
2973  rSh.EndAction();
2974  rReq.Done();
2975 }
2976 
2978 {
2979  sal_uInt16 nSlot = rReq.GetSlot();
2980  switch( nSlot )
2981  {
2982 #if HAVE_FEATURE_DBCONNECTIVITY
2983  case FN_CHANGE_DBFIELD:
2984  {
2987  pDlg->Execute();
2988  }
2989  break;
2990 #endif
2991  default:
2992  OSL_FAIL("wrong dispatcher");
2993  }
2994 }
2995 
2996 /* 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:409
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:379
bool IsContour() const
Definition: fmtsrnd.hxx:53
#define FN_FRAME_WRAP_RIGHT
Definition: cmdid.h:410
#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:638
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:500
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:324
FlyMode
Definition: mdiexp.hxx:41
void SetGrfArrivedLnk(const Link< SwCursorShell &, void > &rLnk)
Definition: crsrsh.hxx:491
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
bool IsInVerticalText(const Point *pPt=nullptr) const
Definition: crsrsh.cxx:3392
#define FN_EDIT_REGION
Definition: cmdid.h:108
static sal_uInt8 nGraphicPos
Definition: basesh.cxx:106
bool IsPasteSpecialAllowed()
Definition: view.cxx:1804
void GetTextCtrlState(SfxItemSet &rSet)
Definition: basesh.cxx:2169
void ChgAnchor(RndStdIds eAnchorId, bool bSameOnly=false, bool bPosCorr=true)
frmatr.hxx.
Definition: feshview.cxx:2263
SfxChildWindow * GetChildWindow(sal_uInt16)
#define FONT_STANDARD
Definition: fontcfg.hxx:27
SwView & GetView()
Definition: basesh.hxx:57
void ExecTextCtrl(SfxRequest &rReq)
Definition: basesh.cxx:2045
void GetGalleryState(SfxItemSet &)
Definition: basesh.cxx:2829
void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId=nullptr)
Definition: viewdlg2.cxx:163
bool HasCharts() const
Definition: viewsh.cxx:666
const Link< SwCursorShell &, void > & GetGrfArrivedLnk() const
Definition: crsrsh.hxx:492
#define FN_GOTO_NEXT_OBJ
Definition: cmdid.h:674
OUString GetRepeatString() const
Definition: wrtundo.cxx:137
#define FN_FRAME_TO_ANCHOR
Definition: cmdid.h:692
virtual void DoRepair(bool bRepair)=0
Enable repair mode.
void SaveTableBoxContent(const SwPosition *pPos=nullptr)
Definition: trvltbl.cxx:868
bool isCHRATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:471
SwView * GetActiveView()
Definition: swmodul1.cxx:115
void ReRead(const OUString &rGrfName, const OUString &rFltName, const Graphic *pGraphic=nullptr)
Re-read if graphic is not ok. Current graphic is replaced by the new one.
Definition: editsh.cxx:294
void SetState(const SfxItemSet &rSet)
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2487
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:1350
virtual VclPtr< VclAbstractDialog > CreateSwChangeDBDlg(SwView &rVw)=0
sfx2::LinkManager & GetLinkManager()
Definition: editsh.cxx:592
void ClearTableBoxContent()
Definition: trvltbl.cxx:907
std::string GetValue
void UpdateChart()
Definition: tablemgr.cxx: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:1830
void ExecuteGallery(SfxRequest &)
Definition: basesh.cxx:2909
void * GetIMapInventor() const
Unique identification of object (for ImageMapDlg).
Definition: editsh.cxx:597
bool IsTableMode() const
Definition: crsrsh.hxx:647
GPOS_NONE
bool MoveFieldType(const SwFieldType *pFieldType, const bool bNext, const SwFieldIds nResType=SwFieldIds::Unknown, const bool bAddSetExpressionFieldsToInputFields=true)
Definition: crstrvl.cxx:726
SwWrtShell * GetShellPtr()
Definition: basesh.cxx:2678
SfxDispatcher * GetDispatcher()
SwWrtShell & GetShell()
Definition: basesh.cxx:2673
void SelectionToHeaven()
Above document.
Definition: feshview.cxx:1140
static SvxAbstractDialogFactory * Create()
void SetWrapMode(sal_uInt16 nSlot)
Definition: basesh.cxx:1899
static bool IsPaste(const SwWrtShell &, const TransferableDataHelper &)
Definition: swdtflvr.cxx:1315
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_LANGUAGE(10)
Size GetObjSize() const
Definition: feshview.cxx:2294
virtual short run() override
#define CNT_GRF
Definition: editsh.hxx:132
bool GetLastUndoInfo(OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const
Definition: edws.cxx:237
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_FONTSIZE(8)
#define FN_TOOL_ANCHOR_PAGE
Definition: cmdid.h:219
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:276
SwInsertTableFlags mnInsMode
Definition: itabenum.hxx:40
sal_Int64 n
Check only parents.
GraphicType
virtual VclPtr< AbstractInsTableDlg > CreateInsTableDlg(SwView &rView)=0
void ClickToField(const SwField &rField)
Definition: wrtsh2.cxx:338
static bool PasteFormat(SwWrtShell &rSh, TransferableDataHelper &rData, SotClipboardFormatId nFormat)
Definition: swdtflvr.cxx:3247
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:2175
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:590
SwEditWin & GetEditWin()
Definition: view.hxx:403
bool IsSelFullPara() const
Definition: crsrsh.cxx:3356
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:1111
void AutoUpdatePara(SwTextFormatColl *pColl, const SfxItemSet &rStyleSet, SwPaM *pPaM=nullptr)
Definition: wrtsh1.cxx:1573
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
virtual void PreGetFormat(const TransferableDataHelper &aHelper)=0
void ResetSubShell()
Definition: view.hxx:569
sal_Int32 GetFontHeight(sal_uInt8 nFont, sal_uInt8 nScriptType, LanguageType eLang)
Definition: fontcfg.cxx:298
void SetOrientation(short nLineOrientation)
void EndAllAction()
Definition: edws.cxx:97
static sal_uInt8 nTableRowPos
Definition: basesh.cxx:110
#define FN_PASTE_NESTED_TABLE
Definition: cmdid.h:293
void SetContour(bool bNew)
Definition: fmtsrnd.hxx:57
void FlushInBuffer()
Character buffer is inserted into the document.
Definition: edtwin.cxx:837
sal_uInt16 mnRowsToRepeat
Definition: itabenum.hxx:41
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
SfxShell * GetCurShell()
Definition: view.hxx:562
void SetUseInputLanguage(bool bNew)
#i42732# display status of font size/name depending on either the input language or the selection pos...
Definition: edtwin.cxx:6239
#define FN_FRAME_WRAP_IDEAL
Definition: cmdid.h:397
void ExecBckCol(SfxRequest &rReq)
Definition: basesh.cxx:2314
sal_uInt16 NextWhich()
void StateStyle(SfxItemSet &)
Definition: basesh.cxx:1876
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:400
const SwSection * GetCurrSection() const
Definition: edsect.cxx:70
#define FONT_GROUP_DEFAULT
Definition: fontcfg.hxx:46
void SwapPam()
Definition: crsrsh.cxx:973
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:377
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
void ToggleChildWindow(sal_uInt16)
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()
void ExecStyleSheet(SfxRequest &)
Definition: docst.cxx:285
#define FN_PAGE_STYLE_SET_PAPER_SIZE
Definition: cmdid.h:376
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:2491
#define FN_PAGE_STYLE_SET_NUMBER_FORMAT
Definition: cmdid.h:378
const OUString & GetName() const
Definition: format.hxx:111
SwField * GetCurField(const bool bIncludeInputFieldAtStart=false) const
Definition: crstrvl.cxx:939
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
int nCount
#define FN_FRAME_WRAP_LEFT
Definition: cmdid.h:409
#define FN_TOOL_ANCHOR_CHAR
Definition: cmdid.h:242
virtual void SetName(const OUString &rNewName, bool bBroadcast=false) override
Definition: atrfrm.cxx:2455
static TransferableDataHelper CreateFromSystemClipboard(vcl::Window *pWindow)
sal_Int8 GetType() const
Point GetAnchorObjDiff() const
Methods for status line.
Definition: feshview.cxx:2307
bool IsAnchorOnly() const
Definition: fmtsrnd.hxx:52
#define FN_GOTO_NEXT_MARK
Definition: cmdid.h:706
const SfxItemSet & GetAttrSet() const
Definition: frmmgr.hxx:123
Mode eMode
static bool HasMacroRecorder(SfxViewFrame const *pFrame)
const SwTable & GetTable() const
Definition: node.hxx:497
static bool Paste(SwWrtShell &, TransferableDataHelper &, RndStdIds nAnchorType=RndStdIds::FLY_AT_PARA, bool bIgnoreComments=false, PasteTableType ePasteTable=PasteTableType::PASTE_DEFAULT)
Definition: swdtflvr.cxx:1391
SwDoc * GetDoc() const
Definition: viewsh.hxx:284
void GetGrfNms(OUString *pGrfName, OUString *pFltName, const SwFlyFrameFormat *=nullptr) const
Returns the name and the filter name of a graphic if the pointer is on a graphic. ...
Definition: editsh.cxx:304
void ExecField(SfxRequest const &rReq)
Definition: basesh.cxx:2977
tools::PolyPolygon GetPolyPolygon()
SotClipboardFormatId
#define FN_FRAME_WRAPTHRU_TOGGLE
Definition: cmdid.h:398
static SvtScriptType GetScriptTypeOfLanguage(LanguageType nLang)
const OUString & GetName() const
bool IsGraphicChanged() const
ShellMode
Definition: view.hxx:87
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:2460
#define FN_PAGE_STYLE_SET_LR_MARGIN
Definition: cmdid.h:374
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:1465
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:1328
constexpr TypedWhichId< SvxWeightItem > RES_CHRATR_WEIGHT(15)
void SelectionToHell()
Below document.
Definition: feshview.cxx:1145
#define FN_NEXT_BOOKMARK
Definition: cmdid.h:113
static sal_uInt8 nFramePos
Definition: basesh.cxx:108
const ImageMap & GetImageMap() const
bool GetFlyFrameAttr(SfxItemSet &rSet) const
Definition: fefly1.cxx:1034
void EndCursorMove(const bool bIdleEnd=false)
Definition: crsrsh.cxx:309
#define FN_TABLE_PASTE_ROW_BEFORE
Definition: cmdid.h:294
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:614
bool IsSelection() const
Definition: crsrsh.hxx:883
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.
sal_uInt16 char * pName
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:565
const SwTableNode * IsCursorInTable() const
Definition: crsrsh.hxx:893
SvtScriptType
Style of a layout element.
Definition: frmfmt.hxx:57
void SetFormView(bool bSet)
Definition: viewopt.hxx:443
SvtScriptType GetScriptType() const
returns the script type of the selection
Definition: edattr.cxx:666
bool HasSelection() const
Definition: wrtsh.hxx:141
#define SW_MOD()
Definition: swmodule.hxx:256
void SetFamilyName(const OUString &rFamilyName)
void SetInputContext(const InputContext &rInputContext)
void AlignFormulaToBaseline(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj)
for starmath formulas anchored 'as char' it aligns it baseline to baseline changing the previous vert...
Definition: fefly1.cxx:2022
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:196
const SvBaseLinks & GetLinks() const
int i
#define FN_INSERT_TABLE
Definition: cmdid.h:211
GraphicType GetGraphicType() const
Definition: editsh.cxx:270
bool GetObjAttr(SfxItemSet &rSet) const
Attention: Ambiguities if multiple selections.
Definition: feshview.cxx:2660
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:442
bool EndAllTableBoxEdit()
Definition: trvltbl.cxx:914
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
bool GoNextBookmark()
Definition: wrtsh3.cxx:138
#define FN_UPDATE_CHARTS
Definition: cmdid.h:134
#define FN_FORMAT_PAGE_SETTING_DLG
Definition: cmdid.h:307
css::uno::Reference< css::datatransfer::XTransferable > GetXTransferable() const
#define LANGUAGE_SYSTEM
constexpr TypedWhichId< SwFormatURL > RES_URL(111)
sal_uInt16 GetPhyPageNum() const
Phy: real page count.
Definition: fews.cxx:333
static void PrePasteSpecial(const SwWrtShell &rSh, TransferableDataHelper &, const VclPtr< SfxAbstractPasteDialog > &pDlg)
PrePasteSpecial Prepares the given dialog without actually running it.
Definition: swdtflvr.cxx:3336
SfxBindings & GetBindings()
bool HasMark() const
Definition: crsrsh.hxx:881
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:1077
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:930
const T * GetArg(sal_uInt16 nSlotId) const
#define FN_REPAGINATE
Definition: cmdid.h:105
void SetAttrSet(const SfxItemSet &rSet)
Definition: frmmgr.cxx:601
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:1142
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:412
sal_Int16 GetHoriOrient() const
Definition: fmtornt.hxx:87
#define LANGUAGE_DONTKNOW
css::text::WrapTextMode GetSurround() const
Definition: fmtsrnd.hxx:51
void setSvxBrushItemAsFillAttributesToTargetSet(const SvxBrushItem &rBrush, SfxItemSet &rToSet)
bool IsUseInputLanguage() const
Definition: edtwin.hxx:263
void Execute(SfxRequest &)
Dispatcher.
Definition: docsh2.cxx:390
#define FN_FORMAT_TITLEPAGE_DLG
Definition: cmdid.h:338
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
static void SetFrameMode(FlyMode eMode, SwWrtShell *pShell)
Definition: basesh.cxx:2001
static void StateDisableItems(SfxItemSet &)
Definition: basesh.cxx:1862
static sal_uInt8 nParagraphPos
Definition: basesh.cxx:105
virtual ~SwBaseShell() override
Definition: basesh.cxx:2035
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:178
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:224
bool HasReadonlySel() const
Definition: crsrsh.cxx:3328
void GrabFocus()
RndStdIds GetAnchorId() const
Anchor type of selected object, RndStdIds::UNKNOWN if ambiguous or in case of frame selection...
Definition: feshview.cxx:2233
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:2597
static sal_uInt8 nFooterPos
Definition: basesh.cxx:114
bool GoPrevBookmark()
Definition: wrtsh3.cxx:159
SwDocShell * GetDocShell()
Definition: view.cxx:1107
SwFrameFormat * GetTableFormat()
Definition: edws.cxx:183
const void * GetEditingObject() const
#define FN_FORMAT_BORDER_DLG
Definition: cmdid.h:309
#define FN_FRAME_WRAPTHRU_TRANSP
Definition: cmdid.h:399
SwFrameFormat * GetTableStyle(const OUString &rFormatName)
Definition: wrtsh1.cxx:1522
SwFrameFormat * GetSelectedFrameFormat() const
If frame then frame style, else 0.
Definition: fefly1.cxx:1187
void StartAction()
Definition: crsrsh.cxx:221
static void FillClipFormatItem(const SwWrtShell &rSh, const TransferableDataHelper &rData, SvxClipboardFormatItem &rToFill)
Definition: swdtflvr.cxx:3394
void StateClpbrd(SfxItemSet &)
Definition: basesh.cxx:444
SelectionType
Definition: wrtsh.hxx:58
const ImageMap * GetMap() const
Definition: fmturl.hxx:68
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
void GetBckColState(SfxItemSet &rSet)
Definition: basesh.cxx:2256
OString OUStringToOString(const OUString &str, ConnectionSettings const *settings)
void SetReturnValue(const SfxPoolItem &)
weld::Window * GetFrameWeld() const
void InsertTable(SfxRequest &_rRequest)
Definition: basesh.cxx:2683
const OUString & GetName() const
Definition: tblafmt.hxx:208
SdrLayerID GetLayerId() const
1 Heaven, 0 Hell, SDRLAYER_NOTFOUND Ambiguous.
Definition: feshview.cxx:1077
void CallChgLnk()
Definition: crsrsh.cxx:2506
#define FN_TOOL_ANCHOR_AT_CHAR
Definition: cmdid.h:270
bool GotoObj(bool bNext, GotoObjFlags eType=GotoObjFlags::DrawAny)
Definition: feshview.cxx:1650
bool GetTableCopied()
Definition: fesh.hxx:649
#define FN_UPDATE_ALL
Definition: cmdid.h:125
IDocumentUndoRedo const & GetIDocumentUndoRedo() const
Provides access to the document undo/redo interface.
Definition: viewsh.cxx:2603
Class for automated call of Start- and EndCursorMove().
Definition: editsh.hxx:1028
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:217
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
#define FN_FRAME_WRAPTHRU
Definition: cmdid.h:325
static FlyMode eFrameMode
Definition: basesh.hxx:42
void GetState(SfxItemSet &)
Definition: basesh.cxx:1424
sal_uInt16 GetSlot() const
SwBaseShell(SwView &rShell)
Definition: basesh.cxx:2023
void Broadcast(const SfxHint &rHint)
#define DEF_GUTTER_WIDTH
Definition: swtypes.hxx:69
bool HasChildWindow(sal_uInt16)
void SetGraphicPolygon(const tools::PolyPolygon *pPoly)
Definition: editsh.cxx:324
void SetStyleName(const OUString &rStyleName)
const css::uno::Reference< css::frame::XDispatchRecorder > & GetRecorder() const
const OUString & GetURL() const
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:401
#define FN_FORMAT_BACKGROUND_DLG
Definition: cmdid.h:311
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:310
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:341
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:465
#define GetWhich(nSlot)
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:426
bool MoveTable(SwWhichTable, SwMoveFnCollection const &)
Definition: trvltbl.cxx:681
void Do(DoType eDoType, sal_uInt16 nCnt=1)
Definition: wrtundo.cxx:32
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:898
bool IsTextToTableAvailable() const
Definition: edtab.cxx:195
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:253
void SetTableStyleName(const OUString &rName)
Set the new table style name for this table.
Definition: swtable.hxx:191
bool TableToText(sal_Unicode cCh)
Definition: edtab.cxx:148
RET_OK
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:175
static sal_uInt8 nHeaderPos
Definition: basesh.cxx:113
#define FN_BACKSPACE
Definition: cmdid.h:656
void ChgPageDesc(size_t i, const SwPageDesc &)
Definition: fedesc.cxx:110
#define FN_TABLE_PASTE_COL_BEFORE
Definition: cmdid.h:295
size_t IsObjSelected() const
Definition: feshview.cxx:1150
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:377
PasteTableType
Definition: swdtflvr.hxx:66
void AutoUpdateFrame(SwFrameFormat *pFormat, const SfxItemSet &rStyleSet)
Definition: wrtsh1.cxx:1612
#define FN_FORMAT_PAGE_DLG
Definition: cmdid.h:312
#define FN_CONVERT_TEXT_TO_TABLE
Definition: cmdid.h:369
sal_Int16 GetVertOrient() const
Definition: fmtornt.hxx:54
void InvalidateRulerPos()
Definition: viewport.cxx:104
#define FN_TOOL_ANCHOR_PARAGRAPH
Definition: cmdid.h:220
#define FN_PAGE_STYLE_SET_UL_MARGIN
Definition: cmdid.h:375
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:936
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:2683
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:80
void UpdateDocStat()
Document - Statistics.
Definition: editsh.cxx:425
#define FN_SHIFT_BACKSPACE
Definition: cmdid.h:671
const sal_uInt16 CRSR_SKIP_CHARS
Definition: swcrsr.hxx:63
void InvalidateAll(bool bWithMsg)
HTMLMODE_FULL_STYLES
void AppendItem(const SfxPoolItem &)
bool IsTableComplexForChart()
Definition: trvltbl.cxx:725
bool AddGrfUpdateSlot(sal_uInt16 nSlot)
Definition: basesh.hxx:59
#define FN_GOTO_PREV_MARK
Definition: cmdid.h:707
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:370
SectionType GetType() const
Definition: section.hxx:171
void FormatPage(const OUString &rPage, const OString &rPageId, SwWrtShell &rActShell, SfxRequest *pRequest=nullptr)
Show page style format dialog.
Definition: docst.cxx:1538
static bool PasteUnformatted(SwWrtShell &rSh, TransferableDataHelper &)
Definition: swdtflvr.cxx:3330
const SwInsertTableOptions & GetInsTableFlags(bool bHTML) const
Definition: modcfg.hxx:301
LanguageType GetInputLanguage() const
void Init(sal_uInt16 nNumCols, sal_uInt16 nGutterWidth, sal_uInt16 nAct)
This function allows to (repeatedly) initialize the columns.
Definition: atrfrm.cxx:946
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1388
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: wrtsh1.cxx:1783
#define FN_ESCAPE
Definition: cmdid.h:670
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
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:926
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:323
::std::vector< OUString > TargetList
#define FN_GOTO_PREV_OBJ
Definition: cmdid.h:675
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Definition: fews.cxx:235
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
bool IsFrameSelected() const
Definition: feshview.cxx:1158
bool GetBoxBackground(std::unique_ptr< SvxBrushItem > &rToFill) const
FALSE ambiguous.
Definition: fetab.cxx:784
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
virtual SfxObjectShell * GetObjectShell()
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(107)
bool IsViewLocked() const
Definition: viewsh.hxx:464
void HideCursor()
Definition: crsrsh.cxx:2403
#define FN_FRAME_WRAP_CONTOUR
Definition: cmdid.h:417
Definition: view.hxx:146
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:140
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:1061
bool CursorInsideInputField() const
Definition: crstrvl.cxx:960