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>
83#include <drawdoc.hxx>
86#include <IDocumentUndoRedo.hxx>
87#include <ThemeColorChanger.hxx>
88#include <swabstdlg.hxx>
89#include <modcfg.hxx>
90#include <svx/fmshell.hxx>
91#include <SwRewriter.hxx>
92#include <GraphicSizeCheck.hxx>
93#include <svx/galleryitem.hxx>
95#include <com/sun/star/gallery/GalleryItemType.hpp>
96#include <com/sun/star/beans/PropertyValues.hpp>
97#include <memory>
98
102#include <comphelper/lok.hxx>
103#include <osl/diagnose.h>
104
105#include <svx/svxdlg.hxx>
107
108#include <shellres.hxx>
109#include <UndoTable.hxx>
110
111#include <ndtxt.hxx>
112#include <UndoManager.hxx>
113#include <fmtrfmrk.hxx>
114#include <txtrfmrk.hxx>
115#include <translatehelper.hxx>
116
118
119// These variables keep the state of Gallery (slot SID_GALLERY_BG_BRUSH)
120// detected by GetGalleryState() for the subsequent ExecuteGallery() call.
121
132
133#define ShellClass_SwBaseShell
134#include <sfx2/msg.hxx>
135#include <swslots.hxx>
136
137#include <AccessibilityCheck.hxx>
138
139namespace
140{
141 SvxContourDlg* GetContourDlg(SwView const &rView)
142 {
143 SfxChildWindow *pWnd = rView.GetViewFrame().GetChildWindow(SvxContourDlgChildWindow::GetChildWindowId());
144 return pWnd ? static_cast<SvxContourDlg*>(pWnd->GetController().get()) : nullptr;
145 }
146
147 SvxIMapDlg* GetIMapDlg(SwView const &rView)
148 {
149 SfxChildWindow* pWnd = rView.GetViewFrame().GetChildWindow(SvxIMapDlgChildWindow::GetChildWindowId());
150 return pWnd ? static_cast<SvxIMapDlg*>(pWnd->GetController().get()) : nullptr;
151 }
152}
153
154using namespace ::com::sun::star;
155using namespace ::com::sun::star::uno;
156using namespace ::com::sun::star::frame;
157using namespace ::com::sun::star::lang;
158
160
161void SwBaseShell::InitInterface_Impl()
162{
163 GetStaticInterface()->RegisterChildWindow(SvxIMapDlgChildWindow::GetChildWindowId());
164 GetStaticInterface()->RegisterChildWindow(SvxContourDlgChildWindow::GetChildWindowId());
165 GetStaticInterface()->RegisterChildWindow(DevelopmentToolChildWindow::GetChildWindowId());
166}
167
168static void lcl_UpdateIMapDlg( SwWrtShell& rSh )
169{
170 Graphic aGrf( rSh.GetIMapGraphic() );
171 GraphicType nGrfType = aGrf.GetType();
172 void* pEditObj = GraphicType::NONE != nGrfType && GraphicType::Default != nGrfType
173 ? rSh.GetIMapInventor() : nullptr;
174 TargetList aList;
176
178 rSh.GetFlyFrameAttr( aSet );
179 const SwFormatURL &rURL = aSet.Get( RES_URL );
181 aGrf, rURL.GetMap(), &aList, pEditObj );
182}
183
185{
186 Graphic aGraf( rSh.GetIMapGraphic() );
187 GraphicType nGrfType = aGraf.GetType();
188 bool bRet = GraphicType::NONE != nGrfType && GraphicType::Default != nGrfType;
189 if( bRet )
190 {
191 OUString aGrfName;
192 if ( nSel & SelectionType::Graphic )
193 rSh.GetGrfNms( &aGrfName, nullptr );
194
195 SvxContourDlg *pDlg = GetContourDlg(rSh.GetView());
196 if (pDlg)
197 {
198 pDlg->Update(aGraf, !aGrfName.isEmpty(),
200 }
201 }
202 return bRet;
203}
204
206{
207 SwWrtShell &rSh = GetShell();
208 SwEditWin& rTmpEditWin = GetView().GetEditWin();
209 switch(rReq.GetSlot())
210 {
211 case SID_DELETE:
213 {
214 // Disallow if the cursor is at the end of a paragraph and the document model
215 // node at this position is an outline node with folded content or the next node
216 // is an outline node with folded content.
217 if (rSh.IsEndPara())
218 {
219 SwNodeIndex aIdx(rSh.GetCursor()->GetPointNode());
220 if (aIdx.GetNode().IsTextNode())
221 {
222 bool bVisible = true;
224 if (!bVisible)
225 break;
226 ++aIdx;
227 if (aIdx.GetNode().IsTextNode())
228 {
229 bVisible = true;
231 if (!bVisible)
232 break;
233 }
234 }
235 }
236 }
237 rSh.DelRight();
238 break;
239
240 case FN_BACKSPACE:
242 {
243 // Disallow if the cursor is at the start of a paragraph and the document model
244 // node at this position is an outline node with folded content or the previous
245 // node is a content node without a layout frame.
246 if (rSh.IsSttPara())
247 {
248 SwNodeIndex aIdx(rSh.GetCursor()->GetPointNode());
249 if (aIdx.GetNode().IsTextNode())
250 {
251 bool bVisible = true;
253 if (!bVisible)
254 break;
255 --aIdx;
256 if (aIdx.GetNode().IsContentNode() &&
258 break;
259 }
260 }
261 }
262 if( rSh.IsNoNum() )
263 {
264 rSh.SttCursorMove();
265 bool bLeft = rSh.Left( SwCursorSkipMode::Chars, true, 1, false );
266 if( bLeft )
267 {
268 rSh.DelLeft();
269 }
270 else
271 // JP 15.07.96: If it no longer goes forward, cancel
272 // the numbering. For example at the beginning
273 // of a doc, frame, table or an area.
274 rSh.DelNumRules();
275
276 rSh.EndCursorMove();
277 break;
278 }
279
280 [[fallthrough]]; // otherwise call DelLeft
282 rSh.DelLeft();
283 break;
284 default:
285 OSL_FAIL("wrong Dispatcher");
286 return;
287 }
288 rReq.Done();
289
290 //#i42732# - notify the edit window that from now on we do not use the input language
291 rTmpEditWin.SetUseInputLanguage( false );
292}
293
295{
296 // Attention: At risk of suicide!
297 // After paste, paste special the shell can be destroy.
298
299 SwWrtShell &rSh = GetShell();
300 sal_uInt16 nId = rReq.GetSlot();
301 bool bIgnore = false;
303
304 switch( nId )
305 {
306 case SID_CUT:
307 case SID_COPY:
309 if ( rSh.HasSelection() )
310 {
311 rtl::Reference<SwTransferable> pTransfer = new SwTransferable( rSh );
312
314 pTransfer->Cut();
315 else
316 {
317 const bool bLockedView = rSh.IsViewLocked();
318 rSh.LockView( true ); //lock visible section
319 pTransfer->Copy();
320 rSh.LockView( bLockedView );
321 }
322 break;
323 }
324 return;
325
329 switch ( nId )
330 {
332 ePasteTable = PasteTableType::PASTE_TABLE;
333 break;
335 ePasteTable = PasteTableType::PASTE_ROW;
336 break;
338 ePasteTable = PasteTableType::PASTE_COLUMN;
339 break;
340 default:
341 ;
342 }
343 [[fallthrough]];
344 case SID_PASTE:
345 {
346 TransferableDataHelper aDataHelper(
348 if( aDataHelper.GetXTransferable().is()
349 && SwTransferable::IsPaste( rSh, aDataHelper ) )
350 {
351 // Temporary variables, because the shell could already be
352 // destroyed after the paste.
353 SwView* pView = &m_rView;
354
355 RndStdIds nAnchorType = RndStdIds::FLY_AT_PARA;
356 const SfxUInt16Item* pAnchorType = rReq.GetArg<SfxUInt16Item>(FN_PARAM_1);
357 if (pAnchorType)
358 nAnchorType = static_cast<RndStdIds>(pAnchorType->GetValue());
359 bool bIgnoreComments = false;
360 const SfxBoolItem* pIgnoreComments = rReq.GetArg<SfxBoolItem>(FN_PARAM_2);
361 if (pIgnoreComments)
362 bIgnoreComments = pIgnoreComments->GetValue();
363 SwTransferable::Paste(rSh, aDataHelper, nAnchorType, bIgnoreComments, ePasteTable);
364
365 if( rSh.IsFrameSelected() || rSh.IsObjSelected() )
366 rSh.EnterSelFrameMode();
367 pView->AttrChangedNotify(nullptr);
368
369 // Fold pasted outlines that have outline content visible attribute false
371 }
372 else
373 return;
374 }
375 break;
376
377 case SID_CLIPBOARD_FORMAT_ITEMS:
378 {
379 const SfxItemSet* pArgs = rReq.GetArgs();
380 const SfxPoolItem* pFormat;
381 if( pArgs && SfxItemState::SET == pArgs->GetItemState( nId, false, &pFormat ) )
382 {
383 TransferableDataHelper aDataHelper(
385 &rSh.GetView().GetEditWin()) );
386 if( aDataHelper.GetXTransferable().is()
387 /*&& SwTransferable::IsPaste( rSh, aDataHelper )*/ )
388 {
389 // Temporary variables, because the shell could already be
390 // destroyed after the paste.
391 SwView* pView = &m_rView;
392
393 SwTransferable::PasteFormat( rSh, aDataHelper,
394 static_cast<SotClipboardFormatId>(static_cast<const SfxUInt32Item*>(pFormat)->GetValue()) );
395
396 //Done() has to be called before the shell has been removed
397 rReq.Done();
398 bIgnore = true;
399 if( rSh.IsFrameSelected() || rSh.IsObjSelected())
400 rSh.EnterSelFrameMode();
401 pView->AttrChangedNotify(nullptr);
402
403 // Fold pasted outlines that have outline content visible attribute false
405 }
406 }
407 }
408 break;
409
410 case SID_PASTE_UNFORMATTED:
411 {
412 TransferableDataHelper aDataHelper(
414 if( aDataHelper.GetXTransferable().is()
415 && SwTransferable::IsPaste( rSh, aDataHelper ) )
416 {
417 // Temporary variables, because the shell could already be
418 // destroyed after the paste.
419 SwView* pView = &m_rView;
420 rReq.Ignore();
421 bIgnore = true;
422 if(SwTransferable::PasteUnformatted( rSh, aDataHelper ))
423 {
424 SfxViewFrame& rViewFrame = pView->GetViewFrame();
425 uno::Reference< frame::XDispatchRecorder > xRecorder =
426 rViewFrame.GetBindings().GetRecorder();
427 if(xRecorder.is()) {
428 SfxRequest aReq(rViewFrame, SID_CLIPBOARD_FORMAT_ITEMS);
429 aReq.AppendItem( SfxUInt32Item( SID_CLIPBOARD_FORMAT_ITEMS, static_cast<sal_uInt32>(SotClipboardFormatId::STRING) ) );
430 aReq.Done();
431 }
432 }
433
434 if (rSh.IsFrameSelected() || rSh.IsObjSelected())
435 rSh.EnterSelFrameMode();
436 pView->AttrChangedNotify(nullptr);
437
438 // Fold pasted outlines that have outline content visible attribute false
440 }
441 else
442 return;
443 }
444 break;
445
446 case SID_PASTE_SPECIAL:
447 {
448 std::shared_ptr<TransferableDataHelper> aDataHelper =
449 std::make_shared<TransferableDataHelper>(TransferableDataHelper::CreateFromSystemClipboard( &rSh.GetView().GetEditWin()));
450
451 if( aDataHelper->GetXTransferable().is()
452 && SwTransferable::IsPaste( rSh, *aDataHelper )
453 && !rSh.CursorInsideInputField() )
454 {
455 rReq.Ignore();
456 bIgnore = true;
457
459 VclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog( rReq.GetFrameWeld() ));
460
461 // Prepare the dialog
462 SwTransferable::PrePasteSpecial(rSh, *aDataHelper, pDlg);
463 pDlg->PreGetFormat(*aDataHelper);
464
465
466 pDlg->StartExecuteAsync([aDataHelper, pDlg, &rSh, this](sal_Int32 nResult){
467 if (nResult == RET_OK)
468 {
469 // Temporary variables, because the shell could already be
470 // destroyed after the paste.
471 SwView* pView = &m_rView;
472 bool bRet = false;
473 SotClipboardFormatId nFormatId = pDlg->GetFormatOnly();
474
475 if( nFormatId != SotClipboardFormatId::NONE )
476 bRet = SwTransferable::PasteFormat( rSh, *aDataHelper, nFormatId );
477
478 if (bRet)
479 {
480 SfxViewFrame& rViewFrame = pView->GetViewFrame();
481 uno::Reference< frame::XDispatchRecorder > xRecorder =
482 rViewFrame.GetBindings().GetRecorder();
483 if(xRecorder.is()) {
484 SfxRequest aReq(rViewFrame, SID_CLIPBOARD_FORMAT_ITEMS);
485 aReq.AppendItem( SfxUInt32Item( SID_CLIPBOARD_FORMAT_ITEMS, static_cast<sal_uInt32>(nFormatId) ) );
486 aReq.Done();
487 }
488 }
489
490 if (rSh.IsFrameSelected() || rSh.IsObjSelected())
491 rSh.EnterSelFrameMode();
492 pView->AttrChangedNotify(nullptr);
493
494 // Fold pasted outlines that have outline content visible attribute false
496 }
497
498 pDlg->disposeOnce();
499
500 });
501 }
502 else
503 return;
504 }
505 break;
506
507 default:
508 OSL_FAIL("wrong Dispatcher");
509 return;
510 }
511 if(!bIgnore)
512 rReq.Done();
513}
514
515// ClipBoard state
516
518{
519 SwWrtShell &rSh = GetShell();
520 SfxWhichIter aIter(rSet);
521
522 const bool bCopy = rSh.HasSelection();
523
524 sal_uInt16 nWhich = aIter.FirstWhich();
525
526 while(nWhich)
527 {
528 switch(nWhich)
529 {
530 case SID_CUT:
532 {
533 rSet.DisableItem( nWhich );
534 break;
535 }
536 [[fallthrough]];
537 case SID_COPY:
538 if( !bCopy || GetObjectShell()->isContentExtractionLocked())
539 rSet.DisableItem( nWhich );
540 break;
541
545 if( !rSh.IsCursorInTable()
546 || !GetView().IsPasteSpecialAllowed()
548 // disable if not a native Writer table and not a spreadsheet format
549 || !GetView().IsPasteSpreadsheet(rSh.GetTableCopied()) )
550 {
551 rSet.DisableItem( nWhich );
552 }
553 break;
554
555 case SID_PASTE:
556 if( !GetView().IsPasteAllowed() )
557 {
558 rSet.DisableItem( nWhich );
559 }
560 break;
561
562 case SID_PASTE_SPECIAL:
563 if( !GetView().IsPasteSpecialAllowed()
564 || rSh.CursorInsideInputField() )
565 {
566 rSet.DisableItem( nWhich );
567 }
568 break;
569
570 case SID_PASTE_UNFORMATTED:
571 if( !GetView().IsPasteSpecialAllowed() )
572 {
573 rSet.DisableItem( nWhich );
574 }
575 break;
576
577 case SID_CLIPBOARD_FORMAT_ITEMS:
578 {
579 TransferableDataHelper aDataHelper(
581 &rSh.GetView().GetEditWin()) );
582
583 SvxClipboardFormatItem aFormatItem( SID_CLIPBOARD_FORMAT_ITEMS );
584 SwTransferable::FillClipFormatItem( rSh, aDataHelper, aFormatItem );
585 rSet.Put( aFormatItem );
586 }
587 break;
588 }
589 nWhich = aIter.NextWhich();
590 }
591}
592
593// Perform undo
594
596{
598
599 SwWrtShell &rWrtShell = GetShell();
600
601 SwUndoId nUndoId(SwUndoId::EMPTY);
602 sal_uInt16 nId = rReq.GetSlot(), nCnt = 1;
603 const SfxItemSet* pArgs = rReq.GetArgs();
604 const SfxPoolItem* pItem;
605 if( pArgs && SfxItemState::SET == pArgs->GetItemState( nId, false, &pItem ))
606 nCnt = static_cast<const SfxUInt16Item*>(pItem)->GetValue();
607
608 // Repair mode: allow undo/redo of all undo actions, even if access would
609 // be limited based on the view shell ID.
610 bool bRepair = false;
611 const SfxBoolItem* pRepairItem;
612 if (pArgs && (pRepairItem = pArgs->GetItemIfSet(SID_REPAIRPACKAGE, false)))
613 bRepair = pRepairItem->GetValue();
614
615 // #i106349#: save pointer: undo/redo may delete the shell, i.e., this!
616 SfxViewFrame& rViewFrame( GetView().GetViewFrame() );
617
618 IDocumentUndoRedo& rUndoRedo = rWrtShell.GetIDocumentUndoRedo();
619 bool bWasRepair = rUndoRedo.DoesRepair();
620 rUndoRedo.DoRepair(bRepair);
621 comphelper::ScopeGuard aGuard([&rUndoRedo, bWasRepair]()
622 {
623 rUndoRedo.DoRepair(bWasRepair);
624 });
625
626 switch( nId )
627 {
628 case SID_UNDO:
629 if (rUndoRedo.GetLastUndoInfo(nullptr, &nUndoId, &rWrtShell.GetView()))
630 {
631 for (SwViewShell& rShell : rWrtShell.GetRingContainer())
632 rShell.LockPaint();
633
634 sal_uInt16 nUndoOffset = 0;
635 if (comphelper::LibreOfficeKit::isActive() && !bRepair && nCnt == 1)
636 {
637 sw::UndoManager& rManager = rWrtShell.GetDoc()->GetUndoManager();
638 const SfxUndoAction* pAction = rManager.GetUndoAction();
639 SwView& rView = rWrtShell.GetView();
640 ViewShellId nViewShellId = rView.GetViewShellId();
641 sal_uInt16 nOffset = 0;
642 if (pAction->GetViewShellId() != nViewShellId
643 && rManager.IsViewUndoActionIndependent(&rView, nOffset))
644 {
645 // Execute the undo with an offset: don't undo the top action, but an
646 // earlier one, since it's independent and that belongs to our view.
647 nUndoOffset += nOffset;
648 }
649 }
650
651 rWrtShell.Do(SwWrtShell::UNDO, nCnt, nUndoOffset);
652
653 for (SwViewShell& rShell : rWrtShell.GetRingContainer())
654 rShell.UnlockPaint();
655
656 // tdf#141613 FIXME: Disable redoing header/footer changes for now.
657 // The proper solution would be to write a SwUndoHeaderFooter class
658 // to represent the addition of a header or footer to the current page.
659 if (nUndoId == SwUndoId::HEADER_FOOTER)
660 rUndoRedo.ClearRedo();
661 }
662 break;
663
664 case SID_REDO:
665 if (rUndoRedo.GetFirstRedoInfo(nullptr, &nUndoId, &rWrtShell.GetView()))
666 {
667 for (SwViewShell& rShell : rWrtShell.GetRingContainer())
668 rShell.LockPaint();
669 rWrtShell.Do( SwWrtShell::REDO, nCnt );
670 for (SwViewShell& rShell : rWrtShell.GetRingContainer())
671 rShell.UnlockPaint();
672 }
673 break;
674
675 case SID_REPEAT:
676 rWrtShell.Do( SwWrtShell::REPEAT );
677 break;
678 default:
679 OSL_FAIL("wrong Dispatcher");
680 }
681
682 if (nUndoId == SwUndoId::CONFLICT)
683 {
684 rReq.SetReturnValue( SfxUInt32Item(nId, static_cast<sal_uInt32>(SID_REPAIRPACKAGE)) );
685 }
686 else if (nUndoId == SwUndoId::INSFMTATTR)
687 {
688 rWrtShell.GetDoc()->GetDocShell()->GetStyleSheetPool()->Broadcast(SfxHint(SfxHintId::StyleSheetModified));
689 }
690
691 rViewFrame.GetBindings().InvalidateAll(false);
692}
693
694// State of undo
695
697{
698 SwUndoId nUndoId(SwUndoId::EMPTY);
699 SwWrtShell &rSh = GetShell();
700 SfxWhichIter aIter(rSet);
701 sal_uInt16 nWhich = aIter.FirstWhich();
702 while(nWhich)
703 {
704 switch(nWhich)
705 {
706 case SID_UNDO:
707 {
708 if (rSh.GetLastUndoInfo(nullptr, &nUndoId, &rSh.GetView()))
709 {
710 rSet.Put( SfxStringItem(nWhich,
712 }
713 else if (nUndoId == SwUndoId::CONFLICT)
714 {
715 rSet.Put( SfxUInt32Item(nWhich, static_cast<sal_uInt32>(SID_REPAIRPACKAGE)) );
716 }
717 else
718 rSet.DisableItem(nWhich);
719
720 break;
721 }
722 case SID_REDO:
723 {
724 if (rSh.GetFirstRedoInfo(nullptr, &nUndoId, &rSh.GetView()))
725 {
726 rSet.Put(SfxStringItem(nWhich,
728 }
729 else if (nUndoId == SwUndoId::CONFLICT)
730 {
731 rSet.Put( SfxInt32Item(nWhich, static_cast<sal_uInt32>(SID_REPAIRPACKAGE)) );
732 }
733 else
734 rSet.DisableItem(nWhich);
735 break;
736 }
737 case SID_REPEAT:
738 { // Repeat is only possible if no REDO is possible - UI-Restriction
739 if ((!rSh.GetFirstRedoInfo(nullptr, nullptr)) &&
740 !rSh.IsSelFrameMode() &&
741 (SwUndoId::EMPTY != rSh.GetRepeatInfo(nullptr)))
742 {
743 rSet.Put(SfxStringItem(nWhich, rSh.GetRepeatString()));
744 }
745 else
746 rSet.DisableItem(nWhich);
747 break;
748 }
749
750 case SID_GETUNDOSTRINGS:
751 if (rSh.GetLastUndoInfo(nullptr, nullptr))
752 {
753 SfxStringListItem aStrLst( nWhich );
754 rSh.GetDoStrings( SwWrtShell::UNDO, aStrLst );
755 rSet.Put( aStrLst );
756 }
757 else
758 rSet.DisableItem( nWhich );
759 break;
760
761 case SID_GETREDOSTRINGS:
762 if (rSh.GetFirstRedoInfo(nullptr, nullptr))
763 {
764 SfxStringListItem aStrLst( nWhich );
765 rSh.GetDoStrings( SwWrtShell::REDO, aStrLst );
766 rSet.Put( aStrLst );
767 }
768 else
769 rSet.DisableItem( nWhich );
770 break;
771 }
772 nWhich = aIter.NextWhich();
773 }
774}
775
776namespace
777{
780bool UpdateFieldContents(SfxRequest& rReq, SwWrtShell& rWrtSh)
781{
782 const SfxStringItem* pTypeName = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
783 if (!pTypeName || pTypeName->GetValue() != "SetRef")
784 {
785 // This is implemented so far only for reference marks.
786 return false;
787 }
788
789 const SfxStringItem* pNamePrefix = rReq.GetArg<SfxStringItem>(FN_PARAM_2);
790 if (!pNamePrefix)
791 {
792 return false;
793 }
794 const OUString& rNamePrefix = pNamePrefix->GetValue();
795
796 const SfxUnoAnyItem* pFields = rReq.GetArg<SfxUnoAnyItem>(FN_PARAM_3);
797 if (!pFields)
798 {
799 return false;
800 }
801 uno::Sequence<beans::PropertyValues> aFields;
802 pFields->GetValue() >>= aFields;
803
804 SwDoc* pDoc = rWrtSh.GetDoc();
805 pDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::UPDATE_FIELDS, nullptr);
806 rWrtSh.StartAction();
807
808 std::vector<const SwFormatRefMark*> aRefMarks;
809
810 for (sal_uInt16 i = 0; i < pDoc->GetRefMarks(); ++i)
811 {
812 aRefMarks.push_back(pDoc->GetRefMark(i));
813 }
814
815 std::sort(aRefMarks.begin(), aRefMarks.end(),
816 [](const SwFormatRefMark* pMark1, const SwFormatRefMark* pMark2) -> bool {
817 const SwTextRefMark* pTextRefMark1 = pMark1->GetTextRefMark();
818 const SwTextRefMark* pTextRefMark2 = pMark2->GetTextRefMark();
819 SwPosition aPos1(pTextRefMark1->GetTextNode(), pTextRefMark1->GetStart());
820 SwPosition aPos2(pTextRefMark2->GetTextNode(), pTextRefMark2->GetStart());
821 return aPos1 < aPos2;
822 });
823
824 sal_uInt16 nFieldIndex = 0;
825 for (auto& pIntermediateRefMark : aRefMarks)
826 {
827 auto pRefMark = const_cast<SwFormatRefMark*>(pIntermediateRefMark);
828 if (!pRefMark->GetRefName().startsWith(rNamePrefix))
829 {
830 continue;
831 }
832
833 if (nFieldIndex >= aFields.getLength())
834 {
835 break;
836 }
837 comphelper::SequenceAsHashMap aMap(aFields[nFieldIndex++]);
838 auto aName = aMap["Name"].get<OUString>();
839 pRefMark->GetRefName() = aName;
840
841 OUString aContent = aMap["Content"].get<OUString>();
842 auto pTextRefMark = const_cast<SwTextRefMark*>(pRefMark->GetTextRefMark());
843 if (!pTextRefMark->End())
844 {
845 continue;
846 }
847
848 // Insert markers to remember where the paste positions are.
849 const SwTextNode& rTextNode = pTextRefMark->GetTextNode();
850 SwPaM aMarkers(SwPosition(rTextNode, *pTextRefMark->End()));
852 pTextRefMark->SetDontExpand(false);
853 bool bSuccess = rIDCO.InsertString(aMarkers, "XY");
854 if (bSuccess)
855 {
856 SwPaM aPasteEnd(SwPosition(rTextNode, *pTextRefMark->End()));
857 aPasteEnd.Move(fnMoveBackward, GoInContent);
858
859 // Paste HTML content.
860 SwPaM* pCursorPos = rWrtSh.GetCursor();
861 *pCursorPos = aPasteEnd;
862 SwTranslateHelper::PasteHTMLToPaM(rWrtSh, pCursorPos, aContent.toUtf8(), true);
863
864 // Update the refmark to point to the new content.
865 sal_Int32 nOldStart = pTextRefMark->GetStart();
866 sal_Int32 nNewStart = *pTextRefMark->End();
867 // First grow it to include text till the end of the paste position.
868 pTextRefMark->SetEnd(aPasteEnd.GetPoint()->GetContentIndex());
869 // Then shrink it to only start at the paste start: we know that the refmark was
870 // truncated to the paste start, as the refmark has to stay inside a single text node
871 pTextRefMark->SetStart(nNewStart);
872 rTextNode.GetSwpHints().SortIfNeedBe();
873 SwPaM aEndMarker(*aPasteEnd.GetPoint());
874 aEndMarker.SetMark();
875 aEndMarker.GetMark()->AdjustContent(1);
876 SwPaM aStartMarker(SwPosition(rTextNode, nOldStart), SwPosition(rTextNode, nNewStart));
877
878 // Remove markers. The start marker includes the old content as well.
879 rIDCO.DeleteAndJoin(aStartMarker);
880 rIDCO.DeleteAndJoin(aEndMarker);
881 }
882 }
883
884 rWrtSh.EndAction();
885 pDoc->GetIDocumentUndoRedo().EndUndo(SwUndoId::UPDATE_FIELDS, nullptr);
886 return true;
887}
888
891void UpdateFieldContent(SfxRequest& rReq, SwWrtShell& rWrtSh)
892{
893 const SfxStringItem* pTypeName = rReq.GetArg<SfxStringItem>(FN_PARAM_1);
894 if (!pTypeName || pTypeName->GetValue() != "SetRef")
895 {
896 // This is implemented so far only for reference marks.
897 return;
898 }
899
900 const SfxStringItem* pNamePrefix = rReq.GetArg<SfxStringItem>(FN_PARAM_2);
901 if (!pNamePrefix)
902 {
903 return;
904 }
905 const OUString& rNamePrefix = pNamePrefix->GetValue();
906
907 const SfxUnoAnyItem* pField = rReq.GetArg<SfxUnoAnyItem>(FN_PARAM_3);
908 if (!pField)
909 {
910 return;
911 }
912 uno::Sequence<beans::PropertyValue> aField;
913 pField->GetValue() >>= aField;
914
915 SwPosition& rCursor = *rWrtSh.GetCursor()->GetPoint();
916 SwTextNode* pTextNode = rCursor.GetNode().GetTextNode();
917 std::vector<SwTextAttr*> aAttrs
918 = pTextNode->GetTextAttrsAt(rCursor.GetContentIndex(), RES_TXTATR_REFMARK);
919 if (aAttrs.empty())
920 {
921 return;
922 }
923
924 auto& rRefmark = const_cast<SwFormatRefMark&>(aAttrs[0]->GetRefMark());
925 if (!rRefmark.GetRefName().startsWith(rNamePrefix))
926 {
927 return;
928 }
929
930 SwDoc* pDoc = rWrtSh.GetDoc();
931 SwRewriter aRewriter;
932 aRewriter.AddRule(UndoArg1, rRefmark.GetRefName());
933 pDoc->GetIDocumentUndoRedo().StartUndo(SwUndoId::UPDATE_FIELD, &aRewriter);
934 rWrtSh.StartAction();
936 [&rWrtSh, &aRewriter]
937 {
938 rWrtSh.EndAction();
939 rWrtSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::UPDATE_FIELD, &aRewriter);
940 });
941
943 auto aName = aMap["Name"].get<OUString>();
944 rRefmark.GetRefName() = aName;
945
946 OUString aContent = aMap["Content"].get<OUString>();
947 auto pTextRefMark = const_cast<SwTextRefMark*>(rRefmark.GetTextRefMark());
948 if (!pTextRefMark->End())
949 {
950 return;
951 }
952
953 // Insert markers to remember where the paste positions are.
954 const SwTextNode& rTextNode = pTextRefMark->GetTextNode();
955 SwPaM aMarkers(SwPosition(rTextNode, *pTextRefMark->End()));
957 pTextRefMark->SetDontExpand(false);
958 if (!rIDCO.InsertString(aMarkers, "XY"))
959 {
960 return;
961 }
962
963 SwPaM aPasteEnd(SwPosition(rTextNode, *pTextRefMark->End()));
964 aPasteEnd.Move(fnMoveBackward, GoInContent);
965
966 // Paste HTML content.
967 SwPaM* pCursorPos = rWrtSh.GetCursor();
968 *pCursorPos = aPasteEnd;
969 SwTranslateHelper::PasteHTMLToPaM(rWrtSh, pCursorPos, aContent.toUtf8(), true);
970
971 // Update the refmark to point to the new content.
972 sal_Int32 nOldStart = pTextRefMark->GetStart();
973 sal_Int32 nNewStart = *pTextRefMark->End();
974 // First grow it to include text till the end of the paste position.
975 pTextRefMark->SetEnd(aPasteEnd.GetPoint()->GetContentIndex());
976 // Then shrink it to only start at the paste start: we know that the refmark was
977 // truncated to the paste start, as the refmark has to stay inside a single text node
978 pTextRefMark->SetStart(nNewStart);
979 rTextNode.GetSwpHints().SortIfNeedBe();
980 SwPaM aEndMarker(*aPasteEnd.GetPoint());
981 aEndMarker.SetMark();
982 aEndMarker.GetMark()->AdjustContent(1);
983 SwPaM aStartMarker(SwPosition(rTextNode, nOldStart), SwPosition(rTextNode, nNewStart));
984
985 // Remove markers. The start marker includes the old content as well.
986 rIDCO.DeleteAndJoin(aStartMarker);
987 rIDCO.DeleteAndJoin(aEndMarker);
988}
989}
990
991// Evaluate respectively dispatching the slot Id
992
994{
995 const SfxPoolItem *pItem;
996 SwWrtShell &rSh = GetShell();
997 const SfxItemSet* pArgs = rReq.GetArgs();
998 bool bMore = false;
999
1000 sal_uInt16 nSlot = rReq.GetSlot();
1001 switch(nSlot)
1002 {
1003 case FN_REPAGINATE:
1004 {
1005 Reference < XModel > xModel = GetView().GetDocShell()->GetModel();
1006 auto pDoc = comphelper::getFromUnoTunnel<SwXTextDocument>(xModel);
1007 pDoc->NotifyRefreshListeners();
1008 rSh.CalcLayout();
1009 }
1010 break;
1011 case FN_UPDATE_FIELDS:
1012 {
1013 if (UpdateFieldContents(rReq, rSh))
1014 {
1015 // Parameters indicated that the name / content of fields has to be updated to
1016 // the provided values, don't do an actual fields update.
1017 break;
1018 }
1019
1020 rSh.UpdateDocStat();
1021 rSh.EndAllTableBoxEdit();
1022 rSh.SwViewShell::UpdateFields(true);
1023
1024 if( rSh.IsCursorInTable() )
1025 {
1026 if( !rSh.IsTableComplexForChart() )
1027 SwTableFUNC( &rSh ).UpdateChart();
1029 rSh.SaveTableBoxContent();
1030 }
1031 }
1032 break;
1033 case FN_UPDATE_FIELD:
1034 {
1035 UpdateFieldContent(rReq, rSh);
1036 }
1037 break;
1038 case FN_UPDATE_CHARTS:
1039 {
1040 SwWait aWait( *m_rView.GetDocShell(), true );
1041 rSh.UpdateAllCharts();
1042 }
1043 break;
1044
1045 case FN_UPDATE_ALL:
1046 {
1047 comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer
1049 rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true);
1050
1051 SwView& rTempView = GetView();
1052 rSh.EnterStdMode();
1053 if( !rSh.GetLinkManager().GetLinks().empty() )
1054 {
1055 rSh.StartAllAction();
1056 rSh.GetLinkManager().UpdateAllLinks( false, true, nullptr );
1057 rSh.EndAllAction();
1058 }
1059 SfxDispatcher &rDis = *rTempView.GetViewFrame().GetDispatcher();
1060 rDis.Execute( FN_UPDATE_FIELDS );
1061 rDis.Execute( FN_UPDATE_TOX );
1062 rDis.Execute( FN_UPDATE_CHARTS );
1063 rSh.Reformat();
1065 }
1066 break;
1067
1069 rSh.UpdateInputFields();
1070 break;
1071
1072 case FN_PREV_BOOKMARK:
1073 rReq.SetReturnValue(SfxBoolItem( nSlot, rSh.GoPrevBookmark()));
1074 break;
1075 case FN_NEXT_BOOKMARK:
1076 rReq.SetReturnValue(SfxBoolItem( nSlot, rSh.GoNextBookmark()));
1077 break;
1078
1079 case FN_GOTO_NEXT_MARK:
1080 case FN_GOTO_PREV_MARK:
1081 {
1082 SwFieldMgr aFieldMgr;
1083 SwFieldType* pFieldType = aFieldMgr.GetFieldType(SwFieldIds::JumpEdit);
1084
1085 if (pFieldType)
1086 {
1087 if (rSh.IsSelFrameMode())
1088 {
1089 rSh.UnSelectFrame();
1090 rSh.LeaveSelFrameMode();
1091 }
1092
1093 if (rSh.HasMark())
1094 {
1095 SwMvContext aMvContext(&rSh);
1096 if (rSh.IsCursorPtAtEnd())
1097 rSh.SwapPam();
1098 rSh.ClearMark();
1099 rSh.EndSelect();
1100 }
1101 bool bRet = rSh.MoveFieldType( pFieldType, nSlot == FN_GOTO_NEXT_MARK );
1102 SwField* pCurField = bRet ? rSh.GetCurField() : nullptr;
1103 if (pCurField)
1104 rSh.ClickToField(*pCurField, /*bExecHyperlinks=*/false);
1105 rReq.SetReturnValue(SfxBoolItem( nSlot, bRet));
1106 }
1107 }
1108 break;
1109
1110 case FN_START_DOC_DIRECT:
1111 case FN_END_DOC_DIRECT:
1112 {
1113 if (rSh.IsSelFrameMode())
1114 {
1115 rSh.UnSelectFrame();
1116 rSh.LeaveSelFrameMode();
1117 }
1118 rSh.EnterStdMode();
1119 nSlot == FN_START_DOC_DIRECT ?
1120 rSh.SttEndDoc(true) :
1121 rSh.SttEndDoc(false);
1122 }
1123 break;
1124 case FN_GOTO_PREV_OBJ:
1125 case FN_GOTO_NEXT_OBJ:
1126 {
1127 bool bSuccess = rSh.GotoObj( nSlot == FN_GOTO_NEXT_OBJ );
1128 rReq.SetReturnValue(SfxBoolItem(nSlot, bSuccess));
1129 if (bSuccess && !rSh.IsSelFrameMode())
1130 {
1131 rSh.HideCursor();
1132 rSh.EnterSelFrameMode();
1133 GetView().AttrChangedNotify(nullptr);
1134 }
1135 }
1136 break;
1137 case SID_GALLERY_FORMATS:
1138 {
1139 const SvxGalleryItem* pGalleryItem = SfxItemSet::GetItem<SvxGalleryItem>(pArgs, SID_GALLERY_FORMATS, false);
1140 if ( !pGalleryItem )
1141 break;
1142
1143 const SelectionType nSelType = rSh.GetSelectionType();
1144 sal_Int8 nGalleryItemType( pGalleryItem->GetType() );
1145
1146 if ( (!rSh.IsSelFrameMode() || nSelType & SelectionType::Graphic) &&
1147 nGalleryItemType == css::gallery::GalleryItemType::GRAPHIC )
1148 {
1149 SwWait aWait( *m_rView.GetDocShell(), true );
1150
1151 OUString aGrfName, aFltName;
1152 const Graphic aGrf( pGalleryItem->GetGraphic() );
1153
1154 if ( nSelType & SelectionType::Graphic )
1155 rSh.ReRead( aGrfName, aFltName, &aGrf );
1156 else
1157 rSh.InsertGraphic( aGrfName, aFltName, aGrf );
1158
1160 }
1161 else if(!rSh.IsSelFrameMode() &&
1162 nGalleryItemType == css::gallery::GalleryItemType::MEDIA )
1163 {
1164 const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, pGalleryItem->GetURL() );
1166 SID_INSERT_AVMEDIA, SfxCallMode::SYNCHRON,
1167 { &aMediaURLItem });
1168 }
1169 }
1170 break;
1172 {
1173 if (pArgs)
1174 {
1175 // Determine the current PageDescriptor and fill the set with that.
1176 const size_t nCurIdx = rSh.GetCurPageDesc();
1177 SwPageDesc aPageDesc(rSh.GetPageDesc(nCurIdx));
1178
1179 SwFrameFormat &rFormat = aPageDesc.GetMaster();
1180
1181 SwFormatCol aFormatCol = rFormat.GetCol();
1182
1183 sal_uInt16 nCount;
1184 if(SfxItemState::SET == pArgs->GetItemState(nSlot))
1185 nCount = static_cast<const SfxUInt16Item &>(pArgs->Get(nSlot)).GetValue();
1186 else
1187 nCount = pArgs->Get(SID_ATTR_COLUMNS).GetValue();
1188 sal_uInt16 nGutterWidth = DEF_GUTTER_WIDTH;
1189
1190 aFormatCol.Init(nCount ? nCount : 1, nGutterWidth, USHRT_MAX);
1191 aFormatCol.SetWishWidth(USHRT_MAX);
1192 aFormatCol.SetGutterWidth(nGutterWidth, USHRT_MAX);
1193
1194 rFormat.SetFormatAttr(aFormatCol);
1195
1196 rSh.ChgPageDesc(nCurIdx, aPageDesc);
1197 }
1198 else
1200 }
1201 break;
1205 {
1206 sal_Unicode cDelim = 0;
1207 bool bToTable = false;
1208 if( nSlot == FN_CONVERT_TEXT_TO_TABLE ||
1209 ( nSlot == FN_CONVERT_TEXT_TABLE && nullptr == rSh.GetTableFormat() ))
1210 bToTable = true;
1212 SwTableAutoFormat const* pTAFormat = nullptr;
1213 std::unique_ptr<SwTableAutoFormatTable> pAutoFormatTable;
1214 bool bDeleteFormat = true;
1215 if(pArgs && SfxItemState::SET == pArgs->GetItemState( FN_PARAM_1, true, &pItem))
1216 {
1217 aInsTableOpts.mnInsMode = SwInsertTableFlags::NONE;
1218 // Delimiter
1219 OUString sDelim = static_cast< const SfxStringItem* >(pItem)->GetValue();
1220 if(!sDelim.isEmpty())
1221 cDelim = sDelim[0];
1222 // AutoFormat
1223 if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_2, true, &pItem))
1224 {
1225 OUString sAutoFormat = static_cast< const SfxStringItem* >(pItem)->GetValue();
1226
1227 pAutoFormatTable.reset(new SwTableAutoFormatTable);
1228 pAutoFormatTable->Load();
1229
1230 for( sal_uInt16 i = 0, nCount = pAutoFormatTable->size(); i < nCount; i++ )
1231 {
1232 SwTableAutoFormat const*const pFormat = &(*pAutoFormatTable)[ i ];
1233 if( pFormat->GetName() == sAutoFormat )
1234 {
1235 pTAFormat = pFormat;
1236 bDeleteFormat = false;
1237 break;
1238 }
1239 }
1240 }
1241 //WithHeader
1242 if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_3, true, &pItem) &&
1243 static_cast< const SfxBoolItem* >(pItem)->GetValue())
1244 aInsTableOpts.mnInsMode |= SwInsertTableFlags::Headline;
1245 // RepeatHeaderLines
1246 if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_4, true, &pItem))
1247 aInsTableOpts.mnRowsToRepeat =
1248 o3tl::narrowing<sal_uInt16>(static_cast< const SfxInt16Item* >(pItem)->GetValue());
1249 //WithBorder
1250 if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_5, true, &pItem) &&
1251 static_cast< const SfxBoolItem* >(pItem)->GetValue())
1253 //DontSplitTable
1254 if(SfxItemState::SET == pArgs->GetItemState( FN_PARAM_6, true, &pItem) &&
1255 !static_cast< const SfxBoolItem* >(pItem)->GetValue() )
1257 }
1258 else
1259 {
1262 if( RET_OK == pDlg->Execute() )
1263 {
1264 pDlg->GetValues( cDelim, aInsTableOpts, pTAFormat );
1265
1266 }
1267 }
1268
1269 if( cDelim )
1270 {
1271 //Shell change!
1272 SwView& rSaveView = m_rView;
1273 bool bInserted = false;
1274 //recording:
1275 SfxViewFrame& rViewFrame = GetView().GetViewFrame();
1276 if (SfxRequest::HasMacroRecorder(rViewFrame))
1277 {
1278 SfxRequest aReq(rViewFrame, nSlot);
1279 aReq.AppendItem( SfxStringItem( FN_PARAM_1, OUString(cDelim) ));
1280 if(bToTable)
1281 {
1282 if(pTAFormat)
1283 aReq.AppendItem( SfxStringItem( FN_PARAM_2, pTAFormat->GetName()));
1284 aReq.AppendItem( SfxBoolItem ( FN_PARAM_3, bool(aInsTableOpts.mnInsMode & SwInsertTableFlags::Headline)));
1285 aReq.AppendItem( SfxInt16Item( FN_PARAM_4, static_cast<short>(aInsTableOpts.mnRowsToRepeat) ));
1286 aReq.AppendItem( SfxBoolItem ( FN_PARAM_5, bool(aInsTableOpts.mnInsMode & SwInsertTableFlags::DefaultBorder) ));
1287 aReq.AppendItem( SfxBoolItem ( FN_PARAM_6, !(aInsTableOpts.mnInsMode & SwInsertTableFlags::SplitLayout)));
1288 }
1289 aReq.Done();
1290 }
1291
1292 if( !bToTable )
1293 rSh.TableToText( cDelim );
1294 else
1295 {
1296 bInserted = rSh.TextToTable( aInsTableOpts, cDelim, pTAFormat );
1297 }
1298 rSh.EnterStdMode();
1299
1300 if( bInserted )
1301 rSaveView.AutoCaption( TABLE_CAP );
1302 }
1303 if(bDeleteFormat)
1304 delete pTAFormat;
1305 }
1306 break;
1307 case SID_STYLE_WATERCAN:
1308 case SID_STYLE_UPDATE_BY_EXAMPLE:
1309 case SID_STYLE_NEW_BY_EXAMPLE:
1310 case SID_STYLE_APPLY:
1311 {
1313 if ( ShellMode::Draw != eMode &&
1317 {
1318 // oj #107754#
1319 if ( SID_STYLE_WATERCAN == nSlot )
1320 {
1321 const bool bLockedView = rSh.IsViewLocked();
1322 rSh.LockView( true ); //lock visible section
1323
1325
1326 rSh.LockView( bLockedView );
1327 }
1328 else
1329 // Will be recorded from the DocShell
1331 }
1332 }
1333 break;
1334 case SID_CLASSIFICATION_APPLY:
1335 {
1336 GetView().GetDocShell()->Execute(rReq);
1337 }
1338 break;
1339 case SID_CLASSIFICATION_DIALOG:
1340 {
1341 GetView().GetDocShell()->Execute(rReq);
1342 }
1343 break;
1344 case SID_PARAGRAPH_SIGN_CLASSIFY_DLG:
1345 {
1346 GetView().GetDocShell()->Execute(rReq);
1347 }
1348 break;
1349 case SID_WATERMARK:
1350 {
1351 GetView().GetDocShell()->Execute(rReq);
1352 }
1353 break;
1354 case FN_ESCAPE:
1355 GetView().ExecuteSlot(rReq);
1356 break;
1357 case SID_IMAP:
1358 {
1359 sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
1360
1361 SfxViewFrame& rVFrame = GetView().GetViewFrame();
1362 rVFrame.ToggleChildWindow( nId );
1363 rVFrame.GetBindings().Invalidate( SID_IMAP );
1364
1365 if ( rVFrame.HasChildWindow( nId ) && rSh.IsFrameSelected() )
1366 lcl_UpdateIMapDlg( rSh );
1367 }
1368 break;
1369 case SID_IMAP_EXEC:
1370 {
1371 SvxIMapDlg* pDlg = GetIMapDlg(GetView());
1372
1373 // Check, if the allocation is useful or allowed at all.
1374 if ( rSh.IsFrameSelected() &&
1375 pDlg->GetEditingObject() == rSh.GetIMapInventor() )
1376 {
1378 rSh.GetFlyFrameAttr( aSet );
1379 SwFormatURL aURL( aSet.Get( RES_URL ) );
1380 aURL.SetMap( &pDlg->GetImageMap() );
1381 aSet.Put( aURL );
1382 rSh.SetFlyFrameAttr( aSet );
1383 }
1384 }
1385 break;
1389 {
1390 SwViewOption aViewOption = *rSh.GetViewOptions();
1391 bool bAllInText = FN_SET_TRACKED_CHANGES_IN_TEXT == nSlot;
1392 aViewOption.SetShowChangesInMargin( !bAllInText );
1393 if ( !bAllInText )
1395 rSh.ApplyViewOptions( aViewOption );
1396
1397 // tdf#140982 restore annotation ranges stored in temporary bookmarks
1398 // (only remove temporary bookmarks during file saving to avoid possible
1399 // conflict with lazy deletion of the bookmarks of the moved tracked deletions)
1400 if ( bAllInText || FN_SET_TRACKED_INSERTIONS_IN_MARGIN == nSlot )
1402 }
1403 break;
1404 case SID_CONTOUR_DLG:
1405 {
1406 sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
1407
1408 SfxViewFrame& rVFrame = GetView().GetViewFrame();
1409 rVFrame.ToggleChildWindow( nId );
1410 rVFrame.GetBindings().Invalidate( SID_CONTOUR_DLG );
1411
1412 SelectionType nSel = rSh.GetSelectionType();
1413 if ( rVFrame.HasChildWindow( nId ) &&
1415 {
1416 lcl_UpdateContourDlg( rSh, nSel );
1417 }
1418 }
1419 break;
1420 case SID_CONTOUR_EXEC:
1421 {
1422 SvxContourDlg *pDlg = GetContourDlg(GetView());
1423 // Check, if the allocation is useful or allowed at all.
1424 SelectionType nSel = rSh.GetSelectionType();
1426 {
1427 if (pDlg && pDlg->GetEditingObject() == rSh.GetIMapInventor())
1428 {
1429 rSh.StartAction();
1431 rSh.GetFlyFrameAttr( aSet );
1432 SwFormatSurround aSur( aSet.Get( RES_SURROUND ) );
1433 if ( !aSur.IsContour() )
1434 {
1435 aSur.SetContour( true );
1436 if ( aSur.GetSurround() == css::text::WrapTextMode_NONE )
1437 aSur.SetSurround( css::text::WrapTextMode_PARALLEL );
1438 aSet.Put( aSur );
1439 rSh.SetFlyFrameAttr( aSet );
1440 }
1441 const tools::PolyPolygon aPoly( pDlg->GetPolyPolygon() );
1442 rSh.SetGraphicPolygon( &aPoly );
1443 if ( pDlg->IsGraphicChanged() )
1444 rSh.ReRead( OUString(), OUString(), &pDlg->GetGraphic());
1445 rSh.EndAction();
1446 }
1447 }
1448 }
1449 break;
1450 case FN_FRAME_TO_ANCHOR:
1451 {
1452 rSh.GotoFlyAnchor();
1453 rSh.EnterStdMode();
1454 rSh.CallChgLnk();
1455 }
1456 break;
1462 {
1463 RndStdIds eSet = nSlot == FN_TOOL_ANCHOR_PAGE
1464 ? RndStdIds::FLY_AT_PAGE
1465 : nSlot == FN_TOOL_ANCHOR_PARAGRAPH
1466 ? RndStdIds::FLY_AT_PARA
1467 : nSlot == FN_TOOL_ANCHOR_FRAME
1468 ? RndStdIds::FLY_AT_FLY
1469 : nSlot == FN_TOOL_ANCHOR_CHAR
1470 ? RndStdIds::FLY_AS_CHAR
1471 : RndStdIds::FLY_AT_CHAR;
1472 rSh.StartUndo();
1473 if (rSh.IsObjSelected())
1474 rSh.ChgAnchor(eSet);
1475 else if (rSh.IsFrameSelected())
1476 {
1477 SwFormatAnchor aAnc(eSet, eSet == RndStdIds::FLY_AT_PAGE ? rSh.GetPhyPageNum() : 0);
1479 rSh.SetFlyFrameAttr(aSet);
1480 }
1481 // if new anchor is 'as char' and it is a Math object and the usual
1482 // pre-conditions are met then align the formula to the baseline of the text
1483 const uno::Reference < embed::XEmbeddedObject > xObj( rSh.GetOleRef() );
1484 const bool bDoMathBaselineAlignment = xObj.is() && SotExchange::IsMath( xObj->getClassID() )
1485 && RndStdIds::FLY_AS_CHAR == eSet && rSh.GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT );
1486 if (bDoMathBaselineAlignment)
1487 rSh.AlignFormulaToBaseline( xObj );
1488
1489 sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
1490 if( nHtmlMode )
1491 {
1493 rSh.GetFlyFrameAttr(aSet);
1494
1495 const SwFormatSurround& rSurround = aSet.Get(RES_SURROUND);
1496 const SwFormatVertOrient& rVert = aSet.Get(RES_VERT_ORIENT);
1497 const SwFormatHoriOrient& rHori = aSet.Get(RES_HORI_ORIENT);
1498 sal_Int16 eVOrient = rVert.GetVertOrient();
1499 sal_Int16 eHOrient = rHori.GetHoriOrient();
1500 css::text::WrapTextMode eSurround = rSurround.GetSurround();
1501
1502 switch( eSet )
1503 {
1504 case RndStdIds::FLY_AT_FLY:
1505 case RndStdIds::FLY_AT_PAGE:
1506 //Wrap through, left or from left, top, from top
1507 if(eSurround != css::text::WrapTextMode_THROUGH)
1508 aSet.Put(SwFormatSurround(css::text::WrapTextMode_THROUGH));
1509
1510 if( eVOrient != text::VertOrientation::TOP && eVOrient != text::VertOrientation::NONE)
1511 aSet.Put(SwFormatVertOrient(0, text::VertOrientation::TOP));
1512
1513 if (eHOrient != text::HoriOrientation::NONE && eHOrient != text::HoriOrientation::LEFT)
1514 aSet.Put(SwFormatHoriOrient(0, text::HoriOrientation::LEFT));
1515 break;
1516
1517 case RndStdIds::FLY_AT_PARA:
1518 // left, from left, right, top, no wrap, wrap left and right
1519 if (eSurround != css::text::WrapTextMode_LEFT && eSurround != css::text::WrapTextMode_RIGHT)
1520 aSet.Put(SwFormatSurround(css::text::WrapTextMode_LEFT));
1521
1522 if( eVOrient != text::VertOrientation::TOP)
1523 aSet.Put(SwFormatVertOrient(0, text::VertOrientation::TOP));
1524
1525 if (eHOrient != text::HoriOrientation::NONE && eHOrient != text::HoriOrientation::LEFT && eHOrient != text::HoriOrientation::RIGHT)
1526 aSet.Put(SwFormatHoriOrient(0, text::HoriOrientation::LEFT));
1527 break;
1528
1529 case RndStdIds::FLY_AT_CHAR:
1530 // left, from left, right, top, wrap through
1531 if(eSurround != css::text::WrapTextMode_THROUGH)
1532 aSet.Put(SwFormatSurround(css::text::WrapTextMode_THROUGH));
1533
1534 if( eVOrient != text::VertOrientation::TOP)
1535 aSet.Put(SwFormatVertOrient(0, text::VertOrientation::TOP));
1536
1537 if (eHOrient != text::HoriOrientation::NONE && eHOrient != text::HoriOrientation::LEFT && eHOrient != text::HoriOrientation::RIGHT)
1538 aSet.Put(SwFormatHoriOrient(0, text::HoriOrientation::LEFT));
1539 break;
1540
1541 default:
1542 ;
1543 }
1544
1545 if( aSet.Count() )
1546 rSh.SetFlyFrameAttr( aSet );
1547 }
1548 rSh.EndUndo();
1549
1550 GetView().GetViewFrame().GetBindings().Invalidate( SID_ANCHOR_MENU );
1551 }
1552 break;
1553
1554 case FN_FRAME_NOWRAP:
1555 case FN_FRAME_WRAP:
1557 case FN_FRAME_WRAPTHRU:
1562 case FN_FRAME_WRAP_LEFT:
1564 SetWrapMode( nSlot );
1565 break;
1566
1568 {
1569 if( !rSh.GetLinkManager().GetLinks().empty() )
1570 {
1571 rSh.EnterStdMode();
1572 rSh.StartAllAction();
1573 rSh.GetLinkManager().UpdateAllLinks( false, false, nullptr );
1574 rSh.EndAllAction();
1575 }
1576 }
1577 break;
1578
1580 if (pArgs && pArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET)
1581 {
1582 if (const SfxBoolItem* pBoolItem = dynamic_cast<const SfxBoolItem*>(pItem))
1583 {
1584 bool bDesignMode = pBoolItem->GetValue();
1585
1586 // set from design mode
1587 OSL_ENSURE( GetView().GetFormShell() != nullptr, "form shell?" );
1588 SfxRequest aReq(GetView().GetViewFrame(), SID_FM_DESIGN_MODE);
1589 aReq.AppendItem( SfxBoolItem( SID_FM_DESIGN_MODE, bDesignMode ) );
1590 GetView().GetFormShell()->Execute( aReq );
1591 aReq.Done();
1592
1593 // also set suitable view options
1594 SwViewOption aViewOption = *rSh.GetViewOptions();
1595 aViewOption.SetFormView( ! bDesignMode );
1596 rSh.ApplyViewOptions( aViewOption );
1597 }
1598 }
1599 break;
1600
1601 default:
1602 bMore = true;
1603 }
1604
1605
1606 if(!bMore || !pArgs)
1607 return;
1608
1609 pItem = nullptr;
1610 pArgs->GetItemState(GetPool().GetWhich(nSlot), false, &pItem);
1611 if(!pItem)
1612 return;
1613
1614 switch(nSlot)
1615 {
1616 case SID_ATTR_BRUSH:
1617 case SID_ATTR_BORDER_SHADOW:
1618 case RES_SHADOW:
1619 {
1620 rSh.StartAllAction();
1621 // Table cell(s) selected?
1622 if ( rSh.IsTableMode() )
1623 {
1624 SwFrameFormat *pFormat = rSh.GetTableFormat();
1625 pFormat->SetFormatAttr( *pItem );
1626 }
1627 else if ( rSh.IsFrameSelected() )
1628 {
1629 // Set border attributes via Frame-Manager.
1630 SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE, nullptr );
1631 aMgr.SetAttrSet( *pArgs );
1632 aMgr.UpdateFlyFrame();
1633 }
1634 else
1635 {
1636 rSh.SetAttrSet( *pArgs );
1637 }
1638 rSh.EndAllAction();
1639 }
1640 break;
1646 {
1647 OSL_FAIL("not implemented");
1648 }
1649 break;
1650
1651 case SID_ATTR_BORDER_OUTER:
1652 {
1653 // Table cell(s) selected?
1654 if ( rSh.IsTableMode() )
1655 {
1656 // Set border attributes Get/SetTabBorders()
1657 rSh.SetTabBorders(*pArgs);
1658 }
1659 else if ( rSh.IsFrameSelected() )
1660 {
1661 // Set border attributes via Frame-Manager.
1662 SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE, nullptr );
1663 aMgr.SetAttrSet(*pArgs);
1664 aMgr.UpdateFlyFrame();
1665 }
1666 else
1667 {
1668 // Set border attributes via shell quite normally.
1669 rSh.SetAttrItem( *pItem );
1670 }
1671 }
1672 break;
1673 default:
1674 OSL_FAIL("wrong Dispatcher");
1675 }
1676}
1677
1678// Here the state for SID_IMAP / SID_CONTOUR will be handled
1679// until the swapping of the graphic is finished.
1680
1681IMPL_LINK_NOARG(SwBaseShell, GraphicArrivedHdl, SwCursorShell&, void)
1682{
1683 SwWrtShell &rSh = GetShell();
1684 if (CNT_GRF != rSh.SwEditShell::GetCntType())
1685 return;
1686 GraphicType const nGrfType(rSh.GetGraphicType());
1687 if (GraphicType::NONE == nGrfType || m_aGrfUpdateSlots.empty())
1688 return;
1689
1691 SfxViewFrame& rVFrame = GetView().GetViewFrame();
1692 for( const auto nSlot : m_aGrfUpdateSlots )
1693 {
1694 bool bSetState = false;
1695 bool bState = false;
1696 switch( nSlot )
1697 {
1698 case SID_IMAP:
1699 case SID_IMAP_EXEC:
1700 {
1701 sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
1702 SfxChildWindow *pChildWindow = rVFrame.HasChildWindow(nId) ?
1703 rVFrame.GetChildWindow(nId) : nullptr;
1704 SvxIMapDlg *pDlg = pChildWindow ?
1705 static_cast<SvxIMapDlg*>(pChildWindow->GetController().get()) : nullptr;
1706
1707 if( pDlg && ( SID_IMAP_EXEC == nSlot ||
1708 ( SID_IMAP == nSlot && !bProtect)) &&
1709 pDlg->GetEditingObject() != rSh.GetIMapInventor())
1710 lcl_UpdateIMapDlg( rSh );
1711
1712 if( !bProtect && SID_IMAP == nSlot )
1713 {
1714 bSetState = true;
1715 bState = nullptr != pDlg;
1716 }
1717 }
1718 break;
1719
1720 case SID_CONTOUR_DLG:
1721 if( !bProtect )
1722 {
1723 sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
1724 SfxChildWindow *pChildWindow = rVFrame.HasChildWindow(nId) ?
1725 rVFrame.GetChildWindow(nId) : nullptr;
1726 SvxIMapDlg *pDlg = pChildWindow ?
1727 static_cast<SvxIMapDlg*>(pChildWindow->GetController().get()) : nullptr;
1728 if( pDlg && pDlg->GetEditingObject() !=
1729 rSh.GetIMapInventor() )
1731
1732 bSetState = true;
1733 bState = nullptr != pDlg;
1734 }
1735 break;
1736
1738 if( !bProtect )
1739 {
1741 rSh.GetFlyFrameAttr(aSet);
1742 const SwFormatSurround& rWrap = aSet.Get(RES_SURROUND);
1743 bSetState = true;
1744 bState = rWrap.IsContour();
1745 }
1746 break;
1747
1748 case SID_GRFFILTER:
1749 case SID_GRFFILTER_INVERT:
1750 case SID_GRFFILTER_SMOOTH:
1751 case SID_GRFFILTER_SHARPEN:
1752 case SID_GRFFILTER_REMOVENOISE:
1753 case SID_GRFFILTER_SOBEL:
1754 case SID_GRFFILTER_MOSAIC:
1755 case SID_GRFFILTER_EMBOSS:
1756 case SID_GRFFILTER_POSTER:
1757 case SID_GRFFILTER_POPART:
1758 case SID_GRFFILTER_SEPIA:
1759 case SID_GRFFILTER_SOLARIZE:
1760 bSetState = bState = GraphicType::Bitmap == nGrfType;
1761 break;
1762 }
1763
1764 if( bSetState )
1765 {
1766 SfxBoolItem aBool( nSlot, bState );
1767 if( m_pGetStateSet )
1768 m_pGetStateSet->Put( aBool );
1769 else
1770 rVFrame.GetBindings().SetState( aBool );
1771 }
1772 }
1773 m_aGrfUpdateSlots.clear();
1774}
1775
1777{
1778 SwWrtShell &rSh = GetShell();
1779 SfxViewFrame& rVFrame = GetView().GetViewFrame();
1780 SfxWhichIter aIter( rSet );
1781 sal_uInt16 nWhich = aIter.FirstWhich();
1783 while ( nWhich )
1784 {
1785 switch ( nWhich )
1786 {
1787 case SID_GALLERY_FORMATS:
1788 if ( rSh.IsObjSelected() ||
1789 (rSh.IsSelFrameMode() &&
1791 rSet.DisableItem( nWhich );
1792 break;
1793 case SID_GALLERY_ENABLE_ADDCOPY:
1794 // #108230# allow copy from gallery in Writer AND Writer/Web!
1795 rSet.Put( SfxBoolItem( SID_GALLERY_ENABLE_ADDCOPY, true ) );
1796 break;
1797 case FN_EDIT_REGION:
1798 if( !rSh.IsAnySectionInDoc() )
1799 rSet.DisableItem(nWhich);
1800 break;
1801
1803 //tdf#112808 if cursor is in an index, don't show the edit section.
1804 if( !rSh.GetCurrSection() ||
1807 {
1808 rSet.DisableItem(nWhich);
1809 }
1810 break;
1811
1812 case FN_INSERT_REGION:
1813 if( rSh.CursorInsideInputField()
1814 || rSh.IsSelFrameMode()
1815 || !rSh.IsInsRegionAvailable() )
1816 {
1817 rSet.DisableItem( nWhich );
1818 }
1819 break;
1820
1822 {
1823 FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,true);
1824 if( (eFrameType & FrameTypeFlags::FOOTNOTE) ||
1825 !rSh.GetTableFormat() )
1826 rSet.DisableItem( nWhich );
1827 }
1828 break;
1830 {
1831 FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,true);
1832 if( (eFrameType & FrameTypeFlags::FOOTNOTE) ||
1833 !rSh.IsTextToTableAvailable() )
1834 rSet.DisableItem( nWhich );
1835 }
1836 break;
1838 {
1839 FrameTypeFlags eFrameType = rSh.GetFrameType(nullptr,true);
1840 if( (eFrameType & FrameTypeFlags::FOOTNOTE) ||
1841 (!rSh.GetTableFormat() && !rSh.IsTextToTableAvailable() ) )
1842 rSet.DisableItem( nWhich );
1843 }
1844 break;
1845 case RES_SHADOW:
1846 {
1848
1849 // Table cell(s) selected?
1850 if ( rSh.IsTableMode() )
1851 {
1852 SwFrameFormat *pFormat = rSh.GetTableFormat();
1853 aSet.Put(pFormat->GetFormatAttr( nWhich ));
1854 }
1855 else if( rSh.IsFrameSelected() )
1856 {
1857 SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE, nullptr );
1858 aSet.Put( aMgr.GetAttrSet() );
1859 }
1860 else
1861 rSh.GetCurAttr( aSet );
1862
1863 const SvxShadowItem& rShItem = static_cast<const SvxShadowItem&>(aSet.Get(nWhich));
1864 rSet.Put(rShItem);
1865 }
1866 break;
1867 case SID_IMAP:
1868 {
1869 // #i59688#
1870 // Improve efficiency:
1871 // If selected object is protected, item has to disabled.
1873 if ( bProtect )
1874 {
1875 rSet.DisableItem( nWhich );
1876 }
1877 else
1878 {
1879 const sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
1880 const bool bHas = rVFrame.HasChildWindow( nId );
1881 const bool bFrameSel = rSh.IsFrameSelected();
1882 const bool bIsGraphicSelection =
1884
1885 // #i59688#
1886 // Avoid unnecessary loading of selected graphic.
1887 // The graphic is only needed, if the dialog is open.
1888 // If the swapping of the graphic is finished, the status
1889 // must be determined asynchronously, until this the slot
1890 // will be disabled.
1891 if ( bHas && bIsGraphicSelection && rSh.IsLinkedGrfSwapOut() )
1892 {
1893 if( AddGrfUpdateSlot( nWhich ))
1894 rSh.GetGraphic(false); // start the loading
1895 }
1896 else
1897 {
1898 if ( !bHas &&
1899 ( !bFrameSel ||
1900 ( bIsGraphicSelection &&
1901 rSh.GetGraphicType() == GraphicType::NONE ) ) )
1902 {
1903 rSet.DisableItem( nWhich );
1904 }
1905 else
1906 {
1907 SfxBoolItem aBool(nWhich, bHas);
1908 if ( bHas && bFrameSel )
1909 lcl_UpdateIMapDlg( rSh );
1910 rSet.Put(aBool);
1911 }
1912 }
1913 }
1914 }
1915 break;
1916 case SID_IMAP_EXEC:
1917 {
1918 bool bDisable = false;
1919 if( !rSh.IsFrameSelected())
1920 bDisable = true;
1921 sal_uInt16 nId = SvxIMapDlgChildWindow::GetChildWindowId();
1922 if(!bDisable && rVFrame.HasChildWindow( nId ))
1923 {
1925 && rSh.IsLinkedGrfSwapOut())
1926 {
1927 if( AddGrfUpdateSlot( nWhich ))
1928 rSh.GetGraphic(false); // start the loading
1929 }
1930 else
1931 {
1932 SvxIMapDlg *pDlg = GetIMapDlg(GetView());
1933 if (pDlg && pDlg->GetEditingObject() != rSh.GetIMapInventor())
1934 lcl_UpdateIMapDlg( rSh );
1935 }
1936 }
1937 rSet.Put(SfxBoolItem(nWhich, bDisable));
1938 }
1939 break;
1940
1941 case FN_BACKSPACE:
1942 case SID_DELETE:
1943 if ( ( rSh.HasReadonlySel() && !rSh.CursorInsideInputField() )
1945 {
1946 rSet.DisableItem( nWhich );
1947 }
1948 break;
1949
1950 case SID_CONTOUR_DLG:
1951 {
1953
1954 if( bParentCntProt || 0 != (HTMLMODE_ON & ::GetHtmlMode(
1955 GetView().GetDocShell() )) )
1956 rSet.DisableItem( nWhich );
1957 else
1958 {
1959 sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
1960 bool bHas = GetView().GetViewFrame().HasChildWindow( nId );
1961 SelectionType nSel = rSh.GetSelectionType();
1962 bool bOk(nSel & (SelectionType::Graphic|SelectionType::Ole));
1963
1964 bool bDisable = false;
1965 if( !bHas && !bOk )
1966 bDisable = true;
1967 // #i59688#
1968 // Avoid unnecessary loading of selected graphic.
1969 // The graphic is only needed, if the dialog is open.
1970 // If the swapping of the graphic is finished, the status
1971 // must be determined asynchronously, until this the slot
1972 // will be disabled.
1973 else if ( bHas && (nSel & SelectionType::Graphic) &&
1974 rSh.IsLinkedGrfSwapOut() )
1975 {
1976 if( AddGrfUpdateSlot( nWhich ))
1977 rSh.GetGraphic(false); // start the loading
1978 // #i75481#
1979 bDisable = true;
1980 }
1981 else if( bHas && bOk )
1982 bDisable = !lcl_UpdateContourDlg( rSh, nSel );
1983 else if( bOk )
1984 {
1985 // #i75481#
1986 // apply fix #i59688# only for selected graphics
1987 if ( nSel & SelectionType::Graphic )
1988 bDisable = GraphicType::NONE == rSh.GetGraphicType();
1989 else
1990 bDisable = GraphicType::NONE == rSh.GetIMapGraphic().GetType();
1991 }
1992
1993 if( bDisable )
1994 rSet.DisableItem( nWhich );
1995 else
1996 rSet.Put( SfxBoolItem(nWhich, bHas) );
1997 }
1998 }
1999 break;
2000 case SID_CONTOUR_EXEC:
2001 {
2002 bool bDisable = false;
2003 SelectionType nSel = rSh.GetSelectionType();
2005 bDisable = true;
2006 sal_uInt16 nId = SvxContourDlgChildWindow::GetChildWindowId();
2007 if( !bDisable && GetView().GetViewFrame().HasChildWindow( nId ))
2008 {
2009 SvxContourDlg *pDlg = GetContourDlg(GetView());
2010 if (pDlg && pDlg->GetEditingObject() != rSh.GetIMapInventor())
2011 bDisable = true;
2012 }
2013 rSet.Put(SfxBoolItem(nWhich, bDisable));
2014 }
2015 break;
2016
2017 case SID_ANCHOR_MENU:
2023 {
2024 bool bObj = 0 != rSh.IsObjSelected();
2026
2027 if( !bParentCntProt && (bObj || rSh.IsFrameSelected()))
2028 {
2030 if(bObj)
2031 rSh.GetObjAttr(aSet);
2032 else
2033 rSh.GetFlyFrameAttr(aSet);
2034 RndStdIds eSet = aSet.Get(RES_ANCHOR).GetAnchorId();
2035 const bool bSet =
2036 ((nWhich == FN_TOOL_ANCHOR_PAGE) &&
2037 (eSet == RndStdIds::FLY_AT_PAGE))
2038 || ((nWhich == FN_TOOL_ANCHOR_PARAGRAPH) &&
2039 (eSet == RndStdIds::FLY_AT_PARA))
2040 || ((nWhich == FN_TOOL_ANCHOR_FRAME) &&
2041 (eSet == RndStdIds::FLY_AT_FLY))
2042 || ((nWhich == FN_TOOL_ANCHOR_AT_CHAR) &&
2043 (eSet == RndStdIds::FLY_AT_CHAR))
2044 || ((nWhich == FN_TOOL_ANCHOR_CHAR) &&
2045 (eSet == RndStdIds::FLY_AS_CHAR));
2046
2047 if( nWhich == FN_TOOL_ANCHOR_FRAME && !rSh.IsFlyInFly() )
2048 rSet.DisableItem(nWhich);
2049 else if(nWhich != SID_ANCHOR_MENU)
2050 rSet.Put(SfxBoolItem(nWhich, bSet));
2051
2053 {
2054 if (nWhich == FN_TOOL_ANCHOR_PAGE || nWhich == FN_TOOL_ANCHOR_FRAME)
2055 {
2056 rSet.DisableItem(nWhich);
2057 }
2058 }
2059 }
2060 else
2061 rSet.DisableItem( nWhich );
2062 }
2063 break;
2064 case FN_FRAME_NOWRAP:
2065 case FN_FRAME_WRAP:
2067 case FN_FRAME_WRAPTHRU:
2072 case FN_FRAME_WRAP_LEFT:
2074 {
2075 bool bObj = 0 != rSh.IsObjSelected();
2077
2078 if( !bParentCntProt && (bObj || rSh.IsFrameSelected()))
2079 {
2081 RndStdIds nAnchorType;
2082 if(bObj)
2083 {
2084 rSh.GetObjAttr(aSet);
2085 nAnchorType = rSh.GetAnchorId();
2086 }
2087 else
2088 {
2089 rSh.GetFlyFrameAttr(aSet);
2090 nAnchorType = aSet.Get(RES_ANCHOR).GetAnchorId();
2091 }
2092 const SwFormatSurround& rWrap = aSet.Get(RES_SURROUND);
2093
2094 const SvxOpaqueItem& rOpaque = aSet.Get(RES_OPAQUE);
2095 bool bOpaque = rOpaque.GetValue();
2096 css::text::WrapTextMode nSurround = rWrap.GetSurround();
2097 bool bSet = false;
2098
2099 bool bDisable =
2100 (nAnchorType == RndStdIds::UNKNOWN) || (nAnchorType == RndStdIds::FLY_AS_CHAR);
2101 const bool bHtmlMode =
2102 0 != ::GetHtmlMode(GetView().GetDocShell());
2103
2104 switch( nWhich )
2105 {
2106 case FN_FRAME_NOWRAP:
2107 bDisable |=
2108 ( (nAnchorType != RndStdIds::FLY_AT_PARA)
2109 && (nAnchorType != RndStdIds::FLY_AT_CHAR)
2110 && (nAnchorType != RndStdIds::FLY_AT_PAGE));
2111 bSet = nSurround == css::text::WrapTextMode_NONE;
2112 break;
2113 case FN_FRAME_WRAP:
2114 bDisable |= bHtmlMode;
2115 bSet = nSurround == css::text::WrapTextMode_PARALLEL;
2116 break;
2118 bDisable |= bHtmlMode;
2119 bSet = nSurround == css::text::WrapTextMode_DYNAMIC;
2120 break;
2121 case FN_FRAME_WRAPTHRU:
2122 bDisable |= (bHtmlMode ||
2123 ( (nAnchorType != RndStdIds::FLY_AT_PARA)
2124 && (nAnchorType != RndStdIds::FLY_AT_CHAR)
2125 && (nAnchorType != RndStdIds::FLY_AT_PAGE)));
2126 if(bObj)
2127 bSet = nSurround == css::text::WrapTextMode_THROUGH && rSh.GetLayerId();
2128 else
2129 bSet = nSurround == css::text::WrapTextMode_THROUGH && bOpaque;
2130 break;
2133 bDisable |= bHtmlMode;
2134 if(bObj)
2135 bSet = nSurround == css::text::WrapTextMode_THROUGH && !rSh.GetLayerId();
2136 else
2137 bSet = nSurround == css::text::WrapTextMode_THROUGH && !bOpaque;
2138 break;
2140 bDisable |= bHtmlMode;
2141 //no contour available when no wrap or wrap through is set
2142 bDisable |= (nSurround == css::text::WrapTextMode_NONE || nSurround == css::text::WrapTextMode_THROUGH);
2143 if( !bDisable )
2144 {
2145 SelectionType nSel = rSh.GetSelectionType();
2146 if( (nSel & SelectionType::Graphic) &&
2147 rSh.IsLinkedGrfSwapOut())
2148 {
2149 if( AddGrfUpdateSlot( nWhich ))
2150 rSh.GetGraphic(false); // start the loading
2151 }
2152 else if( rSh.IsFrameSelected() )
2153 {
2154 // #i102253# applied patch from OD (see task)
2155 bDisable =
2156 nSel & SelectionType::Frame ||
2157 GraphicType::NONE == rSh.GetIMapGraphic().GetType();
2158 }
2159 }
2160 bSet = !bDisable && rWrap.IsContour();
2161
2162 break;
2164 bDisable |= (bHtmlMode ||
2165 (nAnchorType != RndStdIds::FLY_AT_PARA));
2166 bSet = rWrap.IsAnchorOnly();
2167 break;
2168 case FN_FRAME_WRAP_LEFT:
2169 bSet = nSurround == css::text::WrapTextMode_LEFT;
2170 break;
2172 bSet = nSurround == css::text::WrapTextMode_RIGHT;
2173 break;
2174 }
2175
2176 if(bDisable)
2177 rSet.DisableItem(nWhich);
2178 else
2179 rSet.Put(SfxBoolItem(nWhich, bSet));
2180 }
2181 else
2182 rSet.DisableItem(nWhich);
2183 }
2184 break;
2185 case FN_UPDATE_CHARTS:
2186 if( !rSh.HasCharts() )
2187 rSet.DisableItem( nWhich );
2188 break;
2190 if ( rSh.GetLinkManager().GetLinks().empty() )
2191 rSet.DisableItem(nWhich);
2192 break;
2194 // enable if in XForms document
2195 if( rSh.GetDoc()->isXForms() )
2196 {
2197 // determine current state from view options
2198 bool bValue = ! rSh.GetViewOptions()->IsFormView();
2199 rSet.Put( SfxBoolItem( nWhich, bValue ) );
2200 }
2201 else
2202 rSet.Put( SfxVisibilityItem( nWhich, false ) );
2203 break;
2204 case SID_GRAPHIC_SIZE_CHECK:
2205 {
2206 sal_Int32 nDPI = rSh.GetDoc()->getIDocumentSettingAccess().getImagePreferredDPI();
2207 if (nDPI <= 0)
2208 rSet.DisableItem(nWhich);
2209 }
2210 break;
2211 case SID_THEME_DIALOG:
2212 {
2213 bool bDisable = true;
2214 auto* pDocument = rSh.GetDoc();
2215 auto* pDocumentShell = pDocument->GetDocShell();
2216 if (pDocumentShell)
2217 {
2218 SdrPage* pPage = pDocument->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
2219 if (pPage)
2220 {
2221 auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
2222 if (pTheme)
2223 bDisable = false;
2224 }
2225 }
2226 if (bDisable)
2227 rSet.DisableItem(nWhich);
2228 }
2229 break;
2230 }
2231 nWhich = aIter.NextWhich();
2232 }
2233 m_pGetStateSet = nullptr;
2234}
2235
2236// Disable the slots with this status method
2237
2239{
2240 SfxWhichIter aIter(rSet);
2241 sal_uInt16 nWhich = aIter.FirstWhich();
2242
2243 while (nWhich)
2244 {
2245 rSet.DisableItem( nWhich );
2246 nWhich = aIter.NextWhich();
2247 }
2248}
2249
2250// Disable the slots with this status method
2251
2253{
2256
2257 if ( bParentCntProt ||
2262 {
2263 SfxWhichIter aIter( rSet );
2264 sal_uInt16 nWhich = aIter.FirstWhich();
2265 while ( nWhich )
2266 {
2267 rSet.DisableItem( nWhich );
2268 nWhich = aIter.NextWhich();
2269 }
2270 }
2271 else
2273}
2274
2275void SwBaseShell::SetWrapMode( sal_uInt16 nSlot )
2276{
2277 SwWrtShell &rSh = GetShell();
2278 bool bObj = 0 != rSh.IsObjSelected();
2279 if( !bObj && !rSh.IsFrameSelected())
2280 return;
2281
2283 if(bObj)
2284 rSh.GetObjAttr(aSet);
2285 else
2286 rSh.GetFlyFrameAttr(aSet);
2287 SwFormatSurround aWrap( aSet.Get(RES_SURROUND) );
2288 css::text::WrapTextMode nOldSurround(aWrap.GetSurround());
2289 css::text::WrapTextMode nSurround = css::text::WrapTextMode_PARALLEL;
2290
2291 switch (nSlot)
2292 {
2293 case FN_FRAME_NOWRAP:
2294 nSurround = css::text::WrapTextMode_NONE;
2295 if (aWrap.IsContour())
2296 aWrap.SetContour(false);
2297 break;
2299 nSurround = css::text::WrapTextMode_DYNAMIC;
2300 break;
2302 aWrap.SetAnchorOnly(!aWrap.IsAnchorOnly());
2303
2304 // keep previous wrapping
2305
2306 // switch to wrap css::text::WrapTextMode_PARALLEL, if previous wrap is css::text::WrapTextMode_NONE
2307 if ( nOldSurround != css::text::WrapTextMode_NONE )
2308 {
2309 nSurround = nOldSurround;
2310 }
2311 break;
2313 aWrap.SetContour(!aWrap.IsContour());
2314 // Contour is meaningless in no-wrap or wrap-through context. Otherwise keep existing wrap.
2315 if ( !aWrap.IsContour() ||
2316 ( nOldSurround != css::text::WrapTextMode_NONE &&
2317 nOldSurround != css::text::WrapTextMode_THROUGH ) )
2318 {
2319 nSurround = nOldSurround;
2320 }
2321 break;
2324 if (aWrap.IsContour())
2325 aWrap.SetContour(false);
2326 [[fallthrough]];
2327 case FN_FRAME_WRAPTHRU:
2328 nSurround = css::text::WrapTextMode_THROUGH;
2329 break;
2330
2331 case FN_FRAME_WRAP_LEFT:
2332 nSurround = css::text::WrapTextMode_LEFT;
2333 break;
2334
2336 nSurround = css::text::WrapTextMode_RIGHT;
2337 break;
2338
2339 default:
2340 break;
2341 }
2342 aWrap.SetSurround(nSurround);
2343
2344 if (nSlot != FN_FRAME_WRAP_CONTOUR)
2345 {
2346 // Defaulting the contour wrap on draw objects.
2347 if (bObj && nOldSurround != nSurround &&
2348 (nOldSurround == css::text::WrapTextMode_NONE || nOldSurround == css::text::WrapTextMode_THROUGH))
2349 {
2350 aWrap.SetContour(true);
2351 }
2352 }
2353
2354 aSet.Put( aWrap );
2355
2356 bool bOpaque = nSlot != FN_FRAME_WRAPTHRU_TRANSP && nSlot != FN_FRAME_WRAPTHRU_TOGGLE;
2357 if( nSlot == FN_FRAME_WRAPTHRU_TOGGLE )
2358 {
2359 if( bObj )
2360 bOpaque = !rSh.GetLayerId();
2361 else
2362 {
2363 const SvxOpaqueItem& aOpaque( aSet.Get(RES_OPAQUE) );
2364 bOpaque = !aOpaque.GetValue();
2365 }
2366 }
2367 aSet.Put(SvxOpaqueItem(RES_OPAQUE, bOpaque ));
2368
2369 if(bObj)
2370 {
2371 rSh.SetObjAttr(aSet);
2372 if ( bOpaque )
2373 rSh.SelectionToHeaven();
2374 else
2375 rSh.SelectionToHell();
2376 }
2377 else
2378 rSh.SetFlyFrameAttr(aSet);
2379
2380}
2381
2382//Force update of the status line
2383
2385{
2387 SfxBindings &rBnd = pSh->GetView().GetViewFrame().GetBindings();
2388
2389 if( eMode == FLY_DRAG || pSh->IsFrameSelected() || pSh->IsObjSelected() )
2390 {
2391 const SfxPointItem aTmp1( SID_ATTR_POSITION, pSh->GetAnchorObjDiff());
2392 const SvxSizeItem aTmp2( SID_ATTR_SIZE, pSh->GetObjSize());
2393 rBnd.SetState( aTmp1 );
2394 rBnd.SetState( aTmp2 );
2395 }
2396 else if( eMode == FLY_DRAG_END )
2397 {
2398 static sal_uInt16 aInval[] =
2399 {
2400 SID_ATTR_POSITION, SID_ATTR_SIZE, 0
2401 };
2402 rBnd.Invalidate(aInval);
2403 }
2404}
2405
2407 SfxShell( &rVw ),
2408 m_rView(rVw),
2409 m_pGetStateSet(nullptr)
2410{
2411 SwWrtShell& rWrtSh = m_rView.GetWrtShell();
2412
2413 SetPool(&rWrtSh.GetAttrPool());
2414 SetName("Base");
2415 rWrtSh.SetGrfArrivedLnk( LINK( this, SwBaseShell, GraphicArrivedHdl));
2416}
2417
2419{
2420 if( m_rView.GetCurShell() == this )
2422
2423 Link<SwCursorShell&,void> aTmp( LINK( this, SwBaseShell, GraphicArrivedHdl));
2424 if( aTmp == m_rView.GetWrtShell().GetGrfArrivedLnk() )
2426}
2427
2429{
2430 const SfxItemSet *pArgs = rReq.GetArgs();
2431 const sal_uInt16 nSlot = rReq.GetSlot();
2432
2433 if( pArgs)
2434 {
2435 SwWrtShell &rSh = GetShell();
2436 std::unique_ptr<SvxScriptSetItem> pSSetItem;
2437 SfxItemPool& rPool = rSh.GetAttrPool();
2438 sal_uInt16 nWhich = rPool.GetWhich( nSlot );
2439 SvtScriptType nScripts = SvtScriptType::LATIN | SvtScriptType::ASIAN | SvtScriptType::COMPLEX;
2443 aHeightSet( GetPool() );
2444
2445 switch( nSlot )
2446 {
2447 case SID_ATTR_CHAR_FONT:
2448 {
2449 nScripts = rSh.GetScriptType();
2450 // #i42732# input language should be preferred over
2451 // current cursor position to detect script type
2452 if(!rSh.HasSelection())
2453 {
2455 if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM)
2456 nScripts = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang );
2457 }
2458 [[fallthrough]];
2459 }
2460 case SID_ATTR_CHAR_POSTURE:
2461 case SID_ATTR_CHAR_WEIGHT:
2462 {
2463 pSSetItem.reset(new SvxScriptSetItem( nSlot, rPool ));
2464 pSSetItem->PutItemForScriptType( nScripts, pArgs->Get( nWhich ));
2465 pArgs = &pSSetItem->GetItemSet();
2466 }
2467 break;
2468 case SID_ATTR_CHAR_FONTHEIGHT:
2469 {
2470 if(rSh.HasSelection())
2471 {
2472 pSSetItem.reset(new SvxScriptSetItem( nSlot, rPool ));
2473 pSSetItem->PutItemForScriptType( nScripts, pArgs->Get( nWhich ));
2474 pArgs = &pSSetItem->GetItemSet();
2475 }
2476 else
2477 {
2478 nScripts = rSh.GetScriptType();
2480 if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM)
2481 nScripts = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang );
2482 sal_uInt32 nHeight = static_cast< const SvxFontHeightItem& >(pArgs->Get( nWhich )).GetHeight();
2483 SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig();
2484
2488 aLangSet( GetPool() );
2489 rSh.GetCurAttr( aLangSet );
2490
2491 sal_Int32 nWesternSize =
2493 aLangSet.Get( RES_CHRATR_LANGUAGE).GetLanguage());
2494 sal_Int32 nCJKSize =
2496 aLangSet.Get( RES_CHRATR_CJK_LANGUAGE).GetLanguage());
2497 sal_Int32 nCTLSize =
2499 aLangSet.Get( RES_CHRATR_CTL_LANGUAGE).GetLanguage());
2500
2501 switch(nScripts)
2502 {
2503 case SvtScriptType::LATIN:
2504 nCJKSize = nHeight * nCJKSize / nWesternSize;
2505 nCTLSize = nHeight * nCTLSize / nWesternSize;
2506 nWesternSize = static_cast<sal_Int32>(nHeight);
2507 break;
2508 case SvtScriptType::ASIAN:
2509 nCTLSize = nHeight* nCTLSize / nCJKSize;
2510 nWesternSize = nHeight * nWesternSize / nCJKSize;
2511 nCJKSize = static_cast<sal_Int32>(nHeight);
2512 break;
2513 case SvtScriptType::COMPLEX:
2514 nCJKSize = nHeight * nCJKSize / nCTLSize;
2515 nWesternSize = nHeight * nWesternSize / nCTLSize;
2516 nCTLSize = static_cast<sal_Int32>(nHeight);
2517 break;
2518 default: break;
2519 }
2520 aHeightSet.Put( SvxFontHeightItem( static_cast<sal_uInt32>(nWesternSize), 100, RES_CHRATR_FONTSIZE ));
2521 aHeightSet.Put( SvxFontHeightItem( static_cast<sal_uInt32>(nCJKSize), 100, RES_CHRATR_CJK_FONTSIZE ));
2522 aHeightSet.Put( SvxFontHeightItem( static_cast<sal_uInt32>(nCTLSize), 100, RES_CHRATR_CTL_FONTSIZE ));
2523 pArgs = &aHeightSet;
2524 }
2525 }
2526 break;
2527 }
2528
2529 if( pArgs )
2530 {
2531 bool bAuto = false;
2532 if ( !isCHRATR(nWhich) ||
2533 ( rSh.HasSelection() && rSh.IsSelFullPara() ) )
2534 {
2535 SwTextFormatColl * pColl = rSh.GetCurTextFormatColl();
2536 if ( pColl && pColl->IsAutoUpdateOnDirectFormat() )
2537 {
2538 rSh.AutoUpdatePara( pColl, *pArgs );
2539 bAuto = true;
2540 }
2541 }
2542
2543 if (!bAuto)
2544 {
2545 rSh.SetAttrSet( *pArgs );
2546 }
2547 }
2548 }
2549 else
2550 {
2551 if (nSlot == SID_ATTR_CHAR_KERNING)
2552 GetView().GetViewFrame().GetDispatcher()->Execute(SID_CHAR_DLG_POSITION);
2553 else if (nSlot == SID_ATTR_CHAR_COLOR)
2554 GetView().GetViewFrame().GetDispatcher()->Execute(SID_CHAR_DLG_EFFECT);
2555 else
2556 GetView().GetViewFrame().GetDispatcher()->Execute(SID_CHAR_DLG);
2557 }
2558 rReq.Done();
2559}
2560
2562{
2563 SwWrtShell &rSh = GetShell();
2564 rSh.GetCurAttr( rSet );
2565}
2566
2568{
2569 SwWrtShell &rSh = GetShell();
2570 bool bFirst = true;
2571 std::optional<SfxItemSet> pFntCoreSet;
2572 SvtScriptType nScriptType = SvtScriptType::LATIN;
2573 SfxWhichIter aIter( rSet );
2574 sal_uInt16 nWhich = aIter.FirstWhich();
2575 while( nWhich )
2576 {
2577 switch( nWhich )
2578 {
2579 case RES_CHRATR_FONT:
2581 case RES_CHRATR_WEIGHT:
2582 case RES_CHRATR_POSTURE:
2583 {
2584 if( !pFntCoreSet )
2585 {
2586 pFntCoreSet.emplace( *rSet.GetPool(),
2587 svl::Items<RES_CHRATR_BEGIN, RES_CHRATR_END-1> );
2588 rSh.GetCurAttr( *pFntCoreSet );
2589 nScriptType = rSh.GetScriptType();
2590 // #i42732# input language should be preferred over
2591 // current cursor position to detect script type
2592 SwEditWin& rEditWin = GetView().GetEditWin();
2593 if( rEditWin.IsUseInputLanguage() )
2594 {
2595 if(!rSh.HasSelection() && (
2596 nWhich == RES_CHRATR_FONT ||
2597 nWhich == RES_CHRATR_FONTSIZE ))
2598 {
2599 LanguageType nInputLang = rEditWin.GetInputLanguage();
2600 if(nInputLang != LANGUAGE_DONTKNOW && nInputLang != LANGUAGE_SYSTEM)
2601 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage( nInputLang );
2602 }
2603 }
2604 }
2605 SfxItemPool& rPool = *rSet.GetPool();
2606 SvxScriptSetItem aSetItem( rPool.GetSlotId( nWhich ), rPool );
2607 aSetItem.GetItemSet().Put( *pFntCoreSet, false );
2608 const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType );
2609 if( pI )
2610 {
2611 rSet.Put( pI->CloneSetWhich(nWhich) );
2612 }
2613 else
2614 rSet.InvalidateItem( nWhich );
2615 // Set input context of the SwEditWin according to the selected font and script type
2616 if(RES_CHRATR_FONT == nWhich)
2617 {
2618 vcl::Font aFont;
2619 if (const SvxFontItem* pFontItem = dynamic_cast<const SvxFontItem*>(pI))
2620 {
2621 aFont.SetFamilyName(pFontItem->GetFamilyName());
2622 aFont.SetStyleName(pFontItem->GetStyleName());
2623 aFont.SetFamily(pFontItem->GetFamily());
2624 aFont.SetPitch(pFontItem->GetPitch());
2625 aFont.SetCharSet(pFontItem->GetCharSet());
2626 }
2627
2628 bool bVertical = rSh.IsInVerticalText();
2629 aFont.SetOrientation(Degree10(bVertical ? 2700 : 0));
2630 aFont.SetVertical(bVertical);
2631 GetView().GetEditWin().SetInputContext( InputContext( aFont, InputContextFlags::Text |
2632 InputContextFlags::ExtText ) );
2633 }
2634 }
2635 break;
2636
2637 default:
2638 if( bFirst )
2639 {
2640 rSh.GetCurAttr( rSet );
2641 bFirst = false;
2642 }
2643 }
2644 nWhich = aIter.NextWhich();
2645 }
2646}
2647
2649{
2650 SwWrtShell &rSh = GetShell();
2651 SfxWhichIter aIter(rSet);
2652 sal_uInt16 nWhich(aIter.FirstWhich());
2653 SelectionType nSelType(rSh.GetSelectionType());
2654 std::unique_ptr<SvxBrushItem> aBrushItem(std::make_unique<SvxBrushItem>(RES_BACKGROUND));
2655
2656 if( nWhich == SID_TABLE_CELL_BACKGROUND_COLOR )
2657 {
2658 rSh.GetBoxBackground( aBrushItem );
2659 }
2660 else
2661 {
2662 // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set
2664
2665 aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet());
2666
2667 if(nSelType & SelectionType::Graphic || SelectionType::Frame & nSelType)
2668 {
2669 rSh.GetFlyFrameAttr(aCoreSet);
2670 }
2671 else
2672 {
2673 rSh.GetCurAttr(aCoreSet);
2674 }
2675
2676 aBrushItem = getSvxBrushItemFromSourceSet(aCoreSet, RES_BACKGROUND);
2677 }
2678
2679 while(nWhich)
2680 {
2681 switch(nWhich)
2682 {
2683 case SID_BACKGROUND_COLOR:
2684 case SID_TABLE_CELL_BACKGROUND_COLOR:
2685 {
2686 SvxColorItem aColorItem(aBrushItem->GetColor(), nWhich);
2687 rSet.Put(aColorItem);
2688 break;
2689 }
2690 case SID_ATTR_BRUSH:
2691 case RES_BACKGROUND:
2692 {
2693 // if this was intended to have a independent copy of the Item to be set
2694 // this is not needed due to the ItemSet/Pool cloning Items which get set anyways.
2695 // Keeping code as reference - it may have had other reasons I do notz see (?!?)
2696 // std::unique_ptr<SfxPoolItem> pNewItem(aBrushItem.CloneSetWhich(GetPool().GetWhich(nWhich)));
2697 rSet.Put(*aBrushItem);
2698 break;
2699 }
2700 }
2701
2702 nWhich = aIter.NextWhich();
2703 }
2704}
2705
2707{
2708 SwWrtShell &rSh = GetShell();
2709 SelectionType nSelType(rSh.GetSelectionType());
2710 const SfxItemSet* pArgs = rReq.GetArgs();
2711 sal_uInt16 nSlot(rReq.GetSlot());
2712
2713 if (!pArgs && nSlot != SID_BACKGROUND_COLOR && nSlot != SID_TABLE_CELL_BACKGROUND_COLOR)
2714 {
2715 return;
2716 }
2717
2718 std::unique_ptr<SvxBrushItem> aBrushItem(std::make_unique<SvxBrushItem>(RES_BACKGROUND));
2719
2720 if ( nSlot == SID_TABLE_CELL_BACKGROUND_COLOR )
2721 {
2722 rSh.GetBoxBackground( aBrushItem );
2723 }
2724 else
2725 {
2726 // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set
2728
2729 aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet());
2730
2731 if((SelectionType::Frame & nSelType) || (SelectionType::Graphic & nSelType))
2732 {
2733 rSh.GetFlyFrameAttr(aCoreSet);
2734 }
2735 else
2736 {
2737 rSh.GetCurAttr(aCoreSet);
2738 }
2739
2740 aBrushItem = getSvxBrushItemFromSourceSet(aCoreSet, RES_BACKGROUND);
2741 }
2742
2743 switch(nSlot)
2744 {
2745 case SID_BACKGROUND_COLOR:
2746 case SID_TABLE_CELL_BACKGROUND_COLOR:
2747 {
2748 bool bIsTransparent = false;
2749
2750 aBrushItem->SetGraphicPos(GPOS_NONE);
2751
2752 sal_uInt16 nSlotId = (nSlot == SID_BACKGROUND_COLOR) ? SID_BACKGROUND_COLOR : SID_TABLE_CELL_BACKGROUND_COLOR;
2753 if (pArgs)
2754 {
2755 const SvxColorItem& rNewColorItem = static_cast<const SvxColorItem&>(pArgs->Get(nSlotId));
2756 const Color& rNewColor = rNewColorItem.GetValue();
2757 aBrushItem->SetColor(rNewColor);
2758 GetView().GetViewFrame().GetBindings().SetState(rNewColorItem);
2759 }
2760 else
2761 {
2762 bIsTransparent = true;
2763 }
2764
2765 if (bIsTransparent)
2766 {
2767 aBrushItem->SetColor(COL_TRANSPARENT);
2769 }
2770 break;
2771 }
2772
2773 case SID_ATTR_BRUSH:
2774 case RES_BACKGROUND:
2775 {
2776 assert(pArgs && "only SID_BACKGROUND_COLOR can have !pArgs, checked at entry");
2777 aBrushItem.reset(static_cast<SvxBrushItem*>(pArgs->Get(GetPool().GetWhich(nSlot)).Clone()));
2778 break;
2779 }
2780 default:
2781 {
2782 rReq.Ignore();
2783 OSL_FAIL("unknown message in ExecuteAttr!" );
2784 return;
2785 }
2786 }
2787
2788 if ( nSlot == SID_TABLE_CELL_BACKGROUND_COLOR )
2789 {
2790 rSh.SetBoxBackground( *aBrushItem );
2791 }
2792 else
2793 {
2794 // Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set
2796
2797 aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrameFormat()->GetAttrSet());
2798 setSvxBrushItemAsFillAttributesToTargetSet(*aBrushItem, aCoreSet);
2799
2800 if((SelectionType::Frame & nSelType) || (SelectionType::Graphic & nSelType))
2801 {
2802 // Template autoupdate
2803 SwFrameFormat* pFormat = rSh.GetSelectedFrameFormat();
2804
2805 if(pFormat && pFormat->IsAutoUpdateOnDirectFormat())
2806 {
2807 rSh.AutoUpdateFrame(pFormat, aCoreSet);
2808 }
2809 else
2810 {
2811 rSh.SetFlyFrameAttr(aCoreSet);
2812 }
2813 }
2814 else
2815 {
2817
2818 if(pColl && pColl->IsAutoUpdateOnDirectFormat())
2819 {
2820 rSh.AutoUpdatePara(pColl, aCoreSet);
2821 }
2822 else
2823 {
2824 rSh.SetAttrSet(aCoreSet);
2825 }
2826 }
2827 }
2828
2829 rReq.Done();
2830}
2831
2833{
2834 SwWrtShell &rSh = GetShell();
2835 // Table cell(s) selected?
2836 bool bPrepare = true;
2837 bool bTableMode = rSh.IsTableMode();
2838 if ( bTableMode )
2839 {
2841 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> aCoreSet( GetPool() );
2842 SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
2843 aCoreSet.Put( aBoxInfo );
2844 rSh.GetTabBorders( aCoreSet );
2845 rSet.Put( aCoreSet );
2846 }
2847 else if ( rSh.IsFrameSelected() )
2848 {
2849 SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE, nullptr );
2850 rSet.Put( aMgr.GetAttrSet() );
2851 bPrepare = false;
2852 }
2853 else
2854 // Get border attributes via shell quite normal
2855 rSh.GetCurAttr( rSet );
2856 if ( bPrepare )
2857 ::PrepareBoxInfo( rSet, rSh );
2858 // Switch the border toolbox controller mode
2859 rSet.Put( SfxBoolItem( SID_BORDER_REDUCED_MODE, !bTableMode ));
2860}
2861
2863{
2864 SwWrtShell &rSh = GetShell();
2865 weld::Window* pMDI = GetView().GetFrameWeld();
2866 // So that from the basic no dialogues for the background views are called:
2867 bool bBackground = (&GetView() != GetActiveView());
2868 const SfxPoolItem* pItem = nullptr;
2869 const SfxItemSet* pArgs = rReq.GetArgs();
2870
2871 sal_uInt16 nSlot = rReq.GetSlot();
2872 const SfxItemSet* pOutSet = nullptr;
2873 bool bDone = false;
2874 if(pArgs)
2875 pArgs->GetItemState( GetPool().GetWhich(nSlot), false, &pItem );
2876
2877 switch ( nSlot )
2878 {
2880 {
2884 aContext.maEndDialogFn = [](sal_Int32){};
2885 pDlg->StartExecuteAsync(aContext);
2886 }
2887 break;
2888 case FN_FORMAT_PAGE_DLG:
2891 {
2892 if( !bBackground )
2893 {
2894 const size_t nCurIdx = rSh.GetCurPageDesc();
2895 const SwPageDesc& rPageDesc = rSh.GetPageDesc( nCurIdx );
2896 // Temporary view, because the shell does not need to be valid after the dialog
2897 // for example disable header
2898 SwView& rTempView = GetView();
2899
2900 OString sPageId;
2901 switch (nSlot)
2902 {
2904 sPageId = "columns";
2905 break;
2907 sPageId = "page";
2908 break;
2909 case FN_FORMAT_PAGE_DLG:
2910 if (pItem)
2911 sPageId = OUStringToOString(static_cast<const SfxStringItem*>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8);
2912 break;
2913 }
2914 rTempView.GetDocShell()->FormatPage(rReq.GetFrameWeld(), rPageDesc.GetName(), sPageId, rSh, &rReq);
2915 rTempView.InvalidateRulerPos();
2916
2917 bDone = true; // FormatPage() takes care of calling Done()
2918 }
2919 }
2920 break;
2922 {
2924 SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER> aSet( rSh.GetAttrPool() );
2926 // Table cell(s) selected?
2927 if ( rSh.IsTableMode() )
2928 {
2929 // Set border attributes Get/SetTabBorders()
2930 ::PrepareBoxInfo( aSet, rSh );
2931 rSh.GetTabBorders( aSet );
2933 pDlg.disposeAndReset(pFact->CreateSwBorderDlg(pMDI, aSet, SwBorderModes::TABLE));
2934 if ( pDlg->Execute() == RET_OK )
2935 {
2936 rSh.SetTabBorders( *pDlg->GetOutputItemSet() );
2937 pOutSet = pDlg->GetOutputItemSet();
2938 }
2939 }
2940 else if ( rSh.IsFrameSelected() )
2941 {
2942 // Set border attributes via Frame-Manager
2943 SwFlyFrameAttrMgr aMgr( false, &rSh, Frmmgr_Type::NONE, nullptr );
2944 aSet.Put( aMgr.GetAttrSet() );
2945
2947 pDlg.disposeAndReset(pFact->CreateSwBorderDlg(pMDI, aSet, SwBorderModes::FRAME));
2948 if ( pDlg->Execute() == RET_OK )
2949 {
2950 aMgr.SetAttrSet( *pDlg->GetOutputItemSet() );
2951 aMgr.UpdateFlyFrame();
2952 pOutSet = pDlg->GetOutputItemSet();
2953 }
2954 }
2955 else
2956 {
2957 // Set border attributes via Shell quite normal
2958 rSh.GetCurAttr( aSet );
2959 ::PrepareBoxInfo( aSet, rSh );
2960
2962 pDlg.disposeAndReset(pFact->CreateSwBorderDlg(pMDI, aSet, SwBorderModes::PARA));
2963 if ( pDlg->Execute() == RET_OK )
2964 {
2965 rSh.SetAttrSet( *pDlg->GetOutputItemSet() );
2966 pOutSet = pDlg->GetOutputItemSet();
2967 }
2968 }
2969 if(pOutSet)
2970 {
2971 rReq.Done(*pOutSet);
2972 bDone = true;
2973 }
2974 }
2975 break;
2977 {
2980
2983
2984 // Table cell(s) selected?
2985 if ( rSh.IsTableMode() )
2986 {
2987 // Get background attributes of the table and put it in the set
2988 // tdf#144843 calling GetBoxBackground *requires* an incarnation to be handed over
2989 std::unique_ptr<SvxBrushItem> aBrush(std::make_unique<SvxBrushItem>(RES_BACKGROUND));
2990 rSh.GetBoxBackground( aBrush );
2991 pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
2992 aSet.Put( std::move(aBrush) );
2993 if ( pDlg->Execute() == RET_OK )
2994 {
2995
2996 rSh.SetBoxBackground( pDlg->GetOutputItemSet()->Get( RES_BACKGROUND ) );
2997 pOutSet = pDlg->GetOutputItemSet();
2998 }
2999 }
3000 else if ( rSh.IsFrameSelected() )
3001 {
3002
3003 rSh.GetFlyFrameAttr( aSet );
3004
3005 pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
3006 if ( pDlg->Execute() == RET_OK )
3007 {
3008 rSh.SetFlyFrameAttr(const_cast<SfxItemSet &>(*pDlg->GetOutputItemSet()) );
3009 pOutSet = pDlg->GetOutputItemSet();
3010 }
3011 }
3012 else
3013 {
3014 // Set border attributes Umrandungsattribute with the shell quite normal.
3015 rSh.GetCurAttr( aSet );
3016
3017 pDlg.disposeAndReset(pFact->CreateSwBackgroundDialog(pMDI, aSet));
3018 if ( pDlg->Execute() == RET_OK )
3019 {
3020 rSh.SetAttrSet( *pDlg->GetOutputItemSet() );
3021 pOutSet = pDlg->GetOutputItemSet();
3022 }
3023 }
3024 if(pOutSet)
3025 {
3026 rReq.Done(*pOutSet);
3027 bDone = true;
3028 }
3029 }
3030 break;
3031
3032 case SID_GRAPHIC_SIZE_CHECK:
3033 {
3035 svx::GenericCheckDialog aDialog(pMDI, aResult);
3036 aDialog.run();
3037 }
3038 break;
3039
3040 case SID_THEME_DIALOG:
3041 {
3042 auto* pDocument = rSh.GetDoc();
3043 auto* pDocumentShell = pDocument->GetDocShell();
3044 if (pDocumentShell)
3045 {
3046 SdrPage* pPage = pDocument->getIDocumentDrawModelAccess().GetDrawModel()->GetPage(0);
3047 auto const& pTheme = pPage->getSdrPageProperties().GetTheme();
3048 if (pTheme)
3049 {
3050 std::shared_ptr<svx::IThemeColorChanger> pChanger(new sw::ThemeColorChanger(pDocumentShell));
3051 auto pDialog = std::make_shared<svx::ThemeDialog>(pMDI, pTheme.get(), pChanger);
3052 weld::DialogController::runAsync(pDialog, [](int) {});
3053 }
3054 }
3055 }
3056 break;
3057
3058 default:OSL_FAIL("wrong Dispatcher (basesh.cxx)");
3059 }
3060 if(!bDone)
3061 rReq.Done();
3062}
3063
3065{
3066 return m_rView.GetWrtShell();
3067}
3068
3070{
3071 return m_rView.GetWrtShellPtr();
3072}
3073
3074static void EndUndo(SwWrtShell& rSh)
3075{
3076 SwRewriter aRewriter;
3077
3078 if (rSh.GetTableFormat())
3079 {
3080 aRewriter.AddRule(UndoArg1, SwResId(STR_START_QUOTE));
3081 aRewriter.AddRule(UndoArg2, rSh.GetTableFormat()->GetName());
3082 aRewriter.AddRule(UndoArg3, SwResId(STR_END_QUOTE));
3083
3084 }
3085 rSh.EndUndo(SwUndoId::INSTABLE, &aRewriter); // If possible change the Shell
3086}
3087
3089 SwView &rTempView,
3090 const OUString& aTableName,
3091 sal_uInt16 nRows,
3092 sal_uInt16 nCols,
3093 SwInsertTableOptions aInsTableOpts,
3094 const OUString& aAutoName,
3095 const std::unique_ptr<SwTableAutoFormat>& pTAFormat)
3096{
3098
3099 rSh.StartAllAction();
3100 if( rSh.HasSelection() )
3101 rSh.DelRight();
3102
3103 rSh.InsertTable( aInsTableOpts, nRows, nCols, pTAFormat.get() );
3105
3106 if( !aTableName.isEmpty() && !rSh.GetTableStyle( aTableName ) )
3107 rSh.GetTableFormat()->SetFormatName( aTableName );
3108
3109 if( pTAFormat != nullptr && !aAutoName.isEmpty()
3110 && aAutoName != SwViewShell::GetShellRes()->aStrNone )
3111 {
3112 SwTableNode* pTableNode = const_cast<SwTableNode*>( rSh.IsCursorInTable() );
3113 if ( pTableNode )
3114 {
3115 pTableNode->GetTable().SetTableStyleName( aAutoName );
3116 SwUndoTableAutoFormat* pUndo = new SwUndoTableAutoFormat( *pTableNode, *pTAFormat );
3117 if ( pUndo )
3118 rSh.GetIDocumentUndoRedo().AppendUndo( std::unique_ptr<SwUndo>(pUndo) );
3119 }
3120 }
3121
3122 rSh.EndAllAction();
3123 rTempView.AutoCaption(TABLE_CAP);
3124}
3125
3127{
3128 const SfxItemSet* pArgs = _rRequest.GetArgs();
3129 SwWrtShell& rSh = GetShell();
3130
3131 if ( rSh.GetFrameType( nullptr, true ) & FrameTypeFlags::FOOTNOTE )
3132 return;
3133
3134 SwView &rTempView = GetView(); // Because GetView() does not work after the shell exchange
3135 bool bHTMLMode = 0 != (::GetHtmlMode(rTempView.GetDocShell())&HTMLMODE_ON);
3136 bool bCallEndUndo = false;
3137
3138 if( !pArgs && rSh.IsSelection() && !rSh.IsInClickToEdit() &&
3139 !rSh.IsTableMode() )
3140 {
3141 const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
3142 SwInsertTableOptions aInsTableOpts = pModOpt->GetInsTableFlags(bHTMLMode);
3143
3145 bCallEndUndo = true;
3146
3147 bool bInserted = rSh.TextToTable( aInsTableOpts, '\t' );
3148 rSh.EnterStdMode();
3149 if (bInserted)
3150 rTempView.AutoCaption(TABLE_CAP);
3151 _rRequest.Done();
3152 }
3153 else
3154 {
3155 sal_uInt16 nColsIn = 0;
3156 sal_uInt16 nRowsIn = 0;
3157 SwInsertTableOptions aInsTableOptsIn( SwInsertTableFlags::All, 1 );
3158 OUString aTableNameIn;
3159 OUString aAutoNameIn;
3160 std::unique_ptr<SwTableAutoFormat> pTAFormatIn;
3161
3162 if( pArgs && pArgs->Count() >= 2 )
3163 {
3165 const SfxUInt16Item* pCols = _rRequest.GetArg<SfxUInt16Item>(SID_ATTR_TABLE_COLUMN);
3166 const SfxUInt16Item* pRows = _rRequest.GetArg<SfxUInt16Item>(SID_ATTR_TABLE_ROW);
3167 const SfxInt32Item* pFlags = _rRequest.GetArg<SfxInt32Item>(FN_PARAM_1);
3168 const SfxStringItem* pAuto = _rRequest.GetArg<SfxStringItem>(FN_PARAM_2);
3169
3170 if ( pName )
3171 aTableNameIn = pName->GetValue();
3172 if ( pCols )
3173 nColsIn = pCols->GetValue();
3174 if ( pRows )
3175 nRowsIn = pRows->GetValue();
3176 if ( pAuto )
3177 {
3178 aAutoNameIn = pAuto->GetValue();
3179 if ( !aAutoNameIn.isEmpty() )
3180 {
3181 SwTableAutoFormatTable aTableTable;
3182 aTableTable.Load();
3183 for ( size_t n=0; n<aTableTable.size(); n++ )
3184 {
3185 if ( aTableTable[n].GetName() == aAutoNameIn )
3186 {
3187 pTAFormatIn.reset(new SwTableAutoFormat( aTableTable[n] ));
3188 break;
3189 }
3190 }
3191 }
3192 }
3193
3194 if ( pFlags )
3195 aInsTableOptsIn.mnInsMode = static_cast<SwInsertTableFlags>(pFlags->GetValue());
3196 else
3197 {
3198 const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
3199 aInsTableOptsIn = pModOpt->GetInsTableFlags(bHTMLMode);
3200 }
3201 }
3202
3203 if( !nColsIn || !nRowsIn )
3204 {
3206 std::shared_ptr<AbstractInsTableDlg> pAbstractDialog(pFact->CreateInsTableDlg(rTempView));
3207 std::shared_ptr<weld::DialogController> pDialogController(pAbstractDialog->getDialogController());
3208
3209 weld::DialogController::runAsync(pDialogController,
3210 [pAbstractDialog, &rSh, &rTempView, aTableNameIn, nRowsIn, nColsIn, aInsTableOptsIn, aAutoNameIn] (sal_Int32 nResult) {
3211 if( RET_OK == nResult )
3212 {
3213 sal_uInt16 nCols = nColsIn;
3214 sal_uInt16 nRows = nRowsIn;
3215 SwInsertTableOptions aInsTableOpts = aInsTableOptsIn;
3216 OUString aTableName = aTableNameIn;
3217 OUString aAutoName = aAutoNameIn;
3218 std::unique_ptr<SwTableAutoFormat> pTAFormat;
3219
3220 pAbstractDialog->GetValues( aTableName, nRows, nCols, aInsTableOpts, aAutoName, pTAFormat );
3221
3222 if( nCols && nRows )
3223 {
3224 InsertTableImpl( rSh, rTempView, aTableName, nRows, nCols, aInsTableOpts, aAutoName, pTAFormat );
3225 EndUndo(rSh);
3226 }
3227 }
3228 }
3229 );
3230 }
3231 else
3232 {
3233 // record before shell change
3234 _rRequest.AppendItem( SfxStringItem( FN_INSERT_TABLE, aTableNameIn ) );
3235 if ( !aAutoNameIn.isEmpty() )
3236 _rRequest.AppendItem( SfxStringItem( FN_PARAM_2, aAutoNameIn ) );
3237 _rRequest.AppendItem( SfxUInt16Item( SID_ATTR_TABLE_COLUMN, nColsIn ) );
3238 _rRequest.AppendItem( SfxUInt16Item( SID_ATTR_TABLE_ROW, nRowsIn ) );
3239 _rRequest.AppendItem( SfxInt32Item( FN_PARAM_1, static_cast<sal_Int32>(aInsTableOptsIn.mnInsMode) ) );
3240 _rRequest.Done();
3241
3242 InsertTableImpl( rSh, rTempView, aTableNameIn, nRowsIn, nColsIn, aInsTableOptsIn, aAutoNameIn, pTAFormatIn );
3243
3244 bCallEndUndo = true;
3245 }
3246 }
3247
3248 if( bCallEndUndo )
3249 EndUndo(rSh);
3250}
3251
3253{
3254 SwWrtShell &rSh = GetShell();
3255 SfxWhichIter aIter( rSet );
3256 sal_uInt16 nWhich = aIter.FirstWhich();
3257 switch ( nWhich )
3258 {
3259 case SID_GALLERY_BG_BRUSH:
3260 {
3261 SelectionType nSel = rSh.GetSelectionType();
3262 SfxStringListItem aLst( nWhich );
3263 std::vector<OUString> &rLst = aLst.GetList();
3266 nHeaderPos = nFooterPos = 0;
3267 sal_uInt8 nPos = 1;
3268 rLst.push_back( SwResId( STR_SWBG_PAGE ) );
3269 nPagePos = nPos++;
3270 sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell());
3271 bool bHtmlMode = 0 != (nHtmlMode & HTMLMODE_ON);
3272
3273 if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_FULL_STYLES)) &&
3274 (nSel & SelectionType::Text) )
3275 {
3276 rLst.push_back( SwResId( STR_SWBG_PARAGRAPH ) );
3277 nParagraphPos = nPos++;
3278 }
3279 if ( (!bHtmlMode || (nHtmlMode & HTMLMODE_SOME_STYLES)) &&
3281 {
3282 rLst.push_back( SwResId( STR_SWBG_TABLE ) );
3283 nTablePos = nPos++;
3284
3285 if(!bHtmlMode)
3286 {
3287 rLst.push_back( SwResId( STR_SWBG_TABLE_ROW ) );
3288 nTableRowPos = nPos++;
3289 }
3290
3291 rLst.push_back( SwResId( STR_SWBG_TABLE_CELL) );
3292 nTableCellPos = nPos++;
3293 }
3294 if(!bHtmlMode)
3295 {
3296 if ( nSel & SelectionType::Frame )
3297 {
3298 rLst.push_back( SwResId( STR_SWBG_FRAME ) );
3299 nFramePos = nPos++;
3300 }
3301 if ( nSel & SelectionType::Graphic )
3302 {
3303 rLst.push_back( SwResId( STR_SWBG_GRAPHIC ) );
3304 nGraphicPos = nPos++;
3305 }
3306 if ( nSel & SelectionType::Ole )
3307 {
3308 rLst.push_back( SwResId( STR_SWBG_OLE ) );
3309 nOlePos = nPos++;
3310 }
3311 const FrameTypeFlags nType = rSh.GetFrameType(nullptr,true);
3313 {
3314 rLst.push_back( SwResId( STR_SWBG_HEADER ) );
3315 nHeaderPos = nPos++;
3316 }
3318 {
3319 rLst.push_back( SwResId( STR_SWBG_FOOTER ) );
3320 nFooterPos = nPos;
3321 }
3322 }
3323 if ( rLst.empty() )
3324 rSet.DisableItem( nWhich );
3325 else
3326 rSet.Put( aLst );
3327 break;
3328 }
3329 }
3330}
3331
3333{
3334 SwWrtShell &rSh = GetShell();
3335 rSh.StartAction();
3336 const SfxItemSet* pArgs = rReq.GetArgs();
3337 sal_uInt16 nSlot = rReq.GetSlot();
3338 switch(nSlot)
3339 {
3340 case SID_GALLERY_BG_BRUSH:
3341 {
3342 if ( !pArgs )
3343 break;
3344
3345 SelectionType nSel = rSh.GetSelectionType();
3347 break;
3348
3349 const SfxUInt16Item* pPos = rReq.GetArg<SfxUInt16Item>(SID_GALLERY_BG_POS);
3350 const SvxBrushItem* pBrush = rReq.GetArg<SvxBrushItem>(SID_GALLERY_BG_BRUSH);
3351 if ( !pPos || !pBrush )
3352 break;
3353
3354 sal_uInt8 nPos = pPos->GetValue();
3355 ++nPos;
3356
3357 SvxBrushItem aBrush( *pBrush );
3358 aBrush.SetWhich( RES_BACKGROUND );
3359 if ( nPos == nParagraphPos )
3360 rSh.SetAttrItem( aBrush );
3361 else if ( nPos == nTablePos )
3362 rSh.SetTabBackground( aBrush );
3363 else if ( nPos == nTableRowPos )
3364 rSh.SetRowBackground( aBrush );
3365 else if ( nPos == nTableCellPos )
3366 rSh.SetBoxBackground( aBrush );
3367 else if ( nPos == nFramePos || nPos == nGraphicPos || nPos == nOlePos )
3368 {
3370 aCoreSet.Put( aBrush );
3371 rSh.SetFlyFrameAttr( aCoreSet );
3372 }
3373 else if ( nPos == nPagePos || nPos == nHeaderPos || nPos == nFooterPos )
3374 {
3375 sal_uInt16 nDesc = rSh.GetCurPageDesc();
3376 SwPageDesc aDesc( rSh.GetPageDesc( nDesc ) );
3377 if ( nPos == nPagePos )
3378 aDesc.GetMaster().SetFormatAttr( aBrush );
3379 else if ( nPos == nHeaderPos )
3380 {
3381 SwFormatHeader aHead( aDesc.GetMaster().GetHeader() );
3382 aHead.GetHeaderFormat()->SetFormatAttr( aBrush );
3383 aDesc.GetMaster().SetFormatAttr( aHead );
3384 }
3385 else if ( nPos == nFooterPos )
3386 {
3387 SwFormatFooter aFoot( aDesc.GetMaster().GetFooter() );
3388 aFoot.GetFooterFormat()->SetFormatAttr( aBrush );
3389 aDesc.GetMaster().SetFormatAttr( aFoot );
3390 }
3391 rSh.ChgPageDesc( nDesc, aDesc );
3392 }
3393 break;
3394 }
3395 }
3396 rSh.EndAction();
3397 rReq.Done();
3398}
3399
3401{
3402 sal_uInt16 nSlot = rReq.GetSlot();
3403 switch( nSlot )
3404 {
3405#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
3406 case FN_CHANGE_DBFIELD:
3407 {
3410 pDlg->Execute();
3411 }
3412 break;
3413#endif
3414 default:
3415 OSL_FAIL("wrong dispatcher");
3416 }
3417}
3418
3419std::shared_ptr<std::vector<std::unique_ptr<SwPaM>>> SwBaseShell::CopyPaMRing(SwPaM& rOrig)
3420{
3421 auto vCursors = std::make_shared<std::vector<std::unique_ptr<SwPaM>>>();
3422 vCursors->emplace_back(std::make_unique<SwPaM>(rOrig, nullptr));
3423 for (auto& rCursor : rOrig.GetRingContainer())
3424 {
3425 if (&rCursor != &rOrig)
3426 vCursors->emplace_back(std::make_unique<SwPaM>(rCursor, vCursors->front().get()));
3427 }
3428 return vCursors;
3429}
3430
3431/* 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:184
static sal_uInt8 nTableCellPos
Definition: basesh.cxx:128
static sal_uInt8 nFramePos
Definition: basesh.cxx:125
static sal_uInt8 nOlePos
Definition: basesh.cxx:124
static sal_uInt8 nTablePos
Definition: basesh.cxx:126
static sal_uInt8 nParagraphPos
Definition: basesh.cxx:122
static sal_uInt8 nGraphicPos
Definition: basesh.cxx:123
static sal_uInt8 nTableRowPos
Definition: basesh.cxx:127
static sal_uInt8 nPagePos
Definition: basesh.cxx:129
static sal_uInt8 nFooterPos
Definition: basesh.cxx:131
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:3088
static void lcl_UpdateIMapDlg(SwWrtShell &rSh)
Definition: basesh.cxx:168
static void EndUndo(SwWrtShell &rSh)
Definition: basesh.cxx:3074
static sal_uInt8 nHeaderPos
Definition: basesh.cxx:130
IMPL_LINK_NOARG(SwBaseShell, GraphicArrivedHdl, SwCursorShell &, void)
Definition: basesh.cxx:1681
GPOS_NONE
#define GetWhich(nSlot)
sal_uInt16 GetValue() const
const OUString & GetValue() const
void Execute(SfxRequest &)
GraphicType GetType() const
Text operation/manipulation interface.
virtual bool DeleteAndJoin(SwPaM &, SwDeleteFlags flags=SwDeleteFlags::Default)=0
complete delete of a given PaM
virtual bool InsertString(const SwPaM &rRg, const OUString &, const SwInsertFlags nInsertMode=SwInsertFlags::EMPTYEXPAND)=0
Insert string into existing text node at position rRg.Point().
virtual void restoreAnnotationMarks(bool bDelete=true)=0
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual sal_Int32 getImagePreferredDPI()=0
void disposeAndReset(reference_type *pBody)
std::unique_ptr< model::Theme > const & GetTheme() const
SdrPageProperties & getSdrPageProperties()
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(const SfxViewFrame &rFrame)
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
const css::uno::Any & GetValue() 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 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:3419
void StateUndo(SfxItemSet &)
Definition: basesh.cxx:696
void GetBckColState(SfxItemSet &rSet)
Definition: basesh.cxx:2648
SwView & m_rView
Definition: basesh.hxx:41
void GetState(SfxItemSet &)
Definition: basesh.cxx:1776
void GetTextFontCtrlState(SfxItemSet &rSet)
Definition: basesh.cxx:2567
void SetWrapMode(sal_uInt16 nSlot)
Definition: basesh.cxx:2275
SwWrtShell & GetShell()
Definition: basesh.cxx:3064
void GetGalleryState(SfxItemSet &)
Definition: basesh.cxx:3252
void ExecDelete(SfxRequest &)
Definition: basesh.cxx:205
SfxItemSet * m_pGetStateSet
Definition: basesh.hxx:48
void ExecuteGallery(SfxRequest &)
Definition: basesh.cxx:3332
bool AddGrfUpdateSlot(sal_uInt16 nSlot)
Definition: basesh.hxx:61
SwView & GetView()
Definition: basesh.hxx:59
SwBaseShell(SwView &rShell)
Definition: basesh.cxx:2406
void ExecUndo(SfxRequest &)
Definition: basesh.cxx:595
void ExecTextCtrl(SfxRequest &rReq)
Definition: basesh.cxx:2428
void ExecField(SfxRequest const &rReq)
Definition: basesh.cxx:3400
void ExecClpbrd(SfxRequest &)
Definition: basesh.cxx:294
void StateClpbrd(SfxItemSet &)
Definition: basesh.cxx:517
void Execute(SfxRequest &)
Definition: basesh.cxx:993
void InsertTable(SfxRequest &_rRequest)
Definition: basesh.cxx:3126
void StateStyle(SfxItemSet &)
Definition: basesh.cxx:2252
static void SetFrameMode(FlyMode eMode, SwWrtShell *pShell)
Definition: basesh.cxx:2384
SwWrtShell * GetShellPtr()
Definition: basesh.cxx:3069
static void StateDisableItems(SfxItemSet &)
Definition: basesh.cxx:2238
void ExecBckCol(SfxRequest &rReq)
Definition: basesh.cxx:2706
void GetTextCtrlState(SfxItemSet &rSet)
Definition: basesh.cxx:2561
void GetBorderState(SfxItemSet &rSet)
Definition: basesh.cxx:2832
static FlyMode s_eFrameMode
Definition: basesh.hxx:44
virtual ~SwBaseShell() override
Definition: basesh.cxx:2418
void ExecDlg(SfxRequest &)
Definition: basesh.cxx:2862
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1225
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:914
bool IsInVerticalText(const Point *pPt=nullptr) const
Definition: crsrsh.cxx:3456
void SttCursorMove()
Definition: crsrsh.cxx:301
void SwapPam()
Definition: crsrsh.cxx:990
void HideCursor()
Definition: crsrsh.cxx:2457
bool SttEndDoc(bool bStt)
Definition: crsrsh.cxx:573
bool IsEndPara() const
Definition: crsrsh.cxx:1128
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:1109
void GotoFlyAnchor()
jump from the frame to the anchor
Definition: trvlfnfl.cxx:350
bool IsSelection() const
Definition: crsrsh.hxx:904
bool CursorInsideInputField() const
Definition: crstrvl.cxx:1089
SwField * GetCurField(const bool bIncludeInputFieldAtStart=false) const
Definition: crstrvl.cxx:1068
bool HasMark() const
Definition: crsrsh.hxx:902
bool IsSelFullPara() const
Definition: crsrsh.cxx:3424
void EndAction(const bool bIdleEnd=false)
Definition: crsrsh.cxx:243
void ClearMark()
Definition: crsrsh.cxx:953
const Link< SwCursorShell &, void > & GetGrfArrivedLnk() const
Definition: crsrsh.hxx:505
void CallChgLnk()
Definition: crsrsh.cxx:2573
void SetGrfArrivedLnk(const Link< SwCursorShell &, void > &rLnk)
Definition: crsrsh.hxx:504
bool HasReadonlySel(bool isReplace=false) const
Definition: crsrsh.cxx:3388
bool IsCursorPtAtEnd() const
Definition: crsrsh.hxx:919
bool IsTableMode() const
Definition: crsrsh.hxx:662
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:89
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:294
void FormatPage(weld::Window *pDialogParent, const OUString &rPage, const OString &rPageId, SwWrtShell &rActShell, SfxRequest *pRequest=nullptr)
Show page style format dialog.
Definition: docst.cxx:1650
Definition: doc.hxx:195
sal_uInt16 GetRefMarks(std::vector< OUString > *=nullptr) const
Definition: doc.cxx:1097
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:323
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:152
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:184
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1883
bool isXForms() const
Definition: docxforms.cxx:44
const SwFormatRefMark * GetRefMark(std::u16string_view rName) const
Definition: doc.cxx:1053
SwDocShell * GetDocShell()
Definition: doc.hxx:1364
::sw::UndoManager & GetUndoManager()
Definition: doc.cxx:141
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:883
void SetUseInputLanguage(bool bNew)
#i42732# display status of font size/name depending on either the input language or the selection pos...
Definition: edtwin.cxx:6629
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:898
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:862
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:906
void ChgAnchor(RndStdIds eAnchorId, bool bSameOnly=false, bool bPosCorr=true)
frmatr.hxx.
Definition: feshview.cxx:2359
void SetTabBorders(const SfxItemSet &rSet)
Definition: fetab.cxx:875
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:943
void GetTabBorders(SfxItemSet &rSet) const
Definition: fetab.cxx:893
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:244
Base class of all fields.
Definition: fldbas.hxx:295
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
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
bool IsAutoUpdateOnDirectFormat() const
Query / set m_bAutoUpdateOnDirectFormat-flag.
Definition: format.hxx:188
Style of a layout element.
Definition: frmfmt.hxx:62
virtual void SetFormatName(const OUString &rNewName, bool bBroadcast=false) override
Definition: atrfrm.cxx:2608
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:123
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:903
bool IsContentNode() const
Definition: node.hxx:679
bool IsTextNode() const
Definition: node.hxx:687
SwContentNode * GetContentNode()
Definition: node.hxx:666
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
SwNode & GetPointNode() const
Definition: pam.hxx:283
const SwPosition * GetPoint() const
Definition: pam.hxx:261
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:173
sal_Int32 GetFontHeight(sal_uInt8 nFont, sal_uInt8 nScriptType, LanguageType eLang)
Definition: fontcfg.cxx:299
size_t size() const
Definition: tblafmt.cxx:924
SAL_DLLPRIVATE bool Load(SvStream &rStream)
Definition: tblafmt.cxx:1055
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:199
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
void GetAttrOutlineContentVisible(bool &bOutlineContentVisibleAttr)
GetAttrOutlineContentVisible.
Definition: ndtxt.cxx:4208
SwpHints & GetSwpHints()
getters for SwpHints
Definition: ndtxt.hxx:869
std::vector< SwTextAttr * > GetTextAttrsAt(sal_Int32 const nIndex, sal_uInt16 const nWhich) const
get the innermost text attributes covering position nIndex.
Definition: ndtxt.cxx:1793
static void FillClipFormatItem(const SwWrtShell &rSh, const TransferableDataHelper &rData, SvxClipboardFormatItem &rToFill)
Definition: swdtflvr.cxx:3538
static void PrePasteSpecial(const SwWrtShell &rSh, TransferableDataHelper &, const VclPtr< SfxAbstractPasteDialog > &pDlg)
PrePasteSpecial Prepares the given dialog without actually running it.
Definition: swdtflvr.cxx:3482
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:3476
static bool IsPaste(const SwWrtShell &, const TransferableDataHelper &)
Definition: swdtflvr.cxx:1367
static bool PasteFormat(SwWrtShell &rSh, TransferableDataHelper &rData, SotClipboardFormatId nFormat)
Definition: swdtflvr.cxx:3392
void SetShowChangesInMargin(bool b)
Definition: viewopt.hxx:462
bool IsShowOutlineContentVisibilityButton() const
Definition: viewopt.cxx:178
void SetFormView(bool bSet)
Definition: viewopt.hxx:636
void SetShowChangesInMargin2(bool b)
Definition: viewopt.hxx:471
bool IsFormView() const
Definition: viewopt.hxx:635
bool IsViewLocked() const
Definition: viewsh.hxx:472
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:434
bool HasCharts() const
Definition: viewsh.cxx:774
void Reformat()
Invalidates complete Layout (ApplyViewOption).
Definition: viewsh.cxx:1045
static ShellResource * GetShellRes()
Definition: viewsh.cxx:2656
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2159
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:2827
SwDoc * GetDoc() const
Definition: viewsh.hxx:290
void LockView(bool b)
Definition: viewsh.hxx:473
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:625
void UpdateOleObjectPreviews()
Update the previews of all OLE objects.
Definition: viewsh.cxx:728
Definition: view.hxx:146
SfxShell * GetCurShell()
Definition: view.hxx:584
void AutoCaption(const sal_uInt16 nType, const SvGlobalName *pOleId=nullptr)
Definition: viewdlg2.cxx:183
SwWrtShell & GetWrtShell() const
Definition: view.hxx:421
virtual FmFormShell * GetFormShell() override
Definition: view.hxx:587
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:422
void ResetSubShell()
Definition: view.hxx:591
SwEditWin & GetEditWin()
Definition: view.hxx:424
ShellMode GetShellMode() const
Definition: view0.cxx:108
SwDocShell * GetDocShell()
Definition: view.cxx:1163
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:342
bool IsSelFrameMode() const
Definition: wrtsh.hxx:177
void AutoUpdatePara(SwTextFormatColl *pColl, const SfxItemSet &rStyleSet, SwPaM *pPaM=nullptr)
Definition: wrtsh1.cxx:1902
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
Definition: select.cxx:703
bool GoNextBookmark()
Definition: wrtsh3.cxx:277
void EndSelect()
Definition: select.cxx:426
void LeaveSelFrameMode()
Definition: select.cxx:721
OUString GetRepeatString() const
Definition: wrtundo.cxx:138
bool DelLeft()
Definition: delete.cxx:136
void GetDoStrings(DoType eDoType, SfxStringListItem &rStrLstItem) const
Definition: wrtundo.cxx:115
void AutoUpdateFrame(SwFrameFormat *pFormat, const SfxItemSet &rStyleSet)
Definition: wrtsh1.cxx:1939
bool Left(SwCursorSkipMode nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
Definition: move.cxx:110
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1717
void UpdateInputFields(SwInputFieldList *pLst=nullptr)
Definition: wrtsh2.cxx:146
void InsertGraphic(const OUString &rPath, const OUString &rFilter, const Graphic &, SwFlyFrameAttrMgr *=nullptr, RndStdIds nAnchorType=RndStdIds::FLY_AT_PARA)
Definition: wrtsh1.cxx:289
void EnterStdMode()
Definition: select.cxx:552
SwFrameFormat * GetTableStyle(std::u16string_view rFormatName)
Definition: wrtsh1.cxx:1851
virtual void ApplyViewOptions(const SwViewOption &rOpt) override
Apply ViewOptions with Start-/EndAction.
Definition: wrtsh1.cxx:2116
void Do(DoType eDoType, sal_uInt16 nCnt=1, sal_uInt16 nOffset=0)
Definition: wrtundo.cxx:33
bool GoPrevBookmark()
Definition: wrtsh3.cxx:298
bool DelRight(bool isReplaceHeuristic=false)
Definition: delete.cxx:293
bool HasSelection() const
Definition: wrtsh.hxx:147
void UnSelectFrame()
Definition: select.cxx:324
OUString GetDoString(DoType eDoType) const
Definition: wrtundo.cxx:95
bool IsInClickToEdit() const
Definition: wrtsh.hxx:667
const SwView & GetView() const
Definition: wrtsh.hxx:443
void SortIfNeedBe() const
Trigger the sorting if necessary.
Definition: ndhints.hxx:176
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
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:240
#define FN_UPDATE_TOX
Definition: cmdid.h:534
#define FN_UPDATE_ALL
Definition: cmdid.h:133
#define FN_TABLE_PASTE_COL_BEFORE
Definition: cmdid.h:320
#define FN_TOOL_ANCHOR_FRAME
Definition: cmdid.h:246
#define FN_INSERT_REGION
Definition: cmdid.h:298
#define FN_SET_TRACKED_INSERTIONS_IN_MARGIN
Definition: cmdid.h:199
#define FN_FORMAT_BACKGROUND_DLG
Definition: cmdid.h:346
#define FN_SET_TRACKED_CHANGES_IN_TEXT
Definition: cmdid.h:197
#define FN_PAGE_STYLE_SET_LR_MARGIN
Definition: cmdid.h:409
#define FN_ESCAPE
Definition: cmdid.h:709
#define FN_GOTO_NEXT_OBJ
Definition: cmdid.h:713
#define FN_UPDATE_CHARTS
Definition: cmdid.h:139
#define FN_SET_TRACKED_DELETIONS_IN_MARGIN
Definition: cmdid.h:198
#define FN_CONVERT_TEXT_TO_TABLE
Definition: cmdid.h:404
#define FN_INSERT_TABLE
Definition: cmdid.h:231
#define FN_FRAME_WRAP_IDEAL
Definition: cmdid.h:430
#define FN_BACKSPACE
Definition: cmdid.h:695
#define FN_UPDATE_ALL_LINKS
Definition: cmdid.h:128
#define FN_EDIT_REGION
Definition: cmdid.h:116
#define FN_TOOL_ANCHOR_CHAR
Definition: cmdid.h:264
#define FN_PAGE_STYLE_SET_NUMBER_FORMAT
Definition: cmdid.h:413
#define FN_UPDATE_FIELD
Definition: cmdid.h:327
#define FN_SHIFT_BACKSPACE
Definition: cmdid.h:710
#define FN_TOOL_ANCHOR_AT_CHAR
Definition: cmdid.h:292
#define FN_TOOL_ANCHOR_PARAGRAPH
Definition: cmdid.h:241
#define FN_PAGE_STYLE_SET_COLS
Definition: cmdid.h:414
#define FN_FORMAT_BORDER_DLG
Definition: cmdid.h:344
#define FN_FRAME_WRAPTHRU_TRANSP
Definition: cmdid.h:432
#define FN_XFORMS_DESIGN_MODE
Definition: cmdid.h:626
#define FN_FRAME_NOWRAP
Definition: cmdid.h:358
#define FN_CHANGE_DBFIELD
Definition: cmdid.h:209
#define FN_CONVERT_TABLE_TO_TEXT
Definition: cmdid.h:405
#define FN_FORMAT_PAGE_SETTING_DLG
Definition: cmdid.h:342
#define FN_EDIT_CURRENT_REGION
Definition: cmdid.h:118
#define FN_PAGE_STYLE_SET_PAPER_BIN
Definition: cmdid.h:412
#define FN_GOTO_NEXT_MARK
Definition: cmdid.h:745
#define FN_FORMAT_TITLEPAGE_DLG
Definition: cmdid.h:373
#define FN_PASTE_NESTED_TABLE
Definition: cmdid.h:318
#define FN_FRAME_WRAP_RIGHT
Definition: cmdid.h:443
#define FN_PREV_BOOKMARK
Definition: cmdid.h:122
#define FN_FORMAT_PAGE_COLUMN_DLG
Definition: cmdid.h:345
#define FN_REPAGINATE
Definition: cmdid.h:113
#define FN_UPDATE_FIELDS
Definition: cmdid.h:82
#define FN_WRAP_ANCHOR_ONLY
Definition: cmdid.h:445
#define FN_PAGE_STYLE_SET_UL_MARGIN
Definition: cmdid.h:410
#define FN_FRAME_WRAP
Definition: cmdid.h:359
#define FN_FRAME_TO_ANCHOR
Definition: cmdid.h:731
#define FN_FRAME_WRAPTHRU_TOGGLE
Definition: cmdid.h:431
#define FN_FORMAT_PAGE_DLG
Definition: cmdid.h:347
#define FN_CONVERT_TEXT_TABLE
Definition: cmdid.h:376
#define FN_FRAME_WRAP_CONTOUR
Definition: cmdid.h:450
#define FN_PAGE_STYLE_SET_PAPER_SIZE
Definition: cmdid.h:411
#define FN_GOTO_PREV_OBJ
Definition: cmdid.h:714
#define FN_NEXT_BOOKMARK
Definition: cmdid.h:121
#define FN_GOTO_PREV_MARK
Definition: cmdid.h:746
#define FN_FRAME_WRAPTHRU
Definition: cmdid.h:360
#define FN_TABLE_PASTE_ROW_BEFORE
Definition: cmdid.h:319
#define FN_FRAME_WRAP_LEFT
Definition: cmdid.h:442
#define FN_UPDATE_INPUTFIELDS
Definition: cmdid.h:103
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
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< SvxFontHeightItem > RES_CHRATR_CTL_FONTSIZE(28)
constexpr TypedWhichId< SwFormatURL > RES_URL(117)
bool isCHRATR(const sal_uInt16 nWhich)
Definition: hintids.hxx:473
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< SwFormatHoriOrient > RES_HORI_ORIENT(109)
constexpr TypedWhichId< SvxFontHeightItem > RES_CHRATR_CJK_FONTSIZE(23)
constexpr TypedWhichId< SvxShadowItem > RES_SHADOW(113)
constexpr TypedWhichId< SwFormatVertOrient > RES_VERT_ORIENT(108)
constexpr TypedWhichId< SvxBrushItem > RES_BACKGROUND(111)
constexpr TypedWhichId< SvxLanguageItem > RES_CHRATR_CJK_LANGUAGE(24)
constexpr TypedWhichId< SvxOpaqueItem > RES_OPAQUE(105)
constexpr TypedWhichId< SvxPostureItem > RES_CHRATR_POSTURE(11)
constexpr TypedWhichId< SwFormatAnchor > RES_ANCHOR(110)
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr TypedWhichId< SwFormatRefMark > RES_TXTATR_REFMARK(RES_TXTATR_WITHEND_BEGIN)
constexpr TypedWhichId< SvxFontItem > RES_CHRATR_FONT(7)
constexpr TypedWhichId< SwFormatSurround > RES_SURROUND(107)
HTMLMODE_SOME_STYLES
HTMLMODE_ON
HTMLMODE_FULL_STYLES
SVX_DLLPUBLIC SvxIMapDlg * GetIMapDlg()
::std::vector< OUString > TargetList
OUString aName
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)
SW_DLLPUBLIC void PasteHTMLToPaM(SwWrtShell &rWrtSh, SwPaM *pCursor, const OString &rData, bool bSetSelection)
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)
HashMap_OWString_Interface aMap
sal_Int16 nId
const char GetValue[]
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:1180
SwMoveFnCollection const & fnTableStart
Definition: paminit.cxx:54
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:60
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
Marks a position in the document model.
Definition: pam.hxx:37
SwNode & GetNode() const
Definition: pam.hxx:80
sal_Int32 GetContentIndex() const
Definition: pam.hxx:84
std::function< void(sal_Int32)> maEndDialogFn
Reference< XModel > xModel
PasteTableType
Definition: swdtflvr.hxx:69
RndStdIds
SwView * GetActiveView()
Definition: swmodul1.cxx:115
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:168
#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:415
constexpr sal_uInt16 XATTR_FILL_FIRST(XATTRSET_LINE+1)
constexpr sal_uInt16 XATTR_FILL_LAST(XATTR_FILLUSESLIDEBACKGROUND)