69 #include <com/sun/star/embed/XEmbeddedObject.hpp>
71 #include <osl/diagnose.h>
77 template<
typename T,
typename... Args>
static
78 typename 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;
201 class 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 &&
283 (
reinterpret_cast<sal_uLong>(&rCurTOXMark) > reinterpret_cast<sal_uLong>(pTOXMark) &&
284 (!pNew || aPrevPos < aAbsIdx || reinterpret_cast<sal_uLong>(pNew) < reinterpret_cast<sal_uLong>(pTOXMark) ) )) ||
285 (aPrevPos == aAbsNew && aAbsIdx != aAbsNew &&
286 reinterpret_cast<sal_uLong>(pTOXMark) >
reinterpret_cast<sal_uLong>(pNew)) )
290 if ( aAbsNew >= aMax )
299 if (pTOXMark->GetText(
nullptr) != rCurTOXMark.
GetText(
nullptr))
303 if ( (aAbsNew > aAbsIdx && aAbsNew < aNextPos) ||
304 (aAbsIdx == aAbsNew &&
305 (
reinterpret_cast<sal_uLong>(&rCurTOXMark) < reinterpret_cast<sal_uLong>(pTOXMark) &&
306 (!pNew || aNextPos > aAbsIdx ||
reinterpret_cast<sal_uLong>(pNew) > reinterpret_cast<sal_uLong>(pTOXMark)) )) ||
307 (aNextPos == aAbsNew && aAbsIdx != aAbsNew &&
308 reinterpret_cast<sal_uLong>(pTOXMark) <
reinterpret_cast<sal_uLong>(pNew)) )
312 if ( aAbsNew <= aMin )
360 assert(!bExpand || pLayout !=
nullptr);
366 std::tuple<SwTOXBase const*, sw::RedlineMode, sw::FieldmarkMode>
const tmp(
377 pNewSection->SetTOXName(sSectNm);
384 pNewSection->Update(
nullptr, pLayout,
true );
400 aStt, *pSectFormat, headerData,
nullptr, &aIdx,
true,
false);
435 if (!pNewSectionNode)
442 dynamic_cast<SwTOXBaseSection*>(& pNewSectionNode->
GetSection()));
457 assert( dynamic_cast< const SwTOXBaseSection *>( &pSectNd->
GetSection()) &&
458 "no TOXBaseSection!" );
470 assert( dynamic_cast<const SwTOXBaseSection*>( &rTOXBase) &&
"no TOXBaseSection!" );
473 OSL_ENSURE( pFormat,
"invalid TOXBaseSection!" );
479 std::unique_ptr<SwTOXBase>* prBase =
nullptr;
494 if(!(*prBase) && bCreate)
500 return prBase->get();
505 std::unique_ptr<SwTOXBase>* prBase =
nullptr;
528 assert( dynamic_cast<const SwTOXBaseSection*>( &rTOXBase) &&
"no TOXBaseSection!" );
554 if (! aSearchPam.Move()
555 || *aSearchPam.GetPoint() >= aEndPos
561 SwPaM aTmpPam(*pMyNode);
562 aSearchPam = aTmpPam;
566 || *aSearchPam.GetPoint() <= aStartPos
577 SwPaM aTmpPam1(aInsPos);
578 aSearchPam = aTmpPam1;
592 for(
const auto pSect : aArr )
615 if( eTyp == pTOXType->GetType() )
624 if( eTyp == pTOXType->GetType() && nCnt++ == nId )
625 return pTOXType.get();
637 const OUString& sChkStr )
const
641 OUString
newName =
"MailMergeTOX"
644 if( !sChkStr.isEmpty())
649 bool bUseChkStr = !sChkStr.isEmpty();
651 const sal_Int32 nNmLen =
aName.getLength();
655 std::unique_ptr<sal_uInt8[]> pSetFlags(
new sal_uInt8[ nFlagSize ]);
656 memset( pSetFlags.get(), 0, nFlagSize );
668 if ( rNm.startsWith(
aName) )
672 if( nNum-- && nNum < mpSectionFormatTable->
size() )
673 pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
675 if ( bUseChkStr && sChkStr==rNm )
683 nNum = mpSectionFormatTable->size();
702 return aName + OUString::number( ++nNum );
707 assert( dynamic_cast<const SwTOXBaseSection*>( &rTOXBase) &&
"no TOXBaseSection!" );
729 const SwFrame* pFrame = aNode2Layout.GetFrame( &aPt );
735 OSL_ENSURE( pNd,
"Where's the paragraph?" );
745 bool bIsHeadingContained =
false;
748 bool bCheckFirst =
false;
751 if (!rONds.
Seek_Entry(const_cast<SwNode*>(pNd), &nPos))
764 std::pair<Point, bool>
const tmp(aPt,
false);
776 = pNdFrame && pChptrPgFrame
779 if (bIsHeadingContained)
781 const SwNode* aChptrNd = pChptrNd;
782 if (!rONds.
Seek_Entry(const_cast<SwNode*>(aChptrNd), &nPos) && nPos)
785 while (nPos < rONds.
size() - 1
787 < rONds[nPos + 1]->GetTextNode()->GetAttrOutlineLevel())
791 if (nPos < rONds.
size() - 1) {
793 const auto aONdsTxtNd = rONds[nPos]->GetTextNode();
794 pChptrFrame = aONdsTxtNd->getLayoutFrame(
795 aONdsTxtNd->GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(),
nullptr,
797 pChptrPgFrame = pChptrFrame ? pChptrFrame->
FindPageFrame() :
nullptr;
799 = pNdFrame && pChptrPgFrame
808 < rONds[nPos]->GetTextNode()->GetAttrOutlineLevel())
810 bIsHeadingContained = pChptrNd == rONds[nPos]->GetTextNode();
817 bIsHeadingContained =
true;
819 return bIsHeadingContained;
841 rPos.
nNode = *pSectNd;
857 if (
nullptr == pSectNd ||
881 if ( !_bNewTOX && !pDefaultPageDesc )
886 pDefaultPageDesc = pSectNd->
FindPageDesc( pPgDescNdIdx );
887 if ( nPgDescNdIdx < pSectNd->GetIndex() )
889 pDefaultPageDesc =
nullptr;
893 if ( !pDefaultPageDesc &&
903 if ( eBreak != SvxBreak::PageBefore && eBreak != SvxBreak::PageBoth )
909 if ( !pDefaultPageDesc &&
920 if ( !pDefaultPageDesc )
940 const SwTextNode* pOwnChapterNode = pChapterSectNd
1005 assert(pCNd != pFirstEmptyNd);
1006 assert(pCNd->
GetIndex() < pFirstEmptyNd->GetIndex());
1011 if( aBrkSet.Count() )
1012 pFirstEmptyNd->SetAttr( aBrkSet );
1054 aStt, *pSectFormat, headerData,
nullptr, &aIdx,
true,
false);
1063 std::vector<SwTextFormatColl*> aCollArr(
GetTOXForm().GetFormMax(),
nullptr );
1064 std::unordered_map<OUString, int> markURLs;
1066 for(
size_t nCnt = 0; nCnt <
m_aSortArr.size(); ++nCnt )
1071 sal_uInt16 nLvl =
m_aSortArr[ nCnt ]->GetLevel();
1076 aCollArr[ nLvl ] = pColl;
1098 pNextMark = &(
m_aSortArr[nCnt + nRange]->pTextMark->GetTOXMark());
1110 std::shared_ptr<sw::ToxTabStopTokenHandler> tabStopTokenHandler =
1111 std::make_shared<sw::DefaultToxTabStopTokenHandler>(
1122 aInsPos = *pFirstEmptyNd;
1124 SwPaM aCorPam( *pFirstEmptyNd );
1137 aEndIdx = *pFirstEmptyNd;
1150 aN2L.RestoreUpperFrames( rDoc.
GetNodes(), nIdx, nIdx + 1 );
1152 for (
const auto& rpLayout : aAllLayouts )
1179 if( !sDeli.isEmpty() && sLastDeli != sDeli )
1182 if(
' ' <= sDeli[0] )
1184 std::unique_ptr<SwTOXCustom> pCst(
1185 MakeSwTOXSortTabBase<SwTOXCustom>(
nullptr,
1210 sal_uInt16 nPoolFormat = 0;
1238 nPoolFormat = nPoolFormat + 1;
1243 nPoolFormat += 1 == nLevel ? nLevel + 3 : nLevel - 1;
1246 nPoolFormat = nPoolFormat +
nLevel;
1254 if (
auto pFindHint = dynamic_cast<const sw::FindContentFrameHint*>(&rHint))
1256 if(pFindHint->m_rpContentFrame)
1272 pFindHint->m_rpContentFrame = pCNd->
getLayoutFrame(&pFindHint->m_rLayout);
1285 std::vector<std::reference_wrapper<SwTextTOXMark>> vMarks;
1286 pType->CollectTextTOXMarksForLayout(vMarks, pLayout);
1287 for(
auto& rMark: vMarks)
1290 auto& rNode = rMark.get().GetTextNode();
1293 auto rTOXMark = rMark.get().GetTOXMark();
1303 if (!rTOXMark.GetSecondaryKey().isEmpty())
1311 InsertSorted(MakeSwTOXSortTabBase<SwTOXContent>(pLayout, rNode, &rMark.get(), rIntl));
1324 for(
auto pOutlineNode : rOutlNds )
1328 if( pTextNd && pTextNd->Len() && pTextNd->HasWriterListeners() &&
1330 pTextNd->getLayoutFrame(pLayout) &&
1331 !pTextNd->IsHiddenByParaField() &&
1332 !pTextNd->HasHiddenCharAttribute(
true ) &&
1334 ||
static_cast<SwTextFrame*
>(pTextNd->getLayoutFrame(pLayout))->GetTextNodeForParaProps() == pTextNd) &&
1350 if (sTmpStyleNames.isEmpty())
1370 if (pTextNd->GetText().getLength() &&
1371 pTextNd->getLayoutFrame(pLayout) &&
1372 pTextNd->GetNodes().IsDocNodes() &&
1374 ||
static_cast<SwTextFrame*
>(pTextNd->getLayoutFrame(pLayout))->GetTextNodeForParaProps() == pTextNd) &&
1393 std::vector<SwFormatField*> vFields;
1395 for(
auto pFormatField: vFields)
1397 const SwTextField* pTextField = pFormatField->GetTextField();
1401 if (rTextNode.
GetText().getLength() &&
1415 pNew->SetStartIndex(
1420 pNew->SetEndIndex(pTextField->
GetStart() + 1);
1422 pNew->InitText(pLayout);
1436 std::vector<SwFormatField*> vFields;
1438 for(
auto pFormatField: vFields)
1440 const auto pTextField = pFormatField->GetTextField();
1444 if (rTextNode.
GetText().getLength() &&
1456 pTextNode = &rTextNode;
1458 InsertSorted(MakeSwTOXSortTabBase<SwTOXAuthority>(pLayout, *pTextNode, *pFormatField, rIntl));
1465 static const struct SoObjType {
1471 sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15;
1490 for( SoObjType
const & rArr :
aArr )
1491 for (
auto & rId : rArr.aGlNmIds)
1496 rId.b8, rId.b9, rId.b10, rId.b11,
1497 rId.b12, rId.b13, rId.b14, rId.b15 );
1498 if( rFactoryNm == aGlbNm )
1517 while( nIdx < nEndIdx )
1521 SwNode* pNd = rNds[ nIdx ];
1526 if( !pNd->IsNoTextNode() )
1532 pCNd = rNds.
GoNext( &aTmp );
1537 if( pNd->IsGrfNode() )
1538 pCNd = static_cast<SwContentNode*>(pNd);
1541 if( pNd->IsOLENode() )
1543 bool bInclude =
true;
1555 || (nMyOLEOptions & nObj);
1559 OSL_FAIL(
"OLE Object no loaded?");
1574 int nSetLevel = USHRT_MAX;
1598 std::unique_ptr<SwTOXPara> pNew( MakeSwTOXSortTabBase<SwTOXPara>(
1599 pLayout, *pCNd, eMyType,
1600 ( USHRT_MAX != nSetLevel )
1601 ? o3tl::narrowing<sal_uInt16>(nSetLevel)
1607 nIdx = pNd->StartOfSectionNode()->EndOfSectionIndex() +
SwNodeOffset(2);
1619 for(
auto pFrameFormat : rArr )
1625 if( pTmpTable &&
nullptr != (pFBox = pTmpTable->GetTabSortBoxes()[0] ) &&
1632 while(
nullptr != ( pCNd = rNds.
GoNext( &aContentIdx ) ) &&
1640 std::unique_ptr<SwTOXTable> pNew(
new SwTOXTable( *pCNd ));
1650 pNew->SetLevel(o3tl::narrowing<sal_uInt16>(nTmp));
1654 pNew->InitText(pLayout);
1671 sal_uInt16 nPage = 0;
1679 for(
size_t nCnt = 0; nCnt <
m_aSortArr.size(); ++nCnt )
1694 nullptr != (pNextMark = &(
m_aSortArr[nCnt + nRange]->pTextMark->GetTOXMark())) &&
1702 for(
size_t nRunInEntry = nCnt; nRunInEntry < nCnt + nRange; ++nRunInEntry)
1704 std::vector<sal_uInt16> aNums;
1705 std::vector<SwPageDesc*> aDescs;
1706 std::vector<sal_uInt16> aMainNums;
1709 for (
size_t j = 0; j < nSize; ++j)
1714 if( rTOXSource.pNd )
1717 OSL_ENSURE( pFrame || pDoc->
IsUpdateTOX(),
"TOX, no Frame found");
1730 if (!pNext || nPos < pNext->GetOffset())
1737 if( pTmpPage != pCurrentPage )
1740 pCurrentPage = pTmpPage;
1744 std::vector<sal_uInt16>::size_type
i;
1745 for( i = 0; i < aNums.size() && aNums[i] < nPage; ++i )
1748 if( i >= aNums.size() || aNums[ i ] != nPage )
1750 aNums.insert(aNums.begin() + i, nPage);
1751 aDescs.insert(aDescs.begin() + i, pCurrentPage->
GetPageDesc() );
1755 rTOXSource.bMainEntry)
1757 aMainNums.push_back(nPage);
1766 OSL_ENSURE( pTextNd,
"no TextNode, wrong TOC" );
1768 UpdatePageNum_( const_cast<SwTextNode*>(pTextNd), aNums, aDescs, &aMainNums,
1779 static bool lcl_HasMainEntry(
const std::vector<sal_uInt16>* pMainEntryNums, sal_uInt16 nToFind )
1781 if (!pMainEntryNums)
1784 for(
auto nMainEntry : *pMainEntryNums )
1785 if (nToFind == nMainEntry)
1791 const std::vector<sal_uInt16>& rNums,
1792 const std::vector<SwPageDesc*>& rDescs,
1793 const std::vector<sal_uInt16>* pMainEntryNums,
1797 std::optional< std::vector<sal_uInt16> > xCharStyleIdx;
1799 xCharStyleIdx.emplace();
1803 sal_Int32 nStartPos = pNd->
GetText().indexOf(sSrchStr);
1805 sal_Int32 nEndPos = pNd->
GetText().indexOf(sSrchStr);
1807 if (-1 == nEndPos || rNums.empty())
1810 if (-1 == nStartPos || nStartPos > nEndPos)
1811 nStartPos = nEndPos;
1813 sal_uInt16 nOld = rNums[0],
1816 OUString aNumStr( rDescs[0]->
GetNumType().GetNumStr( nBeg ) );
1819 xCharStyleIdx->push_back( 0 );
1827 for(
size_t nHintIdx = 0; nHintIdx < pHints->
Count(); ++nHintIdx)
1830 const sal_Int32 nTmpEnd = pAttr->
End() ? *pAttr->
End() : 0;
1831 if( nStartPos >= pAttr->
GetStart() &&
1832 (nStartPos + 2) <= nTmpEnd &&
1839 pNd->
EraseText(aPos, nEndPos - nStartPos + 2);
1841 std::vector<sal_uInt16>::size_type
i;
1842 for( i = 1; i < rNums.size(); ++i)
1853 if(nOld == rNums[i]-1 && !bMainEntryChanges &&
1871 aNumStr += aType.
GetNumStr( nBeg + nCount );
1878 if (xCharStyleIdx && bMainEntryChanges)
1880 xCharStyleIdx->push_back(aNumStr.getLength());
1890 if (i+1 != rNums.size())
1906 else if(nCount == 1)
1910 aNumStr += rDescs[i-1]->GetNumType().GetNumStr( nBeg+nCount );
1914 if(pPageNoCharFormat)
1925 if (xCharStyleIdx->size()&0x01)
1926 xCharStyleIdx->push_back(aNumStr.getLength());
1932 if(USHRT_MAX != nPoolId)
1940 sal_Int32 nOffset = pNd->
GetText().getLength() - aNumStr.getLength();
1942 for (
size_t j = 0; j < xCharStyleIdx->size(); j += 2)
1944 sal_Int32 nStartIdx = (*xCharStyleIdx)[j] + nOffset;
1945 sal_Int32 nEndIdx = (*xCharStyleIdx)[j + 1] + nOffset;
1955 const SwTOXMark& rMark = pNew->pTextMark->GetTOXMark();
1974 for(
short i = static_cast<short>(aRange.Min()); i < static_cast<short>(aRange.Max()); ++
i)
1997 for( i = aRange.Min(); i < aRange.Max(); ++i)
2015 pOld->
aTOXSources.push_back(pNew->aTOXSources[0]);
2019 #if OSL_DEBUG_LEVEL > 0
2021 OSL_FAIL(
"Bibliography entries cannot be found here");
2024 if (pNew->sort_lt(*pOld))
2029 m_aSortArr[i]->GetLevel() > pNew->GetLevel() )
2039 sal_uInt16 nLevel,
const Range& rRange )
2047 + aToCompare.
sText.subView(1);
2050 OSL_ENSURE(rRange.
Min() >= 0 && rRange.
Max() >= 0,
"Min Max < 0");
2057 for( i = nMin; i < nMax; ++i)
2068 std::unique_ptr<SwTOXCustom> pKey(MakeSwTOXSortTabBase<SwTOXCustom>(
2069 nullptr, aToCompare, nLevel, rIntl, rNew.
GetLocale() ));
2070 for(i = nMin; i < nMax; ++i)
2081 for(i = nStart; i < nEnd; ++i)
2085 return Range(nStart, i);
2088 return Range(nStart, nEnd);
virtual SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)=0
OUString GetNumStr(sal_Int32 nNo) const
SwSectionNode * FindSectionNode()
Search section node, in which it is.
Instances of SwFields and those derived from it occur 0 to n times.
#define SO3_SM_CLASSID_60
const SwEndNode * EndOfSectionNode() const
virtual void SwClientNotify(const SwModify &rMod, const SfxHint &rHint) override
const css::lang::Locale & GetLocale() const
OUString GetIndexKey(const TextAndReading &rTaR, const css::lang::Locale &rLcl) const
Base class of the Writer layout elements.
const sal_Unicode C_NUM_REPL
Represents the visualization of a paragraph.
const SfxItemSet * GetAttrSet() const
bool IsMarkHintHidden(SwRootFrame const &rLayout, SwTextNode const &rNode, SwTextAttrEnd const &rHint)
void SetAttrSet(const SfxItemSet &)
std::vector< SwSection * > SwSections
bool IsInMailMerge() const
bool operator>=(const BigInt &rVal1, const BigInt &rVal2)
OUString const & GetSecondaryKeyReading() const
SwNode & GetEndOfAutotext() const
Section for all Flys/Header/Footers.
SwNodeOffset EndOfSectionIndex() const
Represents the style of a paragraph.
std::unique_ptr< SwDefTOXBase_Impl > mpDefTOXBases
Marks a position in the document model.
SwTOXElement GetCreateType() const
SwTOIOptions GetOptions() const
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
SwPageDesc * GetPageDesc()
const SwOLEObj & GetOLEObj() const
SwCharFormat * MakeCharFormat(const OUString &rFormatName, SwCharFormat *pDerivedFrom, bool bBroadcast=false)
const OUString & GetText() const
virtual const SwRootFrame * GetCurrentLayout() const =0
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.
virtual bool get(DocumentSettingId id) const override
Return the specified document setting.
OUString const & GetPrimaryKey() const
constexpr SwNodeOffset NODE_OFFSET_MAX(SAL_MAX_INT32)
SwDocShell * GetDocShell()
SwpHints * GetpSwpHints()
const SwFrameFormats * GetTableFrameFormats() const
void DelSectionFormat(SwSectionFormat *pFormat, bool bDelNodes=false)
virtual SwFieldType * GetFieldType(SwFieldIds nResId, const OUString &rName, bool bDbFieldMatching) const =0
SwNodeOffset StartOfSectionIndex() const
static SwTOXBase * GetCurTOX(const SwPosition &rPos)
Get current table of contents.
const SwTOXType * InsertTOXType(const SwTOXType &rTyp)
void InsertAlphaDelimiter(const SwTOXInternational &rIntl)
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
void SetSectionName(OUString const &rName)
const SwTextNode * GetBodyTextNode(const SwDoc &rDoc, SwPosition &rPos, const SwFrame &rFrame)
Forward declaration: get "BodyTextNode" for exp.fld in Fly's headers/footers/footnotes.
static bool lcl_HasMainEntry(const std::vector< sal_uInt16 > *pMainEntryNums, sal_uInt16 nToFind)
Replace the PageNumber place holders.
virtual void SetModified()=0
Must be called manually at changes of format.
sal_uInt16 GetType() const
std::vector< SwTOXMark * > SwTOXMarks
#define SO3_SIMPRESS_CLASSID_30
#define SO3_SIMPRESS_CLASSID_60
virtual sal_uInt16 GetLevel() const =0
void CollectTextMarks(SwTOXMarks &rMarks) const
#define SO3_SCH_CLASSID_30
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
#define TOX_STYLE_DELIMITER
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
virtual SwUndoId EndUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Closes undo block.
void TitleSectionInserted(SwSectionFormat &rSectionFormat)
constexpr sal_uInt8 MAXLEVEL
This class generates text for the entries of a table of x.
WW8LvlType GetNumType(sal_uInt8 nWwLevelNo)
#define SO3_SDRAW_CLASSID_50
virtual void DeleteRange(SwPaM &)=0
Delete a range SwFlyFrameFormat.
static SwContentNode * GoPrevious(SwNodeIndex *)
bool HasDummyChar() const
OUString newName(std::u16string_view aNewPrefix, const OUString &aOldPrefix, std::u16string_view old_Name)
void UpdateTemplate(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Generate table of contents from template areas.
SwSectionFormat * GetFormat()
bool operator<=(const BigInt &rVal1, const BigInt &rVal2)
bool IsTOXBaseInReadonly() const
IDocumentUndoRedo & GetIDocumentUndoRedo()
#define SO3_SC_CLASSID_40
const SwTOXType * GetTOXType() const
static const SwAttrSet & GetTOXBaseAttrSet(const SwTOXBase &rTOX)
#define FORM_SECONDARY_KEY
IDocumentContentOperations const & getIDocumentContentOperations() const
The root element of a Writer document layout.
OUString GetFollowingText(bool bMorePages) const
bool SetTOXBaseName(const SwTOXBase &rTOXBase, const OUString &rName)
int GetAttrOutlineLevel() const
Returns outline level of this text node.
void GatherFields(std::vector< SwFormatField * > &rvFormatFields, bool bCollectOnlyInDocNodes=true) const
const SwSection & GetSection() const
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
#define SO3_SCH_CLASSID_40
OUString const & GetPrimaryKeyReading() const
bool IsAssignedToListLevelOfOutlineStyle() const
static SwTOOElements lcl_IsSOObject(const SvGlobalName &rFactoryNm)
const SwTOXType * GetTOXType() const
const SvxFormatBreakItem & GetBreak(bool=true) const
SwTOXBaseSection * InsertTableOf(const SwPosition &rPos, const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr, bool bExpand=false, SwRootFrame const *pLayout=nullptr)
const SwTOXMark & GetTOXMark() const
const SwRect & getFrameArea() const
#define SO3_SC_CLASSID_30
A wrapper around SfxPoolItem to store the start position of (usually) a text portion, with an optional end.
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
virtual bool equivalent(const SwTOXSortTabBase &)
bool IsEqual(const TextAndReading &rTaR1, const css::lang::Locale &rLocale1, const TextAndReading &rTaR2, const css::lang::Locale &rLocale2) const
sal_Int32 GetStart() const
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
const SwTextNode * pTOXNd
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
bool DeleteTOX(const SwTOXBase &rTOXBase, bool bDelNodes)
Delete table of contents.
sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const
Manage table of content types.
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
bool IsProtectFlag() const
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
SwNodeOffset GetIndex() const
const OUString & GetSequenceName() const
#define SO3_SC_CLASSID_60
SwSectionFormat * MakeSectionFormat()
OUString ToUpper(const OUString &rStr, sal_Int32 nPos) const
#define SO3_SCH_CLASSID_60
SwTOOElements GetOLEOptions() const
virtual bool DoesUndo() const =0
Is Undo enabled?
OUString maMSTOCExpression
sal_uInt16 GetSeqNumber() const
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
#define SO3_SC_CLASSID_50
sal_uInt16 GetVirtPageNum() const
void UpdatePageNum()
Calculate PageNumber and insert after formatting.
PaM is Point and Mark: a selection of the document model.
Range GetKeyRange(const OUString &rStr, const OUString &rStrReading, const SwTOXSortTabBase &rNew, sal_uInt16 nLevel, const Range &rRange)
Find Key Range and insert if possible.
const SwAttrSet * GetpSwAttrSet() const
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
static sal_Int32 GetReferenceTextPos(const SwFormatField &rFormat, SwDoc &rDoc, sal_Int32 nHint=0)
Find the index of the reference text following the current field.
#define SO3_SM_CLASSID_50
#define SO3_SCH_CLASSID_50
static SwTable * FindTable(SwFrameFormat const *const pFormat)
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
std::vector< std::unique_ptr< SwTOXSortTabBase > > m_aSortArr
void DeRegister()
deregister the currently registered History
virtual SwUndoId StartUndo(SwUndoId const eUndoId, SwRewriter const *const pRewriter)=0
Opens undo block.
const SwContentFrame * GetFollow() const
SwTextAttr * Get(size_t nPos) const
SwTOXBaseSection(SwTOXBase const &rBase, SwSectionFormat &rFormat)
std::unique_ptr< SwTOXTypes > mpTOXTypes
const SwStartNode * StartOfSectionNode() const
const OUString & GetSectionName() const
const SwPosition * GetPoint() const
std::vector< SwSectionFormat * >::size_type size_type
void UpdateOutline(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Generate table of contents from outline.
SwIndex & Assign(SwIndexReg *, sal_Int32)
const SwPageDesc & GetPageDesc(const size_t i) const
sw::FieldmarkMode GetFieldmarkMode() const
void SetProtect(bool const bFlag=true)
virtual void SwClientNotify(const SwModify &rModify, const SfxHint &rHint) override
SwPageFrame * FindPageFrame()
TextFrameIndex MapModelToView(MergedPara const &, SwTextNode const *pNode, sal_Int32 nIndex)
bool IsFromObjectNames() const
bool IsHiddenFlag() const
virtual bool DeleteRedline(const SwPaM &rPam, bool bSaveInUndo, RedlineType nDelType)=0
SwPageDesc * GetPageDesc()
bool SetPosAtStartEnd(SwPosition &rPos) const
SwContentNode * GetContentNode()
SwNodeOffset GetIndex() const
#define SO3_SIMPRESS_CLASSID_40
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
OUString GetText(SwRootFrame const *pLayout) const
Marks a character position inside a document model node.
void UpdateTable(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Collect table entries.
WhichRangesContainer const aBreakSetRange(svl::Items< RES_PAGEDESC, RES_BREAK >)
const OUString & GetTypeName() const
const SwTextNode * GetpTextNd() const
IDocumentState const & getIDocumentState() const
static bool IsHeadingContained(const SwTextNode *pChptrNd, const SwNode &rNd)
bool operator<(const wwFont &r1, const wwFont &r2)
void GetTOIKeys(SwTOIKeyType eTyp, std::vector< OUString > &rArr, SwRootFrame const &rLayout) const
const SwTOXInternational * pTOXIntl
Marks a node in the document model.
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
SwNodes & GetNodes()
Node is in which nodes-array/doc?
SwTextFormatColl * GetTextFormatColl(sal_uInt16 nLevel)
Evaluate Template.
static std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type MakeSwTOXSortTabBase(SwRootFrame const *const pLayout, Args &&...args)
bool HasSwAttrSet() const
void Register(SwRegHistory *pHist)
register a History, which receives all attribute changes (for Undo)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
void UpdateAuthorities(const SwTOXInternational &rIntl, SwRootFrame const *pLayout)
bool IsFromChapter() const
sal_uInt16 GetLevel() const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
A page of the document layout.
SwSectionNode * InsertTextSection(SwNodeIndex const &rNdIdx, SwSectionFormat &rSectionFormat, SwSectionData const &, SwTOXBase const *const pTOXBase, SwNodeIndex const *const pEnd, bool const bInsAtStart=true, bool const bCreateFrames=true)
Insert a new SwSection.
const SwTOXMark & GotoTOXMark(const SwTOXMark &rCurTOXMark, SwTOXSearch eDir, bool bInReadOnly)
const OUString & GetTitle() const
virtual ~SwTOXBaseSection() override
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
SwCaptionDisplay GetCaptionDisplay() const
SwTable is one table in the document model, containing rows (which contain cells).
const sal_Unicode C_END_PAGE_NUM
bool operator!=(const ScCsvLayoutData &rData1, const ScCsvLayoutData &rData2)
void UpdateSequence(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Generate content from sequence fields.
const OUString & GetSortAlgorithm() const
void DeleteAttribute(SwTextAttr *const pTextAttr)
delete the attribute pTextAttr
std::unique_ptr< SwSectionFormats > mpSectionFormatTable
bool IsOleRef() const
To avoid unnecessary loading of object.
const SwTextNode & GetTextNode() const
void EraseText(const SwIndex &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...
const SwPageDesc * FindPageDesc(SwNodeOffset *pPgDescNdIdx=nullptr) const
Search PageDesc with which this node is formatted.
OUString InsertText(const OUString &rStr, const SwIndex &rIdx, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
insert text content
SwCharFormat * FindCharFormatByName(const OUString &rName) const
const css::lang::Locale & GetLocale(const LanguageType aLang)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwTextNode is a paragraph in the document model.
void DeleteTOXMark(const SwTOXMark *pTOXMark)
Delete table of contents Mark.
static constexpr OUStringLiteral S_PAGE_DELI
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
#define SO3_SIMPRESS_CLASSID_50
void SetTOXName(const OUString &rSet)
const SwStartNode * GetSttNd() const
const SwTextNode * FindOutlineNodeOfLevel(sal_uInt8 nLvl, SwRootFrame const *pLayout=nullptr) const
virtual bool SetAttr(const SfxPoolItem &)
made virtual
An SwTextAttr container, stores all directly formatted text portions for a text node.
void InsertSorted(std::unique_ptr< SwTOXSortTabBase > pBase)
void Update(const SfxItemSet *pAttr=nullptr, SwRootFrame const *pLayout=nullptr, const bool _bNewTOX=false)
Collect table of contents content.
OUString GetUniqueTOXBaseName(const SwTOXType &rType, const OUString &sChkStr) const
void CorrAbs(const SwNodeIndex &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
bool IsFieldDeletedInModel(IDocumentRedlineAccess const &rIDRA, SwTextField const &rTextField)
OUString const & GetSecondaryKey() const
static const SwTextNode * lcl_FindChapterNode(const SwNode &rNd, SwRootFrame const *const pLayout, sal_uInt8 const nLvl=0)
static sal_uInt16 GetCurTOXMark(const SwPosition &rPos, SwTOXMarks &)
Get current table of contents Mark.
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
OUString const & GetStyleNames(sal_uInt16 nLevel) const
#define SO3_SM_CLASSID_40
sal_Int32 GetIndex() const
OString DateTimeToOString(const DateTime &rDateTime)
void SetProgressState(tools::Long nPosition, SwDocShell const *pDocShell)
LanguageType GetLanguage() const
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
::sw::DocumentSettingManager & GetDocumentSettingManager()
void Top(const tools::Long nTop)
const SwModify * GetRegisteredIn() const
const sal_Int32 * End() const
SwTableBox is one table cell in the document model.
#define FORM_ALPHA_DELIMITER
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 Delete(const SwNodeIndex &rPos, SwNodeOffset nNodes=SwNodeOffset(1))
delete nodes
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding)...
virtual bool AppendTextNode(SwPosition &rPos)=0
const OUString & GetMainEntryCharStyle() const
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
SwMoveFnCollection const & fnMoveBackward
const char cSequenceMarkSeparator
void UpdatePageNum_(SwTextNode *pNd, const std::vector< sal_uInt16 > &rNums, const std::vector< SwPageDesc * > &rDescs, const std::vector< sal_uInt16 > *pMainEntryNums, const SwTOXInternational &rIntl)
SwTableNode * FindTableNode()
Search table node, in which it is.
void ChgFormat(SwFormat &rFormat, const SfxItemSet &rSet)
void UpdateMarks(const SwTOXInternational &rIntl, const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Create from Marks.
static SwTOIOptions GetOptions()
void DelFlyInRange(const SwNodeIndex &rMkNdIdx, const SwNodeIndex &rPtNdIdx, SwIndex const *const pMkIdx, SwIndex const *const pPtIdx)
Delete and move all Flys at the paragraph, that are within the selection.
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc...
bool HasMergedParas() const
Subgroup table of contents.
SwSectionNode * GetSectionNode()
const SwTextTOXMark * GetTextTOXMark() const
SectionType GetType() const
bool Seek_Entry(SwNode *rP, size_type *pnPos) const
const SwTOXType * GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
sal_uInt16 GetSectionLevel() const
Returns the section level at the position given by aIndex.
const SwForm & GetTOXForm() const
SwTextNode & GetTextNode() const
const SwFormatCharFormat & GetCharFormat() const
#define SO3_SDRAW_CLASSID_60
int GetAttrOutlineLevel() const
std::vector< SwNode * >::size_type size_type
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
void SetDefaultTOXBase(const SwTOXBase &rBase)
TextAndReading const & GetText() const
SwSection * InsertSwSection(SwPaM const &rRange, SwSectionData &, std::tuple< SwTOXBase const *, sw::RedlineMode, sw::FieldmarkMode > const *pTOXBase, SfxItemSet const *const pAttr, bool const bUpdate=true)
#define SO3_SM_CLASSID_30
virtual bool sort_lt(const SwTOXSortTabBase &)
Class for sorting directories.
bool operator==(const ScCsvLayoutData &rData1, const ScCsvLayoutData &rData2)
Merge GetRedlineMergeFlag() const
SwContentNode * GoNext(SwNodeIndex *) const
void UpdateContent(SwTOXElement eType, const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
std::vector< SwTOXSource > aTOXSources
const SwTOXBase * GetDefaultTOXBase(TOXTypes eTyp, bool bCreate)
bool IsLevelFromChapter() const
const SwAttrPool & GetAttrPool() const
const OUString & GetTOXName() const
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
SwTextNode * MakeTextNode(const SwNodeIndex &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
Base class of the Writer document model elements.
SwTextFormatColl * GetTextColl() const