20#include <com/sun/star/util/SearchAlgorithms2.hpp>
21#include <com/sun/star/util/SearchFlags.hpp>
26#include <osl/diagnose.h>
27#include <osl/thread.h>
60 auto [pStt, pEnd] = rPaM.StartEnd();
66 else if( *pEnd != *pStt )
81 mxDoc->DeleteTOXMark( pMark );
94 assert(
dynamic_cast<const SwTOXBaseSection*
>( &rTOXBase) &&
"no TOXBaseSection!" );
101 assert(
dynamic_cast<const SwTOXBaseSection*
>( &rTOXBase) &&
"no TOXBaseSection!" );
103 const_cast<SwTOXBase&
>(rTOXBase).SetProtected(bReadonly);
133 OSL_ENSURE(pTOX,
"No current TOX");
152 assert(
dynamic_cast<const SwTOXBaseSection*
>(&rTOX) &&
"no TOXBaseSection!");
205 return mxDoc->GetTOXType(eTyp,
nId);
219 for(
auto n = rFormats.
size();
n; )
221 const SwSection* pSect = rFormats[ --
n ]->GetSection();
235 const SwSection* pSect = pFormat->GetSection();
240 assert(
dynamic_cast<const SwTOXBaseSection*
>( pSect) &&
"no TOXBaseSection!" );
289 if(pMark->IsAutoGenerated() && pMark->GetTextTOXMark())
295 SfxMedium aMedium( sAutoMarkURL, StreamMode::STD_READ );
300 if (eChrSet == RTL_TEXTENCODING_DONTKNOW)
301 eChrSet = ::osl_getThreadTextEncoding();
304 sal_Int32
const nLEV_Other = 2;
305 sal_Int32
const nLEV_Longer = 3;
306 sal_Int32
const nLEV_Shorter = 1;
309 SearchFlags::LEV_RELAXED,
312 nLEV_Other, nLEV_Longer, nLEV_Shorter,
313 TransliterationFlags::NONE,
314 SearchAlgorithms2::ABSOLUTE,
317 OStringBuffer aRdLine;
326 if( !aRdLine.isEmpty() &&
'#' != aRdLine[0] )
328 OUString sLine(OStringToOUString(aRdLine, eChrSet));
330 sal_Int32 nTokenPos = 0;
331 OUString sToSelect( sLine.getToken(0,
';', nTokenPos ) );
332 if( !sToSelect.isEmpty() )
334 OUString sAlternative = sLine.getToken(0,
';', nTokenPos);
335 OUString sPrimary = sLine.getToken(0,
';', nTokenPos);
336 OUString sSecondary = sLine.getToken(0,
';', nTokenPos);
337 OUString sCase = sLine.getToken(0,
';', nTokenPos);
338 OUString sWordOnly = sLine.getToken(0,
';', nTokenPos);
341 bool bCaseSensitive = !sCase.isEmpty() && sCase !=
"0";
342 bool bWordOnly = !sWordOnly.isEmpty() && sWordOnly !=
"0";
347 TransliterationFlags::IGNORE_CASE;
355 aSearchOpt.
searchFlag |= SearchFlags::NORM_WORD_ONLY;
357 aSearchOpt.
searchFlag &= ~SearchFlags::NORM_WORD_ONLY;
371 if( !sPrimary.isEmpty() )
374 if( !sSecondary.isEmpty() )
377 if( !sAlternative.isEmpty() )
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
bool ReadLine(OStringBuffer &rStr, sal_Int32 nMaxBytesToRead=0xFFFE)
bool Pop(PopMode, ::std::optional< SwCallLink > &roLink)
void Push()
store a copy of the current cursor on the cursor stack
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
sal_Int32 Find_Text(const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, bool bReplace=false)
void SetDefaultTOXBase(const SwTOXBase &rBase)
SwSectionFormats & GetSections()
bool DeleteTOX(const SwTOXBase &rTOXBase, bool bDelNodes)
Delete table of contents.
static sal_uInt16 GetCurTOXMark(const SwPosition &rPos, SwTOXMarks &)
Get current table of contents Mark.
void SetUpdateTOX(bool bFlag)
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
void GetTOIKeys(SwTOIKeyType eTyp, std::vector< OUString > &rArr, SwRootFrame const &rLayout) const
static SwTOXBase * GetCurTOX(const SwPosition &rPos)
Get current table of contents.
void SetTOIAutoMarkURL(const OUString &rSet)
const OUString & GetTOIAutoMarkURL() const
const SwTOXBase * GetDefaultTOXBase(TOXTypes eTyp, bool bCreate)
SwDocShell * GetDocShell()
virtual void CalcLayout() override
To enable set up of StartActions and EndActions.
const SwTOXBase * GetCurTOX() const
Get current listing before or at the Cursor.
void StartAllAction()
For all views of this document.
void SetUpdateTOX(bool bFlag)
After reading file update all content tables.
OUString const & GetTOIAutoMarkURL() const
AutoMark file.
sal_uInt16 GetTOXCount() const
const SwTOXBase * GetDefaultTOXBase(TOXTypes eTyp, bool bCreate=false)
void Insert(sal_Unicode, bool bOnlyCurrCursor=false)
Edit (all selected ranges).
void InsertTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
Insert content table. Renew if required.
void SetDefaultTOXBase(const SwTOXBase &rBase)
const SwTOXBase * GetTOX(sal_uInt16 nPos) const
void UpdateSection(size_t const nSect, SwSectionData &, SfxItemSet const *const =nullptr)
void UpdateTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
update tables of content
static bool IsTOXBaseReadonly(const SwTOXBase &rTOXBase)
void GetTOIKeys(SwTOIKeyType eTyp, std::vector< OUString > &rArr) const
Key for managing index.
size_t GetSectionFormatPos(const SwSectionFormat &) const
void DoUndo(bool bOn=true)
Undo.
void DeleteTOXMark(SwTOXMark const *pMark)
bool DeleteTOX(const SwTOXBase &rTOXBase, bool bDelNodes)
void SetTOXBaseReadonly(const SwTOXBase &rTOXBase, bool bReadonly)
const SwTOXType * GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
void SetTOIAutoMarkURL(const OUString &rSet)
void GetCurTOXMarks(SwTOXMarks &rMarks) const
Get all marks at current SPoint.
static SW_DLLPUBLIC rtl_TextEncoding GetTextEncoding(SvStream &)
PaM is Point and Mark: a selection of the document model.
const SwPosition * GetPoint() const
void SetTableUpdateInProgress(bool bValue)
SAL_DLLPRIVATE void SetProtectFlag(bool const bFlag)
SwSectionFormat * GetFormat()
SectionType GetType() const
void UpdatePageNum()
Calculate PageNumber and insert after formatting.
void Update(const SfxItemSet *pAttr=nullptr, SwRootFrame const *pLayout=nullptr, const bool _bNewTOX=false)
Collect table of contents content.
bool SetPosAtStartEnd(SwPosition &rPos) const
void SetAlternativeText(const OUString &rAlt)
void SetSecondaryKey(const OUString &rStr)
bool IsAlternativeText() const
void SetAutoGenerated(bool bSet)
void SetMainEntry(bool bSet)
void SetPrimaryKey(const OUString &rStr)
void CollectTextMarks(SwTOXMarks &rMarks) const
rtl::Reference< SwDoc > mxDoc
The document; never 0.
SwRootFrame * GetLayout() const
SwRect maVisArea
The modern version of VisArea.
void InvalidateWindows(const SwRect &rRect)
ring_container GetRingContainer()
@ InSelAll
All (only in non-body and selections).
void StartProgress(TranslateId pMessResId, tools::Long nStartValue, tools::Long nEndValue, SwDocShell *pDocShell)
void EndProgress(SwDocShell const *pDocShell)
SVL_DLLPUBLIC bool IsDocument(const OUString &rURL)
const LanguageTag & getLocale()
TransliterationFlags transliterateFlags
std::vector< SwTOXMark * > SwTOXMarks