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)
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 ( HasSelection() )
86  {
87  if ( rField.GetTyp()->Which() == SwFieldIds::Postit )
88  {
89  // for annotation fields:
90  // - keep the current selection in order to create a corresponding annotation mark
91  // - collapse cursor to its end
92  if ( IsTableMode() )
93  {
94  GetTableCrs()->Normalize( false );
95  const SwPosition rStartPos( *(GetTableCrs()->GetMark()->nNode.GetNode().GetContentNode()), 0 );
96  KillPams();
97  if ( !IsEndOfPara() )
98  {
99  EndPara();
100  }
101  const SwPosition rEndPos( *GetCurrentShellCursor().GetPoint() );
102  pAnnotationTextRange.reset(new SwPaM( rStartPos, rEndPos ));
103  }
104  else
105  {
106  NormalizePam( false );
107  const SwPaM& rCurrPaM = GetCurrentShellCursor();
108  pAnnotationTextRange.reset(new SwPaM( *rCurrPaM.GetPoint(), *rCurrPaM.GetMark() ));
109  ClearMark();
110  }
111  }
112  else
113  {
114  bDeleted = DelRight();
115  }
116  }
117 
118  SwEditShell::Insert2(rField, bDeleted);
119 
120  if ( pAnnotationTextRange )
121  {
122  if ( GetDoc() != nullptr )
123  {
125  pMarksAccess->makeAnnotationMark( *pAnnotationTextRange, OUString() );
126  }
127  pAnnotationTextRange.reset();
128  }
129 
130  EndUndo();
131  EndAllAction();
132 }
133 
134 // Start the field update
135 
137 {
138  // Go through the list of fields and updating
139  std::unique_ptr<SwInputFieldList> pTmp;
140  if (!pLst)
141  {
142  pTmp.reset(new SwInputFieldList( this ));
143  pLst = pTmp.get();
144  }
145 
146  const size_t nCnt = pLst->Count();
147  if(nCnt)
148  {
149  pLst->PushCursor();
150 
151  bool bCancel = false;
152 
153  size_t nIndex = 0;
155 
156  SwField* pField = GetCurField();
157  if (pField)
158  {
159  for (size_t i = 0; i < nCnt; i++)
160  {
161  if (pField == pLst->GetField(i))
162  {
163  nIndex = i;
164  break;
165  }
166  }
167  }
168 
169  while (!bCancel)
170  {
171  bool bPrev = nIndex > 0;
172  bool bNext = nIndex < nCnt - 1;
173  pLst->GotoFieldPos(nIndex);
174  pField = pLst->GetField(nIndex);
175  if (pField->GetTyp()->Which() == SwFieldIds::Dropdown)
176  {
177  bCancel = StartDropDownFieldDlg(pField, bPrev, bNext, GetView().GetFrameWeld(), &ePressedButton);
178  }
179  else
180  bCancel = StartInputFieldDlg(pField, bPrev, bNext, GetView().GetFrameWeld(), &ePressedButton);
181 
182  if (!bCancel)
183  {
184  // Otherwise update error at multi-selection:
185  pLst->GetField(nIndex)->GetTyp()->UpdateFields();
186 
187  if (ePressedButton == FieldDialogPressedButton::Previous && nIndex > 0)
188  nIndex--;
189  else if (ePressedButton == FieldDialogPressedButton::Next && nIndex < nCnt - 1)
190  nIndex++;
191  else
192  bCancel = true;
193  }
194  }
195 
196  pLst->PopCursor();
197  }
198 }
199 
200 // Listener class: will close InputField dialog if input field(s)
201 // is(are) deleted (for instance, by an extension) after the dialog shows up.
202 // Otherwise, the for loop in SwWrtShell::UpdateInputFields will crash when doing:
203 // 'pTmp->GetField( i )->GetTyp()->UpdateFields();'
204 // on a deleted field.
206 {
207  public:
209  : mpInputFieldDlg(pInputFieldDlg)
210  , mpFormatField(nullptr)
211  {
212  SwInputField *const pInputField(dynamic_cast<SwInputField*>(pField));
213  SwSetExpField *const pSetExpField(dynamic_cast<SwSetExpField*>(pField));
214 
215  if (pInputField && pInputField->GetFormatField())
216  {
217  mpFormatField = pInputField->GetFormatField();
218  }
219  else if (pSetExpField && pSetExpField->GetFormatField())
220  {
221  mpFormatField = pSetExpField->GetFormatField();
222  }
223 
224  // Register for possible field deletion while dialog is open
225  if (mpFormatField)
226  mpFormatField->Add(this);
227  }
228 
229  virtual ~FieldDeletionModify() override
230  {
231  // Dialog closed, remove modification listener
232  EndListeningAll();
233  }
234 
235  void Modify( const SfxPoolItem* pOld, const SfxPoolItem *) override
236  {
237  // Input field has been deleted: better to close the dialog
238  if (pOld)
239  {
240  switch (pOld->Which())
241  {
243  case RES_OBJECTDYING:
244  mpFormatField = nullptr;
246  break;
247  }
248  }
249  }
250  private:
253 };
254 
255 // Start input dialog for a specific field
256 bool SwWrtShell::StartInputFieldDlg(SwField* pField, bool bPrevButton, bool bNextButton,
257  weld::Widget* pParentWin, SwWrtShell::FieldDialogPressedButton* pPressedButton)
258 {
259 
261  ScopedVclPtr<AbstractFieldInputDlg> pDlg(pFact->CreateFieldInputDlg(pParentWin, *this, pField, bPrevButton, bNextButton));
262 
263  bool bRet;
264 
265  {
266  FieldDeletionModify aModify(pDlg.get(), pField);
267  bRet = RET_CANCEL == pDlg->Execute();
268  }
269 
270  if (pPressedButton)
271  {
272  if (pDlg->PrevButtonPressed())
273  *pPressedButton = FieldDialogPressedButton::Previous;
274  else if (pDlg->NextButtonPressed())
275  *pPressedButton = FieldDialogPressedButton::Next;
276  }
277 
278  pDlg.disposeAndClear();
279  GetWin()->Update();
280  return bRet;
281 }
282 
283 bool SwWrtShell::StartDropDownFieldDlg(SwField* pField, bool bPrevButton, bool bNextButton,
284  weld::Widget* pParentWin, SwWrtShell::FieldDialogPressedButton* pPressedButton)
285 {
287  ScopedVclPtr<AbstractDropDownFieldDialog> pDlg(pFact->CreateDropDownFieldDialog(pParentWin, *this, pField, bPrevButton, bNextButton));
288  const short nRet = pDlg->Execute();
289 
290  if (pPressedButton)
291  {
292  if (pDlg->PrevButtonPressed())
293  *pPressedButton = FieldDialogPressedButton::Previous;
294  else if (pDlg->NextButtonPressed())
295  *pPressedButton = FieldDialogPressedButton::Next;
296  }
297 
298  pDlg.disposeAndClear();
299  bool bRet = RET_CANCEL == nRet;
300  GetWin()->Update();
301  if(RET_YES == nRet)
302  {
303  GetView().GetViewFrame()->GetDispatcher()->Execute(FN_EDIT_FIELD, SfxCallMode::SYNCHRON);
304  }
305  return bRet;
306 }
307 
308 // Insert directory - remove selection
309 
310 void SwWrtShell::InsertTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet)
311 {
312  if(!CanInsert())
313  return;
314 
315  if(HasSelection())
316  DelRight();
317 
318  SwEditShell::InsertTableOf(rTOX, pSet);
319 }
320 
321 // Update directory - remove selection
322 
323 void SwWrtShell::UpdateTableOf(const SwTOXBase& rTOX, const SfxItemSet* pSet)
324 {
325  if(CanInsert())
326  {
327  SwEditShell::UpdateTableOf(rTOX, pSet);
328  }
329 }
330 
331 // handler for click on the field given as parameter.
332 // the cursor is positioned on the field.
333 
334 void SwWrtShell::ClickToField( const SwField& rField )
335 {
336  // cross reference field must not be selected because it moves the cursor
337  if (SwFieldIds::GetRef != rField.GetTyp()->Which())
338  {
339  StartAllAction();
340  Right( CRSR_SKIP_CHARS, true, 1, false ); // Select the field.
341  NormalizePam();
342  EndAllAction();
343  }
344 
345  m_bIsInClickToEdit = true;
346  switch( rField.GetTyp()->Which() )
347  {
349  {
350  sal_uInt16 nSlotId = 0;
351  switch( rField.GetFormat() )
352  {
353  case JE_FMT_TABLE:
354  nSlotId = FN_INSERT_TABLE;
355  break;
356 
357  case JE_FMT_FRAME:
358  nSlotId = FN_INSERT_FRAME;
359  break;
360 
361  case JE_FMT_GRAPHIC: nSlotId = SID_INSERT_GRAPHIC; break;
362  case JE_FMT_OLE: nSlotId = SID_INSERT_OBJECT; break;
363 
364  }
365 
366  if( nSlotId )
367  {
369  //#97295# immediately select the right shell
371  GetView().GetViewFrame()->GetDispatcher()->Execute( nSlotId,
372  SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
374  }
375  }
376  break;
377 
378  case SwFieldIds::Macro:
379  {
380  const SwMacroField *pField = static_cast<const SwMacroField*>(&rField);
381  const OUString sText( rField.GetPar2() );
382  OUString sRet( sText );
383  ExecMacro( pField->GetSvxMacro(), &sRet );
384 
385  // return value changed?
386  if( sRet != sText )
387  {
388  StartAllAction();
389  const_cast<SwField&>(rField).SetPar2( sRet );
390  rField.GetTyp()->UpdateFields();
391  EndAllAction();
392  }
393  }
394  break;
395 
396  case SwFieldIds::GetRef:
397  StartAllAction();
398  SwCursorShell::GotoRefMark( static_cast<const SwGetRefField&>(rField).GetSetRefName(),
399  static_cast<const SwGetRefField&>(rField).GetSubType(),
400  static_cast<const SwGetRefField&>(rField).GetSeqNo() );
401  EndAllAction();
402  break;
403 
404  case SwFieldIds::Input:
405  {
406  const SwInputField* pInputField = dynamic_cast<const SwInputField*>(&rField);
407  if ( pInputField == nullptr )
408  {
409  StartInputFieldDlg(const_cast<SwField*>(&rField), false, false, GetView().GetFrameWeld());
410  }
411  }
412  break;
413 
414  case SwFieldIds::SetExp:
415  if( static_cast<const SwSetExpField&>(rField).GetInputFlag() )
416  StartInputFieldDlg(const_cast<SwField*>(&rField), false, false, GetView().GetFrameWeld());
417  break;
418  case SwFieldIds::Dropdown :
419  StartDropDownFieldDlg(const_cast<SwField*>(&rField), false, false, GetView().GetFrameWeld());
420  break;
421  default:
422  SAL_WARN_IF(rField.IsClickable(), "sw", "unhandled clickable field!");
423  }
424 
425  m_bIsInClickToEdit = false;
426 }
427 
429 {
430  if( rItem.GetValue().isEmpty() )
431  return ;
432 
433  m_bIsInClickToEdit = true;
434 
435  // At first run the possibly set ObjectSelect Macro
436  const SvxMacro* pMac = rItem.GetMacro( SvMacroItemId::OnClick );
437  if( pMac )
438  {
439  SwCallMouseEvent aCallEvent;
440  aCallEvent.Set( &rItem );
441  GetDoc()->CallEvent( SvMacroItemId::OnClick, aCallEvent );
442  }
443 
444  // So that the implementation of templates is displayed immediately
445  ::LoadURL( *this, rItem.GetValue(), nFilter, rItem.GetTargetFrame() );
446  const SwTextINetFormat* pTextAttr = rItem.GetTextINetFormat();
447  if( pTextAttr )
448  {
449  const_cast<SwTextINetFormat*>(pTextAttr)->SetVisited( true );
450  const_cast<SwTextINetFormat*>(pTextAttr)->SetVisitedValid( true );
451  }
452 
453  m_bIsInClickToEdit = false;
454 }
455 
456 bool SwWrtShell::ClickToINetGrf( const Point& rDocPt, LoadUrlFlags nFilter )
457 {
458  bool bRet = false;
459  OUString sURL;
460  OUString sTargetFrameName;
461  const SwFrameFormat* pFnd = IsURLGrfAtPos( rDocPt, &sURL, &sTargetFrameName );
462  if( pFnd && !sURL.isEmpty() )
463  {
464  bRet = true;
465  // At first run the possibly set ObjectSelect Macro
466  SwCallMouseEvent aCallEvent;
467  aCallEvent.Set(EVENT_OBJECT_URLITEM, pFnd);
468  GetDoc()->CallEvent(SvMacroItemId::OnClick, aCallEvent);
469 
470  ::LoadURL(*this, sURL, nFilter, sTargetFrameName);
471  }
472  return bRet;
473 }
474 
475 void LoadURL( SwViewShell& rVSh, const OUString& rURL, LoadUrlFlags nFilter,
476  const OUString& rTargetFrameName )
477 {
478  OSL_ENSURE( !rURL.isEmpty(), "what should be loaded here?" );
479  if( rURL.isEmpty() )
480  return ;
481 
482  // The shell could be 0 also!!!!!
483  if ( dynamic_cast<const SwCursorShell*>( &rVSh) == nullptr )
484  return;
485 
486  OUString sFileURL = rURL;
487  INetURLObject aURL( sFileURL );
488  if( aURL.GetProtocol() == INetProtocol::NotValid && !sFileURL.startsWith("#") )
489  {
490  // May be the relative link -> try to convert to absolute path
491  OUString sParentPath =
492  rVSh.GetDoc()->GetDocShell()->GetMedium()->GetURLObject().GetPath();
493 
494  bool bCorrectURL = true;
495  aURL = INetURLObject();
496  bCorrectURL &= aURL.setFSysPath( sParentPath, FSysStyle::Detect );
497  bCorrectURL &= aURL.insertName( sFileURL );
498 
499  if( bCorrectURL )
501  }
502 
503  // We are doing tiledRendering, let the client handles the URL loading,
504  // unless we are jumping to a TOC mark.
505  if (comphelper::LibreOfficeKit::isActive() && !rURL.startsWith("#"))
506  {
507  rVSh.GetSfxViewShell()->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, sFileURL.toUtf8().getStr());
508  return;
509  }
510 
511  //A CursorShell is always a WrtShell
512  SwWrtShell &rSh = static_cast<SwWrtShell&>(rVSh);
513 
514  SwDocShell* pDShell = rSh.GetView().GetDocShell();
515  OSL_ENSURE( pDShell, "No DocShell?!");
516  OUString sTargetFrame(rTargetFrameName);
517  if (sTargetFrame.isEmpty() && pDShell)
518  {
519  using namespace ::com::sun::star;
520  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
521  pDShell->GetModel(), uno::UNO_QUERY_THROW);
522  uno::Reference<document::XDocumentProperties> xDocProps
523  = xDPS->getDocumentProperties();
524  sTargetFrame = xDocProps->getDefaultTarget();
525  }
526 
527  OUString sReferer;
528  if( pDShell && pDShell->GetMedium() )
529  sReferer = pDShell->GetMedium()->GetName();
530  SfxViewFrame* pViewFrame = rSh.GetView().GetViewFrame();
531  SfxFrameItem aView( SID_DOCFRAME, pViewFrame );
532  SfxStringItem aName( SID_FILE_NAME, sFileURL );
533  SfxStringItem aTargetFrameName( SID_TARGETNAME, sTargetFrame );
534  SfxStringItem aReferer( SID_REFERER, sReferer );
535 
536  SfxBoolItem aNewView( SID_OPEN_NEW_VIEW, false );
537  //#39076# Silent can be removed accordingly to SFX.
538  SfxBoolItem aBrowse( SID_BROWSE, true );
539 
541  aTargetFrameName.SetValue( "_blank" );
542 
543  const SfxPoolItem* aArr[] = {
544  &aName,
545  &aNewView, /*&aSilent,*/
546  &aReferer,
547  &aView, &aTargetFrameName,
548  &aBrowse,
549  nullptr
550  };
551 
552  pViewFrame->GetDispatcher()->GetBindings()->Execute( SID_OPENDOC, aArr,
553  SfxCallMode::ASYNCHRON|SfxCallMode::RECORD );
554 }
555 
557  const sal_uInt16 nAction )
558 {
559  if( EXCHG_IN_ACTION_COPY == nAction )
560  {
561  // Insert
562  OUString sURL = rBkmk.GetURL();
563  // Is this is a jump within the current Doc?
564  const SwDocShell* pDocShell = GetView().GetDocShell();
565  if(pDocShell->HasName())
566  {
567  const OUString rName = pDocShell->GetMedium()->GetURLObject().GetURLNoMark();
568 
569  if (sURL.startsWith(rName))
570  {
571  if (sURL.getLength()>rName.getLength())
572  {
573  sURL = sURL.copy(rName.getLength());
574  }
575  else
576  {
577  sURL.clear();
578  }
579  }
580  }
581  SwFormatINetFormat aFormat( sURL, OUString() );
582  InsertURL( aFormat, rBkmk.GetDescription() );
583  }
584  else
585  {
587  OUString aLinkFile = rBkmk.GetURL().getToken(0, '#')
588  + OUStringLiteral1(sfx2::cTokenSeparator)
589  + OUStringLiteral1(sfx2::cTokenSeparator)
590  + rBkmk.GetURL().getToken(1, '#');
591  aSection.SetLinkFileName( aLinkFile );
592  aSection.SetProtectFlag( true );
593  const SwSection* pIns = InsertSection( aSection );
594  if( EXCHG_IN_ACTION_MOVE == nAction && pIns )
595  {
596  aSection = SwSectionData(*pIns);
597  aSection.SetLinkFileName( OUString() );
598  aSection.SetType( CONTENT_SECTION );
599  aSection.SetProtectFlag( false );
600 
601  // the update of content from linked section at time delete
602  // the undostack. Then the change of the section don't create
603  // any undoobject. - BUG 69145
604  bool bDoesUndo = DoesUndo();
605  SwUndoId nLastUndoId(SwUndoId::EMPTY);
606  if (GetLastUndoInfo(nullptr, & nLastUndoId))
607  {
608  if (SwUndoId::INSSECTION != nLastUndoId)
609  {
610  DoUndo(false);
611  }
612  }
613  UpdateSection( GetSectionFormatPos( *pIns->GetFormat() ), aSection );
614  DoUndo( bDoesUndo );
615  }
616  }
617 }
618 
619 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void EndDialog(sal_Int32 nResult) override=0
SfxViewFrame * GetViewFrame() const
void StopShellTimer()
Definition: view.cxx:1759
bool ClickToINetGrf(const Point &rDocPt, LoadUrlFlags nFilter)
Definition: wrtsh2.cxx:456
#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:1010
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:613
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:368
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
SwDocShell * GetDocShell()
Definition: doc.hxx:1340
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
Definition: fldbas.hxx:387
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
void Insert(SwField const &)
Definition: wrtsh2.cxx:71
bool IsTableMode() const
Definition: crsrsh.hxx:643
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:279
Provides access to the marks of a document.
void ClickToField(const SwField &rField)
Definition: wrtsh2.cxx:334
SwSection const * InsertSection(SwSectionData &rNewData, SfxItemSet const *const =nullptr)
Definition: edsect.cxx:35
void Modify(const SfxPoolItem *pOld, const SfxPoolItem *) override
Definition: wrtsh2.cxx:235
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:136
SwSectionFormat * GetFormat()
Definition: section.hxx:337
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:1348
void NavigatorPaste(const NaviContentBookmark &rBkmk, const sal_uInt16 nAction)
Definition: wrtsh2.cxx:556
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:292
const SwTextINetFormat * GetTextINetFormat() const
Definition: fmtinfmt.hxx:70
void UpdateFields() const
Definition: fldbas.hxx:271
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:86
sal_uInt16 CallEvent(SvMacroItemId nEvent, const SwCallMouseEvent &rCallEvent, bool bChkPtr=false)
Definition: docbasic.cxx:130
bool setFSysPath(OUString const &rFSysPath, FSysStyle eStyle)
void LoadURL(SwViewShell &rVSh, const OUString &rURL, LoadUrlFlags nFilter, const OUString &rTargetFrameName)
Definition: wrtsh2.cxx:475
const OUString & GetValue() const
Definition: fmtinfmt.hxx:75
const SwView & GetView() const
Definition: wrtsh.hxx:424
RET_YES
bool m_bIsInClickToEdit
Definition: wrtsh.hxx:566
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:958
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 insertName(OUString const &rTheName, bool bAppendFinalSlash=false, sal_Int32 nIndex=LAST_SEGMENT, EncodeMechanism eMechanism=EncodeMechanism::WasEncoded, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
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:323
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:520
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:176
bool HasSelection() const
Definition: wrtsh.hxx:137
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:428
#define FN_INSERT_TABLE
Definition: cmdid.h:207
const SwPaM * GetTableCrs() const
Definition: crsrsh.hxx:900
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:283
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:310
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
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:256
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
bool HasName() const
virtual ~FieldDeletionModify() override
Definition: wrtsh2.cxx:229
virtual OUString GetPar2() const
Definition: fldbas.cxx:276
SwDocShell * GetDocShell()
Definition: view.cxx:1115
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:208
SwFieldType * GetTyp() const
Definition: fldbas.hxx:382
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
#define FN_INSERT_FRAME
Definition: cmdid.h:210
SwFormatField * GetFormatField()
Definition: expfld.hxx:220
OUString GetPath() const
bool IsEndOfPara() const
Definition: wrtsh.hxx:186
#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
INetProtocol GetProtocol() const
SwFormatField * GetFormatField()
Definition: expfld.hxx:311
bool CanInsert()
Definition: wrtsh1.cxx:1701
const INetURLObject & GetURLObject() const
void ClearMark()
Definition: crsrsh.cxx:927
const SvxPageUsage aArr[]
OString const aName
#define RES_OBJECTDYING
Definition: hintids.hxx:283
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:252
bool DoesUndo() const
Definition: edws.cxx:202
VclPtr< AbstractFieldInputDlg > mpInputFieldDlg
Definition: wrtsh2.cxx:251
void StartAllAction()
For all views of this document.
Definition: edws.cxx:85
SwFieldIds Which() const
Definition: fldbas.hxx:265
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