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