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