32#include <com/sun/star/document/UpdateDocMode.hpp>
35#include <bookmark.hxx>
57 const OUString m_Item;
61 explicit FindItem(OUString aS)
62 : m_Item(
std::move(aS)), pTableNd(nullptr), pSectNd(nullptr)
68 for (
const auto& rLinkIter : rLinks)
72 &&
dynamic_cast<const SwBaseLink*
>(&rLnk) !=
nullptr)
80 if( INetProtocol::File ==
aURL.GetProtocol() ||
81 INetProtocol::Cid ==
aURL.GetProtocol() )
100 (bCaseSensitive && (pBkmk->GetName() == sNameLc)) ||
101 (!bCaseSensitive &&
GetAppCharClass().lowercase(pBkmk->GetName()) == sNameLc)
112 bool lcl_FindSection(
const SwSectionFormat* pSectFormat, FindItem *
const pItem,
bool bCaseSensitive )
117 OUString sNm( bCaseSensitive
120 OUString sCompare( bCaseSensitive
123 if( sNm == sCompare )
140 bool lcl_FindTable(
const SwFrameFormat* pTableFormat, FindItem *
const pItem )
143 if ( sNm == pItem->m_Item )
171 : mbVisibleLinks(true)
172 , mbLinksUpdated( false )
173 , m_pLinkMgr( new
sfx2::LinkManager(nullptr) )
205 if (
eMode == SfxObjectCreateMode::INTERNAL)
207 if (
eMode == SfxObjectCreateMode::ORGANIZER)
215 if (nLinkMode ==
NEVER && nUpdateDocMode != document::UpdateDocMode::FULL_UPDATE)
218 bool bAskUpdate = nLinkMode ==
MANUAL;
220 switch(nUpdateDocMode)
222 case document::UpdateDocMode::NO_UPDATE: bUpdate =
false;
break;
223 case document::UpdateDocMode::QUIET_UPDATE:bAskUpdate =
false;
break;
224 case document::UpdateDocMode::FULL_UPDATE: bAskUpdate =
true;
break;
226 if (nLinkMode ==
AUTOMATIC && !bAskUpdate)
253 bool bCaseSensitive =
true;
261 OUString sItem( bCaseSensitive ? rItem :
GetAppCharClass().lowercase(rItem));
262 FindItem aPara( sItem );
265 if (!(lcl_FindSection(pFormat, &aPara, bCaseSensitive)))
273 if( !bCaseSensitive )
275 bCaseSensitive =
false;
281 if (!(lcl_FindTable(pFormat, &aPara)))
295 bool bCaseSensitive =
true;
305 OUString sItem( bCaseSensitive ? rItem :
GetAppCharClass().lowercase(rItem));
306 FindItem aPara( sItem );
309 if (!(lcl_FindSection(pFormat, &aPara, bCaseSensitive)))
317 if( !bCaseSensitive )
319 bCaseSensitive =
false;
323 FindItem aPara( sItem );
326 if (!(lcl_FindTable(pFormat, &aPara)))
336 bool bCaseSensitive =
true;
355 FindItem aPara(bCaseSensitive ? rItem :
GetAppCharClass().lowercase(rItem));
359 if (!(lcl_FindSection(pFormat, &aPara, bCaseSensitive)))
370 aPara.pSectNd->GetSection().SetRefObject( pObj );
376 if( !bCaseSensitive )
378 bCaseSensitive =
false;
385 if (!(lcl_FindTable(pFormat, &aPara)))
395 aPara.pTableNd->GetTable().SetRefObject(pObj);
407 const ::sfx2::SvBaseLinks& rLinks = rLnkMgr.
GetLinks();
408 if( !rLinks.empty() )
413 while(
nullptr != (pLnk = lcl_FindNextRemovableLink( rLinks ) ) )
463 bool bContinue =
false;
465 std::u16string_view sCmp( sItem.subView(
nPos + 1 ));
468 FindItem aPara(
sName );
470 if( sCmp ==
u"table" )
475 if (!(lcl_FindTable(pFormat, &aPara)))
485 else if( sCmp ==
u"frame" )
502 else if( sCmp ==
u"region" )
507 else if( sCmp ==
u"outline" )
522 nTmpPos < rOutlNds.
size() &&
523 nLvl < rOutlNds[ nTmpPos ]->GetTextNode()->
524 GetAttrOutlineLevel()-1;
528 if( nTmpPos < rOutlNds.
size() )
529 roRange->aEnd = *rOutlNds[ nTmpPos ];
541 bool bCaseSensitive =
true;
551 return static_cast<bool>(rpPam);
554 FindItem aPara( bCaseSensitive ? sItem : rCC.
lowercase( sItem ) );
560 if (!(lcl_FindSection(pFormat, &aPara, bCaseSensitive)))
566 *aPara.pSectNd->EndOfSectionNode() );
571 if( !bCaseSensitive )
573 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
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()
const SwFrameFormats * GetTableFrameFormats() const
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 SwSection & GetSection() const
const OUString & GetSectionName() const
const SwServerObject * GetObject() 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
const SwTable & GetTable() const
SwTable is one table in the document model, containing rows (which contain cells).
const SwServerObject * GetObject() const
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