30#include <osl/diagnose.h>
53#include <com/sun/star/document/XDocumentProperties.hpp>
54#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
58#include <LibreOfficeKit/LibreOfficeKitEnums.h>
75 bool bDeleted =
false;
76 std::optional<SwPaM> pAnnotationTextRange;
79 pAnnotationTextRange.emplace(*pAnnotationRange->
Start(), *pAnnotationRange->
End());
99 pAnnotationTextRange.emplace( rStartPos, rEndPos );
105 pAnnotationTextRange.emplace( *rCurrPaM.
GetPoint(), *rCurrPaM.
GetMark() );
117 if ( pAnnotationTextRange )
119 if (
GetDoc() !=
nullptr )
122 if (*rCurrPaM.
Start() == *pAnnotationTextRange->Start()
123 && *rCurrPaM.
End() == *pAnnotationTextRange->End())
128 if (pAnnotationTextRange->Start()->GetContentIndex() > 0)
129 pAnnotationTextRange->Start()->AdjustContent(-1);
134 pAnnotationTextRange.reset();
148 std::unique_ptr<SwInputFieldList> pTmp;
155 const size_t nCnt = pLst->
Count();
161 bool bCancel =
false;
169 for (
size_t i = 0;
i < nCnt;
i++)
182 bool bNext =
nIndex < nCnt - 1;
220 : mpInputFieldDlg(pInputFieldDlg)
221 , mpFormatField(nullptr)
226 if (pInputField && pInputField->GetFormatField())
228 mpFormatField = pInputField->GetFormatField();
230 else if (pSetExpField && pSetExpField->GetFormatField())
232 mpFormatField = pSetExpField->GetFormatField();
240 virtual ~FieldDeletionListener()
override
249 if(rHint.
GetId() == SfxHintId::Dying)
251 mpFormatField =
nullptr;
252 mpInputFieldDlg->EndDialog(RET_CANCEL);
273 FieldDeletionListener aModify(pDlg.
get(), pField);
279 if (pDlg->PrevButtonPressed())
281 else if (pDlg->NextButtonPressed())
295 const short nRet = pDlg->Execute();
299 if (pDlg->PrevButtonPressed())
301 else if (pDlg->NextButtonPressed())
359 sal_uInt16 nSlotId = 0;
371 case JE_FMT_OLE: nSlotId = SID_INSERT_OBJECT;
break;
381 SfxCallMode::SYNCHRON|SfxCallMode::RECORD );
390 const OUString sText( rField.
GetPar2() );
391 OUString sRet( sText );
398 const_cast<SwField&
>(rField).SetPar2( sRet );
407 if (!bExecHyperlinks)
413 if (!pField->HasURL())
418 const OUString& rURL = pField->GetAbsoluteURL();
434 if ( pInputField ==
nullptr )
442 if(
static_cast<const SwSetExpField&
>(rField).GetInputFlag() )
469 aCallEvent.
Set( &rItem );
489 OUString sTargetFrameName;
491 if( pFnd && !sURL.isEmpty() )
499 ::LoadURL(*
this, sURL, nFilter, sTargetFrameName);
505 const OUString& rTargetFrameName )
507 OSL_ENSURE( !rURL.isEmpty(),
"what should be loaded here?" );
527 OSL_ENSURE( pDShell,
"No DocShell?!");
528 OUString sTargetFrame(rTargetFrameName);
529 if (sTargetFrame.isEmpty() && pDShell)
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();
545 SfxStringItem aTargetFrameName( SID_TARGETNAME, sTargetFrame );
553 aTargetFrameName.
SetValue(
"_blank" );
559 &aView, &aTargetFrameName,
565 SfxCallMode::ASYNCHRON|SfxCallMode::RECORD );
569 const sal_uInt16 nAction )
574 OUString sURL = rBkmk.
GetURL();
581 if (sURL.startsWith(rName))
583 if (sURL.getLength()>rName.getLength())
585 sURL = sURL.copy(rName.getLength());
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
const OUString & GetDescription() const
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
const INetURLObject & GetURLObject() const
const OUString & GetName() 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
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()
invariant for SwAuthorityField is that it is always registered at its SwAuthorityFieldType via AddFie...
bool GotoRefMark(const OUString &rRefMark, sal_uInt16 nSubType, sal_uInt16 nSeqNo)
jump to reference marker
const SwPaM * GetTableCrs() const
virtual SwCursor & GetCurrentShellCursor() override
Return the current shell cursor.
void NormalizePam(bool bPointFirst=true)
Ensure point and mark of the current PaM are in a specific order.
SwField * GetCurField(const bool bIncludeInputFieldAtStart=false) const
sal_uInt16 CallEvent(SvMacroItemId nEvent, const SwCallMouseEvent &rCallEvent, bool bChkPtr=false)
IDocumentMarkAccess * getIDocumentMarkAccess()
bool InsertField(SwField const &, const bool bForceExpandHints)
add a field at the cursor position
void StartAllAction()
For all views of this document.
SwSection const * InsertSection(SwSectionData &rNewData, SfxItemSet const *const =nullptr)
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
bool InsertURL(const SwFormatINetFormat &rFormat, const OUString &rStr, bool bKeepSelection=false)
bool GetLastUndoInfo(OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const
void InsertTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
Insert content table. Renew if required.
void UpdateSection(size_t const nSect, SwSectionData &, SfxItemSet const *const =nullptr)
void UpdateTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
update tables of content
OUString GetUniqueSectionName(const OUString *pChkStr=nullptr) const
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
size_t GetSectionFormatPos(const SwSectionFormat &) const
void DoUndo(bool bOn=true)
Undo.
const SwFrameFormat * IsURLGrfAtPos(const Point &rPt, OUString *pURL=nullptr, OUString *pTargetFrameName=nullptr, OUString *pURLDescription=nullptr) const
Position is a graphic with URL?
virtual void UpdateFields()
Base class of all fields.
bool IsClickable() const
Is this field clickable?
sal_uInt32 GetFormat() const
Query parameters for dialog and for BASIC.
virtual OUString GetDescription() const
SwFieldType * GetTyp() const
virtual OUString GetPar2() const
SvxMacro GetSvxMacro() const
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetMark() const
void Normalize(bool bPointFirst=true)
Normalizes PaM, i.e.
const SwPosition * End() const
const SwPosition * GetPoint() const
const SwPosition * Start() const
void AddRule(SwUndoArg eWhat, const OUString &rWith)
SAL_DLLPRIVATE void SetProtectFlag(bool const bFlag)
void SetType(SectionType const eNew)
void SetLinkFileName(OUString const &rNew)
SwSectionFormat * GetFormat()
vcl::Window * GetWin() const
SfxViewShell * GetSfxViewShell() const
SwDocShell * GetDocShell()
Used by the UI to modify the document model.
void ClickToField(const SwField &rField, bool bExecHyperlinks)
bool ClickToINetGrf(const Point &rDocPt, LoadUrlFlags nFilter)
bool Right(SwCursorSkipMode nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
bool StartInputFieldDlg(SwField *, bool bPrevButton, bool bNextButton, weld::Widget *pParentWin, FieldDialogPressedButton *pPressedButton=nullptr)
void addCurrentPosition()
void InsertTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
void UpdateInputFields(SwInputFieldList *pLst=nullptr)
void EndPara(bool bSelect=false)
void UpdateTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
void ExecMacro(const SvxMacro &rMacro, OUString *pRet=nullptr, SbxArray *pArgs=nullptr)
void NavigatorPaste(const NaviContentBookmark &rBkmk, const sal_uInt16 nAction)
bool DelRight(bool isReplaceHeuristic=false)
bool HasSelection() const
bool InsertField2(SwField const &, SwPaM *pAnnotationRange=nullptr)
bool StartDropDownFieldDlg(SwField *, bool bPrevButton, bool bNextButton, weld::Widget *pParentWin, FieldDialogPressedButton *pPressedButton=nullptr)
void ClickToINetAttr(const SwFormatINetFormat &rItem, LoadUrlFlags nFilter=LoadUrlFlags::NONE)
const SwView & GetView() const
reference_type * get() const
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
#define EXCHG_IN_ACTION_COPY
#define EXCHG_IN_ACTION_MOVE
static SwContentNode * GetContentNode(SwDoc &rDoc, SwPosition &rPos, bool bNext)
#define SAL_WARN_IF(condition, area, stream)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
const sal_Unicode cTokenSeparator
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.
void Set(SwCallEventObjectType eTyp, const SwFrameFormat *pFormat)
Marks a position in the document model.
void LoadURL(SwViewShell &rVSh, const OUString &rURL, LoadUrlFlags nFilter, const OUString &rTargetFrameName)