23#include <osl/diagnose.h>
24#include <osl/thread.h>
25#include <rtl/ustrbuf.hxx>
55 virtual void Closed()
override;
56 virtual ::sfx2::SvBaseLink::UpdateResult
DataChanged(
57 const OUString& rMimeType,
const css::uno::Any & rValue )
override;
70 case SotClipboardFormatId::STRING:
74 if (!(rValue >>= sStr))
76 uno::Sequence< sal_Int8 >
aSeq;
78 sStr = OUString(
reinterpret_cast<char const*
>(
aSeq.getConstArray()),
aSeq.getLength(), osl_getThreadTextEncoding());
82 sal_Int32
n = sStr.getLength();
83 while( n && 0 == sStr[ n-1 ] )
85 if( n && 0x0a == sStr[ n-1 ] )
87 if( n && 0x0d == sStr[ n-1 ] )
90 bool bDel =
n != sStr.getLength();
92 sStr = sStr.copy( 0, n );
94 m_rFieldType.SetExpansion(sStr);
96 m_rFieldType.SetCRLFDelFlag(bDel);
106 m_rFieldType.UpdateDDE();
111void SwIntrnlRefLink::Closed()
113 if (m_rFieldType.GetDoc() && !m_rFieldType.GetDoc()->IsInDtor())
119 pESh->StartAllAction();
120 pESh->FieldToText(&m_rFieldType);
121 pESh->EndAllAction();
130 SvBaseLink::Closed();
135const SwNode* SwIntrnlRefLink::GetAnchor()
const
138 const SwNode* pNd =
nullptr;
139 m_rFieldType.CallSwClientNotify(
146 bool bInRange =
false;
157 m_RefLink =
new SwIntrnlRefLink( *
this, nUpdateType );
185 OUString
aStr = _aStr;
206 OSL_ENSURE( !
m_nRefCount,
"How do we get the references?" );
236 sal_Int32 nPart = -1;
243 rVal <<=
GetType() == SfxLinkUpdateMode::ALWAYS;
257 sal_Int32 nPart = -1;
264 SetType( *o3tl::doAccess<bool>(rVal) ?
265 SfxLinkUpdateMode::ALWAYS :
266 SfxLinkUpdateMode::ONCALL );
277 const OUString sOldCmd(
GetCmd() );
278 OUStringBuffer sNewCmd;
280 for (sal_Int32
i=0;
i<3; ++
i)
287 sNewCmd.append((
i < 2)
290 SetCmd( sNewCmd.makeStringAndClear() );
300 SwEditShell* pESh = bNotifyShells ? pDoc->GetEditShell() :
nullptr;
305 std::vector<SwFormatField*> vFields;
306 std::vector<SwDDETable*> vTables;
309 const bool bDoAction = vFields.size() || vTables.size();
319 for(
auto pTable: vTables)
320 pTable->ChangeContent();
343 if(
GetTyp()->HasOnlyOneListener() )
353 if (
aStr.endsWith(
"|"))
355 return aStr.copy(0,
aStr.getLength()-1);
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual sfx2::LinkManager & GetLinkManager()=0
virtual bool IsVisibleLinks() const =0
Insert links in-/visibly into LinkManager (linked ranges).
virtual void SetModified()=0
Must be called manually at changes of format.
static SotClipboardFormatId GetFormatIdFromMimeType(std::u16string_view rMimeType)
virtual void Closed() override
virtual bool IsInRange(SwNodeOffset nSttNd, SwNodeOffset nEndNd) const
virtual const SwNode * GetAnchor() const
virtual ::sfx2::SvBaseLink::UpdateResult DataChanged(const OUString &rMimeType, const css::uno::Any &rValue) override
void UpdateDDE(const bool bNotifyShells=true)
virtual std::unique_ptr< SwFieldType > Copy() const override
OUString const & GetCmd() const
SfxLinkUpdateMode GetType() const
SAL_DLLPRIVATE void RefCntChgd()
void SetCmd(const OUString &aStr)
virtual ~SwDDEFieldType() override
virtual void QueryValue(css::uno::Any &rVal, sal_uInt16 nWhich) const override
tools::SvRef< sfx2::SvBaseLink > m_RefLink
void SetType(SfxLinkUpdateMode nType)
SwDDEFieldType(OUString aName, const OUString &rCmd, SfxLinkUpdateMode)
virtual OUString GetName() const override
Only in derived classes.
const SwDoc * GetDoc() const
virtual void PutValue(const css::uno::Any &rVal, sal_uInt16 nWhich) override
virtual OUString GetPar1() const override
Get parameter via types.
virtual ~SwDDEField() override
virtual void SetPar2(const OUString &rStr) override
set field type command
SwDDEField(SwDDEFieldType *)
virtual std::unique_ptr< SwField > Copy() const override
virtual OUString ExpandImpl(SwRootFrame const *pLayout) const override
virtual OUString GetPar2() const override
get field type command
IDocumentState const & getIDocumentState() const
IDocumentLinksAdministration const & getIDocumentLinksAdministration() const
SwEditShell const * GetEditShell() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
void StartAllAction()
For all views of this document.
Instances of SwFields and those derived from it occur 0 to n times.
void GatherDdeTables(std::vector< SwDDETable * > &rvTables) const
void GatherFields(std::vector< SwFormatField * > &rvFormatFields, bool bCollectOnlyInDocNodes=true) const
Base class of all fields.
SwFieldType * GetTyp() const
Base class of the Writer document model elements.
The root element of a Writer document layout.
void EndAction(const bool bIdleEnd=false)
const IDocumentLayoutAccess & getIDocumentLayoutAccess() const
Provides access to the document layout interface.
void InsertDDELink(SvBaseLink *, const OUString &rServer, std::u16string_view rTopic, std::u16string_view rItem)
void Remove(SvBaseLink const *pLink)
virtual OUString GetName() const override
Sequence< sal_Int8 > aSeq
const sal_Unicode cTokenSeparator
virtual ~LinkAnchorSearchHint() override
bool IsInRange(const WhichRangesContainer &pRange, const sal_uInt16 nId)
check if ID is in range of attribute set IDs
#define FIELD_PROP_SUBTYPE