LibreOffice Module sw (master) 1
doctxm.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <limits.h>
21#include <hintids.hxx>
24#include <o3tl/string_view.hxx>
25#include <docsh.hxx>
26#include <ndole.hxx>
27#include <txttxmrk.hxx>
28#include <fmtpdsc.hxx>
29#include <frmatr.hxx>
30#include <pagedesc.hxx>
31#include <doc.hxx>
32#include <IDocumentUndoRedo.hxx>
36#include <IDocumentState.hxx>
39#include <pagefrm.hxx>
40#include <ndtxt.hxx>
41#include <swtable.hxx>
42#include <doctxm.hxx>
43#include <txmsrt.hxx>
44#include <rolbck.hxx>
45#include <poolfmt.hxx>
46#include <txtfrm.hxx>
47#include <rootfrm.hxx>
48#include <UndoAttribute.hxx>
49#include <UndoSection.hxx>
50#include <swundo.hxx>
51#include <mdiexp.hxx>
52#include <docary.hxx>
53#include <charfmt.hxx>
54#include <fchrfmt.hxx>
55#include <fldbas.hxx>
56#include <fmtfld.hxx>
57#include <txtfld.hxx>
58#include <expfld.hxx>
59#include <mvsave.hxx>
60#include <node2lay.hxx>
61#include <SwStyleNameMapper.hxx>
62#include <breakit.hxx>
63#include <calbck.hxx>
64#include <ToxTextGenerator.hxx>
66#include <frameformats.hxx>
68#include <tools/globname.hxx>
69#include <com/sun/star/embed/XEmbeddedObject.hpp>
70#include <o3tl/safeint.hxx>
71#include <osl/diagnose.h>
72
73#include <memory>
74
75using namespace ::com::sun::star;
76
77template<typename T, typename... Args> static
78typename std::enable_if<!std::is_array<T>::value, std::unique_ptr<T>>::type
79MakeSwTOXSortTabBase(SwRootFrame const*const pLayout, Args&& ... args)
80{
81 std::unique_ptr<T> pRet(new T(std::forward<Args>(args)...));
82 pRet->InitText(pLayout); // ensure it's expanded with the layout
83 return pRet;
84}
85
86void SwDoc::GetTOIKeys(SwTOIKeyType eTyp, std::vector<OUString>& rArr,
87 SwRootFrame const& rLayout) const
88{
89 rArr.clear();
90
91 // Look up all Primary and Secondary via the Pool
92 for (const SfxPoolItem* pPoolItem : GetAttrPool().GetItemSurrogates(RES_TXTATR_TOXMARK))
93 {
94 const SwTOXMark* pItem = dynamic_cast<const SwTOXMark*>(pPoolItem);
95 if( !pItem )
96 continue;
97 const SwTOXType* pTOXType = pItem->GetTOXType();
98 if ( !pTOXType || pTOXType->GetType()!=TOX_INDEX )
99 continue;
100 const SwTextTOXMark* pMark = pItem->GetTextTOXMark();
101 if ( pMark && pMark->GetpTextNd() &&
102 pMark->GetpTextNd()->GetNodes().IsDocNodes() &&
103 (!rLayout.IsHideRedlines()
104 || !sw::IsMarkHintHidden(rLayout, *pMark->GetpTextNd(), *pMark)))
105 {
106 const OUString sStr = TOI_PRIMARY == eTyp
107 ? pItem->GetPrimaryKey()
108 : pItem->GetSecondaryKey();
109
110 if( !sStr.isEmpty() )
111 rArr.push_back( sStr );
112 }
113 }
114}
115
117sal_uInt16 SwDoc::GetCurTOXMark( const SwPosition& rPos,
118 SwTOXMarks& rArr )
119{
120 // search on Position rPos for all SwTOXMarks
121 SwTextNode *const pTextNd = rPos.GetNode().GetTextNode();
122 if( !pTextNd || !pTextNd->GetpSwpHints() )
123 return 0;
124
125 const SwpHints & rHts = *pTextNd->GetpSwpHints();
126 sal_Int32 nSttIdx;
127 const sal_Int32 *pEndIdx;
128
129 const sal_Int32 nCurrentPos = rPos.GetContentIndex();
130
131 for( size_t n = 0; n < rHts.Count(); ++n )
132 {
133 const SwTextAttr* pHt = rHts.Get(n);
134 if( RES_TXTATR_TOXMARK != pHt->Which() )
135 continue;
136 if( ( nSttIdx = pHt->GetStart() ) < nCurrentPos )
137 {
138 // also check the end
139 pEndIdx = pHt->End();
140 if( nullptr == pEndIdx || *pEndIdx <= nCurrentPos )
141 continue; // keep searching
142 }
143 else if( nSttIdx > nCurrentPos )
144 // If Hint's Start is greater than rPos, break, because
145 // the attributes are sorted by Start!
146 break;
147
148 SwTOXMark* pTMark = const_cast<SwTOXMark*>(&pHt->GetTOXMark());
149 rArr.push_back( pTMark );
150 }
151 return rArr.size();
152}
153
155void SwDoc::DeleteTOXMark( const SwTOXMark* pTOXMark )
156{
157 const SwTextTOXMark* pTextTOXMark = pTOXMark->GetTextTOXMark();
158 assert(pTextTOXMark);
159
160 SwTextNode& rTextNd = const_cast<SwTextNode&>(pTextTOXMark->GetTextNode());
161 assert(rTextNd.GetpSwpHints());
162
163 if (pTextTOXMark->HasDummyChar())
164 {
165 // tdf#106377 don't use SwUndoResetAttr, it uses NOTXTATRCHR
166 SwPaM tmp(rTextNd, pTextTOXMark->GetStart(),
167 rTextNd, pTextTOXMark->GetStart()+1);
168 assert(rTextNd.GetText()[pTextTOXMark->GetStart()] == CH_TXTATR_INWORD);
170 }
171 else
172 {
173 std::unique_ptr<SwRegHistory> aRHst;
174 if (GetIDocumentUndoRedo().DoesUndo())
175 {
176 // save attributes for Undo
177 SwUndoResetAttr* pUndo = new SwUndoResetAttr(
178 SwPosition( rTextNd, pTextTOXMark->GetStart() ),
180 GetIDocumentUndoRedo().AppendUndo( std::unique_ptr<SwUndo>(pUndo) );
181
182 aRHst.reset(new SwRegHistory(rTextNd, &pUndo->GetHistory()));
183 rTextNd.GetpSwpHints()->Register(aRHst.get());
184 }
185
186 rTextNd.DeleteAttribute( const_cast<SwTextTOXMark*>(pTextTOXMark) );
187
188 if (GetIDocumentUndoRedo().DoesUndo())
189 {
190 if( rTextNd.GetpSwpHints() )
191 rTextNd.GetpSwpHints()->DeRegister();
192 }
193 }
194
196}
197
198namespace {
199
201class CompareNodeContent
202{
203 SwNodeOffset m_nNode;
204 sal_Int32 m_nContent;
205public:
206 CompareNodeContent( SwNodeOffset nNd, sal_Int32 nCnt )
207 : m_nNode( nNd ), m_nContent( nCnt ) {}
208
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); }
225};
226
227}
228
229const SwTOXMark& SwDoc::GotoTOXMark( const SwTOXMark& rCurTOXMark,
230 SwTOXSearch eDir, bool bInReadOnly )
231{
232 const SwTextTOXMark* pMark = rCurTOXMark.GetTextTOXMark();
233
234 CompareNodeContent aAbsIdx(pMark ? pMark->GetpTextNd()->GetIndex() : SwNodeOffset(0), pMark ? pMark->GetStart() : 0);
235 CompareNodeContent aPrevPos( SwNodeOffset(0), 0 );
236 CompareNodeContent aNextPos( NODE_OFFSET_MAX, SAL_MAX_INT32 );
237 CompareNodeContent aMax( SwNodeOffset(0), 0 );
238 CompareNodeContent aMin( NODE_OFFSET_MAX, SAL_MAX_INT32 );
239
240 const SwTOXMark* pNew = nullptr;
241 const SwTOXMark* pMax = &rCurTOXMark;
242 const SwTOXMark* pMin = &rCurTOXMark;
243
244 const SwTOXType* pType = rCurTOXMark.GetTOXType();
245 SwTOXMarks aMarks;
246 pType->CollectTextMarks(aMarks);
247
248 for(SwTOXMark* pTOXMark : aMarks)
249 {
250 if ( pTOXMark == &rCurTOXMark )
251 continue;
252
253 pMark = pTOXMark->GetTextTOXMark();
254 if (!pMark)
255 continue;
256
257 SwTextNode const*const pTOXSrc = pMark->GetpTextNd();
258 if (!pTOXSrc)
259 continue;
260
261 Point aPt;
262 std::pair<Point, bool> const tmp(aPt, false);
263 const SwContentFrame* pCFrame = pTOXSrc->getLayoutFrame(
264 getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, &tmp);
265 if (!pCFrame)
266 continue;
267
268 if ( bInReadOnly || !pCFrame->IsProtected() )
269 {
270 CompareNodeContent aAbsNew( pTOXSrc->GetIndex(), pMark->GetStart() );
271 switch( eDir )
272 {
273 // The following (a bit more complicated) statements make it
274 // possible to also travel across Entries on the same (!)
275 // position. If someone has time, please feel free to optimize.
276 case TOX_SAME_PRV:
277 if (pTOXMark->GetText(nullptr) != rCurTOXMark.GetText(nullptr))
278 break;
279 [[fallthrough]];
280 case TOX_PRV:
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)) )
287 {
288 pNew = pTOXMark;
289 aPrevPos = aAbsNew;
290 if ( aAbsNew >= aMax )
291 {
292 aMax = aAbsNew;
293 pMax = pTOXMark;
294 }
295 }
296 break;
297
298 case TOX_SAME_NXT:
299 if (pTOXMark->GetText(nullptr) != rCurTOXMark.GetText(nullptr))
300 break;
301 [[fallthrough]];
302 case TOX_NXT:
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)) )
309 {
310 pNew = pTOXMark;
311 aNextPos = aAbsNew;
312 if ( aAbsNew <= aMin )
313 {
314 aMin = aAbsNew;
315 pMin = pTOXMark;
316 }
317 }
318 break;
319 }
320 }
321 }
322
323 // We couldn't find a successor
324 // Use minimum or maximum
325 if(!pNew)
326 {
327 switch(eDir)
328 {
329 case TOX_PRV:
330 case TOX_SAME_PRV:
331 pNew = pMax;
332 break;
333 case TOX_NXT:
334 case TOX_SAME_NXT:
335 pNew = pMin;
336 break;
337 default:
338 pNew = &rCurTOXMark;
339 }
340 }
341 return *pNew;
342}
343
345 const SwTOXBase& rTOX,
346 const SfxItemSet* pSet,
347 bool bExpand,
348 SwRootFrame const*const pLayout)
349{
350 SwPaM aPam( rPos );
351 return InsertTableOf( aPam, rTOX, pSet, bExpand, pLayout );
352}
353
355 const SwTOXBase& rTOX,
356 const SfxItemSet* pSet,
357 bool bExpand,
358 SwRootFrame const*const pLayout )
359{
360 assert(!bExpand || pLayout != nullptr);
361 GetIDocumentUndoRedo().StartUndo( SwUndoId::INSTOX, nullptr );
362
363 OUString sSectNm = GetUniqueTOXBaseName( *rTOX.GetTOXType(), rTOX.GetTOXName() );
364 SwSectionData aSectionData( SectionType::ToxContent, sSectNm );
365
366 std::tuple<SwTOXBase const*, sw::RedlineMode, sw::FieldmarkMode, sw::ParagraphBreakMode> const tmp(
367 &rTOX,
368 pLayout && pLayout->IsHideRedlines()
371 pLayout ? pLayout->GetFieldmarkMode() : sw::FieldmarkMode::ShowBoth,
373 SwTOXBaseSection *const pNewSection = dynamic_cast<SwTOXBaseSection *>(
374 InsertSwSection(aPam, aSectionData, & tmp, pSet, false));
375 if (pNewSection)
376 {
377 SwSectionNode *const pSectNd = pNewSection->GetFormat()->GetSectionNode();
378 pNewSection->SetTOXName(sSectNm); // rTOX may have had no name...
379
380 if( bExpand )
381 {
382 // add value for 2nd parameter = true to
383 // indicate, that a creation of a new table of content has to be performed.
384 // Value of 1st parameter = default value.
385 pNewSection->Update( nullptr, pLayout, true );
386 }
387 else if( rTOX.GetTitle().getLength()==1 && IsInReading() )
388 // insert title of TOX
389 {
390 // then insert the headline section
391 SwNodeIndex aIdx( *pSectNd, +1 );
392
393 SwTextNode* pHeadNd = GetNodes().MakeTextNode( aIdx.GetNode(),
394 getIDocumentStylePoolAccess().GetTextCollFromPool( RES_POOLCOLL_STANDARD ) );
395
396 SwSectionData headerData( SectionType::ToxHeader, pNewSection->GetTOXName()+"_Head" );
397
398 --aIdx;
399 SwSectionFormat* pSectFormat = MakeSectionFormat();
401 *pHeadNd, *pSectFormat, headerData, nullptr, &aIdx.GetNode(), true, false);
402 }
403 }
404
405 GetIDocumentUndoRedo().EndUndo( SwUndoId::INSTOX, nullptr );
406
407 return pNewSection;
408}
409
411 const SwTOXBase& rTOX,
412 const SfxItemSet* pSet )
413{
414 // check for recursive TOX
415 SwNode* pNd = GetNodes()[ nSttNd ];
416 SwSectionNode* pSectNd = pNd->FindSectionNode();
417 while( pSectNd )
418 {
419 SectionType eT = pSectNd->GetSection().GetType();
421 return;
422 pSectNd = pSectNd->StartOfSectionNode()->FindSectionNode();
423 }
424
425 const OUString sSectNm = GetUniqueTOXBaseName(*rTOX.GetTOXType(), rTOX.GetTOXName());
426
427 SwSectionData aSectionData( SectionType::ToxContent, sSectNm );
428
429 SwNodeIndex aStt( GetNodes(), nSttNd ), aEnd( GetNodes(), nEndNd );
431 if(pSet)
432 pFormat->SetFormatAttr(*pSet);
433
434 SwSectionNode *const pNewSectionNode =
435 GetNodes().InsertTextSection(aStt.GetNode(), *pFormat, aSectionData, &rTOX, &aEnd.GetNode());
436 if (!pNewSectionNode)
437 {
438 DelSectionFormat( pFormat );
439 return;
440 }
441
442 SwTOXBaseSection *const pNewSection(
443 dynamic_cast<SwTOXBaseSection*>(& pNewSectionNode->GetSection()));
444 if (pNewSection)
445 pNewSection->SetTOXName(sSectNm); // rTOX may have had no name...
446}
447
450{
451 SwNode& rNd = rPos.GetNode();
452 SwSectionNode* pSectNd = rNd.FindSectionNode();
453 while( pSectNd )
454 {
455 SectionType eT = pSectNd->GetSection().GetType();
456 if( SectionType::ToxContent == eT )
457 {
458 assert( dynamic_cast< const SwTOXBaseSection *>( &pSectNd->GetSection()) &&
459 "no TOXBaseSection!" );
460 SwTOXBaseSection& rTOXSect = static_cast<SwTOXBaseSection&>(
461 pSectNd->GetSection());
462 return &rTOXSect;
463 }
464 pSectNd = pSectNd->StartOfSectionNode()->FindSectionNode();
465 }
466 return nullptr;
467}
468
470{
471 assert( dynamic_cast<const SwTOXBaseSection*>( &rTOXBase) && "no TOXBaseSection!" );
472 const SwTOXBaseSection& rTOXSect = static_cast<const SwTOXBaseSection&>(rTOXBase);
473 SwSectionFormat const * pFormat = rTOXSect.GetFormat();
474 OSL_ENSURE( pFormat, "invalid TOXBaseSection!" );
475 return pFormat->GetAttrSet();
476}
477
478const SwTOXBase* SwDoc::GetDefaultTOXBase( TOXTypes eTyp, bool bCreate )
479{
480 std::unique_ptr<SwTOXBase>* prBase = nullptr;
481 switch(eTyp)
482 {
483 case TOX_CONTENT: prBase = &mpDefTOXBases->pContBase; break;
484 case TOX_INDEX: prBase = &mpDefTOXBases->pIdxBase; break;
485 case TOX_USER: prBase = &mpDefTOXBases->pUserBase; break;
486 case TOX_TABLES: prBase = &mpDefTOXBases->pTableBase; break;
487 case TOX_OBJECTS: prBase = &mpDefTOXBases->pObjBase; break;
488 case TOX_ILLUSTRATIONS: prBase = &mpDefTOXBases->pIllBase; break;
489 case TOX_AUTHORITIES: prBase = &mpDefTOXBases->pAuthBase; break;
490 case TOX_BIBLIOGRAPHY: prBase = &mpDefTOXBases->pBiblioBase; break;
491 case TOX_CITATION: break;
492 }
493 if (!prBase)
494 return nullptr;
495 if(!(*prBase) && bCreate)
496 {
497 SwForm aForm(eTyp);
498 const SwTOXType* pType = GetTOXType(eTyp, 0);
499 prBase->reset(new SwTOXBase(pType, aForm, SwTOXElement::NONE, pType->GetTypeName()));
500 }
501 return prBase->get();
502}
503
505{
506 std::unique_ptr<SwTOXBase>* prBase = nullptr;
507 switch(rBase.GetType())
508 {
509 case TOX_CONTENT: prBase = &mpDefTOXBases->pContBase; break;
510 case TOX_INDEX: prBase = &mpDefTOXBases->pIdxBase; break;
511 case TOX_USER: prBase = &mpDefTOXBases->pUserBase; break;
512 case TOX_TABLES: prBase = &mpDefTOXBases->pTableBase; break;
513 case TOX_OBJECTS: prBase = &mpDefTOXBases->pObjBase; break;
514 case TOX_ILLUSTRATIONS: prBase = &mpDefTOXBases->pIllBase; break;
515 case TOX_AUTHORITIES: prBase = &mpDefTOXBases->pAuthBase; break;
516 case TOX_BIBLIOGRAPHY: prBase = &mpDefTOXBases->pBiblioBase; break;
517 case TOX_CITATION: break;
518 }
519 if (!prBase)
520 return;
521 prBase->reset(new SwTOXBase(rBase));
522}
523
525bool SwDoc::DeleteTOX( const SwTOXBase& rTOXBase, bool bDelNodes )
526{
527 // We only delete the TOX, not the Nodes
528 bool bRet = false;
529 assert( dynamic_cast<const SwTOXBaseSection*>( &rTOXBase) && "no TOXBaseSection!" );
530
531 const SwTOXBaseSection& rTOXSect = static_cast<const SwTOXBaseSection&>(rTOXBase);
532 SwSectionFormat const * pFormat = rTOXSect.GetFormat();
533 /* Save the start node of the TOX' section. */
534 SwSectionNode const * pMyNode = pFormat ? pFormat->GetSectionNode() : nullptr;
535 if (pMyNode)
536 {
537 GetIDocumentUndoRedo().StartUndo( SwUndoId::CLEARTOXRANGE, nullptr );
538
539 /* Save start node of section's surrounding. */
540 SwNode const * pStartNd = pMyNode->StartOfSectionNode();
541
542 /* Look for the point where to move the cursors in the area to
543 delete to. This is done by first searching forward from the
544 end of the TOX' section. If no content node is found behind
545 the TOX one is searched before it. If this is not
546 successful, too, insert new text node behind the end of
547 the TOX' section. The cursors from the TOX' section will be
548 moved to the content node found or the new text node. */
549
550 /* Set PaM to end of TOX' section and search following content node.
551 aSearchPam will contain the point where to move the cursors
552 to. */
553 SwPaM aSearchPam(*pMyNode->EndOfSectionNode());
554 SwPosition aEndPos(*pStartNd->EndOfSectionNode());
555 if (! aSearchPam.Move() /* no content node found */
556 || *aSearchPam.GetPoint() >= aEndPos /* content node found
557 outside surrounding */
558 )
559 {
560 /* Set PaM to beginning of TOX' section and search previous
561 content node */
562 SwPaM aTmpPam(*pMyNode);
563 aSearchPam = aTmpPam;
564 SwPosition aStartPos(*pStartNd);
565
566 if ( ! aSearchPam.Move(fnMoveBackward) /* no content node found */
567 || *aSearchPam.GetPoint() <= aStartPos /* content node
568 found outside
569 surrounding */
570 )
571 {
572 /* There is no content node in the surrounding of
573 TOX'. Append text node behind TOX' section. */
574
575 SwPosition aInsPos(*pMyNode->EndOfSectionNode());
577
578 SwPaM aTmpPam1(aInsPos);
579 aSearchPam = aTmpPam1;
580 }
581 }
582
583 /* PaM containing the TOX. */
584 SwPaM aPam(*pMyNode->EndOfSectionNode(), *pMyNode);
585
586 /* Move cursors contained in TOX to the above calculated point. */
587 PaMCorrAbs(aPam, *aSearchPam.GetPoint());
588
589 if( !bDelNodes )
590 {
591 SwSections aArr( 0 );
592 pFormat->GetChildSections( aArr, SectionSort::Not, false );
593 for( const auto pSect : aArr )
594 {
595 if( SectionType::ToxHeader == pSect->GetType() )
596 {
597 DelSectionFormat( pSect->GetFormat(), bDelNodes );
598 }
599 }
600 }
601
602 DelSectionFormat( const_cast<SwSectionFormat *>(pFormat), bDelNodes );
603
604 GetIDocumentUndoRedo().EndUndo( SwUndoId::CLEARTOXRANGE, nullptr );
605 bRet = true;
606 }
607
608 return bRet;
609}
610
612sal_uInt16 SwDoc::GetTOXTypeCount(TOXTypes eTyp) const
613{
614 sal_uInt16 nCnt = 0;
615 for( auto const & pTOXType : *mpTOXTypes )
616 if( eTyp == pTOXType->GetType() )
617 ++nCnt;
618 return nCnt;
619}
620
621const SwTOXType* SwDoc::GetTOXType( TOXTypes eTyp, sal_uInt16 nId ) const
622{
623 sal_uInt16 nCnt = 0;
624 for( auto const & pTOXType : *mpTOXTypes )
625 if( eTyp == pTOXType->GetType() && nCnt++ == nId )
626 return pTOXType.get();
627 return nullptr;
628}
629
631{
632 SwTOXType * pNew = new SwTOXType(rTyp);
633 mpTOXTypes->emplace_back( pNew );
634 return pNew;
635}
636
638 const OUString& sChkStr ) const
639{
640 if( IsInMailMerge())
641 {
642 OUString newName = "MailMergeTOX"
643 + OStringToOUString( DateTimeToOString( DateTime( DateTime::SYSTEM )), RTL_TEXTENCODING_ASCII_US )
644 + OUString::number( mpSectionFormatTable->size() + 1 );
645 if( !sChkStr.isEmpty())
646 newName += sChkStr;
647 return newName;
648 }
649
650 bool bUseChkStr = !sChkStr.isEmpty();
651 const OUString& aName( rType.GetTypeName() );
652 const sal_Int32 nNmLen = aName.getLength();
653
655 const SwSectionFormats::size_type nFlagSize = ( mpSectionFormatTable->size() / 8 ) +2;
656 std::unique_ptr<sal_uInt8[]> pSetFlags(new sal_uInt8[ nFlagSize ]);
657 memset( pSetFlags.get(), 0, nFlagSize );
658
659 for( auto pSectionFormat : *mpSectionFormatTable )
660 {
661 const SwSectionNode *pSectNd = pSectionFormat->GetSectionNode();
662 if ( !pSectNd )
663 continue;
664
665 const SwSection& rSect = pSectNd->GetSection();
666 if (rSect.GetType()==SectionType::ToxContent)
667 {
668 const OUString& rNm = rSect.GetSectionName();
669 if ( rNm.startsWith(aName) )
670 {
671 // Calculate number and set the Flag
672 nNum = o3tl::toInt32(rNm.subView( nNmLen ));
673 if( nNum-- && nNum < mpSectionFormatTable->size() )
674 pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
675 }
676 if ( bUseChkStr && sChkStr==rNm )
677 bUseChkStr = false;
678 }
679 }
680
681 if( !bUseChkStr )
682 {
683 // All Numbers have been flagged accordingly, so get the right Number
684 nNum = mpSectionFormatTable->size();
685 for( SwSectionFormats::size_type n = 0; n < nFlagSize; ++n )
686 {
687 sal_uInt8 nTmp = pSetFlags[ n ];
688 if( nTmp != 0xff )
689 {
690 // so get the Number
691 nNum = n * 8;
692 while( nTmp & 1 )
693 {
694 ++nNum;
695 nTmp >>= 1;
696 }
697 break;
698 }
699 }
700 }
701 if ( bUseChkStr )
702 return sChkStr;
703 return aName + OUString::number( ++nNum );
704}
705
706bool SwDoc::SetTOXBaseName(const SwTOXBase& rTOXBase, const OUString& rName)
707{
708 assert( dynamic_cast<const SwTOXBaseSection*>( &rTOXBase) && "no TOXBaseSection!" );
709 SwTOXBaseSection* pTOX = const_cast<SwTOXBaseSection*>(static_cast<const SwTOXBaseSection*>(&rTOXBase));
710
711 if (GetUniqueTOXBaseName(*rTOXBase.GetTOXType(), rName) == rName)
712 {
713 pTOX->SetTOXName(rName);
714 pTOX->SetSectionName(rName);
716 return true;
717 }
718 return false;
719}
720
721static const SwTextNode* lcl_FindChapterNode( const SwNode& rNd,
722 SwRootFrame const*const pLayout, sal_uInt8 const nLvl = 0 )
723{
724 const SwNode* pNd = &rNd;
725 if( pNd->GetNodes().GetEndOfExtras().GetIndex() > pNd->GetIndex() )
726 {
727 // then find the "Anchor" (Body) position
728 Point aPt;
729 SwNode2Layout aNode2Layout( *pNd, pNd->GetIndex() );
730 const SwFrame* pFrame = aNode2Layout.GetFrame( &aPt );
731
732 if( pFrame )
733 {
734 SwPosition aPos( *pNd );
735 pNd = GetBodyTextNode( pNd->GetDoc(), aPos, *pFrame );
736 OSL_ENSURE( pNd, "Where's the paragraph?" );
737 // tdf#151462 - search for outline node containing the current node
738 return pNd ? pNd->FindOutlineNodeOfLevel(pNd->GetSectionLevel() - 1, pLayout) : nullptr;
739 }
740 }
741 return pNd->FindOutlineNodeOfLevel(nLvl, pLayout);
742}
743
744static bool IsHeadingContained(const SwTextNode* pChptrNd, const SwNode& rNd)
745{
746 const SwNode* pNd = &rNd;
747 const SwOutlineNodes& rONds = pNd->GetNodes().GetOutLineNds();
748 bool bIsHeadingContained = false;
749 if (!rONds.empty())
750 {
751 bool bCheckFirst = false;
753
754 if (!rONds.Seek_Entry(const_cast<SwNode*>(pNd), &nPos))
755 {
756 if (nPos == 0)
757 bCheckFirst = true;
758 else
759 nPos--;
760 }
761
762 if (bCheckFirst)
763 {
764 const SwContentNode* pCNd = pNd->GetContentNode();
765
766 Point aPt(0, 0);
767 std::pair<Point, bool> const tmp(aPt, false);
768
769 const SwFrame* pChptrFrame = pChptrNd ? pChptrNd->getLayoutFrame(
770 pChptrNd->GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, &tmp) : nullptr;
771 const SwPageFrame* pChptrPgFrame = pChptrFrame ? pChptrFrame->FindPageFrame() : nullptr;
772 const SwFrame* pNdFrame
773 = pCNd ? pCNd->getLayoutFrame(
774 pCNd->GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(), nullptr, &tmp)
775 : nullptr;
776
777 // Check if the one asking doesn't precede the page of the specified chapter note
778 bIsHeadingContained
779 = pNdFrame && pChptrPgFrame
780 && pChptrPgFrame->getFrameArea().Top() <= pNdFrame->getFrameArea().Top();
781 // Check if the one asking doesn't succeed the specified chapter note
782 if (bIsHeadingContained)
783 {
784 const SwNode* aChptrNd = pChptrNd;
785 if (!rONds.Seek_Entry(const_cast<SwNode*>(aChptrNd), &nPos) && nPos)
786 nPos--;
787 // Search for the next outline node with a larger level than the specified chapter node
788 while (nPos < rONds.size() - 1
789 && pChptrNd->GetAttrOutlineLevel()
790 < rONds[nPos + 1]->GetTextNode()->GetAttrOutlineLevel())
791 nPos++;
792 // If there exists such an outline node, check if the one asking doesn't succeed
793 // the specified chapter node
794 if (nPos < rONds.size() - 1) {
795 nPos++;
796 const auto aONdsTxtNd = rONds[nPos]->GetTextNode();
797 pChptrFrame = aONdsTxtNd->getLayoutFrame(
798 aONdsTxtNd->GetDoc().getIDocumentLayoutAccess().GetCurrentLayout(), nullptr,
799 &tmp);
800 pChptrPgFrame = pChptrFrame ? pChptrFrame->FindPageFrame() : nullptr;
801 bIsHeadingContained
802 = pNdFrame && pChptrPgFrame
803 && pChptrPgFrame->getFrameArea().Top() >= pNdFrame->getFrameArea().Top();
804 }
805 }
806 }
807 else
808 {
809 // Search for the next outline node which lies not within the current chapter node
810 while (nPos > 0
811 && pChptrNd->GetAttrOutlineLevel()
812 < rONds[nPos]->GetTextNode()->GetAttrOutlineLevel())
813 nPos--;
814 bIsHeadingContained = pChptrNd == rONds[nPos]->GetTextNode();
815 }
816 }
817 else
818 {
819 // If there are no outline nodes, consider the heading contained,
820 // otherwise the _XDocumentIndex._update() test fails
821 bIsHeadingContained = true;
822 }
823 return bIsHeadingContained;
824}
825
826// Table of contents class
828 : SwTOXBase( rBase )
829 , SwSection( SectionType::ToxContent, OUString(), rFormat )
830{
831 SetProtect( rBase.IsProtected() );
833}
834
836{
837}
838
840{
841 bool bRet = false;
842 const SwSectionNode* pSectNd = GetFormat()->GetSectionNode();
843 if( pSectNd )
844 {
845 rPos.Assign(*pSectNd);
846 pSectNd->GetDoc().GetNodes().GoNext( &rPos );
847 bRet = true;
848 }
849 return bRet;
850}
851
854 SwRootFrame const*const pLayout,
855 const bool _bNewTOX)
856{
857 if (!GetFormat())
858 return;
859 SwSectionNode const*const pSectNd(GetFormat()->GetSectionNode());
860 if (nullptr == pSectNd ||
861 !pSectNd->GetNodes().IsDocNodes() ||
862 IsHiddenFlag() ||
863 (pLayout->HasMergedParas() && pSectNd->GetRedlineMergeFlag() == SwNode::Merge::Hidden))
864 {
865 return;
866 }
867
868 if ( !mbKeepExpression )
869 {
870 maMSTOCExpression.clear();
871 }
872
873 SwDoc& rDoc = const_cast<SwDoc&>(pSectNd->GetDoc());
874
875 if (pAttr && GetFormat())
876 rDoc.ChgFormat(*GetFormat(), *pAttr);
877
878 // determine default page description, which will be used by the content nodes,
879 // if no appropriate one is found.
880 const SwPageDesc* pDefaultPageDesc;
881 {
882 pDefaultPageDesc =
884 if ( !_bNewTOX && !pDefaultPageDesc )
885 {
886 // determine page description of table-of-content
887 SwNodeOffset nPgDescNdIdx = pSectNd->GetIndex() + 1;
888 SwNodeOffset* pPgDescNdIdx = &nPgDescNdIdx;
889 pDefaultPageDesc = pSectNd->FindPageDesc( pPgDescNdIdx );
890 if ( nPgDescNdIdx < pSectNd->GetIndex() )
891 {
892 pDefaultPageDesc = nullptr;
893 }
894 }
895 // consider end node of content section in the node array.
896 if ( !pDefaultPageDesc &&
897 ( pSectNd->EndOfSectionNode()->GetIndex() <
898 (pSectNd->GetNodes().GetEndOfContent().GetIndex() - 1) )
899 )
900 {
901 // determine page description of content after table-of-content
902 SwNodeIndex aIdx( *(pSectNd->EndOfSectionNode()) );
903 const SwContentNode* pNdAfterTOX = pSectNd->GetNodes().GoNext( &aIdx );
904 const SwAttrSet& aNdAttrSet = pNdAfterTOX->GetSwAttrSet();
905 const SvxBreak eBreak = aNdAttrSet.GetBreak().GetBreak();
906 if ( eBreak != SvxBreak::PageBefore && eBreak != SvxBreak::PageBoth )
907 {
908 pDefaultPageDesc = pNdAfterTOX->FindPageDesc();
909 }
910 }
911 // consider start node of content section in the node array.
912 if ( !pDefaultPageDesc &&
913 ( pSectNd->GetIndex() >
914 (pSectNd->GetNodes().GetEndOfContent().StartOfSectionIndex() + 1) )
915 )
916 {
917 // determine page description of content before table-of-content
918 SwNodeIndex aIdx( *pSectNd );
919 SwContentNode* pTmp = SwNodes::GoPrevious( &aIdx );
920 assert(pTmp); // make coverity happy
921 pDefaultPageDesc = pTmp->FindPageDesc();
922
923 }
924 if ( !pDefaultPageDesc )
925 {
926 // determine default page description
927 pDefaultPageDesc = &rDoc.GetPageDesc( 0 );
928 }
929 }
930
932
933 // get current Language
938
939 m_aSortArr.clear();
940
941 // find the first layout node for this TOX, if it only find the content
942 // in his own chapter
943 const SwSectionNode* pChapterSectNd = IsFromChapter() ? pSectNd->FindSectionNode() : nullptr;
944 const SwTextNode* pOwnChapterNode = pChapterSectNd
945 ? ::lcl_FindChapterNode( *pSectNd, pLayout, pChapterSectNd->GetSectionLevel() + 1 )
946 : nullptr;
947
948 SwNode2LayoutSaveUpperFrames aN2L(*pSectNd);
949 const_cast<SwSectionNode*>(pSectNd)->DelFrames();
950
951 // This would be a good time to update the Numbering
952 rDoc.UpdateNumRule();
953
955 UpdateMarks( aIntl, pOwnChapterNode, pLayout );
956
958 UpdateOutline( pOwnChapterNode, pLayout );
959
961 UpdateTemplate( pOwnChapterNode, pLayout );
962
965 UpdateContent( SwTOXElement::Ole, pOwnChapterNode, pLayout );
966
969 UpdateTable( pOwnChapterNode, pLayout );
970
973 UpdateContent( SwTOXElement::Graphic, pOwnChapterNode, pLayout );
974
975 if( !GetSequenceName().isEmpty() && !IsFromObjectNames() &&
978 UpdateSequence( pOwnChapterNode, pLayout );
979
981 UpdateContent( SwTOXElement::Frame, pOwnChapterNode, pLayout );
982
984 UpdateAuthorities( aIntl, pLayout );
985
986 // Insert AlphaDelimiters if needed (just for keywords)
987 if( TOX_INDEX == SwTOXBase::GetType() &&
989 InsertAlphaDelimiter( aIntl );
990
991 // remove old content an insert one empty textnode (to hold the layout!)
992 SwTextNode* pFirstEmptyNd;
993
994 SwUndoUpdateIndex * pUndo(nullptr);
995 {
996 rDoc.getIDocumentRedlineAccess().DeleteRedline( *pSectNd, true, RedlineType::Any );
997
998 SwNodeIndex aSttIdx( *pSectNd, +1 );
999 SwNodeIndex aEndIdx( *pSectNd->EndOfSectionNode() );
1000 pFirstEmptyNd = rDoc.GetNodes().MakeTextNode( aEndIdx.GetNode(),
1002
1003 {
1004 // Task 70995 - save and restore PageDesc and Break Attributes
1005 SwNodeIndex aNxtIdx( aSttIdx );
1006 const SwContentNode* pCNd = aNxtIdx.GetNode().GetContentNode();
1007 if( !pCNd )
1008 pCNd = rDoc.GetNodes().GoNext( &aNxtIdx );
1009 assert(pCNd != pFirstEmptyNd);
1010 assert(pCNd->GetIndex() < pFirstEmptyNd->GetIndex());
1011 if( pCNd->HasSwAttrSet() )
1012 {
1013 SfxItemSet aBrkSet( rDoc.GetAttrPool(), aBreakSetRange );
1014 aBrkSet.Put( *pCNd->GetpSwAttrSet() );
1015 if( aBrkSet.Count() )
1016 pFirstEmptyNd->SetAttr( aBrkSet );
1017 }
1018 }
1019
1020 if (rDoc.GetIDocumentUndoRedo().DoesUndo())
1021 {
1022 // note: this will first append a SwUndoDelSection from the ctor...
1023 pUndo = new SwUndoUpdateIndex(*this);
1024 // tdf#123313 insert Undo *after* all CrossRefBookmark Undos have
1025 // been inserted by the Update*() functions
1026 rDoc.GetIDocumentUndoRedo().AppendUndo(std::unique_ptr<SwUndoUpdateIndex>(pUndo));
1027 }
1028 else
1029 {
1030 --aEndIdx;
1031 SwPosition aPos( aEndIdx, pFirstEmptyNd, 0 );
1032 SwDoc::CorrAbs( aSttIdx, aEndIdx, aPos, true );
1033
1034 // delete flys in whole range including start node which requires
1035 // giving the node before start node as Mark parameter, hence -1.
1036 // (flys must be deleted because the anchor nodes are removed)
1037 DelFlyInRange( SwNodeIndex(aSttIdx, -1).GetNode(), aEndIdx.GetNode() );
1038
1039 rDoc.GetNodes().Delete( aSttIdx, aEndIdx.GetIndex() - aSttIdx.GetIndex() );
1040 }
1041 }
1042
1043 // insert title of TOX
1044 if ( !GetTitle().isEmpty() )
1045 {
1046 // then insert the headline section
1047 SwNodeIndex aIdx( *pSectNd, +1 );
1048
1049 SwTextNode* pHeadNd = rDoc.GetNodes().MakeTextNode( aIdx.GetNode(),
1051 pHeadNd->InsertText( GetTitle(), SwContentIndex( pHeadNd ) );
1052
1053 SwSectionData headerData( SectionType::ToxHeader, GetTOXName()+"_Head" );
1054
1055 --aIdx;
1056 SwSectionFormat* pSectFormat = rDoc.MakeSectionFormat();
1058 *pHeadNd, *pSectFormat, headerData, nullptr, &aIdx.GetNode(), true, false);
1059
1060 if (pUndo)
1061 {
1062 pUndo->TitleSectionInserted(*pSectFormat);
1063 }
1064 }
1065
1066 // Sort the List of all TOC Marks and TOC Sections
1067 std::vector<SwTextFormatColl*> aCollArr( GetTOXForm().GetFormMax(), nullptr );
1068 std::unordered_map<OUString, int> markURLs;
1069 SwNodeIndex aInsPos( *pFirstEmptyNd, 1 );
1070 for( size_t nCnt = 0; nCnt < m_aSortArr.size(); ++nCnt )
1071 {
1072 ::SetProgressState( 0, rDoc.GetDocShell() );
1073
1074 // Put the Text into the TOC
1075 sal_uInt16 nLvl = m_aSortArr[ nCnt ]->GetLevel();
1076 SwTextFormatColl* pColl = aCollArr[ nLvl ];
1077 if( !pColl )
1078 {
1079 pColl = GetTextFormatColl( nLvl );
1080 aCollArr[ nLvl ] = pColl;
1081 }
1082
1083 // Generate: Set dynamic TabStops
1084 SwTextNode* pTOXNd = rDoc.GetNodes().MakeTextNode( aInsPos.GetNode() , pColl );
1085 m_aSortArr[ nCnt ]->pTOXNd = pTOXNd;
1086
1087 // Generate: Evaluate Form and insert the place holder for the
1088 // page number. If it is a TOX_INDEX and the SwForm IsCommaSeparated()
1089 // then a range of entries must be generated into one paragraph
1090 size_t nRange = 1;
1091 if(TOX_INDEX == SwTOXBase::GetType() &&
1092 GetTOXForm().IsCommaSeparated() &&
1093 m_aSortArr[nCnt]->GetType() == TOX_SORT_INDEX)
1094 {
1095 const SwTOXMark& rMark = m_aSortArr[nCnt]->pTextMark->GetTOXMark();
1096 const OUString& sPrimKey = rMark.GetPrimaryKey();
1097 const OUString& sSecKey = rMark.GetSecondaryKey();
1098 const SwTOXMark* pNextMark = nullptr;
1099 while(m_aSortArr.size() > (nCnt + nRange) &&
1100 m_aSortArr[nCnt + nRange]->GetType() == TOX_SORT_INDEX )
1101 {
1102 pNextMark = &(m_aSortArr[nCnt + nRange]->pTextMark->GetTOXMark());
1103 if( !pNextMark ||
1104 pNextMark->GetPrimaryKey() != sPrimKey ||
1105 pNextMark->GetSecondaryKey() != sSecKey)
1106 break;
1107 nRange++;
1108 }
1109 }
1110 // pass node index of table-of-content section and default page description
1111 // to method <GenerateText(..)>.
1112 ::SetProgressState( 0, rDoc.GetDocShell() );
1113
1114 std::shared_ptr<sw::ToxTabStopTokenHandler> tabStopTokenHandler =
1115 std::make_shared<sw::DefaultToxTabStopTokenHandler>(
1116 pSectNd->GetIndex(), *pDefaultPageDesc, GetTOXForm().IsRelTabPos(),
1120 sw::ToxTextGenerator ttgn(GetTOXForm(), tabStopTokenHandler);
1121 ttgn.GenerateText(GetFormat()->GetDoc(), markURLs, m_aSortArr, nCnt, nRange, pLayout);
1122 nCnt += nRange - 1;
1123 }
1124
1125 // delete the first dummy node and remove all Cursor into the previous node
1126 aInsPos = *pFirstEmptyNd;
1127 {
1128 SwPaM aCorPam( *pFirstEmptyNd );
1129 if( !aCorPam.Move( fnMoveForward ) )
1130 aCorPam.Move( fnMoveBackward );
1131 SwNodeIndex aEndIdx( aInsPos, 1 );
1132 SwDoc::CorrAbs( aInsPos, aEndIdx, *aCorPam.GetPoint(), true );
1133
1134 // Task 70995 - save and restore PageDesc and Break Attributes
1135 if( pFirstEmptyNd->HasSwAttrSet() )
1136 {
1137 if( !GetTitle().isEmpty() )
1138 aEndIdx = *pSectNd;
1139 else
1140 aEndIdx = *pFirstEmptyNd;
1141 SwContentNode* pCNd = rDoc.GetNodes().GoNext( &aEndIdx );
1142 if( pCNd ) // Robust against defect documents, e.g. i60336
1143 pCNd->SetAttr( *pFirstEmptyNd->GetpSwAttrSet() );
1144 }
1145 }
1146
1147 // now create the new Frames
1148 SwNodeOffset nIdx = pSectNd->GetIndex();
1149 // don't delete if index is empty
1150 if(nIdx + SwNodeOffset(2) < pSectNd->EndOfSectionIndex())
1151 rDoc.GetNodes().Delete( aInsPos );
1152
1153 aN2L.RestoreUpperFrames( rDoc.GetNodes(), nIdx, nIdx + 1 );
1155 for ( const auto& rpLayout : aAllLayouts )
1156 {
1157 SwFrame::CheckPageDescs( static_cast<SwPageFrame*>(rpLayout->Lower()) );
1158 }
1159
1161}
1162
1164{
1165 SwDoc* pDoc = GetFormat()->GetDoc();
1166 OUString sLastDeli;
1167 size_t i = 0;
1168 while( i < m_aSortArr.size() )
1169 {
1170 ::SetProgressState( 0, pDoc->GetDocShell() );
1171
1172 sal_uInt16 nLevel = m_aSortArr[i]->GetLevel();
1173
1174 // Skip AlphaDelimiter
1176 continue;
1177
1178 const OUString sDeli = rIntl.GetIndexKey( m_aSortArr[i]->GetText(),
1179 m_aSortArr[i]->GetLocale() );
1180
1181 // Do we already have a Delimiter?
1182 if( !sDeli.isEmpty() && sLastDeli != sDeli )
1183 {
1184 // We skip all that are less than a small Blank (these are special characters)
1185 if( ' ' <= sDeli[0] )
1186 {
1187 std::unique_ptr<SwTOXCustom> pCst(
1188 MakeSwTOXSortTabBase<SwTOXCustom>(nullptr,
1189 TextAndReading(sDeli, OUString()),
1191 rIntl, m_aSortArr[i]->GetLocale() ));
1192 m_aSortArr.insert( m_aSortArr.begin() + i, std::move(pCst));
1193 i++;
1194 }
1195 sLastDeli = sDeli;
1196 }
1197
1198 // Skip until we get to the same or a lower Level
1199 do {
1200 i++;
1201 } while (i < m_aSortArr.size() && m_aSortArr[i]->GetLevel() > nLevel);
1202 }
1203}
1204
1207{
1208 SwDoc* pDoc = GetFormat()->GetDoc();
1209 const OUString& rName = GetTOXForm().GetTemplate( nLevel );
1210 SwTextFormatColl* pColl = !rName.isEmpty() ? pDoc->FindTextFormatCollByName(rName) :nullptr;
1211 if( !pColl )
1212 {
1213 sal_uInt16 nPoolFormat = 0;
1214 const TOXTypes eMyType = SwTOXBase::GetType();
1215 switch( eMyType )
1216 {
1217 case TOX_INDEX: nPoolFormat = RES_POOLCOLL_TOX_IDXH; break;
1218 case TOX_USER:
1219 if( nLevel < 6 )
1220 nPoolFormat = RES_POOLCOLL_TOX_USERH;
1221 else
1222 nPoolFormat = RES_POOLCOLL_TOX_USER6 - 6;
1223 break;
1224 case TOX_ILLUSTRATIONS: nPoolFormat = RES_POOLCOLL_TOX_ILLUSH; break;
1225 case TOX_OBJECTS: nPoolFormat = RES_POOLCOLL_TOX_OBJECTH; break;
1226 case TOX_TABLES: nPoolFormat = RES_POOLCOLL_TOX_TABLESH; break;
1227 case TOX_AUTHORITIES:
1228 case TOX_BIBLIOGRAPHY:
1229 nPoolFormat = RES_POOLCOLL_TOX_AUTHORITIESH; break;
1230 case TOX_CITATION: break;
1231 case TOX_CONTENT:
1232 // There's a jump in the ContentArea!
1233 if( nLevel < 6 )
1234 nPoolFormat = RES_POOLCOLL_TOX_CNTNTH;
1235 else
1236 nPoolFormat = RES_POOLCOLL_TOX_CNTNT6 - 6;
1237 break;
1238 }
1239
1240 if(eMyType == TOX_AUTHORITIES && nLevel)
1241 nPoolFormat = nPoolFormat + 1;
1242 else if(eMyType == TOX_INDEX && nLevel)
1243 {
1244 // pool: Level 1,2,3, Delimiter
1245 // SwForm: Delimiter, Level 1,2,3
1246 nPoolFormat += 1 == nLevel ? nLevel + 3 : nLevel - 1;
1247 }
1248 else
1249 nPoolFormat = nPoolFormat + nLevel;
1250 pColl = pDoc->getIDocumentStylePoolAccess().GetTextCollFromPool( nPoolFormat );
1251 }
1252 return pColl;
1253}
1254
1255void SwTOXBaseSection::SwClientNotify(const SwModify& rModify, const SfxHint& rHint)
1256{
1257 if (auto pFindHint = dynamic_cast<const sw::FindContentFrameHint*>(&rHint))
1258 {
1259 if(pFindHint->m_rpContentFrame)
1260 return;
1261 auto pSectFormat = GetFormat();
1262 if(!pSectFormat)
1263 return;
1264 const SwSectionNode* pSectNd = pSectFormat->GetSectionNode();
1265 if(!pSectNd)
1266 return;
1267 SwNodeIndex aIdx(*pSectNd, 1);
1268 SwContentNode* pCNd = aIdx.GetNode().GetContentNode();
1269 if(!pCNd)
1270 pCNd = pFindHint->m_rDoc.GetNodes().GoNext(&aIdx);
1271 if(!pCNd)
1272 return;
1273 if(pCNd->EndOfSectionIndex() >= pSectNd->EndOfSectionIndex())
1274 return;
1275 pFindHint->m_rpContentFrame = pCNd->getLayoutFrame(&pFindHint->m_rLayout);
1276 } else
1277 SwTOXBase::SwClientNotify(rModify, rHint);
1278}
1279
1282 const SwTextNode* pOwnChapterNode,
1283 SwRootFrame const*const pLayout)
1284{
1285 const auto pType = static_cast<SwTOXType*>(SwTOXBase::GetRegisteredIn());
1286 auto pShell = GetFormat()->GetDoc()->GetDocShell();
1287 const TOXTypes eTOXTyp = GetTOXType()->GetType();
1288 std::vector<std::reference_wrapper<SwTextTOXMark>> vMarks;
1289 pType->CollectTextTOXMarksForLayout(vMarks, pLayout);
1290 for(auto& rMark: vMarks)
1291 {
1292 ::SetProgressState(0, pShell);
1293 auto& rNode = rMark.get().GetTextNode();
1294 if(IsFromChapter() && !IsHeadingContained(pOwnChapterNode, rNode))
1295 continue;
1296 auto rTOXMark = rMark.get().GetTOXMark();
1297 if(TOX_INDEX == eTOXTyp)
1298 {
1299 // index entry mark
1300 assert(g_pBreakIt);
1301 lang::Locale aLocale = g_pBreakIt->GetLocale(rNode.GetLang(rMark.get().GetStart()));
1302 InsertSorted(MakeSwTOXSortTabBase<SwTOXIndex>(pLayout, rNode, &rMark.get(), GetOptions(), FORM_ENTRY, rIntl, aLocale));
1303 if(GetOptions() & SwTOIOptions::KeyAsEntry && !rTOXMark.GetPrimaryKey().isEmpty())
1304 {
1305 InsertSorted(MakeSwTOXSortTabBase<SwTOXIndex>(pLayout, rNode, &rMark.get(), GetOptions(), FORM_PRIMARY_KEY, rIntl, aLocale));
1306 if (!rTOXMark.GetSecondaryKey().isEmpty())
1307 {
1308 InsertSorted(MakeSwTOXSortTabBase<SwTOXIndex>(pLayout, rNode, &rMark.get(), GetOptions(), FORM_SECONDARY_KEY, rIntl, aLocale));
1309 }
1310 }
1311 }
1312 else if(TOX_USER == eTOXTyp || rTOXMark.GetLevel() <= GetLevel())
1313 { // table of content mark, also used for user marks
1314 InsertSorted(MakeSwTOXSortTabBase<SwTOXContent>(pLayout, rNode, &rMark.get(), rIntl));
1315 }
1316 }
1317}
1318
1320void SwTOXBaseSection::UpdateOutline( const SwTextNode* pOwnChapterNode,
1321 SwRootFrame const*const pLayout)
1322{
1323 SwDoc* pDoc = GetFormat()->GetDoc();
1324 SwNodes& rNds = pDoc->GetNodes();
1325
1326 const SwOutlineNodes& rOutlNds = rNds.GetOutLineNds();
1327 for( auto pOutlineNode : rOutlNds )
1328 {
1329 ::SetProgressState( 0, pDoc->GetDocShell() );
1330 SwTextNode* pTextNd = pOutlineNode->GetTextNode();
1331 if( pTextNd && pTextNd->Len() && pTextNd->HasWriterListeners() &&
1333 pTextNd->getLayoutFrame(pLayout) &&
1334 !pTextNd->IsHiddenByParaField() &&
1335 !pTextNd->HasHiddenCharAttribute( true ) &&
1336 (!pLayout || !pLayout->HasMergedParas()
1337 || static_cast<SwTextFrame*>(pTextNd->getLayoutFrame(pLayout))->GetTextNodeForParaProps() == pTextNd) &&
1338 ( !IsFromChapter() || IsHeadingContained(pOwnChapterNode, *pTextNd) ))
1339 {
1340 InsertSorted(MakeSwTOXSortTabBase<SwTOXPara>(pLayout, *pTextNd, SwTOXElement::OutlineLevel));
1341 }
1342 }
1343}
1344
1347 SwRootFrame const*const pLayout)
1348{
1349 SwDoc* pDoc = GetFormat()->GetDoc();
1350 for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
1351 {
1352 const OUString sTmpStyleNames = GetStyleNames(i);
1353 if (sTmpStyleNames.isEmpty())
1354 continue;
1355
1356 sal_Int32 nIndex = 0;
1357 while (nIndex >= 0)
1358 {
1360 sTmpStyleNames.getToken( 0, TOX_STYLE_DELIMITER, nIndex ));
1361 //TODO: no outline Collections in content indexes if OutlineLevels are already included
1362 if( !pColl ||
1366 continue;
1367
1369 for( SwTextNode* pTextNd = aIter.First(); pTextNd; pTextNd = aIter.Next() )
1370 {
1371 ::SetProgressState( 0, pDoc->GetDocShell() );
1372
1373 if (pTextNd->GetText().getLength() &&
1374 pTextNd->getLayoutFrame(pLayout) &&
1375 pTextNd->GetNodes().IsDocNodes() &&
1376 (!pLayout || !pLayout->HasMergedParas()
1377 || static_cast<SwTextFrame*>(pTextNd->getLayoutFrame(pLayout))->GetTextNodeForParaProps() == pTextNd) &&
1378 (!IsFromChapter() || IsHeadingContained(pOwnChapterNode, *pTextNd)))
1379 {
1380 InsertSorted(MakeSwTOXSortTabBase<SwTOXPara>(pLayout, *pTextNd, SwTOXElement::Template, i + 1));
1381 }
1382 }
1383 }
1384 }
1385}
1386
1389 SwRootFrame const*const pLayout)
1390{
1391 SwDoc* pDoc = GetFormat()->GetDoc();
1393 if(!pSeqField)
1394 return;
1395
1396 std::vector<SwFormatField*> vFields;
1397 pSeqField->GatherFields(vFields);
1398 for(auto pFormatField: vFields)
1399 {
1400 const SwTextField* pTextField = pFormatField->GetTextField();
1401 SwTextNode& rTextNode = pTextField->GetTextNode();
1402 ::SetProgressState( 0, pDoc->GetDocShell() );
1403
1404 if (rTextNode.GetText().getLength() &&
1405 rTextNode.getLayoutFrame(pLayout) &&
1406 ( !IsFromChapter() || IsHeadingContained(pOwnChapterNode, rTextNode))
1407 && (!pLayout || !pLayout->IsHideRedlines()
1408 || !sw::IsFieldDeletedInModel(pDoc->getIDocumentRedlineAccess(), *pTextField)))
1409 {
1410 const SwSetExpField& rSeqField = dynamic_cast<const SwSetExpField&>(*(pFormatField->GetField()));
1411 const OUString sName = GetSequenceName()
1412 + OUStringChar(cSequenceMarkSeparator)
1413 + OUString::number( rSeqField.GetSeqNumber() );
1414 std::unique_ptr<SwTOXPara> pNew(new SwTOXPara( rTextNode, SwTOXElement::Sequence, 1, sName ));
1415 // set indexes if the number or the reference text are to be displayed
1417 {
1418 pNew->SetStartIndex(
1419 SwGetExpField::GetReferenceTextPos( *pFormatField, *pDoc ));
1420 }
1421 else if(GetCaptionDisplay() == CAPTION_NUMBER)
1422 {
1423 pNew->SetEndIndex(pTextField->GetStart() + 1);
1424 }
1425 pNew->InitText(pLayout);
1426 InsertSorted(std::move(pNew));
1427 }
1428 }
1429}
1430
1432 SwRootFrame const*const pLayout)
1433{
1434 SwDoc* pDoc = GetFormat()->GetDoc();
1435 SwFieldType* pAuthField = pDoc->getIDocumentFieldsAccess().GetFieldType(SwFieldIds::TableOfAuthorities, OUString(), false);
1436 if(!pAuthField)
1437 return;
1438
1439 std::vector<SwFormatField*> vFields;
1440 pAuthField->GatherFields(vFields);
1441 for(auto pFormatField: vFields)
1442 {
1443 const auto pTextField = pFormatField->GetTextField();
1444 const SwTextNode& rTextNode = pFormatField->GetTextField()->GetTextNode();
1445 ::SetProgressState( 0, pDoc->GetDocShell() );
1446
1447 if (rTextNode.GetText().getLength() &&
1448 rTextNode.getLayoutFrame(pLayout) &&
1449 (!pLayout || !pLayout->IsHideRedlines()
1450 || !sw::IsFieldDeletedInModel(pDoc->getIDocumentRedlineAccess(), *pTextField)))
1451 {
1452 //#106485# the body node has to be used!
1453 SwContentFrame *const pFrame = rTextNode.getLayoutFrame(pLayout);
1454 SwPosition aFieldPos(rTextNode);
1455 const SwTextNode* pTextNode = nullptr;
1456 if(pFrame && !pFrame->IsInDocBody())
1457 pTextNode = GetBodyTextNode( *pDoc, aFieldPos, *pFrame );
1458 if(!pTextNode)
1459 pTextNode = &rTextNode;
1460
1461 InsertSorted(MakeSwTOXSortTabBase<SwTOXAuthority>(pLayout, *pTextNode, *pFormatField, rIntl));
1462 }
1463 }
1464}
1465
1466static SwTOOElements lcl_IsSOObject( const SvGlobalName& rFactoryNm )
1467{
1468 static const struct SoObjType {
1469 SwTOOElements nFlag;
1470 // GlobalNameId
1471 struct {
1472 sal_uInt32 n1;
1473 sal_uInt16 n2, n3;
1474 sal_uInt8 b8, b9, b10, b11, b12, b13, b14, b15;
1475 } aGlNmIds[4];
1476 } aArr[] = {
1491 };
1492
1493 for( SoObjType const & rArr : aArr )
1494 for (auto & rId : rArr.aGlNmIds)
1495 {
1496 if( !rId.n1 )
1497 break;
1498 SvGlobalName aGlbNm( rId.n1, rId.n2, rId.n3,
1499 rId.b8, rId.b9, rId.b10, rId.b11,
1500 rId.b12, rId.b13, rId.b14, rId.b15 );
1501 if( rFactoryNm == aGlbNm )
1502 {
1503 return rArr.nFlag;
1504 }
1505 }
1506
1507 return SwTOOElements::NONE;
1508}
1509
1511 const SwTextNode* pOwnChapterNode,
1512 SwRootFrame const*const pLayout)
1513{
1514 SwDoc* pDoc = GetFormat()->GetDoc();
1515 SwNodes& rNds = pDoc->GetNodes();
1516 // on the 1st Node of the 1st Section
1518 nEndIdx = rNds.GetEndOfAutotext().GetIndex();
1519
1520 while( nIdx < nEndIdx )
1521 {
1522 ::SetProgressState( 0, pDoc->GetDocShell() );
1523
1524 SwNode* pNd = rNds[ nIdx ];
1525 SwContentNode* pCNd = nullptr;
1526 switch( eMyType )
1527 {
1529 if( !pNd->IsNoTextNode() )
1530 {
1531 pCNd = pNd->GetContentNode();
1532 if( !pCNd )
1533 {
1534 SwNodeIndex aTmp( *pNd );
1535 pCNd = rNds.GoNext( &aTmp );
1536 }
1537 }
1538 break;
1540 if( pNd->IsGrfNode() )
1541 pCNd = static_cast<SwContentNode*>(pNd);
1542 break;
1543 case SwTOXElement::Ole:
1544 if( pNd->IsOLENode() )
1545 {
1546 bool bInclude = true;
1548 {
1549 SwOLENode* pOLENode = pNd->GetOLENode();
1550 SwTOOElements nMyOLEOptions = GetOLEOptions();
1551 SwOLEObj& rOLEObj = pOLENode->GetOLEObj();
1552
1553 if( rOLEObj.IsOleRef() ) // Not yet loaded
1554 {
1555 SvGlobalName aTmpName( rOLEObj.GetOleRef()->getClassID() );
1556 SwTOOElements nObj = ::lcl_IsSOObject( aTmpName );
1557 bInclude = ( (nMyOLEOptions & SwTOOElements::Other) && SwTOOElements::NONE == nObj )
1558 || (nMyOLEOptions & nObj);
1559 }
1560 else
1561 {
1562 OSL_FAIL("OLE Object no loaded?");
1563 bInclude = false;
1564 }
1565 }
1566
1567 if(bInclude)
1568 pCNd = static_cast<SwContentNode*>(pNd);
1569 }
1570 break;
1571 default: break;
1572 }
1573
1574 if( pCNd )
1575 {
1576 // find node in body text
1577 int nSetLevel = USHRT_MAX;
1578
1579 //#111105# tables of tables|illustrations|objects don't support hierarchies
1580 if( IsLevelFromChapter() &&
1584 {
1585 const SwTextNode* pOutlNd = ::lcl_FindChapterNode( *pCNd,
1586 pLayout, MAXLEVEL - 1);
1587 if( pOutlNd )
1588 {
1590 {
1591 nSetLevel = pOutlNd->GetTextColl()->GetAttrOutlineLevel();
1592 }
1593 }
1594 }
1595
1596 if (pCNd->getLayoutFrame(pLayout)
1597 && (!pLayout || !pLayout->HasMergedParas()
1599 && ( !IsFromChapter() || IsHeadingContained(pOwnChapterNode, *pCNd)))
1600 {
1601 std::unique_ptr<SwTOXPara> pNew( MakeSwTOXSortTabBase<SwTOXPara>(
1602 pLayout, *pCNd, eMyType,
1603 ( USHRT_MAX != nSetLevel )
1604 ? o3tl::narrowing<sal_uInt16>(nSetLevel)
1606 InsertSorted( std::move(pNew) );
1607 }
1608 }
1609
1610 nIdx = pNd->StartOfSectionNode()->EndOfSectionIndex() + SwNodeOffset(2); // 2 == End/Start Node
1611 }
1612}
1613
1615void SwTOXBaseSection::UpdateTable(const SwTextNode* pOwnChapterNode,
1616 SwRootFrame const*const pLayout)
1617{
1618 SwDoc* pDoc = GetFormat()->GetDoc();
1619 SwNodes& rNds = pDoc->GetNodes();
1620 const SwFrameFormats& rArr = *pDoc->GetTableFrameFormats();
1621
1622 for( auto pFrameFormat : rArr )
1623 {
1624 ::SetProgressState( 0, pDoc->GetDocShell() );
1625
1626 SwTable* pTmpTable = SwTable::FindTable( pFrameFormat );
1627 SwTableBox* pFBox;
1628 if( pTmpTable && nullptr != (pFBox = pTmpTable->GetTabSortBoxes()[0] ) &&
1629 pFBox->GetSttNd() && pFBox->GetSttNd()->GetNodes().IsDocNodes() )
1630 {
1631 const SwTableNode* pTableNd = pFBox->GetSttNd()->FindTableNode();
1632 SwNodeIndex aContentIdx( *pTableNd, 1 );
1633
1634 SwContentNode* pCNd;
1635 while( nullptr != ( pCNd = rNds.GoNext( &aContentIdx ) ) &&
1636 aContentIdx.GetIndex() < pTableNd->EndOfSectionIndex() )
1637 {
1638 if (pCNd->getLayoutFrame(pLayout)
1639 && (!pLayout || !pLayout->HasMergedParas()
1641 && (!IsFromChapter() || IsHeadingContained(pOwnChapterNode, *pCNd)))
1642 {
1643 std::unique_ptr<SwTOXTable> pNew(new SwTOXTable( *pCNd ));
1645 {
1646 const SwTextNode* pOutlNd =
1647 ::lcl_FindChapterNode(*pCNd, pLayout, MAXLEVEL - 1);
1648 if( pOutlNd )
1649 {
1651 {
1652 const int nTmp = pOutlNd->GetTextColl()->GetAttrOutlineLevel();
1653 pNew->SetLevel(o3tl::narrowing<sal_uInt16>(nTmp));
1654 }
1655 }
1656 }
1657 pNew->InitText(pLayout);
1658 InsertSorted(std::move(pNew));
1659 break;
1660 }
1661 }
1662 }
1663 }
1664}
1665
1668{
1669 if( m_aSortArr.empty() )
1670 return ;
1671
1672 // Insert the current PageNumber into the TOC
1673 SwPageFrame* pCurrentPage = nullptr;
1674 sal_uInt16 nPage = 0;
1675 SwDoc* pDoc = GetFormat()->GetDoc();
1676
1678 TOX_INDEX == GetTOXType()->GetType() ?
1680 GetSortAlgorithm() );
1681
1682 for( size_t nCnt = 0; nCnt < m_aSortArr.size(); ++nCnt )
1683 {
1684 // Loop over all SourceNodes
1685
1686 // process run in lines
1687 size_t nRange = 0;
1688 if(GetTOXForm().IsCommaSeparated() &&
1689 m_aSortArr[nCnt]->GetType() == TOX_SORT_INDEX)
1690 {
1691 const SwTOXMark& rMark = m_aSortArr[nCnt]->pTextMark->GetTOXMark();
1692 const OUString& sPrimKey = rMark.GetPrimaryKey();
1693 const OUString& sSecKey = rMark.GetSecondaryKey();
1694 const SwTOXMark* pNextMark = nullptr;
1695 while(m_aSortArr.size() > (nCnt + nRange)&&
1696 m_aSortArr[nCnt + nRange]->GetType() == TOX_SORT_INDEX &&
1697 nullptr != (pNextMark = &(m_aSortArr[nCnt + nRange]->pTextMark->GetTOXMark())) &&
1698 pNextMark->GetPrimaryKey() == sPrimKey &&
1699 pNextMark->GetSecondaryKey() == sSecKey)
1700 nRange++;
1701 }
1702 else
1703 nRange = 1;
1704
1705 for(size_t nRunInEntry = nCnt; nRunInEntry < nCnt + nRange; ++nRunInEntry)
1706 {
1707 std::vector<sal_uInt16> aNums; // the PageNumber
1708 std::vector<SwPageDesc*> aDescs; // The PageDescriptors matching the PageNumbers
1709 std::vector<sal_uInt16> aMainNums; // contains page numbers of main entries
1710 SwTOXSortTabBase* pSortBase = m_aSortArr[nRunInEntry].get();
1711 size_t nSize = pSortBase->aTOXSources.size();
1712 for (size_t j = 0; j < nSize; ++j)
1713 {
1714 ::SetProgressState( 0, pDoc->GetDocShell() );
1715
1716 SwTOXSource& rTOXSource = pSortBase->aTOXSources[j];
1717 if( rTOXSource.pNd )
1718 {
1720 OSL_ENSURE( pFrame || pDoc->IsUpdateTOX(), "TOX, no Frame found");
1721 if( !pFrame )
1722 continue;
1723 if( pFrame->IsTextFrame() && static_cast<SwTextFrame*>(pFrame)->HasFollow() )
1724 {
1725 // find the right one
1726 SwTextFrame* pNext;
1727 TextFrameIndex const nPos(static_cast<SwTextFrame*>(pFrame)
1728 ->MapModelToView(static_cast<SwTextNode const*>(rTOXSource.pNd),
1729 rTOXSource.nPos));
1730 for (;;)
1731 {
1732 pNext = static_cast<SwTextFrame*>(pFrame->GetFollow());
1733 if (!pNext || nPos < pNext->GetOffset())
1734 break;
1735 pFrame = pNext;
1736 }
1737 }
1738
1739 SwPageFrame* pTmpPage = pFrame->FindPageFrame();
1740 if( pTmpPage != pCurrentPage )
1741 {
1742 nPage = pTmpPage->GetVirtPageNum();
1743 pCurrentPage = pTmpPage;
1744 }
1745
1746 // Insert as sorted
1747 std::vector<sal_uInt16>::size_type i;
1748 for( i = 0; i < aNums.size() && aNums[i] < nPage; ++i )
1749 ;
1750
1751 if( i >= aNums.size() || aNums[ i ] != nPage )
1752 {
1753 aNums.insert(aNums.begin() + i, nPage);
1754 aDescs.insert(aDescs.begin() + i, pCurrentPage->GetPageDesc() );
1755 }
1756 // is it a main entry?
1757 if(TOX_SORT_INDEX == pSortBase->GetType() &&
1758 rTOXSource.bMainEntry)
1759 {
1760 aMainNums.push_back(nPage);
1761 }
1762 }
1763 }
1764 // Insert the PageNumber into the TOC TextNode
1765 const SwTOXSortTabBase* pBase = m_aSortArr[ nCnt ].get();
1766 if(pBase->pTOXNd)
1767 {
1768 const SwTextNode* pTextNd = pBase->pTOXNd->GetTextNode();
1769 OSL_ENSURE( pTextNd, "no TextNode, wrong TOC" );
1770
1771 UpdatePageNum_( const_cast<SwTextNode*>(pTextNd), aNums, aDescs, &aMainNums,
1772 aIntl );
1773 }
1774 }
1775 }
1776 // Delete the mapping array after setting the right PageNumber
1777 m_aSortArr.clear();
1778}
1779
1782static bool lcl_HasMainEntry( const std::vector<sal_uInt16>* pMainEntryNums, sal_uInt16 nToFind )
1783{
1784 if (!pMainEntryNums)
1785 return false;
1786
1787 for( auto nMainEntry : *pMainEntryNums )
1788 if (nToFind == nMainEntry)
1789 return true;
1790 return false;
1791}
1792
1794 const std::vector<sal_uInt16>& rNums,
1795 const std::vector<SwPageDesc*>& rDescs,
1796 const std::vector<sal_uInt16>* pMainEntryNums,
1797 const SwTOXInternational& rIntl )
1798{
1799 // collect starts end ends of main entry character style
1800 std::optional< std::vector<sal_uInt16> > xCharStyleIdx;
1801 if (pMainEntryNums)
1802 xCharStyleIdx.emplace();
1803
1804 OUString sSrchStr
1805 = OUStringChar(C_NUM_REPL) + SwTOXMark::S_PAGE_DELI + OUStringChar(C_NUM_REPL);
1806 sal_Int32 nStartPos = pNd->GetText().indexOf(sSrchStr);
1807 sSrchStr = OUStringChar(C_NUM_REPL) + OUStringChar(C_END_PAGE_NUM);
1808 sal_Int32 nEndPos = pNd->GetText().indexOf(sSrchStr);
1809
1810 if (-1 == nEndPos || rNums.empty())
1811 return;
1812
1813 if (-1 == nStartPos || nStartPos > nEndPos)
1814 nStartPos = nEndPos;
1815
1816 sal_uInt16 nOld = rNums[0],
1817 nBeg = nOld,
1818 nCount = 0;
1819 OUString aNumStr( rDescs[0]->GetNumType().GetNumStr( nBeg ) );
1820 if( xCharStyleIdx && lcl_HasMainEntry( pMainEntryNums, nBeg ))
1821 {
1822 xCharStyleIdx->push_back( 0 );
1823 }
1824
1825 // Delete place holder
1826 SwContentIndex aPos(pNd, nStartPos);
1827 SwCharFormat* pPageNoCharFormat = nullptr;
1828 SwpHints* pHints = pNd->GetpSwpHints();
1829 if(pHints)
1830 for(size_t nHintIdx = 0; nHintIdx < pHints->Count(); ++nHintIdx)
1831 {
1832 const SwTextAttr* pAttr = pHints->Get(nHintIdx);
1833 const sal_Int32 nTmpEnd = pAttr->End() ? *pAttr->End() : 0;
1834 if( nStartPos >= pAttr->GetStart() &&
1835 (nStartPos + 2) <= nTmpEnd &&
1836 pAttr->Which() == RES_TXTATR_CHARFMT)
1837 {
1838 pPageNoCharFormat = pAttr->GetCharFormat().GetCharFormat();
1839 break;
1840 }
1841 }
1842 pNd->EraseText(aPos, nEndPos - nStartPos + 2);
1843
1844 std::vector<sal_uInt16>::size_type i;
1845 for( i = 1; i < rNums.size(); ++i)
1846 {
1847 SvxNumberType aType( rDescs[i]->GetNumType() );
1848 if( TOX_INDEX == SwTOXBase::GetType() )
1849 { // Summarize for the following
1850 // Add up all following
1851 // break up if main entry starts or ends and
1852 // insert a char style index
1853 bool bMainEntryChanges = lcl_HasMainEntry(pMainEntryNums, nOld)
1854 != lcl_HasMainEntry(pMainEntryNums, rNums[i]);
1855
1856 if(nOld == rNums[i]-1 && !bMainEntryChanges &&
1858 nCount++;
1859 else
1860 {
1861 // Flush for the following old values
1863 {
1864 if ( nCount >= 1 )
1865 aNumStr += rIntl.GetFollowingText( nCount > 1 );
1866 }
1867 else if (nCount) //#58127# If nCount == 0, then the only PageNumber is already in aNumStr!
1868 {
1869 if (nCount == 1 )
1870 aNumStr += SwTOXMark::S_PAGE_DELI;
1871 else
1872 aNumStr += "-";
1873
1874 aNumStr += aType.GetNumStr( nBeg + nCount );
1875 }
1876
1877 // Create new String
1878 nBeg = rNums[i];
1879 aNumStr += SwTOXMark::S_PAGE_DELI;
1880 //the change of the character style must apply after sPageDeli is appended
1881 if (xCharStyleIdx && bMainEntryChanges)
1882 {
1883 xCharStyleIdx->push_back(aNumStr.getLength());
1884 }
1885 aNumStr += aType.GetNumStr( nBeg );
1886 nCount = 0;
1887 }
1888 nOld = rNums[i];
1889 }
1890 else
1891 { // Insert all Numbers
1892 aNumStr += aType.GetNumStr( rNums[i] );
1893 if (i+1 != rNums.size())
1894 aNumStr += SwTOXMark::S_PAGE_DELI;
1895 }
1896 }
1897 // Flush when ending and the following old values
1898 if( TOX_INDEX == SwTOXBase::GetType() )
1899 {
1901 {
1902 if( nCount >= 1 )
1903 aNumStr += rIntl.GetFollowingText( nCount > 1 );
1904 }
1905 else
1906 {
1907 if(nCount >= 2)
1908 aNumStr += "-";
1909 else if(nCount == 1)
1910 aNumStr += SwTOXMark::S_PAGE_DELI;
1911 //#58127# If nCount == 0, then the only PageNumber is already in aNumStr!
1912 if(nCount)
1913 aNumStr += rDescs[i-1]->GetNumType().GetNumStr( nBeg+nCount );
1914 }
1915 }
1917 if(pPageNoCharFormat)
1918 {
1919 SwFormatCharFormat aCharFormat( pPageNoCharFormat );
1920 pNd->InsertItem(aCharFormat, nStartPos, nStartPos + aNumStr.getLength(), SetAttrMode::DONTEXPAND);
1921 }
1922
1923 // The main entries should get their character style
1924 if (!xCharStyleIdx || xCharStyleIdx->empty() || GetMainEntryCharStyle().isEmpty())
1925 return;
1926
1927 // eventually the last index must me appended
1928 if (xCharStyleIdx->size()&0x01)
1929 xCharStyleIdx->push_back(aNumStr.getLength());
1930
1931 // search by name
1932 SwDoc& rDoc = pNd->GetDoc();
1934 SwCharFormat* pCharFormat = nullptr;
1935 if(USHRT_MAX != nPoolId)
1936 pCharFormat = rDoc.getIDocumentStylePoolAccess().GetCharFormatFromPool(nPoolId);
1937 else
1938 pCharFormat = rDoc.FindCharFormatByName( GetMainEntryCharStyle() );
1939 if(!pCharFormat)
1940 pCharFormat = rDoc.MakeCharFormat(GetMainEntryCharStyle(), nullptr);
1941
1942 // find the page numbers in aNumStr and set the character style
1943 sal_Int32 nOffset = pNd->GetText().getLength() - aNumStr.getLength();
1944 SwFormatCharFormat aCharFormat(pCharFormat);
1945 for (size_t j = 0; j < xCharStyleIdx->size(); j += 2)
1946 {
1947 sal_Int32 nStartIdx = (*xCharStyleIdx)[j] + nOffset;
1948 sal_Int32 nEndIdx = (*xCharStyleIdx)[j + 1] + nOffset;
1949 pNd->InsertItem(aCharFormat, nStartIdx, nEndIdx, SetAttrMode::DONTEXPAND);
1950 }
1951}
1952
1953void SwTOXBaseSection::InsertSorted(std::unique_ptr<SwTOXSortTabBase> pNew)
1954{
1955 Range aRange(0, m_aSortArr.size());
1956 if( TOX_INDEX == SwTOXBase::GetType() && pNew->pTextMark )
1957 {
1958 const SwTOXMark& rMark = pNew->pTextMark->GetTOXMark();
1959 // Evaluate Key
1960 // Calculate the range where to insert
1962 !rMark.GetPrimaryKey().isEmpty() )
1963 {
1964 aRange = GetKeyRange( rMark.GetPrimaryKey(),
1965 rMark.GetPrimaryKeyReading(),
1966 *pNew, FORM_PRIMARY_KEY, aRange );
1967
1968 if( !rMark.GetSecondaryKey().isEmpty() )
1969 aRange = GetKeyRange( rMark.GetSecondaryKey(),
1970 rMark.GetSecondaryKeyReading(),
1971 *pNew, FORM_SECONDARY_KEY, aRange );
1972 }
1973 }
1974 // Search for identical entries and remove the trailing one
1976 {
1977 for(short i = static_cast<short>(aRange.Min()); i < static_cast<short>(aRange.Max()); ++i)
1978 {
1979 SwTOXSortTabBase* pOld = m_aSortArr[i].get();
1980 if (pOld->equivalent(*pNew))
1981 {
1982 if (pOld->sort_lt(*pNew))
1983 {
1984 return;
1985 }
1986 else
1987 {
1988 // remove the old content
1989 m_aSortArr.erase( m_aSortArr.begin() + i );
1990 aRange.Max()--;
1991 break;
1992 }
1993 }
1994 }
1995 }
1996
1997 // find position and insert
1998 tools::Long i;
1999
2000 for( i = aRange.Min(); i < aRange.Max(); ++i)
2001 { // Only check for same level
2002 SwTOXSortTabBase* pOld = m_aSortArr[i].get();
2003 if (pOld->equivalent(*pNew))
2004 {
2006 {
2007 // Own entry for double entries or keywords
2008 if( pOld->GetType() == TOX_SORT_CUSTOM &&
2010 continue;
2011
2013 { // Own entry
2014 m_aSortArr.insert(m_aSortArr.begin() + i, std::move(pNew));
2015 return;
2016 }
2017 // If the own entry is already present, add it to the references list
2018 pOld->aTOXSources.push_back(pNew->aTOXSources[0]);
2019
2020 return;
2021 }
2022#if OSL_DEBUG_LEVEL > 0
2023 else
2024 OSL_FAIL("Bibliography entries cannot be found here");
2025#endif
2026 }
2027 if (pNew->sort_lt(*pOld))
2028 break;
2029 }
2030 // Skip SubLevel
2031 while( TOX_INDEX == SwTOXBase::GetType() && i < aRange.Max() &&
2032 m_aSortArr[i]->GetLevel() > pNew->GetLevel() )
2033 i++;
2034
2035 // Insert at position i
2036 m_aSortArr.insert(m_aSortArr.begin()+i, std::move(pNew));
2037}
2038
2040Range SwTOXBaseSection::GetKeyRange(const OUString& rStr, const OUString& rStrReading,
2041 const SwTOXSortTabBase& rNew,
2042 sal_uInt16 nLevel, const Range& rRange )
2043{
2044 const SwTOXInternational& rIntl = *rNew.pTOXIntl;
2045 TextAndReading aToCompare(rStr, rStrReading);
2046
2048 {
2049 aToCompare.sText = rIntl.ToUpper( aToCompare.sText, 0 )
2050 + aToCompare.sText.subView(1);
2051 }
2052
2053 OSL_ENSURE(rRange.Min() >= 0 && rRange.Max() >= 0, "Min Max < 0");
2054
2055 const tools::Long nMin = rRange.Min();
2056 const tools::Long nMax = rRange.Max();
2057
2058 tools::Long i;
2059
2060 for( i = nMin; i < nMax; ++i)
2061 {
2062 SwTOXSortTabBase* pBase = m_aSortArr[i].get();
2063
2064 if( rIntl.IsEqual( pBase->GetText(), pBase->GetLocale(),
2065 aToCompare, rNew.GetLocale() ) &&
2066 pBase->GetLevel() == nLevel )
2067 break;
2068 }
2069 if(i == nMax)
2070 { // If not already present, create and insert
2071 std::unique_ptr<SwTOXCustom> pKey(MakeSwTOXSortTabBase<SwTOXCustom>(
2072 nullptr, aToCompare, nLevel, rIntl, rNew.GetLocale() ));
2073 for(i = nMin; i < nMax; ++i)
2074 {
2075 if (nLevel == m_aSortArr[i]->GetLevel() && pKey->sort_lt(*m_aSortArr[i]))
2076 break;
2077 }
2078 m_aSortArr.insert(m_aSortArr.begin() + i, std::move(pKey));
2079 }
2080 const tools::Long nStart = i+1;
2081 const tools::Long nEnd = m_aSortArr.size();
2082
2083 // Find end of range
2084 for(i = nStart; i < nEnd; ++i)
2085 {
2086 if(m_aSortArr[i]->GetLevel() <= nLevel)
2087 {
2088 return Range(nStart, i);
2089 }
2090 }
2091 return Range(nStart, nEnd);
2092}
2093
2095{
2096 const SwTOXBaseSection *pSect = dynamic_cast<const SwTOXBaseSection*>(this);
2097 if (!pSect || !pSect->GetFormat())
2098 return false;
2099
2100 const SwSectionNode* pSectNode = pSect->GetFormat()->GetSectionNode();
2101 if (!pSectNode)
2102 return false;
2103
2104 const SwDocShell* pDocSh = pSectNode->GetDoc().GetDocShell();
2105 if (!pDocSh)
2106 return false;
2107
2108 if (pDocSh->IsReadOnly())
2109 return true;
2110
2111 pSectNode = pSectNode->StartOfSectionNode()->FindSectionNode();
2112 if (!pSectNode)
2113 return false;
2114
2115 return pSectNode->GetSection().IsProtectFlag();
2116}
2117
2119{
2120 const SwTOXBaseSection *pSect = dynamic_cast<const SwTOXBaseSection*>(this);
2121 if(pSect && pSect->GetFormat())
2122 return &pSect->GetFormat()->GetAttrSet();
2123 return nullptr;
2124}
2125
2127{
2128 SwTOXBaseSection *pSect = dynamic_cast<SwTOXBaseSection*>(this);
2129 if( pSect && pSect->GetFormat() )
2130 pSect->GetFormat()->SetFormatAttr( rSet );
2131}
2132
2133/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool operator<=(const BigInt &rVal1, const BigInt &rVal2)
bool operator>=(const BigInt &rVal1, const BigInt &rVal2)
SwBreakIt * g_pBreakIt
Definition: breakit.cxx:34
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.
tools::Long Max() const
tools::Long Min() const
sal_uInt16 Count() const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
bool IsReadOnly() const
SvxBreak GetBreak() const
OUString GetNumStr(sal_Int32 nNo) const
const SvxFormatBreakItem & GetBreak(bool=true) const
Definition: frmatr.hxx:62
const css::lang::Locale & GetLocale(const LanguageType aLang)
Definition: breakit.hxx:67
Represents the style of a text portion.
Definition: charfmt.hxx:27
const SwModify * GetRegisteredIn() const
Definition: calbck.hxx:166
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:58
const SwContentFrame * GetFollow() const
Definition: cntfrm.hxx:135
Marks a character position inside a document model content node (SwContentNode)
bool HasSwAttrSet() const
Definition: node.hxx:494
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1230
const SwAttrSet & GetSwAttrSet() const
Does node has already its own auto-attributes? Access to SwAttrSet.
Definition: node.hxx:765
virtual bool SetAttr(const SfxPoolItem &)
made virtual
Definition: node.cxx:1601
const SwAttrSet * GetpSwAttrSet() const
Definition: node.hxx:493
Definition: doc.hxx:195
const SwTOXType * InsertTOXType(const SwTOXType &rTyp)
Definition: doctxm.cxx:630
bool IsInReading() const
Definition: doc.hxx:963
static const SwAttrSet & GetTOXBaseAttrSet(const SwTOXBase &rTOX)
Definition: doctxm.cxx:469
SwTOXBaseSection * InsertTableOf(const SwPosition &rPos, const SwTOXBase &rTOX, const SfxItemSet *pSet=nullptr, bool bExpand=false, SwRootFrame const *pLayout=nullptr)
Definition: doctxm.cxx:344
void SetDefaultTOXBase(const SwTOXBase &rBase)
Definition: doctxm.cxx:504
bool DeleteTOX(const SwTOXBase &rTOXBase, bool bDelNodes)
Delete table of contents.
Definition: doctxm.cxx:525
static sal_uInt16 GetCurTOXMark(const SwPosition &rPos, SwTOXMarks &)
Get current table of contents Mark.
Definition: doctxm.cxx:117
std::unique_ptr< SwTOXTypes > mpTOXTypes
Definition: doc.hxx:255
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:402
void ChgFormat(SwFormat &rFormat, const SfxItemSet &rSet)
Definition: docfmt.cxx:1862
void CorrAbs(const SwNode &rOldNode, const SwPosition &rNewPos, const sal_Int32 nOffset=0, bool bMoveCursor=false)
Definition: doccorr.cxx:171
o3tl::sorted_vector< SwRootFrame * > GetAllLayouts()
Definition: doclay.cxx:1683
sal_uInt16 GetTOXTypeCount(TOXTypes eTyp) const
Manage table of content types.
Definition: doctxm.cxx:612
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)
Definition: ndsect.cxx:154
void UpdateNumRule()
Definition: docnum.cxx:2615
SwCharFormat * FindCharFormatByName(const OUString &rName) const
Definition: doc.hxx:780
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:323
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:152
SwNodes & GetNodes()
Definition: doc.hxx:418
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:365
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:343
void GetTOIKeys(SwTOIKeyType eTyp, std::vector< OUString > &rArr, SwRootFrame const &rLayout) const
Definition: doctxm.cxx:86
static SwTOXBase * GetCurTOX(const SwPosition &rPos)
Get current table of contents.
Definition: doctxm.cxx:449
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:413
void DelSectionFormat(SwSectionFormat *pFormat, bool bDelNodes=false)
Definition: ndsect.cxx:513
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:434
std::unique_ptr< SwDefTOXBase_Impl > mpDefTOXBases
Definition: doc.hxx:256
const SwTOXBase * GetDefaultTOXBase(TOXTypes eTyp, bool bCreate)
Definition: doctxm.cxx:478
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: doc.hxx:808
std::unique_ptr< SwSectionFormats > mpSectionFormatTable
Definition: doc.hxx:250
void DeleteTOXMark(const SwTOXMark *pTOXMark)
Delete table of contents Mark.
Definition: doctxm.cxx:155
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1329
bool SetTOXBaseName(const SwTOXBase &rTOXBase, const OUString &rName)
Definition: doctxm.cxx:706
SwCharFormat * MakeCharFormat(const OUString &rFormatName, SwCharFormat *pDerivedFrom, bool bBroadcast=false)
Definition: docfmt.cxx:854
bool IsInMailMerge() const
Definition: doc.hxx:969
const SwTOXType * GetTOXType(TOXTypes eTyp, sal_uInt16 nId) const
Definition: doctxm.cxx:621
SwSectionFormat * MakeSectionFormat()
Definition: ndsect.cxx:506
OUString GetUniqueTOXBaseName(const SwTOXType &rType, const OUString &sChkStr) const
Definition: doctxm.cxx:637
::sw::DocumentSettingManager & GetDocumentSettingManager()
Definition: doc.cxx:194
bool IsUpdateTOX() const
Definition: doc.hxx:958
const SwFrameFormats * GetTableFrameFormats() const
Definition: doc.hxx:820
SwDocShell * GetDocShell()
Definition: doc.hxx:1362
const SwPageDesc & GetPageDesc(const size_t i) const
Definition: doc.hxx:890
const SwTOXMark & GotoTOXMark(const SwTOXMark &rCurTOXMark, SwTOXSearch eDir, bool bInReadOnly)
Definition: doctxm.cxx:229
Instances of SwFields and those derived from it occur 0 to n times.
Definition: fldbas.hxx:243
void GatherFields(std::vector< SwFormatField * > &rvFormatFields, bool bCollectOnlyInDocNodes=true) const
Definition: fldbas.cxx:203
Definition: tox.hxx:314
OUString const & GetTemplate(sal_uInt16 nLevel) const
Definition: tox.hxx:672
SwCharFormat * GetCharFormat() const
Definition: fchrfmt.hxx:70
SwPageDesc * GetPageDesc()
Definition: fmtpdsc.hxx:61
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:136
const SwFormatPageDesc & GetPageDesc(bool=true) const
Definition: fmtpdsc.hxx:78
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:447
const SwRect & getFrameArea() const
Definition: frame.hxx:179
Specific frame formats (frames, DrawObjects).
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool IsTextFrame() const
Definition: frame.hxx:1234
sal_uInt16 GetVirtPageNum() const
Definition: trvlfrm.cxx:1817
bool IsInDocBody() const
Definition: frame.hxx:943
bool IsProtected() const
Is the Frame or rather the Section in which it lies protected?
Definition: trvlfrm.cxx:1639
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.
Definition: pagechg.cxx:1066
SwPageFrame * FindPageFrame()
Definition: frame.hxx:680
static sal_Int32 GetReferenceTextPos(const SwFormatField &rFormat, SwDoc &rDoc, sal_Int32 nHint=0)
Find the index of the reference text following the current field.
Definition: expfld.cxx:971
TElementType * Next()
Definition: calbck.hxx:373
TElementType * First()
Definition: calbck.hxx:365
void RestoreUpperFrames(SwNodes &rNds, SwNodeOffset nStt, SwNodeOffset nEnd)
Definition: node2lay.cxx:489
SwFrame * GetFrame(const Point *pDocPos) const
Definition: node2lay.cxx:513
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNode & GetNode() const
Definition: ndindex.hxx:136
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:171
Base class of the Writer document model elements.
Definition: node.hxx:98
bool IsGrfNode() const
Definition: node.hxx:707
sal_uInt16 GetSectionLevel() const
Returns the section level at the position given by aIndex.
Definition: node.cxx:280
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:897
SwSectionNode * GetSectionNode()
Definition: node.hxx:658
SwNodeOffset GetIndex() const
Definition: node.hxx:312
bool IsNoTextNode() const
Definition: node.hxx:699
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:744
const SwTextNode * FindOutlineNodeOfLevel(sal_uInt8 nLvl, SwRootFrame const *pLayout=nullptr) const
Definition: node.cxx:793
SwDoc & GetDoc()
Definition: node.hxx:233
SwNodeOffset StartOfSectionIndex() const
Definition: node.hxx:724
const SwPageDesc * FindPageDesc(SwNodeOffset *pPgDescNdIdx=nullptr) const
Search PageDesc with which this node is formatted.
Definition: node.cxx:496
SwTableNode * FindTableNode()
Search table node, in which it is.
Definition: node.cxx:380
SwSectionNode * FindSectionNode()
Search section node, in which it is.
Definition: ndsect.cxx:974
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:153
Merge GetRedlineMergeFlag() const
Definition: node.hxx:116
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:165
SwNodeOffset EndOfSectionIndex() const
Definition: node.hxx:728
SwContentNode * GetContentNode()
Definition: node.hxx:666
bool IsOLENode() const
Definition: node.hxx:703
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:733
const SwOutlineNodes & GetOutLineNds() const
Array of all OutlineNodes.
Definition: ndarr.hxx:240
SwNode & GetEndOfExtras() const
This is the last EndNode of a special section.
Definition: ndarr.hxx:163
SwTextNode * MakeTextNode(SwNode &rWhere, SwTextFormatColl *pColl, bool bNewFrames=true)
Implementations of "Make...Node" are in the given .cxx-files.
Definition: ndtxt.cxx:121
SwNode & GetEndOfAutotext() const
Section for all Flys/Header/Footers.
Definition: ndarr.hxx:158
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:165
bool IsDocNodes() const
Is the NodesArray the regular one of Doc? (and not the UndoNds, ...) Implementation in doc....
Definition: nodes.cxx:2543
void Delete(const SwNodeIndex &rPos, SwNodeOffset nNodes=SwNodeOffset(1))
Definition: nodes.cxx:1070
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.
Definition: ndsect.cxx:775
static SwContentNode * GoPrevious(SwNodeIndex *)
Definition: nodes.cxx:1333
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1299
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:116
bool IsOleRef() const
To avoid unnecessary loading of object.
Definition: ndole.cxx:906
css::uno::Reference< css::embed::XEmbeddedObject > const & GetOleRef()
Definition: ndole.cxx:941
bool Seek_Entry(SwNode *rP, size_type *pnPos) const
Definition: ndnum.cxx:32
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:668
const SwPosition * GetPoint() const
Definition: pam.hxx:261
A page of the document layout.
Definition: pagefrm.hxx:58
SwPageDesc * GetPageDesc()
Definition: pagefrm.hxx:143
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
The root element of a Writer document layout.
Definition: rootfrm.hxx:83
bool HasMergedParas() const
Definition: wsfrm.cxx:4750
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding).
Definition: rootfrm.hxx:423
sw::FieldmarkMode GetFieldmarkMode() const
Definition: rootfrm.hxx:425
sw::ParagraphBreakMode GetParagraphBreakMode() const
Definition: rootfrm.hxx:427
void GetChildSections(SwSections &rArr, SectionSort eSort=SectionSort::Not, bool bAllSections=true) const
Definition: section.cxx:861
SwSectionNode * GetSectionNode()
Definition: section.cxx:931
A section node represents the start of a section on the UI, i.e.
Definition: node.hxx:575
const SwSection & GetSection() const
Definition: node.hxx:590
bool IsProtectFlag() const
Definition: section.hxx:191
bool IsHiddenFlag() const
Definition: section.hxx:190
const OUString & GetSectionName() const
Definition: section.hxx:171
SwSectionFormat * GetFormat()
Definition: section.hxx:339
SectionType GetType() const
Definition: section.hxx:173
void SetProtect(bool const bFlag=true)
Definition: section.cxx:362
void SetSectionName(OUString const &rName)
Definition: section.hxx:172
sal_uInt16 GetSeqNumber() const
Definition: expfld.hxx:248
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.
Definition: doctxm.cxx:1346
void UpdatePageNum()
Calculate PageNumber and insert after formatting.
Definition: doctxm.cxx:1667
void InsertAlphaDelimiter(const SwTOXInternational &rIntl)
Definition: doctxm.cxx:1163
void UpdateTable(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Collect table entries.
Definition: doctxm.cxx:1615
void UpdateSequence(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Generate content from sequence fields.
Definition: doctxm.cxx:1388
void InsertSorted(std::unique_ptr< SwTOXSortTabBase > pBase)
Definition: doctxm.cxx:1953
virtual void SwClientNotify(const SwModify &rModify, const SfxHint &rHint) override
Definition: doctxm.cxx:1255
Range GetKeyRange(const OUString &rStr, const OUString &rStrReading, const SwTOXSortTabBase &rNew, sal_uInt16 nLevel, const Range &rRange)
Find Key Range and insert if possible.
Definition: doctxm.cxx:2040
void UpdateContent(SwTOXElement eType, const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Definition: doctxm.cxx:1510
void Update(const SfxItemSet *pAttr=nullptr, SwRootFrame const *pLayout=nullptr, const bool _bNewTOX=false)
Collect table of contents content.
Definition: doctxm.cxx:853
void UpdateMarks(const SwTOXInternational &rIntl, const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Create from Marks.
Definition: doctxm.cxx:1281
SwTextFormatColl * GetTextFormatColl(sal_uInt16 nLevel)
Evaluate Template.
Definition: doctxm.cxx:1206
bool SetPosAtStartEnd(SwPosition &rPos) const
Definition: doctxm.cxx:839
SwTOXBaseSection(SwTOXBase const &rBase, SwSectionFormat &rFormat)
Definition: doctxm.cxx:827
void UpdateOutline(const SwTextNode *pOwnChapterNode, SwRootFrame const *pLayout)
Generate table of contents from outline.
Definition: doctxm.cxx:1320
void UpdateAuthorities(const SwTOXInternational &rIntl, SwRootFrame const *pLayout)
Definition: doctxm.cxx:1431
std::vector< std::unique_ptr< SwTOXSortTabBase > > m_aSortArr
Definition: doctxm.hxx:37
void UpdatePageNum_(SwTextNode *pNd, const std::vector< sal_uInt16 > &rNums, const std::vector< SwPageDesc * > &rDescs, const std::vector< sal_uInt16 > *pMainEntryNums, const SwTOXInternational &rIntl)
Definition: doctxm.cxx:1793
virtual ~SwTOXBaseSection() override
Definition: doctxm.cxx:835
void SetTOXName(const OUString &rSet)
Definition: tox.hxx:482
const OUString & GetSequenceName() const
Definition: tox.hxx:541
const OUString & GetSortAlgorithm() const
Definition: tox.hxx:555
bool IsLevelFromChapter() const
Definition: tox.hxx:535
virtual void SwClientNotify(const SwModify &rMod, const SfxHint &rHint) override
Definition: tox.hxx:466
bool IsProtected() const
Definition: tox.hxx:538
LanguageType GetLanguage() const
Definition: tox.hxx:552
sal_uInt16 nLevel
Definition: tox.hxx:441
SwTOXElement GetCreateType() const
Definition: tox.hxx:701
bool IsFromChapter() const
Definition: tox.hxx:529
SwTOOElements GetOLEOptions() const
Definition: tox.hxx:514
void SetAttrSet(const SfxItemSet &)
Definition: doctxm.cxx:2126
const SwForm & GetTOXForm() const
Definition: tox.hxx:713
const OUString & GetTOXName() const
Definition: tox.hxx:481
const OUString & GetMainEntryCharStyle() const
Definition: tox.hxx:502
const SfxItemSet * GetAttrSet() const
Definition: doctxm.cxx:2118
const SwTOXType * GetTOXType() const
Definition: tox.hxx:698
sal_uInt16 GetLevel() const
Definition: tox.hxx:731
bool IsFromObjectNames() const
Definition: tox.hxx:532
OUString const & GetStyleNames(sal_uInt16 nLevel) const
Definition: tox.hxx:519
TOXTypes GetType() const
Definition: tox.hxx:722
SwTOIOptions GetOptions() const
Definition: tox.hxx:737
bool mbKeepExpression
Definition: tox.hxx:458
bool IsTOXBaseInReadonly() const
Definition: doctxm.cxx:2094
const OUString & GetTitle() const
Definition: tox.hxx:704
OUString maMSTOCExpression
Definition: tox.hxx:457
SwCaptionDisplay GetCaptionDisplay() const
Definition: tox.hxx:544
OUString ToUpper(const OUString &rStr, sal_Int32 nPos) const
Definition: txmsrt.cxx:104
OUString GetIndexKey(const TextAndReading &rTaR, const css::lang::Locale &rLcl) const
Definition: txmsrt.cxx:123
OUString GetFollowingText(bool bMorePages) const
Definition: txmsrt.cxx:129
bool IsEqual(const TextAndReading &rTaR1, const css::lang::Locale &rLocale1, const TextAndReading &rTaR2, const css::lang::Locale &rLocale2) const
Definition: txmsrt.hxx:94
const SwTextTOXMark * GetTextTOXMark() const
Definition: tox.hxx:160
const SwTOXType * GetTOXType() const
Definition: tox.hxx:576
OUString const & GetSecondaryKeyReading() const
Definition: tox.hxx:658
OUString const & GetSecondaryKey() const
Definition: tox.hxx:640
OUString GetText(SwRootFrame const *pLayout) const
Definition: tox.cxx:201
OUString const & GetPrimaryKey() const
Definition: tox.hxx:634
static constexpr OUStringLiteral S_PAGE_DELI
Definition: tox.hxx:169
OUString const & GetPrimaryKeyReading() const
Definition: tox.hxx:652
const OUString & GetTypeName() const
Definition: tox.hxx:690
TOXTypes GetType() const
Definition: tox.hxx:693
void CollectTextMarks(SwTOXMarks &rMarks) const
Definition: tox.hxx:184
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:426
const SwStartNode * GetSttNd() const
Definition: swtable.hxx:478
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:113
static SwTable * FindTable(SwFrameFormat const *const pFormat)
Definition: swtable.cxx:2135
SwTableSortBoxes & GetTabSortBoxes()
Definition: swtable.hxx:265
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Definition: txatbase.hxx:44
const sal_Int32 * End() const
Definition: txatbase.hxx:156
sal_Int32 GetStart() const
Definition: txatbase.hxx:88
const SwFormatCharFormat & GetCharFormat() const
Definition: txatbase.hxx:187
bool HasDummyChar() const
Definition: txatbase.hxx:107
sal_uInt16 Which() const
Definition: txatbase.hxx:116
const SwTOXMark & GetTOXMark() const
Definition: txatbase.hxx:232
SwTextNode & GetTextNode() const
Definition: txtfld.hxx:53
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:122
int GetAttrOutlineLevel() const
Definition: fmtcol.cxx:609
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:165
SwTextNode const * GetTextNodeForParaProps() const
Definition: txtfrm.cxx:1303
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:111
virtual sal_Int32 Len() const override
Definition: ndtxt.cxx:291
void DeleteAttribute(SwTextAttr *const pTextAttr)
delete the attribute pTextAttr
Definition: thints.cxx:1763
bool IsHiddenByParaField() const
is the paragraph visible?
Definition: ndtxt.hxx:765
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
Definition: thints.cxx:1305
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
Definition: ndtxt.cxx:5044
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...
Definition: ndtxt.cxx:2775
OUString InsertText(const OUString &rStr, const SwContentIndex &rIdx, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
insert text content
Definition: ndtxt.cxx:2370
int GetAttrOutlineLevel() const
Returns outline level of this text node.
Definition: ndtxt.cxx:4160
SwpHints * GetpSwpHints()
Definition: ndtxt.hxx:250
const OUString & GetText() const
Definition: ndtxt.hxx:242
bool HasHiddenCharAttribute(bool bWholePara) const
Hidden Paragraph Field:
Definition: ndtxt.hxx:770
SwTextFormatColl * GetTextColl() const
Definition: ndtxt.hxx:891
const SwTextNode * GetpTextNd() const
Definition: txttxmrk.hxx:44
const SwTextNode & GetTextNode() const
Definition: txttxmrk.hxx:49
SwHistory & GetHistory()
void TitleSectionInserted(SwSectionFormat &rSectionFormat)
Definition: unsect.cxx:555
std::vector< SwSectionFormat * >::size_type size_type
Definition: docary.hxx:66
An SwTextAttr container, stores all directly formatted text portions for a text node.
Definition: ndhints.hxx:68
void DeRegister()
deregister the currently registered History
Definition: ndhints.hxx:197
SwTextAttr * Get(size_t nPos) const
Definition: ndhints.hxx:144
void Register(SwRegHistory *pHist)
register a History, which receives all attribute changes (for Undo)
Definition: ndhints.hxx:195
size_t Count() const
Definition: ndhints.hxx:142
#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
bool empty() const
size_type size() const
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).
int nCount
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.
Definition: doccorr.cxx:90
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.
Definition: docedt.cxx:208
static bool lcl_HasMainEntry(const std::vector< sal_uInt16 > *pMainEntryNums, sal_uInt16 nToFind)
Replace the PageNumber place holders.
Definition: doctxm.cxx:1782
static SwTOOElements lcl_IsSOObject(const SvGlobalName &rFactoryNm)
Definition: doctxm.cxx:1466
static const SwTextNode * lcl_FindChapterNode(const SwNode &rNd, SwRootFrame const *const pLayout, sal_uInt8 const nLvl=0)
Definition: doctxm.cxx:721
static bool IsHeadingContained(const SwTextNode *pChptrNd, const SwNode &rNd)
Definition: doctxm.cxx:744
static std::enable_if<!std::is_array< T >::value, std::unique_ptr< T > >::type MakeSwTOXSortTabBase(SwRootFrame const *const pLayout, Args &&... args)
Definition: doctxm.cxx:79
const SwTextNode * GetBodyTextNode(const SwDoc &rDoc, SwPosition &rPos, const SwFrame &rFrame)
Forward declaration: get "BodyTextNode" for exp.fld in Fly's headers/footers/footnotes.
Definition: expfld.cxx:163
@ TableOfAuthorities
constexpr TypedWhichId< SwFormatCharFormat > RES_TXTATR_CHARFMT(52)
#define CH_TXTATR_INWORD
Definition: hintids.hxx:172
constexpr TypedWhichId< SwTOXMark > RES_TXTATR_TOXMARK(47)
WhichRangesContainer const aBreakSetRange(svl::Items< RES_PAGEDESC, RES_BREAK >)
sal_Int32 nIndex
OUString aName
sal_Int64 n
sal_uInt16 nPos
void SetProgressState(tools::Long nPosition, SwDocShell const *pDocShell)
Definition: mainwn.cxx:82
int n2
int n1
const char * sName
sal_uInt32 n3
size
OUString newName(std::u16string_view aNewPrefix, std::u16string_view aOldPrefix, std::u16string_view old_Name)
int i
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)
args
const SvxPageUsage aArr[]
bool IsFieldDeletedInModel(IDocumentRedlineAccess const &rIDRA, SwTextField const &rTextField)
TextFrameIndex MapModelToView(MergedPara const &, SwTextNode const *pNode, sal_Int32 nIndex)
Definition: txtfrm.cxx:1183
bool IsMarkHintHidden(SwRootFrame const &rLayout, SwTextNode const &rNode, SwTextAttrEnd const &rHint)
Definition: reffld.cxx:1141
long Long
o3tl::strong_int< sal_Int32, struct Tag_SwNodeOffset > SwNodeOffset
Definition: nodeoffset.hxx:16
constexpr SwNodeOffset NODE_OFFSET_MAX(SAL_MAX_INT32)
sal_Int16 nId
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.
Definition: pam.cxx:1020
SwMoveFnCollection const & fnMoveBackward
Definition: paminit.cxx:60
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:61
@ RES_POOLCOLL_TEXT
Text body.
Definition: poolfmt.hxx:251
@ RES_POOLCOLL_STANDARD
Standard.
Definition: poolfmt.hxx:250
@ RES_POOLCOLL_TOX_USERH
Subgroup user indices.
Definition: poolfmt.hxx:382
@ RES_POOLCOLL_TOX_USER6
user index 6..10.
Definition: poolfmt.hxx:412
@ RES_POOLCOLL_TOX_CNTNTH
Subgroup table of contents.
Definition: poolfmt.hxx:374
@ RES_POOLCOLL_TOX_TABLESH
tables index.
Definition: poolfmt.hxx:404
@ RES_POOLCOLL_TOX_IDXH
Subgroup index tables.
Definition: poolfmt.hxx:367
@ RES_POOLCOLL_TOX_OBJECTH
object index.
Definition: poolfmt.hxx:400
@ RES_POOLCOLL_TOX_CNTNT6
Content 6th level.
Definition: poolfmt.hxx:389
@ RES_POOLCOLL_TOX_ILLUSH
illustrations index.
Definition: poolfmt.hxx:396
@ RES_POOLCOLL_TOX_AUTHORITIESH
index of authorities.
Definition: poolfmt.hxx:408
SectionType
Definition: section.hxx:46
std::vector< SwSection * > SwSections
Definition: section.hxx:42
static SfxItemSet & rSet
sal_uIntPtr sal_uLong
Marks a position in the document model.
Definition: pam.hxx:37
SwNode & GetNode() const
Definition: pam.hxx:80
void Assign(const SwNode &rNd, SwNodeOffset nDelta, sal_Int32 nContentOffset=0)
These all set both nNode and nContent.
Definition: pam.cxx:230
sal_Int32 GetContentIndex() const
Definition: pam.hxx:84
Class for sorting directories.
Definition: txmsrt.hxx:123
virtual sal_uInt16 GetLevel() const =0
std::vector< SwTOXSource > aTOXSources
Definition: txmsrt.hxx:127
static SwTOIOptions GetOptions()
Definition: txmsrt.hxx:145
const css::lang::Locale & GetLocale() const
Definition: txmsrt.hxx:184
virtual bool sort_lt(const SwTOXSortTabBase &)
Definition: txmsrt.cxx:253
TextAndReading const & GetText() const
Definition: txmsrt.hxx:178
sal_uInt16 GetType() const
Definition: txmsrt.hxx:144
virtual bool equivalent(const SwTOXSortTabBase &)
Definition: txmsrt.cxx:227
const SwTextNode * pTOXNd
Definition: txmsrt.hxx:129
const SwTOXInternational * pTOXIntl
Definition: txmsrt.hxx:131
bool bMainEntry
Definition: txmsrt.hxx:52
const SwContentNode * pNd
Definition: txmsrt.hxx:50
sal_Int32 nPos
Definition: txmsrt.hxx:51
OUString sText
Definition: txmsrt.hxx:62
SvxBreak
const char cSequenceMarkSeparator
Definition: swtypes.hxx:126
constexpr sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:92
const sal_Unicode C_NUM_REPL
Definition: tox.cxx:47
const sal_Unicode C_END_PAGE_NUM
Definition: tox.cxx:48
SwTOXElement
Definition: tox.hxx:366
#define FORM_TITLE
Definition: tox.hxx:206
SwTOOElements
Definition: tox.hxx:410
#define FORM_SECONDARY_KEY
Definition: tox.hxx:209
std::vector< SwTOXMark * > SwTOXMarks
Definition: tox.hxx:46
#define FORM_ALPHA_DELIMITER
Definition: tox.hxx:207
#define FORM_PRIMARY_KEY
Definition: tox.hxx:208
#define FORM_ENTRY
Definition: tox.hxx:210
@ CAPTION_NUMBER
Definition: tox.hxx:405
@ CAPTION_TEXT
Definition: tox.hxx:406
#define TOX_STYLE_DELIMITER
Definition: tox.hxx:422
SwTOIKeyType
Definition: toxe.hxx:31
@ TOI_PRIMARY
Definition: toxe.hxx:32
TOXTypes
Definition: toxe.hxx:40
@ TOX_USER
Definition: toxe.hxx:42
@ TOX_CONTENT
Definition: toxe.hxx:43
@ TOX_TABLES
Definition: toxe.hxx:46
@ TOX_INDEX
Definition: toxe.hxx:41
@ TOX_OBJECTS
Definition: toxe.hxx:45
@ TOX_AUTHORITIES
Definition: toxe.hxx:47
@ TOX_ILLUSTRATIONS
Definition: toxe.hxx:44
@ TOX_BIBLIOGRAPHY
Definition: toxe.hxx:48
@ TOX_CITATION
Definition: toxe.hxx:49
SwTOXSearch
Definition: toxe.hxx:23
@ TOX_SAME_PRV
Definition: toxe.hxx:27
@ TOX_PRV
Definition: toxe.hxx:25
@ TOX_SAME_NXT
Definition: toxe.hxx:26
@ TOX_NXT
Definition: toxe.hxx:24
@ TOX_SORT_CUSTOM
Definition: txmsrt.hxx:41
@ TOX_SORT_INDEX
Definition: txmsrt.hxx:40
unsigned char sal_uInt8
#define SAL_MAX_INT32
bool operator<(const wwFont &r1, const wwFont &r2)
Definition: wrtw8sty.cxx:888
WW8LvlType GetNumType(sal_uInt8 nWwLevelNo)
Definition: ww8par2.cxx:889
bool operator!=(const XclExpString &rLeft, const XclExpString &rRight)
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)