LibreOffice Module sw (master) 1
wrtsh2.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 <svl/macitem.hxx>
21#include <sfx2/frame.hxx>
22#include <svl/eitem.hxx>
23#include <svl/listener.hxx>
24#include <svl/stritem.hxx>
25#include <sfx2/docfile.hxx>
26#include <sfx2/dispatch.hxx>
27#include <sfx2/linkmgr.hxx>
28#include <sfx2/viewfrm.hxx>
29#include <sot/exchange.hxx>
30#include <osl/diagnose.h>
31#include <o3tl/string_view.hxx>
32#include <fmtinfmt.hxx>
33#include <wrtsh.hxx>
34#include <docsh.hxx>
35#include <fldbas.hxx>
36#include <expfld.hxx>
37#include <docufld.hxx>
38#include <reffld.hxx>
39#include <swundo.hxx>
40#include <doc.hxx>
41#include <frmfmt.hxx>
42#include <fmtfld.hxx>
43#include <view.hxx>
44#include <swevent.hxx>
45#include <section.hxx>
46#include <navicont.hxx>
47#include <txtinet.hxx>
48#include <cmdid.h>
49#include <swabstdlg.hxx>
50#include <SwRewriter.hxx>
51#include <authfld.hxx>
52
53#include <com/sun/star/document/XDocumentProperties.hpp>
54#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
55
56#include <memory>
57
58#include <LibreOfficeKit/LibreOfficeKitEnums.h>
59#include <comphelper/lok.hxx>
60#include <sfx2/event.hxx>
61#include <sal/log.hxx>
62
63bool SwWrtShell::InsertField2(SwField const& rField, SwPaM* pAnnotationRange)
64{
66 if(!CanInsert())
67 return false;
69
70 SwRewriter aRewriter;
71 aRewriter.AddRule(UndoArg1, rField.GetDescription());
72
73 StartUndo(SwUndoId::INSERT, &aRewriter);
74
75 bool bDeleted = false;
76 std::optional<SwPaM> pAnnotationTextRange;
77 if (pAnnotationRange)
78 {
79 pAnnotationTextRange.emplace(*pAnnotationRange->Start(), *pAnnotationRange->End());
80 }
81
82 if ( HasSelection() )
83 {
84 if ( rField.GetTyp()->Which() == SwFieldIds::Postit )
85 {
86 // for annotation fields:
87 // - keep the current selection in order to create a corresponding annotation mark
88 // - collapse cursor to its end
89 if ( IsTableMode() )
90 {
91 GetTableCrs()->Normalize( false );
92 const SwPosition rStartPos( *(GetTableCrs()->GetMark()->GetNode().GetContentNode()), 0 );
93 KillPams();
94 if ( !IsEndOfPara() )
95 {
96 EndPara();
97 }
98 const SwPosition rEndPos( *GetCurrentShellCursor().GetPoint() );
99 pAnnotationTextRange.emplace( rStartPos, rEndPos );
100 }
101 else
102 {
103 NormalizePam( false );
104 const SwPaM& rCurrPaM = GetCurrentShellCursor();
105 pAnnotationTextRange.emplace( *rCurrPaM.GetPoint(), *rCurrPaM.GetMark() );
106 ClearMark();
107 }
108 }
109 else
110 {
111 bDeleted = DelRight();
112 }
113 }
114
115 bool const isSuccess = SwEditShell::InsertField(rField, bDeleted);
116
117 if ( pAnnotationTextRange )
118 {
119 if ( GetDoc() != nullptr )
120 {
121 const SwPaM& rCurrPaM = GetCurrentShellCursor();
122 if (*rCurrPaM.Start() == *pAnnotationTextRange->Start()
123 && *rCurrPaM.End() == *pAnnotationTextRange->End())
124 {
125 // Annotation range was passed in externally, and inserting the postit field shifted
126 // its start/end positions right by one. Restore the original position for the range
127 // start. This allows commenting on the placeholder character of the field.
128 if (pAnnotationTextRange->Start()->GetContentIndex() > 0)
129 pAnnotationTextRange->Start()->AdjustContent(-1);
130 }
132 pMarksAccess->makeAnnotationMark( *pAnnotationTextRange, OUString() );
133 }
134 pAnnotationTextRange.reset();
135 }
136
137 EndUndo();
138 EndAllAction();
139
140 return isSuccess;
141}
142
143// Start the field update
144
146{
147 // Go through the list of fields and updating
148 std::unique_ptr<SwInputFieldList> pTmp;
149 if (!pLst)
150 {
151 pTmp.reset(new SwInputFieldList( this ));
152 pLst = pTmp.get();
153 }
154
155 const size_t nCnt = pLst->Count();
156 if(!nCnt)
157 return;
158
159 pLst->PushCursor();
160
161 bool bCancel = false;
162
163 size_t nIndex = 0;
165
166 SwField* pField = GetCurField();
167 if (pField)
168 {
169 for (size_t i = 0; i < nCnt; i++)
170 {
171 if (pField == pLst->GetField(i))
172 {
173 nIndex = i;
174 break;
175 }
176 }
177 }
178
179 while (!bCancel)
180 {
181 bool bPrev = nIndex > 0;
182 bool bNext = nIndex < nCnt - 1;
183 pLst->GotoFieldPos(nIndex);
184 pField = pLst->GetField(nIndex);
185 if (pField->GetTyp()->Which() == SwFieldIds::Dropdown)
186 {
187 bCancel = StartDropDownFieldDlg(pField, bPrev, bNext, GetView().GetFrameWeld(), &ePressedButton);
188 }
189 else
190 bCancel = StartInputFieldDlg(pField, bPrev, bNext, GetView().GetFrameWeld(), &ePressedButton);
191
192 if (!bCancel)
193 {
194 // Otherwise update error at multi-selection:
195 pLst->GetField(nIndex)->GetTyp()->UpdateFields();
196
197 if (ePressedButton == FieldDialogPressedButton::Previous && nIndex > 0)
198 nIndex--;
199 else if (ePressedButton == FieldDialogPressedButton::Next && nIndex < nCnt - 1)
200 nIndex++;
201 else
202 bCancel = true;
203 }
204 }
205
206 pLst->PopCursor();
207}
208
209namespace {
210
211// Listener class: will close InputField dialog if input field(s)
212// is(are) deleted (for instance, by an extension) after the dialog shows up.
213// Otherwise, the for loop in SwWrtShell::UpdateInputFields will crash when doing:
214// 'pTmp->GetField( i )->GetTyp()->UpdateFields();'
215// on a deleted field.
216class FieldDeletionListener : public SvtListener
217{
218 public:
219 FieldDeletionListener(AbstractFieldInputDlg* pInputFieldDlg, SwField* pField)
220 : mpInputFieldDlg(pInputFieldDlg)
221 , mpFormatField(nullptr)
222 {
223 SwInputField *const pInputField(dynamic_cast<SwInputField*>(pField));
224 SwSetExpField *const pSetExpField(dynamic_cast<SwSetExpField*>(pField));
225
226 if (pInputField && pInputField->GetFormatField())
227 {
228 mpFormatField = pInputField->GetFormatField();
229 }
230 else if (pSetExpField && pSetExpField->GetFormatField())
231 {
232 mpFormatField = pSetExpField->GetFormatField();
233 }
234
235 // Register for possible field deletion while dialog is open
236 if (mpFormatField)
237 StartListening(mpFormatField->GetNotifier());
238 }
239
240 virtual ~FieldDeletionListener() override
241 {
242 // Dialog closed, remove modification listener
244 }
245
246 virtual void Notify(const SfxHint& rHint) override
247 {
248 // Input field has been deleted: better to close the dialog
249 if(rHint.GetId() == SfxHintId::Dying)
250 {
251 mpFormatField = nullptr;
252 mpInputFieldDlg->EndDialog(RET_CANCEL);
253 }
254 }
255 private:
256 VclPtr<AbstractFieldInputDlg> mpInputFieldDlg;
257 SwFormatField* mpFormatField;
258};
259
260}
261
262// Start input dialog for a specific field
263bool SwWrtShell::StartInputFieldDlg(SwField* pField, bool bPrevButton, bool bNextButton,
264 weld::Widget* pParentWin, SwWrtShell::FieldDialogPressedButton* pPressedButton)
265{
266
268 ScopedVclPtr<AbstractFieldInputDlg> pDlg(pFact->CreateFieldInputDlg(pParentWin, *this, pField, bPrevButton, bNextButton));
269
270 bool bRet;
271
272 {
273 FieldDeletionListener aModify(pDlg.get(), pField);
274 bRet = RET_CANCEL == pDlg->Execute();
275 }
276
277 if (pPressedButton)
278 {
279 if (pDlg->PrevButtonPressed())
280 *pPressedButton = FieldDialogPressedButton::Previous;
281 else if (pDlg->NextButtonPressed())
282 *pPressedButton = FieldDialogPressedButton::Next;
283 }
284
285 pDlg.disposeAndClear();
287 return bRet;
288}
289
290bool SwWrtShell::StartDropDownFieldDlg(SwField* pField, bool bPrevButton, bool bNextButton,
291 weld::Widget* pParentWin, SwWrtShell::FieldDialogPressedButton* pPressedButton)
292{
294 ScopedVclPtr<AbstractDropDownFieldDialog> pDlg(pFact->CreateDropDownFieldDialog(pParentWin, *this, pField, bPrevButton, bNextButton));
295 const short nRet = pDlg->Execute();
296
297 if (pPressedButton)
298 {
299 if (pDlg->PrevButtonPressed())
300 *pPressedButton = FieldDialogPressedButton::Previous;
301 else if (pDlg->NextButtonPressed())
302 *pPressedButton = FieldDialogPressedButton::Next;
303 }
304
305 pDlg.disposeAndClear();
306 bool bRet = RET_CANCEL == nRet;
308 if(RET_YES == nRet)
309 {
310 GetView().GetViewFrame()->GetDispatcher()->Execute(FN_EDIT_FIELD, SfxCallMode::SYNCHRON);
311 }
312 return bRet;
313}
314
315// Insert directory - remove selection
316
317void SwWrtShell::InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet)
318{
319 if(!CanInsert())
320 return;
321
322 if(HasSelection())
323 DelRight();
324
325 SwEditShell::InsertTableOf(rTOX, pSet);
326}
327
328// Update directory - remove selection
329
330void SwWrtShell::UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet)
331{
332 if(CanInsert())
333 {
334 SwEditShell::UpdateTableOf(rTOX, pSet);
335 }
336}
337
338// handler for click on the field given as parameter.
339// the cursor is positioned on the field.
340
341void SwWrtShell::ClickToField(const SwField& rField, bool bExecHyperlinks)
342{
344
345 // cross reference field must not be selected because it moves the cursor
346 if (SwFieldIds::GetRef != rField.GetTyp()->Which())
347 {
349 Right( SwCursorSkipMode::Chars, true, 1, false ); // Select the field.
350 NormalizePam();
351 EndAllAction();
352 }
353
354 m_bIsInClickToEdit = true;
355 switch( rField.GetTyp()->Which() )
356 {
358 {
359 sal_uInt16 nSlotId = 0;
360 switch( rField.GetFormat() )
361 {
362 case JE_FMT_TABLE:
363 nSlotId = FN_INSERT_TABLE;
364 break;
365
366 case JE_FMT_FRAME:
367 nSlotId = FN_INSERT_FRAME;
368 break;
369
370 case JE_FMT_GRAPHIC: nSlotId = SID_INSERT_GRAPHIC; break;
371 case JE_FMT_OLE: nSlotId = SID_INSERT_OBJECT; break;
372
373 }
374
375 if( nSlotId )
376 {
378 //#97295# immediately select the right shell
380 GetView().GetViewFrame()->GetDispatcher()->Execute( nSlotId,
381 SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
383 }
384 }
385 break;
386
388 {
389 const SwMacroField *pField = static_cast<const SwMacroField*>(&rField);
390 const OUString sText( rField.GetPar2() );
391 OUString sRet( sText );
392 ExecMacro( pField->GetSvxMacro(), &sRet );
393
394 // return value changed?
395 if( sRet != sText )
396 {
398 const_cast<SwField&>(rField).SetPar2( sRet );
399 rField.GetTyp()->UpdateFields();
400 EndAllAction();
401 }
402 }
403 break;
404
406 {
407 if (!bExecHyperlinks)
408 {
409 break;
410 }
411
412 auto pField = static_cast<const SwAuthorityField*>(&rField);
413 if (!pField->HasURL())
414 {
415 break;
416 }
417
418 const OUString& rURL = pField->GetAbsoluteURL();
419 ::LoadURL(*this, rURL, LoadUrlFlags::NewView, /*rTargetFrameName=*/OUString());
420 }
421 break;
422
425 SwCursorShell::GotoRefMark( static_cast<const SwGetRefField&>(rField).GetSetRefName(),
426 static_cast<const SwGetRefField&>(rField).GetSubType(),
427 static_cast<const SwGetRefField&>(rField).GetSeqNo() );
428 EndAllAction();
429 break;
430
432 {
433 const SwInputField* pInputField = dynamic_cast<const SwInputField*>(&rField);
434 if ( pInputField == nullptr )
435 {
436 StartInputFieldDlg(const_cast<SwField*>(&rField), false, false, GetView().GetFrameWeld());
437 }
438 }
439 break;
440
442 if( static_cast<const SwSetExpField&>(rField).GetInputFlag() )
443 StartInputFieldDlg(const_cast<SwField*>(&rField), false, false, GetView().GetFrameWeld());
444 break;
446 StartDropDownFieldDlg(const_cast<SwField*>(&rField), false, false, GetView().GetFrameWeld());
447 break;
448 default:
449 SAL_WARN_IF(rField.IsClickable(), "sw", "unhandled clickable field!");
450 }
451
452 m_bIsInClickToEdit = false;
453}
454
456{
458
459 if( rItem.GetValue().isEmpty() )
460 return ;
461
462 m_bIsInClickToEdit = true;
463
464 // At first run the possibly set ObjectSelect Macro
465 const SvxMacro* pMac = rItem.GetMacro( SvMacroItemId::OnClick );
466 if( pMac )
467 {
468 SwCallMouseEvent aCallEvent;
469 aCallEvent.Set( &rItem );
470 GetDoc()->CallEvent( SvMacroItemId::OnClick, aCallEvent );
471 }
472
473 // So that the implementation of templates is displayed immediately
474 ::LoadURL( *this, rItem.GetValue(), nFilter, rItem.GetTargetFrame() );
475 const SwTextINetFormat* pTextAttr = rItem.GetTextINetFormat();
476 if( pTextAttr )
477 {
478 const_cast<SwTextINetFormat*>(pTextAttr)->SetVisited( true );
479 const_cast<SwTextINetFormat*>(pTextAttr)->SetVisitedValid( true );
480 }
481
482 m_bIsInClickToEdit = false;
483}
484
485bool SwWrtShell::ClickToINetGrf( const Point& rDocPt, LoadUrlFlags nFilter )
486{
487 bool bRet = false;
488 OUString sURL;
489 OUString sTargetFrameName;
490 const SwFrameFormat* pFnd = IsURLGrfAtPos( rDocPt, &sURL, &sTargetFrameName );
491 if( pFnd && !sURL.isEmpty() )
492 {
493 bRet = true;
494 // At first run the possibly set ObjectSelect Macro
495 SwCallMouseEvent aCallEvent;
496 aCallEvent.Set(EVENT_OBJECT_URLITEM, pFnd);
497 GetDoc()->CallEvent(SvMacroItemId::OnClick, aCallEvent);
498
499 ::LoadURL(*this, sURL, nFilter, sTargetFrameName);
500 }
501 return bRet;
502}
503
504void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter,
505 const OUString& rTargetFrameName )
506{
507 OSL_ENSURE( !rURL.isEmpty(), "what should be loaded here?" );
508 if( rURL.isEmpty() )
509 return ;
510
511 // The shell could be 0 also!!!!!
512 if ( dynamic_cast<const SwCursorShell*>( &rVSh) == nullptr )
513 return;
514
515 // We are doing tiledRendering, let the client handles the URL loading,
516 // unless we are jumping to a TOC mark.
517 if (comphelper::LibreOfficeKit::isActive() && !rURL.startsWith("#"))
518 {
519 rVSh.GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, rURL.toUtf8().getStr());
520 return;
521 }
522
523 //A CursorShell is always a WrtShell
524 SwWrtShell &rSh = static_cast<SwWrtShell&>(rVSh);
525
526 SwDocShell* pDShell = rSh.GetView().GetDocShell();
527 OSL_ENSURE( pDShell, "No DocShell?!");
528 OUString sTargetFrame(rTargetFrameName);
529 if (sTargetFrame.isEmpty() && pDShell)
530 {
531 using namespace ::com::sun::star;
532 uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
533 pDShell->GetModel(), uno::UNO_QUERY_THROW);
534 uno::Reference<document::XDocumentProperties> xDocProps
535 = xDPS->getDocumentProperties();
536 sTargetFrame = xDocProps->getDefaultTarget();
537 }
538
539 OUString sReferer;
540 if( pDShell && pDShell->GetMedium() )
541 sReferer = pDShell->GetMedium()->GetName();
542 SfxViewFrame* pViewFrame = rSh.GetView().GetViewFrame();
543 SfxFrameItem aView( SID_DOCFRAME, pViewFrame );
544 SfxStringItem aName( SID_FILE_NAME, rURL );
545 SfxStringItem aTargetFrameName( SID_TARGETNAME, sTargetFrame );
546 SfxStringItem aReferer( SID_REFERER, sReferer );
547
548 SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, false );
549 //#39076# Silent can be removed accordingly to SFX.
550 SfxBoolItem aBrowse( SID_BROWSE, true );
551
553 aTargetFrameName.SetValue( "_blank" );
554
555 const SfxPoolItem* aArr[] = {
556 &aName,
557 &aNewView, /*&aSilent,*/
558 &aReferer,
559 &aView, &aTargetFrameName,
560 &aBrowse,
561 nullptr
562 };
563
564 pViewFrame->GetDispatcher()->GetBindings()->Execute( SID_OPENDOC, aArr,
565 SfxCallMode::ASYNCHRON|SfxCallMode::RECORD );
566}
567
569 const sal_uInt16 nAction )
570{
571 if( EXCHG_IN_ACTION_COPY == nAction )
572 {
573 // Insert
574 OUString sURL = rBkmk.GetURL();
575 // Is this is a jump within the current Doc?
576 const SwDocShell* pDocShell = GetView().GetDocShell();
577 if(pDocShell->HasName())
578 {
579 const OUString rName = pDocShell->GetMedium()->GetURLObject().GetURLNoMark();
580
581 if (sURL.startsWith(rName))
582 {
583 if (sURL.getLength()>rName.getLength())
584 {
585 sURL = sURL.copy(rName.getLength());
586 }
587 else
588 {
589 sURL.clear();
590 }
591 }
592 }
593 SwFormatINetFormat aFormat( sURL, OUString() );
594 InsertURL( aFormat, rBkmk.GetDescription() );
595 }
596 else
597 {
599 OUString aLinkFile = o3tl::getToken(rBkmk.GetURL(), 0, '#')
600 + OUStringChar(sfx2::cTokenSeparator)
601 + OUStringChar(sfx2::cTokenSeparator)
602 + o3tl::getToken(rBkmk.GetURL(), 1, '#');
603 aSection.SetLinkFileName( aLinkFile );
604 aSection.SetProtectFlag( true );
605 const SwSection* pIns = InsertSection( aSection );
606 if( EXCHG_IN_ACTION_MOVE == nAction && pIns )
607 {
608 aSection = SwSectionData(*pIns);
609 aSection.SetLinkFileName( OUString() );
610 aSection.SetType( SectionType::Content );
611 aSection.SetProtectFlag( false );
612
613 // the update of content from linked section at time delete
614 // the undostack. Then the change of the section don't create
615 // any undoobject. - BUG 69145
616 bool bDoesUndo = DoesUndo();
617 SwUndoId nLastUndoId(SwUndoId::EMPTY);
618 if (GetLastUndoInfo(nullptr, & nLastUndoId))
619 {
620 if (SwUndoId::INSSECTION != nLastUndoId)
621 {
622 DoUndo(false);
623 }
624 }
625 UpdateSection( GetSectionFormatPos( *pIns->GetFormat() ), aSection );
626 DoUndo( bDoesUndo );
627 }
628 }
629}
630
631/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ UndoArg1
Definition: SwRewriter.hxx:29
void SetValue(const OUString &rTheValue)
Provides access to the marks of a document.
virtual sw::mark::IMark * makeAnnotationMark(const SwPaM &rPaM, const OUString &rName)=0
OUString GetURLNoMark(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
const OUString & GetURL() const
Definition: navicont.hxx:47
const OUString & GetDescription() const
Definition: navicont.hxx:48
bool Execute(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr, SfxCallMode nCall=SfxCallMode::SLOT)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
SfxBindings * GetBindings() const
SfxHintId GetId() const
const INetURLObject & GetURLObject() const
const OUString & GetName() const
bool HasName() const
SfxMedium * GetMedium() const
css::uno::Reference< css::frame::XModel3 > GetModel() const
SfxDispatcher * GetDispatcher()
SfxViewFrame * GetViewFrame() const
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) const override
void EndListeningAll()
virtual void Notify(const SfxHint &rHint)
bool StartListening(SvtBroadcaster &rBroadcaster)
virtual VclPtr< AbstractFieldInputDlg > CreateFieldInputDlg(weld::Widget *pParent, SwWrtShell &rSh, SwField *pField, bool bPrevButton, bool bNextButton)=0
virtual VclPtr< AbstractDropDownFieldDialog > CreateDropDownFieldDialog(weld::Widget *pParent, SwWrtShell &rSh, SwField *pField, bool bPrevButton, bool bNextButton)=0
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
invariant for SwAuthorityField is that it is always registered at its SwAuthorityFieldType via AddFie...
Definition: authfld.hxx:155
bool GotoRefMark(const OUString &rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo)
jump to reference marker
Definition: crstrvl.cxx:1273
const SwPaM * GetTableCrs() const
Definition: crsrsh.hxx:924
virtual SwCursor & GetCurrentShellCursor() override
Return the current shell cursor.
Definition: crsrsh.cxx:184
void NormalizePam(bool bPointFirst=true)
Ensure point and mark of the current PaM are in a specific order.
Definition: crsrsh.cxx:969
SwField * GetCurField(const bool bIncludeInputFieldAtStart=false) const
Definition: crstrvl.cxx:942
void ClearMark()
Definition: crsrsh.cxx:938
void KillPams()
Definition: crsrsh.cxx:1021
bool IsTableMode() const
Definition: crsrsh.hxx:659
sal_uInt16 CallEvent(SvMacroItemId nEvent, const SwCallMouseEvent &rCallEvent, bool bChkPtr=false)
Definition: docbasic.cxx:130
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1793
bool InsertField(SwField const &, const bool bForceExpandHints)
add a field at the cursor position
Definition: edfld.cxx:142
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
SwSection const * InsertSection(SwSectionData &rNewData, SfxItemSet const *const =nullptr)
Definition: edsect.cxx:35
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:223
bool InsertURL(const SwFormatINetFormat &rFormat, const OUString &rStr, bool bKeepSelection=false)
Definition: editsh.cxx:634
bool GetLastUndoInfo(OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const
Definition: edws.cxx:237
void InsertTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
Insert content table. Renew if required.
Definition: edtox.cxx:122
void UpdateSection(size_t const nSect, SwSectionData &, SfxItemSet const *const =nullptr)
Definition: edsect.cxx:156
void UpdateTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
update tables of content
Definition: edtox.cxx:150
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
Definition: edsect.cxx:166
bool DoesUndo() const
Definition: edws.cxx:203
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:234
size_t GetSectionFormatPos(const SwSectionFormat &) const
Definition: edsect.cxx:136
void DoUndo(bool bOn=true)
Undo.
Definition: edws.cxx:200
void EndAllAction()
Definition: edws.cxx:97
const SwFrameFormat * IsURLGrfAtPos(const Point &rPt, OUString *pURL=nullptr, OUString *pTargetFrameName=nullptr, OUString *pURLDescription=nullptr) const
Position is a graphic with URL?
Definition: fefly1.cxx:1511
virtual void UpdateFields()
Definition: fldbas.cxx:213
SwFieldIds Which() const
Definition: fldbas.hxx:273
Base class of all fields.
Definition: fldbas.hxx:292
bool IsClickable() const
Is this field clickable?
Definition: fldbas.cxx:836
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
Definition: fldbas.hxx:403
virtual OUString GetDescription() const
Definition: fldbas.cxx:831
SwFieldType * GetTyp() const
Definition: fldbas.hxx:398
virtual OUString GetPar2() const
Definition: fldbas.cxx:326
const OUString & GetValue() const
Definition: fmtinfmt.hxx:75
const SvxMacro * GetMacro(SvMacroItemId nEvent) const
Definition: fmtatr2.cxx:258
const SwTextINetFormat * GetTextINetFormat() const
Definition: fmtinfmt.hxx:70
const OUString & GetTargetFrame() const
Definition: fmtinfmt.hxx:89
Style of a layout element.
Definition: frmfmt.hxx:62
void PopCursor()
get cursor
Definition: fldlst.cxx:93
SwField * GetField(size_t nId)
Definition: fldlst.cxx:78
size_t Count() const
Definition: fldlst.cxx:72
void GotoFieldPos(size_t nId)
go to position of a field
Definition: fldlst.cxx:99
void PushCursor()
save cursor
Definition: fldlst.cxx:86
SvxMacro GetSvxMacro() const
Definition: macrofld.cxx:109
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
const SwPosition * GetMark() const
Definition: pam.hxx:263
void Normalize(bool bPointFirst=true)
Normalizes PaM, i.e.
Definition: pam.cxx:700
const SwPosition * End() const
Definition: pam.hxx:271
const SwPosition * GetPoint() const
Definition: pam.hxx:261
const SwPosition * Start() const
Definition: pam.hxx:266
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:25
SAL_DLLPRIVATE void SetProtectFlag(bool const bFlag)
Definition: section.hxx:106
void SetType(SectionType const eNew)
Definition: section.hxx:96
void SetLinkFileName(OUString const &rNew)
Definition: section.hxx:118
SwSectionFormat * GetFormat()
Definition: section.hxx:337
vcl::Window * GetWin() const
Definition: viewsh.hxx:346
SwDoc * GetDoc() const
Definition: viewsh.hxx:290
SfxViewShell * GetSfxViewShell() const
Definition: viewsh.hxx:454
void StopShellTimer()
Definition: view.cxx:1819
SwDocShell * GetDocShell()
Definition: view.cxx:1160
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
void ClickToField(const SwField &rField, bool bExecHyperlinks)
Definition: wrtsh2.cxx:341
bool ClickToINetGrf(const Point &rDocPt, LoadUrlFlags nFilter)
Definition: wrtsh2.cxx:485
bool Right(SwCursorSkipMode nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
Definition: move.cxx:127
FieldDialogPressedButton
Definition: wrtsh.hxx:380
bool StartInputFieldDlg(SwField *, bool bPrevButton, bool bNextButton, weld::Widget *pParentWin, FieldDialogPressedButton *pPressedButton=nullptr)
Definition: wrtsh2.cxx:263
void addCurrentPosition()
Definition: wrtsh1.cxx:1847
void InsertTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
Definition: wrtsh2.cxx:317
void ResetCursorStack()
Definition: wrtsh.hxx:639
void UpdateInputFields(SwInputFieldList *pLst=nullptr)
Definition: wrtsh2.cxx:145
void EndPara(bool bSelect=false)
Definition: move.cxx:362
bool m_bIsInClickToEdit
Definition: wrtsh.hxx:592
void UpdateTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
Definition: wrtsh2.cxx:330
void ExecMacro(const SvxMacro &rMacro, OUString *pRet=nullptr, SbxArray *pArgs=nullptr)
Definition: wrtsh3.cxx:320
void NavigatorPaste(const NaviContentBookmark &rBkmk, const sal_uInt16 nAction)
Definition: wrtsh2.cxx:568
bool DelRight(bool isReplaceHeuristic=false)
Definition: delete.cxx:293
bool HasSelection() const
Definition: wrtsh.hxx:147
bool InsertField2(SwField const &, SwPaM *pAnnotationRange=nullptr)
Definition: wrtsh2.cxx:63
bool IsEndOfPara() const
Definition: wrtsh.hxx:197
bool StartDropDownFieldDlg(SwField *, bool bPrevButton, bool bNextButton, weld::Widget *pParentWin, FieldDialogPressedButton *pPressedButton=nullptr)
Definition: wrtsh2.cxx:290
bool CanInsert()
Definition: wrtsh1.cxx:2039
void ClickToINetAttr(const SwFormatINetFormat &rItem, LoadUrlFlags nFilter=LoadUrlFlags::NONE)
Definition: wrtsh2.cxx:455
const SwView & GetView() const
Definition: wrtsh.hxx:438
void disposeAndClear()
reference_type * get() const
void PaintImmediately()
#define FN_INSERT_TABLE
Definition: cmdid.h:227
#define FN_INSERT_FRAME
Definition: cmdid.h:231
#define FN_EDIT_FIELD
Definition: cmdid.h:77
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
Definition: dialoghelp.cxx:19
@ JE_FMT_GRAPHIC
Definition: docufld.hxx:127
@ JE_FMT_TABLE
Definition: docufld.hxx:125
@ JE_FMT_OLE
Definition: docufld.hxx:128
@ JE_FMT_FRAME
Definition: docufld.hxx:126
#define EXCHG_IN_ACTION_COPY
#define EXCHG_IN_ACTION_MOVE
@ TableOfAuthorities
static SwContentNode * GetContentNode(SwDoc &rDoc, SwPosition &rPos, bool bNext)
Definition: fltshell.cxx:54
sal_Int32 nIndex
OUString aName
#define SAL_WARN_IF(condition, area, stream)
int i
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
const sal_Unicode cTokenSeparator
const SvxPageUsage aArr[]
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
Definition: pam.cxx:1012
void Set(SwCallEventObjectType eTyp, const SwFrameFormat *pFormat)
Definition: swevent.hxx:87
Marks a position in the document model.
Definition: pam.hxx:37
@ EVENT_OBJECT_URLITEM
Definition: swevent.hxx:50
SwUndoId
Definition: swundo.hxx:30
LoadUrlFlags
Definition: swurl.hxx:27
RET_CANCEL
RET_YES
void LoadURL(SwViewShell &rVSh, const OUString &rURL, LoadUrlFlags nFilter, const OUString &rTargetFrameName)
Definition: wrtsh2.cxx:504