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