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