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>
44 #include <strings.hrc>
67 else if( *pEnd != *pStt )
82 mxDoc->DeleteTOXMark( pMark );
95 assert( dynamic_cast<const SwTOXBaseSection*>( &rTOXBase) &&
"no TOXBaseSection!" );
102 assert( dynamic_cast<const SwTOXBaseSection*>( &rTOXBase) &&
"no TOXBaseSection!" );
104 const_cast<SwTOXBase&
>(rTOXBase).SetProtected(bReadonly);
108 aSectionData.SetProtectFlag(bReadonly);
134 OSL_ENSURE(pTOX,
"No current TOX");
153 assert(dynamic_cast<const SwTOXBaseSection*>(&rTOX) &&
"no TOXBaseSection!");
206 return mxDoc->GetTOXType(eTyp, nId);
220 for(
auto n = rFormats.
size();
n; )
222 const SwSection* pSect = rFormats[ --
n ]->GetSection();
236 const SwSection* pSect = pFormat->GetSection();
241 assert( dynamic_cast<const SwTOXBaseSection*>( pSect) &&
"no TOXBaseSection!" );
290 if(pMark->IsAutoGenerated() && pMark->GetTextTOXMark())
296 SfxMedium aMedium( sAutoMarkURL, StreamMode::STD_READ );
301 if (eChrSet == RTL_TEXTENCODING_DONTKNOW)
302 eChrSet = ::osl_getThreadTextEncoding();
305 sal_Int32
const nLEV_Other = 2;
306 sal_Int32
const nLEV_Longer = 3;
307 sal_Int32
const nLEV_Shorter = 1;
310 SearchAlgorithms_ABSOLUTE,
311 SearchFlags::LEV_RELAXED,
314 nLEV_Other, nLEV_Longer, nLEV_Shorter,
315 TransliterationFlags::NONE,
316 SearchAlgorithms2::ABSOLUTE,
328 if( !aRdLine.isEmpty() &&
'#' != aRdLine[0] )
330 OUString sLine(OStringToOUString(aRdLine, eChrSet));
332 sal_Int32 nTokenPos = 0;
333 OUString sToSelect( sLine.getToken(0,
';', nTokenPos ) );
334 if( !sToSelect.isEmpty() )
336 OUString sAlternative = sLine.getToken(0,
';', nTokenPos);
337 OUString sPrimary = sLine.getToken(0,
';', nTokenPos);
338 OUString sSecondary = sLine.getToken(0,
';', nTokenPos);
339 OUString sCase = sLine.getToken(0,
';', nTokenPos);
340 OUString sWordOnly = sLine.getToken(0,
';', nTokenPos);
343 bool bCaseSensitive = !sCase.isEmpty() && sCase !=
"0";
344 bool bWordOnly = !sWordOnly.isEmpty() && sWordOnly !=
"0";
349 TransliterationFlags::IGNORE_CASE;
357 aSearchOpt.
searchFlag |= SearchFlags::NORM_WORD_ONLY;
359 aSearchOpt.
searchFlag &= ~SearchFlags::NORM_WORD_ONLY;
373 if( !sPrimary.isEmpty() )
376 if( !sSecondary.isEmpty() )
379 if( !sAlternative.isEmpty() )
SVL_DLLPUBLIC bool IsDocument(const OUString &rURL)
bool IsAlternativeText() const
sal_uLong Find_Text(const i18nutil::SearchOptions2 &rSearchOpt, bool bSearchInNotes, SwDocPositions eStart, SwDocPositions eEnd, bool &bCancel, FindRanges eRng, bool bReplace=false)
size_t GetSectionFormatPos(const SwSectionFormat &) const
static SW_DLLPUBLIC rtl_TextEncoding GetTextEncoding(SvStream &)
Marks a position in the document model.
const OUString & GetTOIAutoMarkURL() const
SwDocShell * GetDocShell()
void InsertTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
Insert content table. Renew if required.
static SwTOXBase * GetCurTOX(const SwPosition &rPos)
Get current table of contents.
void UpdateTableOf(const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr)
update tables of content
std::vector< SwTOXMark * > SwTOXMarks
void CollectTextMarks(SwTOXMarks &rMarks) const
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
void SetTOIAutoMarkURL(const OUString &rSet)
void EndProgress(SwDocShell const *pDocShell)
SwSectionFormat * GetFormat()
OUString const & GetTOIAutoMarkURL() const
AutoMark file.
void DoUndo(bool bOn=true)
Undo.
IDocumentUndoRedo & GetIDocumentUndoRedo()
virtual bool InsertPoolItem(const SwPaM &rRg, const SfxPoolItem &, const SetAttrMode nFlags=SetAttrMode::DEFAULT, SwRootFrame const *pLayout=nullptr, SwTextAttr **ppNewTextAttr=nullptr)=0
Insert an attribute.
void StartProgress(TranslateId pMessResId, tools::Long nStartValue, tools::Long nEndValue, SwDocShell *pDocShell)
IDocumentContentOperations const & getIDocumentContentOperations() const
static bool IsTOXBaseReadonly(const SwTOXBase &rTOXBase)
void UpdateSection(size_t const nSect, SwSectionData &, SfxItemSet const *const =nullptr)
rtl::Reference< SwDoc > mxDoc
The document; never 0.
void DeleteTOXMark(SwTOXMark const *pMark)
bool ReadLine(OString &rStr, sal_Int32 nMaxBytesToRead=0xFFFE)
const SwTOXBase * GetTOX(sal_uInt16 nPos) const
void SetTOIAutoMarkURL(const OUString &rSet)
SwRect maVisArea
The modern version of VisArea.
bool DeleteTOX(const SwTOXBase &rTOXBase, bool bDelNodes)
Delete table of contents.
const SwTOXBase * GetCurTOX() const
Get current listing before or at the Cursor.
void SetAlternativeText(const OUString &rAlt)
void UpdatePageNum()
Calculate PageNumber and insert after formatting.
PaM is Point and Mark: a selection of the document model.
void GetTOIKeys(SwTOIKeyType eTyp, std::vector< OUString > &rArr) const
Key for managing index.
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
const SwTOXBase * GetDefaultTOXBase(TOXTypes eTyp, bool bCreate=false)
void SetPrimaryKey(const OUString &rStr)
void Push()
store a copy of the current cursor on the cursor stack
TransliterationFlags transliterateFlags
bool SetPosAtStartEnd(SwPosition &rPos) const
void SetUpdateTOX(bool bFlag)
All (only in non-body and selections).
sal_uInt16 GetTOXCount() const
void GetTOIKeys(SwTOIKeyType eTyp, std::vector< OUString > &rArr, SwRootFrame const &rLayout) const
void SetTableUpdateInProgress(bool bValue)
ring_container GetRingContainer()
void InvalidateWindows(const SwRect &rRect)
void SetAutoGenerated(bool bSet)
void SetDefaultTOXBase(const SwTOXBase &rBase)
void SetTOXBaseReadonly(const SwTOXBase &rTOXBase, bool bReadonly)
const LanguageTag & getLocale()
SwCursor * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
void Update(const SfxItemSet *pAttr=nullptr, SwRootFrame const *pLayout=nullptr, const bool _bNewTOX=false)
Collect table of contents content.
static sal_uInt16 GetCurTOXMark(const SwPosition &rPos, SwTOXMarks &)
Get current table of contents Mark.
void SetUpdateTOX(bool bFlag)
After reading file update all content tables.
void SetSecondaryKey(const OUString &rStr)
const SwTOXType * GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
virtual void CalcLayout() override
To enable set up of StartActions and EndActions.
void GetCurTOXMarks(SwTOXMarks &rMarks) const
Get all marks at current SPoint.
void Insert(sal_Unicode, bool bOnlyCurrCursor=false)
Edit (all selected ranges).
SectionType GetType() const
bool Pop(PopMode)
delete cursor
void SetDefaultTOXBase(const SwTOXBase &rBase)
void StartAllAction()
For all views of this document.
SwRootFrame * GetLayout() const
SwSectionFormats & GetSections()
void SetMainEntry(bool bSet)
bool DeleteTOX(const SwTOXBase &rTOXBase, bool bDelNodes)
const SwTOXBase * GetDefaultTOXBase(TOXTypes eTyp, bool bCreate)