32#include <com/sun/star/document/UpdateDocMode.hpp>
35#include <bookmark.hxx>
57 for (
const auto& rLinkIter : rLinks)
61 &&
dynamic_cast<const SwBaseLink*
>(&rLnk) !=
nullptr)
69 if( INetProtocol::File ==
aURL.GetProtocol() ||
70 INetProtocol::Cid ==
aURL.GetProtocol() )
89 (bCaseSensitive && (pBkmk->GetName() == sNameLc)) ||
90 (!bCaseSensitive &&
GetAppCharClass().lowercase(pBkmk->GetName()) == sNameLc)
101 SwSectionNode* lcl_FindSection(
const SwDoc& rDoc,
const OUString& rItem,
bool bCaseSensitive)
106 SwSection* pSect = pSectFormat->GetSection();
114 const SwNodeIndex* pIdx = pSectFormat->GetContent().GetContentIdx();
115 if (pIdx && &pSectFormat->GetDoc()->GetNodes() == &pIdx->
GetNodes())
161 : mbVisibleLinks(true)
162 , mbLinksUpdated( false )
163 , m_pLinkMgr( new
sfx2::LinkManager(nullptr) )
195 if (
eMode == SfxObjectCreateMode::INTERNAL)
197 if (
eMode == SfxObjectCreateMode::ORGANIZER)
205 if (nLinkMode ==
NEVER && nUpdateDocMode != document::UpdateDocMode::FULL_UPDATE)
208 bool bAskUpdate = nLinkMode ==
MANUAL;
210 switch(nUpdateDocMode)
212 case document::UpdateDocMode::NO_UPDATE: bUpdate =
false;
break;
213 case document::UpdateDocMode::QUIET_UPDATE:bAskUpdate =
false;
break;
214 case document::UpdateDocMode::FULL_UPDATE: bAskUpdate =
true;
break;
216 if (nLinkMode ==
AUTOMATIC && !bAskUpdate)
243 bool bCaseSensitive =
true;
256 if( !bCaseSensitive )
258 bCaseSensitive =
false;
273 bool bCaseSensitive =
true;
283 if (lcl_FindSection(
m_rDoc, rItem, bCaseSensitive))
288 if( !bCaseSensitive )
290 bCaseSensitive =
false;
293 (void)lcl_FindTable(
m_rDoc, rItem);
299 bool bCaseSensitive =
true;
325 pSectNd->GetSection().SetRefObject( pObj );
330 if( !bCaseSensitive )
332 bCaseSensitive =
false;
343 pTableNd->GetTable().SetRefObject(pObj);
356 const ::sfx2::SvBaseLinks& rLinks = rLnkMgr.
GetLinks();
357 if( !rLinks.empty() )
362 while(
nullptr != (pLnk = lcl_FindNextRemovableLink( rLinks ) ) )
411 std::u16string_view sCmp( sItem.subView(
nPos + 1 ));
413 if( sCmp ==
u"table" )
420 return roRange.has_value();
422 else if( sCmp ==
u"frame" )
437 return roRange.has_value();
439 else if( sCmp ==
u"region" )
443 else if( sCmp ==
u"outline" )
458 nTmpPos < rOutlNds.
size() &&
459 nLvl < rOutlNds[ nTmpPos ]->GetTextNode()->
460 GetAttrOutlineLevel()-1;
464 if( nTmpPos < rOutlNds.
size() )
465 roRange->aEnd = *rOutlNds[ nTmpPos ];
469 return roRange.has_value();
474 bool bCaseSensitive =
true;
484 return static_cast<bool>(rpPam);
492 *pSectNd->EndOfSectionNode() );
497 if( !bCaseSensitive )
499 bCaseSensitive =
false;
OUString lowercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
Provides access to the marks of a document.
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
virtual const_iterator_t getAllMarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence of marks.
virtual void SetModified()=0
Must be called manually at changes of format.
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
SfxMedium * GetMedium() const
SfxObjectCreateMode GetCreateMode() const
virtual comphelper::EmbeddedObjectContainer & getEmbeddedObjectContainer() const override
sal_Int16 GetUpdateDocMode() const
SwSectionFormats & GetSections()
IDocumentState const & getIDocumentState() const
const sw::TableFrameFormats * GetTableFrameFormats() const
bool GotoOutline(SwPosition &rPos, const OUString &rName, SwRootFrame const *=nullptr) const
IDocumentUndoRedo & GetIDocumentUndoRedo()
const SwFlyFrameFormat * FindFlyByName(const OUString &rName, SwNodeType nNdTyp=SwNodeType::NONE) const
IDocumentMarkAccess * getIDocumentMarkAccess()
::sw::DocumentSettingManager & GetDocumentSettingManager()
SwDocShell * GetDocShell()
const SwNodeIndex * GetContentIdx() const
Marks a node in the document model.
const SwNodes & GetNodes() const
Base class of the Writer document model elements.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwSectionNode * GetSectionNode()
bool IsNoTextNode() const
SwNodes & GetNodes()
Node is in which nodes-array/doc?
SwTableNode * FindTableNode()
Search table node, in which it is.
const SwEndNode * EndOfSectionNode() const
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
bool Seek_Entry(SwNode *rP, size_type *pnPos) const
PaM is Point and Mark: a selection of the document model.
A section node represents the start of a section on the UI, i.e.
const OUString & GetSectionName() const
virtual bool GetData(css::uno::Any &rData, const OUString &rMimeType, bool bSynchron=false) override
SwTableBox is one table cell in the document model.
const SwStartNode * GetSttNd() const
SwTable is one table in the document model, containing rows (which contain cells).
static SwTable * FindTable(SwFrameFormat const *const pFormat)
SwTableSortBoxes & GetTabSortBoxes()
int GetAttrOutlineLevel() const
Returns outline level of this text node.
void setUserAllowsLinkUpdate(bool bNew)
std::vector< Value >::size_type size_type
static bool GetDisplayNames(const SvBaseLink *, OUString *pType, OUString *pFile=nullptr, OUString *pLink=nullptr, OUString *pFilter=nullptr)
bool InsertServer(SvLinkSource *rObj)
void UpdateAllLinks(bool bAskUpdate, bool bUpdateGrfLinks, weld::Window *pParentWin)
void Remove(SvBaseLink const *pLink)
const SvBaseLinks & GetLinks() const
SvBaseLinkObjectType GetObjType() const
bool SelectServerObj(std::u16string_view rStr, SwPaM *&rpPam, std::optional< SwNodeRange > &rpRange) const
DocumentLinksAdministrationManager(SwDoc &i_rSwdoc)
bool EmbedAllLinks() override
embedded all local links (Areas/Graphics)
virtual ~DocumentLinksAdministrationManager() override
bool LinksUpdated() const override
bool IsVisibleLinks() const override
Insert links in-/visibly into LinkManager (linked ranges).
bool GetData(const OUString &rItem, const OUString &rMimeType, css::uno::Any &rValue) const override
for linking of parts of documents.
void SetLinksUpdated(const bool bNewLinksUpdated) override
sfx2::LinkManager & GetLinkManager() override
::sfx2::SvLinkSource * CreateLinkSource(const OUString &rItem) override
void SetData(const OUString &rItem) override
void UpdateLinks() override
#i42634# Moved common code of SwReader::Read() and SwDocShell::UpdateLinks() to new SwDoc::UpdateLink...
std::unique_ptr< sfx2::LinkManager > m_pLinkMgr
void SetVisibleLinks(bool bFlag) override
virtual sal_uInt16 getLinkUpdateMode(bool bGlobalSettings) const override
Get the current link update mode.
const SwServerObject * GetRefObject() const
void SetRefObject(SwServerObject *pObj)
bool IsExpanded() const override
SwPosition & GetMarkPos() const override
SwPosition & GetOtherMarkPos() const override
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
CharClass & GetAppCharClass()
bool isTrustedLocationUriForUpdatingLinks(OUString const &uri)
Dialog to specify the properties of date form field.
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Marks a position in the document model.
const sal_Unicode cMarkSeparator