69#include <com/sun/star/embed/XEmbeddedObject.hpp>
71#include <osl/diagnose.h>
77template<
typename T,
typename... Args>
static
78typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T>>::type
81 std::unique_ptr<T> pRet(
new T(std::forward<Args>(
args)...));
82 pRet->InitText(pLayout);
110 if( !sStr.isEmpty() )
111 rArr.push_back( sStr );
127 const sal_Int32 *pEndIdx;
131 for(
size_t n = 0;
n < rHts.
Count(); ++
n )
136 if( ( nSttIdx = pHt->
GetStart() ) < nCurrentPos )
139 pEndIdx = pHt->
End();
140 if(
nullptr == pEndIdx || *pEndIdx <= nCurrentPos )
143 else if( nSttIdx > nCurrentPos )
149 rArr.push_back( pTMark );
158 assert(pTextTOXMark);
167 rTextNd, pTextTOXMark->
GetStart()+1);
173 std::unique_ptr<SwRegHistory> aRHst;
201class CompareNodeContent
204 sal_Int32 m_nContent;
207 : m_nNode( nNd ), m_nContent( nCnt ) {}
209 bool operator==(
const CompareNodeContent& rCmp )
const
210 {
return m_nNode == rCmp.m_nNode && m_nContent == rCmp.m_nContent; }
211 bool operator!=(
const CompareNodeContent& rCmp )
const
212 {
return m_nNode != rCmp.m_nNode || m_nContent != rCmp.m_nContent; }
213 bool operator< (
const CompareNodeContent& rCmp )
const
214 {
return m_nNode < rCmp.m_nNode ||
215 ( m_nNode == rCmp.m_nNode && m_nContent < rCmp.m_nContent); }
216 bool operator<=(
const CompareNodeContent& rCmp )
const
217 {
return m_nNode < rCmp.m_nNode ||
218 ( m_nNode == rCmp.m_nNode && m_nContent <= rCmp.m_nContent); }
219 bool operator> (
const CompareNodeContent& rCmp )
const
220 {
return m_nNode > rCmp.m_nNode ||
221 ( m_nNode == rCmp.m_nNode && m_nContent > rCmp.m_nContent); }
222 bool operator>=(
const CompareNodeContent& rCmp )
const
223 {
return m_nNode > rCmp.m_nNode ||
224 ( m_nNode == rCmp.m_nNode && m_nContent >= rCmp.m_nContent); }
250 if ( pTOXMark == &rCurTOXMark )
253 pMark = pTOXMark->GetTextTOXMark();
262 std::pair<Point, bool>
const tmp(aPt,
false);
277 if (pTOXMark->GetText(
nullptr) != rCurTOXMark.
GetText(
nullptr))
281 if ( (aAbsNew < aAbsIdx && aAbsNew > aPrevPos) ||
282 (aAbsIdx == aAbsNew &&
284 (!pNew || aPrevPos < aAbsIdx ||
reinterpret_cast<sal_uLong>(pNew) <
reinterpret_cast<sal_uLong>(pTOXMark) ) )) ||
285 (aPrevPos == aAbsNew && aAbsIdx != aAbsNew &&
290 if ( aAbsNew >= aMax )
299 if (pTOXMark->GetText(
nullptr) != rCurTOXMark.
GetText(
nullptr))
303 if ( (aAbsNew > aAbsIdx && aAbsNew < aNextPos) ||
304 (aAbsIdx == aAbsNew &&
306 (!pNew || aNextPos > aAbsIdx ||
reinterpret_cast<sal_uLong>(pNew) >
reinterpret_cast<sal_uLong>(pTOXMark)) )) ||
307 (aNextPos == aAbsNew && aAbsIdx != aAbsNew &&
312 if ( aAbsNew <= aMin )
360 assert(!bExpand || pLayout !=
nullptr);
366 std::tuple<SwTOXBase const*, sw::RedlineMode, sw::FieldmarkMode, sw::ParagraphBreakMode>
const tmp(
385 pNewSection->
Update(
nullptr, pLayout,
true );
401 *pHeadNd, *pSectFormat, headerData,
nullptr, &aIdx.
GetNode(),
true,
false);
436 if (!pNewSectionNode)
459 "no TOXBaseSection!" );
471 assert(
dynamic_cast<const SwTOXBaseSection*
>( &rTOXBase) &&
"no TOXBaseSection!" );
474 OSL_ENSURE( pFormat,
"invalid TOXBaseSection!" );
480 std::unique_ptr<SwTOXBase>* prBase =
nullptr;
495 if(!(*prBase) && bCreate)
501 return prBase->get();
506 std::unique_ptr<SwTOXBase>* prBase =
nullptr;
529 assert(
dynamic_cast<const SwTOXBaseSection*
>( &rTOXBase) &&
"no TOXBaseSection!" );
555 if (! aSearchPam.
Move()
556 || *aSearchPam.
GetPoint() >= aEndPos
562 SwPaM aTmpPam(*pMyNode);
563 aSearchPam = aTmpPam;
567 || *aSearchPam.
GetPoint() <= aStartPos
578 SwPaM aTmpPam1(aInsPos);
579 aSearchPam = aTmpPam1;
593 for(
const auto pSect :
aArr )
616 if( eTyp == pTOXType->GetType() )
625 if( eTyp == pTOXType->GetType() && nCnt++ ==
nId )
626 return pTOXType.get();
638 const OUString& sChkStr )
const
642 OUString
newName =
"MailMergeTOX"
645 if( !sChkStr.isEmpty())
650 bool bUseChkStr = !sChkStr.isEmpty();
652 const sal_Int32 nNmLen =
aName.getLength();
656 std::unique_ptr<sal_uInt8[]> pSetFlags(
new sal_uInt8[ nFlagSize ]);
657 memset( pSetFlags.get(), 0, nFlagSize );
669 if ( rNm.startsWith(
aName) )
673 if( nNum-- && nNum < mpSectionFormatTable->
size() )
674 pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
676 if ( bUseChkStr && sChkStr==rNm )
703 return aName + OUString::number( ++nNum );
708 assert(
dynamic_cast<const SwTOXBaseSection*
>( &rTOXBase) &&
"no TOXBaseSection!" );
736 OSL_ENSURE( pNd,
"Where's the paragraph?" );
748 bool bIsHeadingContained =
false;
751 bool bCheckFirst =
false;
767 std::pair<Point, bool>
const tmp(aPt,
false);
779 = pNdFrame && pChptrPgFrame
782 if (bIsHeadingContained)
784 const SwNode* aChptrNd = pChptrNd;
790 < rONds[
nPos + 1]->GetTextNode()->GetAttrOutlineLevel())
796 const auto aONdsTxtNd = rONds[
nPos]->GetTextNode();
797 pChptrFrame = aONdsTxtNd->getLayoutFrame(
798 aONdsTxtNd->GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(),
nullptr,
800 pChptrPgFrame = pChptrFrame ? pChptrFrame->
FindPageFrame() :
nullptr;
802 = pNdFrame && pChptrPgFrame
812 < rONds[
nPos]->GetTextNode()->GetAttrOutlineLevel())
814 bIsHeadingContained = pChptrNd == rONds[
nPos]->GetTextNode();
821 bIsHeadingContained =
true;
823 return bIsHeadingContained;
860 if (
nullptr == pSectNd ||
884 if ( !_bNewTOX && !pDefaultPageDesc )
889 pDefaultPageDesc = pSectNd->
FindPageDesc( pPgDescNdIdx );
890 if ( nPgDescNdIdx < pSectNd->GetIndex() )
892 pDefaultPageDesc =
nullptr;
896 if ( !pDefaultPageDesc &&
906 if ( eBreak != SvxBreak::PageBefore && eBreak != SvxBreak::PageBoth )
912 if ( !pDefaultPageDesc &&
924 if ( !pDefaultPageDesc )
944 const SwTextNode* pOwnChapterNode = pChapterSectNd
1009 assert(pCNd != pFirstEmptyNd);
1015 if( aBrkSet.
Count() )
1016 pFirstEmptyNd->
SetAttr( aBrkSet );
1031 SwPosition aPos( aEndIdx, pFirstEmptyNd, 0 );
1058 *pHeadNd, *pSectFormat, headerData,
nullptr, &aIdx.
GetNode(),
true,
false);
1067 std::vector<SwTextFormatColl*> aCollArr(
GetTOXForm().GetFormMax(),
nullptr );
1068 std::unordered_map<OUString, int> markURLs;
1070 for(
size_t nCnt = 0; nCnt <
m_aSortArr.size(); ++nCnt )
1075 sal_uInt16 nLvl =
m_aSortArr[ nCnt ]->GetLevel();
1080 aCollArr[ nLvl ] = pColl;
1102 pNextMark = &(
m_aSortArr[nCnt + nRange]->pTextMark->GetTOXMark());
1114 std::shared_ptr<sw::ToxTabStopTokenHandler> tabStopTokenHandler =
1115 std::make_shared<sw::DefaultToxTabStopTokenHandler>(
1126 aInsPos = *pFirstEmptyNd;
1128 SwPaM aCorPam( *pFirstEmptyNd );
1140 aEndIdx = *pFirstEmptyNd;
1155 for (
const auto& rpLayout : aAllLayouts )
1182 if( !sDeli.isEmpty() && sLastDeli != sDeli )
1185 if(
' ' <= sDeli[0] )
1187 std::unique_ptr<SwTOXCustom> pCst(
1188 MakeSwTOXSortTabBase<SwTOXCustom>(
nullptr,
1213 sal_uInt16 nPoolFormat = 0;
1241 nPoolFormat = nPoolFormat + 1;
1249 nPoolFormat = nPoolFormat +
nLevel;
1259 if(pFindHint->m_rpContentFrame)
1275 pFindHint->m_rpContentFrame = pCNd->
getLayoutFrame(&pFindHint->m_rLayout);
1288 std::vector<std::reference_wrapper<SwTextTOXMark>> vMarks;
1289 pType->CollectTextTOXMarksForLayout(vMarks, pLayout);
1290 for(
auto& rMark: vMarks)
1293 auto& rNode = rMark.get().GetTextNode();
1296 auto rTOXMark = rMark.get().GetTOXMark();
1306 if (!rTOXMark.GetSecondaryKey().isEmpty())
1314 InsertSorted(MakeSwTOXSortTabBase<SwTOXContent>(pLayout, rNode, &rMark.get(), rIntl));
1327 for(
auto pOutlineNode : rOutlNds )
1331 if( pTextNd && pTextNd->
Len() && pTextNd->HasWriterListeners() &&
1353 if (sTmpStyleNames.isEmpty())
1373 if (pTextNd->GetText().getLength() &&
1374 pTextNd->getLayoutFrame(pLayout) &&
1375 pTextNd->GetNodes().IsDocNodes() &&
1398 std::vector<SwFormatField*> vFields;
1400 for(
auto pFormatField: vFields)
1402 const SwTextField* pTextField = pFormatField->GetTextField();
1406 if (rTextNode.
GetText().getLength() &&
1420 pNew->SetStartIndex(
1425 pNew->SetEndIndex(pTextField->
GetStart() + 1);
1427 pNew->InitText(pLayout);
1441 std::vector<SwFormatField*> vFields;
1443 for(
auto pFormatField: vFields)
1445 const auto pTextField = pFormatField->GetTextField();
1449 if (rTextNode.
GetText().getLength() &&
1461 pTextNode = &rTextNode;
1463 InsertSorted(MakeSwTOXSortTabBase<SwTOXAuthority>(pLayout, *pTextNode, *pFormatField, rIntl));
1470 static const struct SoObjType {
1476 sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15;
1495 for( SoObjType
const & rArr :
aArr )
1496 for (
auto & rId : rArr.aGlNmIds)
1501 rId.b8, rId.b9, rId.b10, rId.b11,
1502 rId.b12, rId.b13, rId.b14, rId.b15 );
1503 if( rFactoryNm == aGlbNm )
1522 while( nIdx < nEndIdx )
1526 SwNode* pNd = rNds[ nIdx ];
1537 pCNd = rNds.
GoNext( &aTmp );
1548 bool bInclude =
true;
1560 || (nMyOLEOptions & nObj);
1564 OSL_FAIL(
"OLE Object no loaded?");
1579 int nSetLevel = USHRT_MAX;
1603 std::unique_ptr<SwTOXPara> pNew( MakeSwTOXSortTabBase<SwTOXPara>(
1604 pLayout, *pCNd, eMyType,
1605 ( USHRT_MAX != nSetLevel )
1606 ? o3tl::narrowing<sal_uInt16>(nSetLevel)
1629 if( pTmpTable &&
nullptr != (pFBox = pTmpTable->
GetTabSortBoxes()[0] ) &&
1636 while(
nullptr != ( pCNd = rNds.
GoNext( &aContentIdx ) ) &&
1644 std::unique_ptr<SwTOXTable> pNew(
new SwTOXTable( *pCNd ));
1654 pNew->SetLevel(o3tl::narrowing<sal_uInt16>(nTmp));
1658 pNew->InitText(pLayout);
1675 sal_uInt16 nPage = 0;
1683 for(
size_t nCnt = 0; nCnt <
m_aSortArr.size(); ++nCnt )
1698 nullptr != (pNextMark = &(
m_aSortArr[nCnt + nRange]->pTextMark->GetTOXMark())) &&
1706 for(
size_t nRunInEntry = nCnt; nRunInEntry < nCnt + nRange; ++nRunInEntry)
1708 std::vector<sal_uInt16> aNums;
1709 std::vector<SwPageDesc*> aDescs;
1710 std::vector<sal_uInt16> aMainNums;
1713 for (
size_t j = 0; j < nSize; ++j)
1718 if( rTOXSource.
pNd )
1721 OSL_ENSURE( pFrame || pDoc->
IsUpdateTOX(),
"TOX, no Frame found");
1734 if (!pNext || nPos < pNext->GetOffset())
1741 if( pTmpPage != pCurrentPage )
1744 pCurrentPage = pTmpPage;
1748 std::vector<sal_uInt16>::size_type
i;
1749 for(
i = 0;
i < aNums.size() && aNums[
i] < nPage; ++
i )
1752 if(
i >= aNums.size() || aNums[
i ] != nPage )
1754 aNums.insert(aNums.begin() +
i, nPage);
1755 aDescs.insert(aDescs.begin() +
i, pCurrentPage->
GetPageDesc() );
1761 aMainNums.push_back(nPage);
1770 OSL_ENSURE( pTextNd,
"no TextNode, wrong TOC" );
1783static bool lcl_HasMainEntry(
const std::vector<sal_uInt16>* pMainEntryNums, sal_uInt16 nToFind )
1785 if (!pMainEntryNums)
1788 for(
auto nMainEntry : *pMainEntryNums )
1789 if (nToFind == nMainEntry)
1795 const std::vector<sal_uInt16>& rNums,
1796 const std::vector<SwPageDesc*>& rDescs,
1797 const std::vector<sal_uInt16>* pMainEntryNums,
1801 std::optional< std::vector<sal_uInt16> > xCharStyleIdx;
1803 xCharStyleIdx.emplace();
1807 sal_Int32 nStartPos = pNd->
GetText().indexOf(sSrchStr);
1809 sal_Int32 nEndPos = pNd->
GetText().indexOf(sSrchStr);
1811 if (-1 == nEndPos || rNums.empty())
1814 if (-1 == nStartPos || nStartPos > nEndPos)
1815 nStartPos = nEndPos;
1817 sal_uInt16 nOld = rNums[0],
1820 OUString aNumStr( rDescs[0]->
GetNumType().GetNumStr( nBeg ) );
1823 xCharStyleIdx->push_back( 0 );
1831 for(
size_t nHintIdx = 0; nHintIdx < pHints->
Count(); ++nHintIdx)
1834 const sal_Int32 nTmpEnd = pAttr->
End() ? *pAttr->
End() : 0;
1835 if( nStartPos >= pAttr->
GetStart() &&
1836 (nStartPos + 2) <= nTmpEnd &&
1843 pNd->
EraseText(aPos, nEndPos - nStartPos + 2);
1845 std::vector<sal_uInt16>::size_type
i;
1846 for(
i = 1;
i < rNums.size(); ++
i)
1857 if(nOld == rNums[
i]-1 && !bMainEntryChanges &&
1882 if (xCharStyleIdx && bMainEntryChanges)
1884 xCharStyleIdx->push_back(aNumStr.getLength());
1894 if (
i+1 != rNums.size())
1914 aNumStr += rDescs[
i-1]->GetNumType().GetNumStr( nBeg+
nCount );
1918 if(pPageNoCharFormat)
1929 if (xCharStyleIdx->size()&0x01)
1930 xCharStyleIdx->push_back(aNumStr.getLength());
1936 if(USHRT_MAX != nPoolId)
1944 sal_Int32 nOffset = pNd->
GetText().getLength() - aNumStr.getLength();
1946 for (
size_t j = 0; j < xCharStyleIdx->size(); j += 2)
1948 sal_Int32 nStartIdx = (*xCharStyleIdx)[j] + nOffset;
1949 sal_Int32 nEndIdx = (*xCharStyleIdx)[j + 1] + nOffset;
1959 const SwTOXMark& rMark = pNew->pTextMark->GetTOXMark();
1978 for(
short i =
static_cast<short>(aRange.
Min());
i <
static_cast<short>(aRange.
Max()); ++
i)
2001 for(
i = aRange.
Min();
i < aRange.
Max(); ++
i)
2019 pOld->
aTOXSources.push_back(pNew->aTOXSources[0]);
2023#if OSL_DEBUG_LEVEL > 0
2025 OSL_FAIL(
"Bibliography entries cannot be found here");
2028 if (pNew->sort_lt(*pOld))
2043 sal_uInt16 nLevel,
const Range& rRange )
2051 + aToCompare.
sText.subView(1);
2054 OSL_ENSURE(rRange.
Min() >= 0 && rRange.
Max() >= 0,
"Min Max < 0");
2061 for(
i = nMin;
i < nMax; ++
i)
2072 std::unique_ptr<SwTOXCustom> pKey(MakeSwTOXSortTabBase<SwTOXCustom>(
2074 for(
i = nMin;
i < nMax; ++
i)
2085 for(
i = nStart;
i < nEnd; ++
i)
2092 return Range(nStart, nEnd);
@ TABS_RELATIVE_TO_INDENT
bool operator<=(const BigInt &rVal1, const BigInt &rVal2)
bool operator>=(const BigInt &rVal1, const BigInt &rVal2)
virtual bool AppendTextNode(SwPosition &rPos)=0
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType)=0
virtual void SetModified()=0
Must be called manually at changes of format.
virtual SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)=0
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
OUString GetNumStr(sal_Int32 nNo) const
const SvxFormatBreakItem & GetBreak(bool=true) const
const css::lang::Locale & GetLocale(const LanguageType aLang)
const SwModify * GetRegisteredIn() const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
const SwContentFrame * GetFollow() const
Marks a character position inside a document model content node (SwContentNode)
bool HasSwAttrSet() const
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
virtual bool SetAttr(const SfxPoolItem &)
made virtual
const SwAttrSet * GetpSwAttrSet() const
const SwTOXType * InsertTOXType(const SwTOXType &rTyp)
static const SwAttrSet & GetTOXBaseAttrSet(const SwTOXBase &rTOX)
SwTOXBaseSection * InsertTableOf(const SwPosition &rPos, const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr, bool bExpand=false, SwRootFrame const *pLayout=nullptr)
void SetDefaultTOXBase(const SwTOXBase &rBase)
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.
std::unique_ptr< SwTOXTypes > mpTOXTypes
IDocumentState const & getIDocumentState() const
const sw::TableFrameFormats * GetTableFrameFormats() const
void ChgFormat(SwFormat &rFormat, const SfxItemSet &rSet)
void CorrAbs(const SwNode &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const
Manage table of content types.
SwSection * InsertSwSection(SwPaM const &rRange, SwSectionData &, std::tuple< SwTOXBase const *, sw::RedlineMode, sw::FieldmarkMode, sw::ParagraphBreakMode > const *pTOXBase, SfxItemSet const *const pAttr, bool const bUpdate=true)
SwCharFormat * FindCharFormatByName(const OUString &rName) const
IDocumentContentOperations const & getIDocumentContentOperations() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
void GetTOIKeys(SwTOIKeyType eTyp, std::vector< OUString > &rArr, SwRootFrame const &rLayout) const
static SwTOXBase * GetCurTOX(const SwPosition &rPos)
Get current table of contents.
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
void DelSectionFormat(SwSectionFormat *pFormat, bool bDelNodes=false)
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
std::unique_ptr< SwDefTOXBase_Impl > mpDefTOXBases
const SwTOXBase * GetDefaultTOXBase(TOXTypes eTyp, bool bCreate)
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
std::unique_ptr< SwSectionFormats > mpSectionFormatTable
void DeleteTOXMark(const SwTOXMark *pTOXMark)
Delete table of contents Mark.
const SwAttrPool & GetAttrPool() const
bool SetTOXBaseName(const SwTOXBase &rTOXBase, const OUString &rName)
SwCharFormat * MakeCharFormat(const OUString &rFormatName, SwCharFormat *pDerivedFrom, bool bBroadcast=false)
bool IsInMailMerge() const
const SwTOXType * GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
SwSectionFormat * MakeSectionFormat()
OUString GetUniqueTOXBaseName(const SwTOXType &rType, const OUString &sChkStr) const
::sw::DocumentSettingManager & GetDocumentSettingManager()
SwDocShell * GetDocShell()
const SwPageDesc & GetPageDesc(const size_t i) const
const SwTOXMark & GotoTOXMark(const SwTOXMark &rCurTOXMark, SwTOXSearch eDir, bool bInReadOnly)
Instances of SwFields and those derived from it occur 0 to n times.
void GatherFields(std::vector< SwFormatField * > &rvFormatFields, bool bCollectOnlyInDocNodes=true) const
SwPageDesc * GetPageDesc()
const SwRect & getFrameArea() const
Base class of the Writer layout elements.
sal_uInt16 GetVirtPageNum() const
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
static void CheckPageDescs(SwPageFrame *pStart, bool bNotifyFields=true, SwPageFrame **ppPrev=nullptr)
Check all pages (starting from the given one) if they use the appropriate frame format.
SwPageFrame * FindPageFrame()
static sal_Int32 GetReferenceTextPos(const SwFormatField &rFormat, SwDoc &rDoc, sal_Int32 nHint=0)
Find the index of the reference text following the current field.
void RestoreUpperFrames(SwNodes &rNds, SwNodeOffset nStt, SwNodeOffset nEnd)
SwFrame * GetFrame(const Point *pDocPos) const
Marks a node in the document model.
SwNodeOffset GetIndex() const
Base class of the Writer document model elements.
sal_uInt16 GetSectionLevel() const
Returns the section level at the position given by aIndex.
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwSectionNode * GetSectionNode()
SwNodeOffset GetIndex() const
bool IsNoTextNode() const
SwNodes & GetNodes()
Node is in which nodes-array/doc?
const SwTextNode * FindOutlineNodeOfLevel(sal_uInt8 nLvl, SwRootFrame const *pLayout=nullptr) const
SwNodeOffset StartOfSectionIndex() const
const SwPageDesc * FindPageDesc(SwNodeOffset *pPgDescNdIdx=nullptr) const
Search PageDesc with which this node is formatted.
SwTableNode * FindTableNode()
Search table node, in which it is.
SwSectionNode * FindSectionNode()
Search section node, in which it is.
const SwStartNode * StartOfSectionNode() const
Merge GetRedlineMergeFlag() const
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
SwNodeOffset EndOfSectionIndex() const
SwContentNode * GetContentNode()
const SwEndNode * EndOfSectionNode() const
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
SwTextNode * MakeTextNode(SwNode &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
SwNode & GetEndOfAutotext() const
Section for all Flys/Header/Footers.
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc....
void Delete(const SwNodeIndex &rPos, SwNodeOffset nNodes=SwNodeOffset(1))
SwSectionNode * InsertTextSection(SwNode &rNd, SwSectionFormat &rSectionFormat, SwSectionData const &, SwTOXBase const *const pTOXBase, SwNode const *pEndNd, bool const bInsAtStart=true, bool const bCreateFrames=true)
Insert a new SwSection.
static SwContentNode * GoPrevious(SwNodeIndex *)
SwContentNode * GoNext(SwNodeIndex *) const
const SwOLEObj & GetOLEObj() const
bool IsOleRef() const
To avoid unnecessary loading of object.
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
bool Seek_Entry(SwNode *rP, size_type *pnPos) const
PaM is Point and Mark: a selection of the document model.
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
const SwPosition * GetPoint() const
A page of the document layout.
SwPageDesc * GetPageDesc()
void Top(const tools::Long nTop)
The root element of a Writer document layout.
bool HasMergedParas() const
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding).
sw::FieldmarkMode GetFieldmarkMode() const
sw::ParagraphBreakMode GetParagraphBreakMode() const
A section node represents the start of a section on the UI, i.e.
const SwSection & GetSection() const
bool IsProtectFlag() const
bool IsHiddenFlag() const
const OUString & GetSectionName() const
SwSectionFormat * GetFormat()
SectionType GetType() const
void SetProtect(bool const bFlag=true)
void SetSectionName(OUString const &rName)
sal_uInt16 GetSeqNumber() const
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
void UpdateTemplate(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Generate table of contents from template areas.
void UpdatePageNum()
Calculate PageNumber and insert after formatting.
void InsertAlphaDelimiter(const SwTOXInternational &rIntl)
void UpdateTable(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Collect table entries.
void UpdateSequence(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Generate content from sequence fields.
void InsertSorted(std::unique_ptr< SwTOXSortTabBase > pBase)
virtual void SwClientNotify(const SwModify &rModify, const SfxHint &rHint) override
Range GetKeyRange(const OUString &rStr, const OUString &rStrReading, const SwTOXSortTabBase &rNew, sal_uInt16 nLevel, const Range &rRange)
Find Key Range and insert if possible.
void UpdateContent(SwTOXElement eType, const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
void Update(const SfxItemSet *pAttr=nullptr, SwRootFrame const *pLayout=nullptr, const bool _bNewTOX=false)
Collect table of contents content.
void UpdateMarks(const SwTOXInternational &rIntl, const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Create from Marks.
SwTextFormatColl * GetTextFormatColl(sal_uInt16 nLevel)
Evaluate Template.
bool SetPosAtStartEnd(SwPosition &rPos) const
SwTOXBaseSection(SwTOXBase const &rBase, SwSectionFormat &rFormat)
void UpdateOutline(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Generate table of contents from outline.
void UpdateAuthorities(const SwTOXInternational &rIntl, SwRootFrame const *pLayout)
std::vector< std::unique_ptr< SwTOXSortTabBase > > m_aSortArr
void UpdatePageNum_(SwTextNode *pNd, const std::vector< sal_uInt16 > &rNums, const std::vector< SwPageDesc * > &rDescs, const std::vector< sal_uInt16 > *pMainEntryNums, const SwTOXInternational &rIntl)
virtual ~SwTOXBaseSection() override
void SetTOXName(const OUString &rSet)
const OUString & GetSequenceName() const
const OUString & GetSortAlgorithm() const
bool IsLevelFromChapter() const
virtual void SwClientNotify(const SwModify &rMod, const SfxHint &rHint) override
LanguageType GetLanguage() const
SwTOXElement GetCreateType() const
bool IsFromChapter() const
SwTOOElements GetOLEOptions() const
void SetAttrSet(const SfxItemSet &)
const SwForm & GetTOXForm() const
const OUString & GetTOXName() const
const OUString & GetMainEntryCharStyle() const
const SfxItemSet * GetAttrSet() const
const SwTOXType * GetTOXType() const
sal_uInt16 GetLevel() const
bool IsFromObjectNames() const
OUString const & GetStyleNames(sal_uInt16 nLevel) const
SwTOIOptions GetOptions() const
bool IsTOXBaseInReadonly() const
const OUString & GetTitle() const
OUString maMSTOCExpression
SwCaptionDisplay GetCaptionDisplay() const
OUString ToUpper(const OUString &rStr, sal_Int32 nPos) const
OUString GetIndexKey(const TextAndReading &rTaR, const css::lang::Locale &rLcl) const
OUString GetFollowingText(bool bMorePages) const
bool IsEqual(const TextAndReading &rTaR1, const css::lang::Locale &rLocale1, const TextAndReading &rTaR2, const css::lang::Locale &rLocale2) const
const SwTextTOXMark * GetTextTOXMark() const
const SwTOXType * GetTOXType() const
OUString const & GetSecondaryKeyReading() const
OUString const & GetSecondaryKey() const
OUString GetText(SwRootFrame const *pLayout) const
OUString const & GetPrimaryKey() const
static constexpr OUStringLiteral S_PAGE_DELI
OUString const & GetPrimaryKeyReading() const
const OUString & GetTypeName() const
void CollectTextMarks(SwTOXMarks &rMarks) const
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()
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
const sal_Int32 * End() const
sal_Int32 GetStart() const
const SwFormatCharFormat & GetCharFormat() const
bool HasDummyChar() const
const SwTOXMark & GetTOXMark() const
SwTextNode & GetTextNode() const
Represents the style of a paragraph.
bool IsAssignedToListLevelOfOutlineStyle() const
int GetAttrOutlineLevel() const
Represents the visualization of a paragraph.
SwTextNode const * GetTextNodeForParaProps() const
SwTextNode is a paragraph in the document model.
virtual sal_Int32 Len() const override
void DeleteAttribute(SwTextAttr *const pTextAttr)
delete the attribute pTextAttr
bool IsHiddenByParaField() const
is the paragraph visible?
SwTextAttr * InsertItem(SfxPoolItem &rAttr, const sal_Int32 nStart, const sal_Int32 nEnd, const SetAttrMode nMode=SetAttrMode::DEFAULT)
create new text attribute from rAttr and insert it
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
void EraseText(const SwContentIndex &rIdx, const sal_Int32 nCount=SAL_MAX_INT32, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
delete text content ATTENTION: must not be called with a range that overlaps the start of an attribut...
OUString InsertText(const OUString &rStr, const SwContentIndex &rIdx, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
insert text content
int GetAttrOutlineLevel() const
Returns outline level of this text node.
SwpHints * GetpSwpHints()
const OUString & GetText() const
bool HasHiddenCharAttribute(bool bWholePara) const
Hidden Paragraph Field:
SwTextFormatColl * GetTextColl() const
const SwTextNode * GetpTextNd() const
const SwTextNode & GetTextNode() const
void TitleSectionInserted(SwSectionFormat &rSectionFormat)
std::vector< SwSectionFormat * >::size_type size_type
An SwTextAttr container, stores all directly formatted text portions for a text node.
void DeRegister()
deregister the currently registered History
SwTextAttr * Get(size_t nPos) const
void Register(SwRegHistory *pHist)
register a History, which receives all attribute changes (for Undo)
#define SO3_SDRAW_CLASSID_50
#define SO3_SCH_CLASSID_40
#define SO3_SC_CLASSID_30
#define SO3_SDRAW_CLASSID_60
#define SO3_SIMPRESS_CLASSID_50
#define SO3_SM_CLASSID_50
#define SO3_SC_CLASSID_60
#define SO3_SIMPRESS_CLASSID_30
#define SO3_SM_CLASSID_60
#define SO3_SCH_CLASSID_30
#define SO3_SCH_CLASSID_50
#define SO3_SC_CLASSID_40
#define SO3_SCH_CLASSID_60
#define SO3_SIMPRESS_CLASSID_40
#define SO3_SM_CLASSID_30
#define SO3_SM_CLASSID_40
#define SO3_SIMPRESS_CLASSID_60
#define SO3_SC_CLASSID_50
std::vector< Value >::size_type size_type
@ TABSTOPS_RELATIVE_TO_PAGE
@ TABSTOPS_RELATIVE_TO_INDENT
virtual bool get(DocumentSettingId id) const override
Return the specified document setting.
This class generates text for the entries of a table of x.
void GenerateText(SwDoc *doc, std::unordered_map< OUString, int > &rMarkURLs, const std::vector< std::unique_ptr< SwTOXSortTabBase > > &entries, sal_uInt16 indexOfEntryToProcess, sal_uInt16 numberOfEntriesToProcess, SwRootFrame const *pLayout)
Generate the text for an entry of a table of X (X is, e.g., content).
TOOLS_DLLPUBLIC OString DateTimeToOString(const DateTime &rDateTime)
void PaMCorrAbs(const SwPaM &rRange, const SwPosition &rNewPos)
Function declarations so that everything below the CursorShell can move the Cursor once in a while.
void DelFlyInRange(SwNode &rMkNd, SwNode &rPtNd, std::optional< sal_Int32 > oMkContentIdx, std::optional< sal_Int32 > oPtContentIdx)
Delete and move all Flys at the paragraph, that are within the selection.
static bool lcl_HasMainEntry(const std::vector< sal_uInt16 > *pMainEntryNums, sal_uInt16 nToFind)
Replace the PageNumber place holders.
static SwTOOElements lcl_IsSOObject(const SvGlobalName &rFactoryNm)
static const SwTextNode * lcl_FindChapterNode(const SwNode &rNd, SwRootFrame const *const pLayout, sal_uInt8 const nLvl=0)
static bool IsHeadingContained(const SwTextNode *pChptrNd, const SwNode &rNd)
static std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type MakeSwTOXSortTabBase(SwRootFrame const *const pLayout, Args &&... args)
const SwTextNode * GetBodyTextNode(const SwDoc &rDoc, SwPosition &rPos, const SwFrame &rFrame)
Forward declaration: get "BodyTextNode" for exp.fld in Fly's headers/footers/footnotes.
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
WhichRangesContainer const aBreakSetRange(svl::Items< RES_PAGEDESC, RES_BREAK >)
void SetProgressState(tools::Long nPosition, SwDocShell const *pDocShell)
OUString newName(std::u16string_view aNewPrefix, std::u16string_view aOldPrefix, std::u16string_view old_Name)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
bool IsFieldDeletedInModel(IDocumentRedlineAccess const &rIDRA, SwTextField const &rTextField)
TextFrameIndex MapModelToView(MergedPara const &, SwTextNode const *pNode, sal_Int32 nIndex)
bool IsMarkHintHidden(SwRootFrame const &rLayout, SwTextNode const &rNode, SwTextAttrEnd const &rHint)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
constexpr SwNodeOffset NODE_OFFSET_MAX(SAL_MAX_INT32)
SwContentNode * GetNode(SwPaM &rPam, bool &rbFirst, SwMoveFnCollection const &fnMove, bool const bInReadOnly, SwRootFrame const *const i_pLayout)
This function returns the next node in direction of search.
SwMoveFnCollection const & fnMoveBackward
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
@ RES_POOLCOLL_TEXT
Text body.
@ RES_POOLCOLL_STANDARD
Standard.
@ RES_POOLCOLL_TOX_USERH
Subgroup user indices.
@ RES_POOLCOLL_TOX_USER6
user index 6..10.
@ RES_POOLCOLL_TOX_CNTNTH
Subgroup table of contents.
@ RES_POOLCOLL_TOX_TABLESH
tables index.
@ RES_POOLCOLL_TOX_IDXH
Subgroup index tables.
@ RES_POOLCOLL_TOX_OBJECTH
object index.
@ RES_POOLCOLL_TOX_CNTNT6
Content 6th level.
@ RES_POOLCOLL_TOX_ILLUSH
illustrations index.
@ RES_POOLCOLL_TOX_AUTHORITIESH
index of authorities.
std::vector< SwSection * > SwSections
Marks a position in the document model.
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
sal_Int32 GetContentIndex() const
Class for sorting directories.
virtual sal_uInt16 GetLevel() const =0
std::vector< SwTOXSource > aTOXSources
static SwTOIOptions GetOptions()
const css::lang::Locale & GetLocale() const
virtual bool sort_lt(const SwTOXSortTabBase &)
TextAndReading const & GetText() const
sal_uInt16 GetType() const
virtual bool equivalent(const SwTOXSortTabBase &)
const SwTextNode * pTOXNd
const SwTOXInternational * pTOXIntl
const SwContentNode * pNd
const char cSequenceMarkSeparator
constexpr sal_uInt8 MAXLEVEL
const sal_Unicode C_NUM_REPL
const sal_Unicode C_END_PAGE_NUM
#define FORM_SECONDARY_KEY
std::vector< SwTOXMark * > SwTOXMarks
#define FORM_ALPHA_DELIMITER
#define TOX_STYLE_DELIMITER
bool operator<(const wwFont &r1, const wwFont &r2)
WW8LvlType GetNumType(sal_uInt8 nWwLevelNo)
bool operator!=(const XclExpString &rLeft, const XclExpString &rRight)
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)