32 #include <com/sun/star/document/UpdateDocMode.hpp>
38 #include <section.hxx>
56 const OUString m_Item;
60 explicit FindItem(
const OUString& rS)
61 : m_Item(rS), pTableNd(nullptr), pSectNd(nullptr)
67 for (
const auto& rLinkIter : rLinks)
71 && dynamic_cast<const SwBaseLink*>(&rLnk) !=
nullptr)
79 if( INetProtocol::File ==
aURL.GetProtocol() ||
80 INetProtocol::Cid ==
aURL.GetProtocol() )
99 (bCaseSensitive && (pBkmk->GetName() == sNameLc)) ||
111 bool lcl_FindSection(
const SwSectionFormat* pSectFormat, FindItem *
const pItem,
bool bCaseSensitive )
116 OUString sNm( bCaseSensitive
119 OUString sCompare( bCaseSensitive
122 if( sNm == sCompare )
139 bool lcl_FindTable(
const SwFrameFormat* pTableFormat, FindItem *
const pItem )
142 if ( sNm == pItem->m_Item )
170 : mbVisibleLinks(true)
171 , mbLinksUpdated( false )
172 , m_pLinkMgr( new
sfx2::LinkManager(nullptr) )
204 if (eMode == SfxObjectCreateMode::INTERNAL)
206 if (eMode == SfxObjectCreateMode::ORGANIZER)
214 if (nLinkMode ==
NEVER && nUpdateDocMode != document::UpdateDocMode::FULL_UPDATE)
217 bool bAskUpdate = nLinkMode ==
MANUAL;
219 switch(nUpdateDocMode)
221 case document::UpdateDocMode::NO_UPDATE: bUpdate =
false;
break;
222 case document::UpdateDocMode::QUIET_UPDATE:bAskUpdate =
false;
break;
223 case document::UpdateDocMode::FULL_UPDATE: bAskUpdate =
true;
break;
225 if (nLinkMode ==
AUTOMATIC && !bAskUpdate)
229 medium ==
nullptr ? OUString() : medium->
GetName()))
252 bool bCaseSensitive =
true;
260 OUString sItem( bCaseSensitive ? rItem :
GetAppCharClass().lowercase(rItem));
261 FindItem aPara( sItem );
264 if (!(lcl_FindSection(pFormat, &aPara, bCaseSensitive)))
272 if( !bCaseSensitive )
274 bCaseSensitive =
false;
280 if (!(lcl_FindTable(pFormat, &aPara)))
294 bool bCaseSensitive =
true;
304 OUString sItem( bCaseSensitive ? rItem :
GetAppCharClass().lowercase(rItem));
305 FindItem aPara( sItem );
308 if (!(lcl_FindSection(pFormat, &aPara, bCaseSensitive)))
316 if( !bCaseSensitive )
318 bCaseSensitive =
false;
322 FindItem aPara( sItem );
325 if (!(lcl_FindTable(pFormat, &aPara)))
335 bool bCaseSensitive =
true;
354 FindItem aPara(bCaseSensitive ? rItem :
GetAppCharClass().lowercase(rItem));
358 if (!(lcl_FindSection(pFormat, &aPara, bCaseSensitive)))
364 pObj = aPara.pSectNd->GetSection().GetObject();
369 aPara.pSectNd->GetSection().SetRefObject( pObj );
375 if( !bCaseSensitive )
377 bCaseSensitive =
false;
384 if (!(lcl_FindTable(pFormat, &aPara)))
389 pObj = aPara.pTableNd->GetTable().GetObject();
394 aPara.pTableNd->GetTable().SetRefObject(pObj);
406 const ::sfx2::SvBaseLinks& rLinks = rLnkMgr.
GetLinks();
407 if( !rLinks.empty() )
412 while(
nullptr != (pLnk = lcl_FindNextRemovableLink( rLinks ) ) )
462 bool bContinue =
false;
463 OUString
sName( sItem.copy( 0, nPos ) );
464 OUString sCmp( sItem.copy( nPos + 1 ));
467 FindItem aPara(
sName );
469 if( sCmp ==
"table" )
474 if (!(lcl_FindTable(pFormat, &aPara)))
480 *aPara.pTableNd->EndOfSectionNode(), 1 ));
484 else if( sCmp ==
"frame" )
501 else if( sCmp ==
"region" )
506 else if( sCmp ==
"outline" )
521 nTmpPos < rOutlNds.
size() &&
522 nLvl < rOutlNds[ nTmpPos ]->GetTextNode()->
523 GetAttrOutlineLevel()-1;
527 if( nTmpPos < rOutlNds.
size() )
528 rpRange->aEnd = *rOutlNds[ nTmpPos ];
540 bool bCaseSensitive =
true;
550 return static_cast<bool>(rpPam);
553 FindItem aPara( bCaseSensitive ? sItem : rCC.
lowercase( sItem ) );
559 if (!(lcl_FindSection(pFormat, &aPara, bCaseSensitive)))
565 *aPara.pSectNd->EndOfSectionNode() ));
570 if( !bCaseSensitive )
572 bCaseSensitive =
false;
void SetVisibleLinks(bool bFlag) override
const SwEndNode * EndOfSectionNode() const
bool IsVisibleLinks() const override
Insert links in-/visibly into LinkManager (linked ranges).
Marks a position in the document model.
sfx2::LinkManager & GetLinkManager() override
sal_Int16 GetUpdateDocMode() const
SwDocShell * GetDocShell()
const SwFrameFormats * GetTableFrameFormats() const
wrapper iterator: wraps iterator of implementation while hiding MarkBase class; only IMark instances ...
const OUString & GetName() const
virtual void SetModified()=0
Must be called manually at changes of format.
Provides access to the marks of a document.
bool InsertServer(SvLinkSource *rObj)
IDocumentMarkAccess * getIDocumentMarkAccess()
Dialog to specify the properties of date form field.
IDocumentUndoRedo & GetIDocumentUndoRedo()
DocumentLinksAdministrationManager(SwDoc &i_rSwdoc)
int GetAttrOutlineLevel() const
Returns outline level of this text node.
virtual bool IsExpanded() const override
virtual bool GetData(css::uno::Any &rData, const OUString &rMimeType, bool bSynchron=false) override
bool SelectServerObj(const OUString &rStr, SwPaM *&rpPam, std::unique_ptr< SwNodeRange > &rpRange) const
virtual void DelAllUndoObj()=0
Delete all Undo actions.
SfxObjectCreateMode GetCreateMode() const
void SetRefObject(SwServerObject *pObj)
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
virtual const_iterator_t getAllMarksBegin() const =0
returns a STL-like random access iterator to the begin of the sequence of marks.
SwTableSortBoxes & GetTabSortBoxes()
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
PaM is Point and Mark: a selection of the document model.
static SwTable * FindTable(SwFrameFormat const *const pFormat)
const SwFlyFrameFormat * FindFlyByName(const OUString &rName, SwNodeType nNdTyp=SwNodeType::NONE) const
virtual const_iterator_t getAllMarksEnd() const =0
returns a STL-like random access iterator to the end of the sequence of marks.
const SvBaseLinks & GetLinks() const
const OUString & GetSectionName() const
void Remove(SvBaseLink const *pLink)
std::unique_ptr< sfx2::LinkManager > m_pLinkMgr
void SetData(const OUString &rItem) override
IDocumentState const & getIDocumentState() const
bool IsNoTextNode() const
virtual comphelper::EmbeddedObjectContainer & getEmbeddedObjectContainer() const override
Marks a node in the document model.
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
SwNodes & GetNodes()
Node is in which nodes-array/doc?
bool GetData(const OUString &rItem, const OUString &rMimeType, css::uno::Any &rValue) const override
for linking of parts of documents.
OUString lowercase(const OUString &rStr, sal_Int32 nPos, sal_Int32 nCount) const
const sal_Unicode cMarkSeparator
SwTable is one table in the document model, containing rows (which contain cells).
const SwNodeIndex * GetContentIdx() const
static bool GetDisplayNames(const SvBaseLink *, OUString *pType, OUString *pFile=nullptr, OUString *pLink=nullptr, OUString *pFilter=nullptr)
virtual SwPosition & GetOtherMarkPos() const override
const SwStartNode * GetSttNd() const
void setUserAllowsLinkUpdate(bool bNew)
bool GotoOutline(SwPosition &rPos, const OUString &rName, SwRootFrame const *=nullptr) const
void UpdateAllLinks(bool bAskUpdate, bool bUpdateGrfLinks, weld::Window *pParentWin)
const SwNodes & GetNodes() const
bool LinksUpdated() const override
virtual SwPosition & GetMarkPos() const override
void SetLinksUpdated(const bool bNewLinksUpdated) override
::sw::DocumentSettingManager & GetDocumentSettingManager()
virtual sal_uInt16 getLinkUpdateMode(bool bGlobalSettings) const override
Get the current link update mode.
SwTableBox is one table cell in the document model.
virtual ~DocumentLinksAdministrationManager() override
SwTableNode * FindTableNode()
Search table node, in which it is.
::sfx2::SvLinkSource * CreateLinkSource(const OUString &rItem) override
SwSectionNode * GetSectionNode()
bool Seek_Entry(SwNode *rP, size_type *pnPos) const
std::vector< SwNode * >::size_type size_type
void UpdateLinks() override
#i42634# Moved common code of SwReader::Read() and SwDocShell::UpdateLinks() to new SwDoc::UpdateLink...
SwSectionFormats & GetSections()
SvBaseLinkObjectType GetObjType() const
CharClass & GetAppCharClass()
bool EmbedAllLinks() override
embedded all local links (Areas/Graphics)
const SwServerObject * GetRefObject() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Base class of the Writer document model elements.
SfxMedium * GetMedium() const
static OUString decode(OUString const &rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)