LibreOffice Module sw (master)  1
ToxTextGenerator.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 <ToxTextGenerator.hxx>
21 
22 #include <chpfld.hxx>
23 #include <cntfrm.hxx>
24 #include <txtfrm.hxx>
25 #include <rootfrm.hxx>
26 #include <ndindex.hxx>
27 #include <fchrfmt.hxx>
28 #include <doc.hxx>
31 #include <fmtinfmt.hxx>
32 #include <ndtxt.hxx>
33 #include <pagedesc.hxx>
34 #include <tox.hxx>
35 #include <txmsrt.hxx>
36 #include <fmtautofmt.hxx>
38 #include <SwStyleNameMapper.hxx>
39 #include <swatrset.hxx>
41 #include <ToxLinkProcessor.hxx>
43 #include <txatbase.hxx>
44 #include <modeltoviewhelper.hxx>
45 
46 #include <svl/itemiter.hxx>
47 
48 #include <cassert>
49 #include <memory>
50 
51 namespace {
52 
53 bool sortTabHasNoToxSourcesOrFirstToxSourceHasNoNode(const SwTOXSortTabBase& sortTab)
54 {
55  if (sortTab.aTOXSources.empty()) {
56  return true;
57  }
58  if (sortTab.aTOXSources.at(0).pNd == nullptr) {
59  return true;
60  }
61  return false;
62 }
63 
64 } // end anonymous namespace
65 
66 namespace sw {
67 
68 OUString
70  bool bUsePrefix, sal_uInt8 nLevel,
71  SwRootFrame const*const pLayout)
72 {
73  if (sortTabHasNoToxSourcesOrFirstToxSourceHasNoNode(rBase)) {
74  return OUString();
75  }
76 
77  OUString sRet;
78  if (rBase.pTextMark) { // only if it's not a Mark
79  return sRet;
80  }
81 
82  const SwTextNode* pNd = rBase.aTOXSources[0].pNd->GetTextNode();
83  if (!pNd) {
84  return sRet;
85  }
86  if (pLayout && pLayout->IsHideRedlines())
87  { // note: pNd could be any node, since it could be Sequence etc.
88  pNd = sw::GetParaPropsNode(*pLayout, SwNodeIndex(*pNd));
89  }
90 
91  const SwNumRule* pRule = pNd->GetNumRule();
92  if (!pRule) {
93  return sRet;
94  }
95 
96  if (pNd->GetActualListLevel() < MAXLEVEL) {
97  sRet = pNd->GetNumString(bUsePrefix, nLevel, pLayout);
98  }
99 
100  if (!sRet.isEmpty()) {
101  sRet += " ";// Makes sure spacing is done only when there is outline numbering
102  }
103 
104  return sRet;
105 }
106 
107 
109  std::shared_ptr<ToxTabStopTokenHandler> const & tabStopHandler)
110 : mToxForm(toxForm),
111  mLinkProcessor(new ToxLinkProcessor()),
112  mTabStopTokenHandler(tabStopHandler)
113 {}
114 
116 {}
117 
118 OUString
120  const SwFormToken& aToken, SwRootFrame const*const pLayout) const
121 {
122  if (sortTabHasNoToxSourcesOrFirstToxSourceHasNoNode(rBase)) {
123  return OUString();
124  }
125 
126  // A bit tricky: Find a random Frame
127  const SwContentNode* contentNode = rBase.aTOXSources.at(0).pNd->GetContentNode();
128  if (!contentNode) {
129  return OUString();
130  }
131 
132  // #i53420#
133  const SwContentFrame* contentFrame = contentNode->getLayoutFrame(pLayout);
134  if (!contentFrame) {
135  return OUString();
136  }
137 
138  return GenerateTextForChapterToken(aToken, contentFrame, contentNode, pLayout);
139 }
140 
141 OUString
143  const SwContentNode *contentNode,
144  SwRootFrame const*const pLayout) const
145 {
146  OUString retval;
147 
148  SwChapterFieldType chapterFieldType;
149  SwChapterField aField = ObtainChapterField(&chapterFieldType, &chapterToken, contentFrame, contentNode);
150 
151  //---> #i89791#
152  // continue to support CF_NUMBER and CF_NUM_TITLE in order to handle ODF 1.0/1.1 written by OOo 3.x
153  // in the same way as OOo 2.x would handle them.
154  if (CF_NUM_NOPREPST_TITLE == chapterToken.nChapterFormat || CF_NUMBER == chapterToken.nChapterFormat) {
155  retval += aField.GetNumber(pLayout); // get the string number without pre/postfix
156  }
157  else if (CF_NUMBER_NOPREPST == chapterToken.nChapterFormat || CF_NUM_TITLE == chapterToken.nChapterFormat) {
158  retval += aField.GetNumber(pLayout) + " ";
159  retval += aField.GetTitle(pLayout);
160  } else if (CF_TITLE == chapterToken.nChapterFormat) {
161  retval += aField.GetTitle(pLayout);
162  }
163  return retval;
164 }
165 
166 // Add parameter <_TOXSectNdIdx> and <_pDefaultPageDesc> in order to control,
167 // which page description is used, no appropriate one is found.
168 void
169 ToxTextGenerator::GenerateText(SwDoc* pDoc, const std::vector<std::unique_ptr<SwTOXSortTabBase>> &entries,
170  sal_uInt16 indexOfEntryToProcess, sal_uInt16 numberOfEntriesToProcess,
171  SwRootFrame const*const pLayout)
172 {
173  // pTOXNd is only set at the first mark
174  SwTextNode* pTOXNd = const_cast<SwTextNode*>(entries.at(indexOfEntryToProcess)->pTOXNd);
175  // FIXME this operates directly on the node text
176  OUString & rText = const_cast<OUString&>(pTOXNd->GetText());
177  rText.clear();
178  for(sal_uInt16 nIndex = indexOfEntryToProcess; nIndex < indexOfEntryToProcess + numberOfEntriesToProcess; nIndex++)
179  {
180  if(nIndex > indexOfEntryToProcess)
181  rText += ", "; // comma separation
182  // Initialize String with the Pattern from the form
183  const SwTOXSortTabBase& rBase = *entries.at(nIndex);
184  sal_uInt16 nLvl = rBase.GetLevel();
185  OSL_ENSURE( nLvl < mToxForm.GetFormMax(), "invalid FORM_LEVEL");
186 
187  SvxTabStopItem aTStops( 0, 0, SvxTabAdjust::Default, RES_PARATR_TABSTOP );
188  // create an enumerator
189  // #i21237#
190  SwFormTokens aPattern = mToxForm.GetPattern(nLvl);
191  // remove text from node
192  for(const auto& aToken : aPattern) // #i21237#
193  {
194  sal_Int32 nStartCharStyle = rText.getLength();
195  switch( aToken.eTokenType )
196  {
197  case TOKEN_ENTRY_NO:
198  // for TOC numbering
199  rText += GetNumStringOfFirstNode(rBase,
200  aToken.nChapterFormat == CF_NUMBER,
201  static_cast<sal_uInt8>(aToken.nOutlineLevel - 1), pLayout);
202  break;
203 
204  case TOKEN_ENTRY_TEXT: {
205  HandledTextToken htt = HandleTextToken(rBase, pDoc->GetAttrPool(), pLayout);
206  ApplyHandledTextToken(htt, *pTOXNd);
207  }
208  break;
209 
210  case TOKEN_ENTRY:
211  {
212  // for TOC numbering
213  rText += GetNumStringOfFirstNode(rBase, true, MAXLEVEL, pLayout);
214  HandledTextToken htt = HandleTextToken(rBase, pDoc->GetAttrPool(), pLayout);
215  ApplyHandledTextToken(htt, *pTOXNd);
216  }
217  break;
218 
219  case TOKEN_TAB_STOP: {
221  mTabStopTokenHandler->HandleTabStopToken(aToken, *pTOXNd, pDoc->getIDocumentLayoutAccess().GetCurrentLayout());
222  rText += htst.text;
223  aTStops.Insert(htst.tabStop);
224  break;
225  }
226 
227  case TOKEN_TEXT:
228  rText += aToken.sText;
229  break;
230 
231  case TOKEN_PAGE_NUMS:
232  rText += ConstructPageNumberPlaceholder(rBase.aTOXSources.size());
233  break;
234 
235  case TOKEN_CHAPTER_INFO:
236  rText += HandleChapterToken(rBase, aToken, pLayout);
237  break;
238 
239  case TOKEN_LINK_START:
240  mLinkProcessor->StartNewLink(rText.getLength(), aToken.sCharStyleName);
241  break;
242 
243  case TOKEN_LINK_END:
244  mLinkProcessor->CloseLink(rText.getLength(), rBase.GetURL());
245  break;
246 
247  case TOKEN_AUTHORITY:
248  {
249  ToxAuthorityField eField = static_cast<ToxAuthorityField>(aToken.nAuthorityField);
250  SwIndex aIdx( pTOXNd, rText.getLength() );
251  rBase.FillText( *pTOXNd, aIdx, static_cast<sal_uInt16>(eField), pLayout );
252  }
253  break;
254  case TOKEN_END: break;
255  }
256 
257  if ( !aToken.sCharStyleName.isEmpty() )
258  {
259  SwCharFormat* pCharFormat;
260  if( USHRT_MAX != aToken.nPoolId )
261  pCharFormat = pDoc->getIDocumentStylePoolAccess().GetCharFormatFromPool( aToken.nPoolId );
262  else
263  pCharFormat = pDoc->FindCharFormatByName( aToken.sCharStyleName);
264 
265  if (pCharFormat)
266  {
267  SwFormatCharFormat aFormat( pCharFormat );
268  pTOXNd->InsertItem( aFormat, nStartCharStyle,
269  rText.getLength(), SetAttrMode::DONTEXPAND );
270  }
271  }
272  }
273 
274  pTOXNd->SetAttr( aTStops );
275  }
276  mLinkProcessor->InsertLinkAttributes(*pTOXNd);
277 }
278 
279 /*static*/ std::shared_ptr<SfxItemSet>
281 {
282  std::shared_ptr<SfxItemSet> retval(new SfxItemSet(pool));
283  if (hint.Which() != RES_TXTATR_AUTOFMT) {
284  return retval;
285  }
286  const SwFormatAutoFormat& afmt = hint.GetAutoFormat();
287  SfxItemIter aIter( *afmt.GetStyleHandle());
288  const SfxPoolItem* pItem = aIter.GetCurItem();
289  do
290  {
291  if (pItem->Which() == RES_CHRATR_ESCAPEMENT ||
292  pItem->Which() == RES_CHRATR_POSTURE ||
293  pItem->Which() == RES_CHRATR_CJK_POSTURE ||
294  pItem->Which() == RES_CHRATR_CTL_POSTURE)
295  {
296  retval->Put(std::unique_ptr<SfxPoolItem>(pItem->Clone()));
297  }
298  pItem = aIter.NextItem();
299  } while (pItem);
300  return retval;
301 }
302 
305  sal_Int32 & rOffset,
306  SwTextNode const& rNode,
307  ToxWhitespaceStripper const& rStripper,
308  SwAttrPool & rPool,
309  SwRootFrame const*const pLayout)
310 {
311  // note: this *must* use the same flags as SwTextNode::GetExpandText()
312  // or indexes will be off!
314  if (pLayout && pLayout->IsHideRedlines())
315  {
316  eMode |= ExpandMode::HideDeletions;
317  }
318  ModelToViewHelper aConversionMap(rNode, pLayout, eMode);
319  if (SwpHints const*const pHints = rNode.GetpSwpHints())
320  {
321  for (size_t i = 0; i < pHints->Count(); ++i)
322  {
323  const SwTextAttr* pHint = pHints->Get(i);
324  std::shared_ptr<SfxItemSet> attributesToClone =
325  CollectAttributesForTox(*pHint, rPool);
326  if (attributesToClone->Count() <= 0) {
327  continue;
328  }
329 
330  // sw_redlinehide: due to the ... interesting ... multi-level index
331  // mapping going on here, can't use the usual merged attr iterators :(
332 
333  sal_Int32 const nStart(aConversionMap.ConvertToViewPosition(pHint->GetStart()));
334  sal_Int32 const nEnd(aConversionMap.ConvertToViewPosition(pHint->GetAnyEnd()));
335  if (nStart != nEnd) // might be in delete redline, and useless anyway
336  {
337  std::unique_ptr<SwFormatAutoFormat> pClone(
338  static_cast<SwFormatAutoFormat*>(pHint->GetAutoFormat().Clone()));
339  pClone->SetStyleHandle(attributesToClone);
340  rResult.autoFormats.push_back(std::move(pClone));
341  // note the rStripper is on the whole merged text, so need rOffset
342  rResult.startPositions.push_back(
343  rStripper.GetPositionInStrippedString(rOffset + nStart));
344  rResult.endPositions.push_back(
345  rStripper.GetPositionInStrippedString(rOffset + nEnd));
346  }
347  }
348  }
349  rOffset += aConversionMap.getViewText().getLength();
350 }
351 
354  SwAttrPool& pool, SwRootFrame const*const pLayout)
355 {
357  ToxWhitespaceStripper stripper(source.GetText().sText);
358  result.text = stripper.GetStrippedString();
359 
360  // FIXME: there is a pre-existing problem that the index mapping of the
361  // attributes only works if the paragraph is fully selected
362  if (!source.IsFullPara() || source.aTOXSources.empty())
363  return result;
364 
365  const SwTextNode* pSrc = source.aTOXSources.front().pNd->GetTextNode();
366  if (!pSrc)
367  {
368  return result;
369  }
370 
371  sal_Int32 nOffset(0);
372  GetAttributesForNode(result, nOffset, *pSrc, stripper, pool, pLayout);
373  if (pLayout && pLayout->IsHideRedlines())
374  {
375  if (SwTextFrame const*const pFrame = static_cast<SwTextFrame*>(pSrc->getLayoutFrame(pLayout)))
376  {
377  if (sw::MergedPara const*const pMerged = pFrame->GetMergedPara())
378  {
379  // pSrc already copied above
380  assert(pSrc == pMerged->pParaPropsNode);
381  for (sal_uLong i = pSrc->GetIndex() + 1;
382  i <= pMerged->pLastNode->GetIndex(); ++i)
383  {
384  SwNode *const pTmp(pSrc->GetNodes()[i]);
385  if (pTmp->GetRedlineMergeFlag() == SwNode::Merge::NonFirst)
386  {
387  GetAttributesForNode(result, nOffset,
388  *pTmp->GetTextNode(), stripper, pool, pLayout);
389  }
390  }
391  }
392  }
393  }
394 
395  return result;
396 }
397 
398 /*static*/ void
400 {
401  sal_Int32 offset = targetNode.GetText().getLength();
402  SwIndex aIdx(&targetNode, offset);
403  targetNode.InsertText(htt.text, aIdx);
404  for (size_t i=0; i < htt.autoFormats.size(); ++i) {
405  targetNode.InsertItem(*htt.autoFormats.at(i),
406  htt.startPositions.at(i) + offset,
407  htt.endPositions.at(i) + offset);
408  }
409 }
410 
411 /*static*/ OUString
413 {
414  if (numberOfToxSources == 0) {
415  return OUString();
416  }
417  OUStringBuffer retval;
418  // Place holder for the PageNumber; we only respect the first one
419  retval.append(C_NUM_REPL);
420  for (size_t i = 1; i < numberOfToxSources; ++i) {
421  retval.append(S_PAGE_DELI);
422  retval.append(C_NUM_REPL);
423  }
424  retval.append(C_END_PAGE_NUM);
425  return retval.makeStringAndClear();
426 }
427 
428 /*virtual*/ SwChapterField
430  const SwFormToken* chapterToken, const SwContentFrame* contentFrame,
431  const SwContentNode* contentNode) const
432 {
433  assert(chapterToken);
434  assert(chapterToken->nOutlineLevel >= 1);
435 
436  SwChapterField retval(chapterFieldType, chapterToken->nChapterFormat);
437  retval.SetLevel(static_cast<sal_uInt8>(chapterToken->nOutlineLevel - 1));
438  // #i53420#
439  retval.ChangeExpansion(*contentFrame, contentNode, true);
440  return retval;
441 }
442 } // end namespace sw
443 
444 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)=0
std::vector< SwFormToken > SwFormTokens
Vector of tokens.
Definition: tox.hxx:249
std::shared_ptr< ToxLinkProcessor > mLinkProcessor
const sal_Unicode C_NUM_REPL
Definition: tox.cxx:46
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:149
sal_uLong GetIndex() const
Definition: node.hxx:282
OUString HandleChapterToken(const SwTOXSortTabBase &rBase, const SwFormToken &aToken, SwRootFrame const *pLayout) const
Handle a chapter token.
virtual OUString GetURL() const
Definition: txmsrt.cxx:187
const OUString & GetText() const
Definition: ndtxt.hxx:210
virtual const SwRootFrame * GetCurrentLayout() const =0
std::vector< std::unique_ptr< SwFormatAutoFormat > > autoFormats
virtual bool SetAttr(const SfxPoolItem &) override
overriding to handle change of certain paragraph attributes
Definition: ndtxt.cxx:4889
SwpHints * GetpSwpHints()
Definition: ndtxt.hxx:218
sal_uInt16 nOutlineLevel
Definition: tox.hxx:215
Definition: tox.hxx:276
#define RES_CHRATR_CJK_POSTURE
Definition: hintids.hxx:94
sal_uIntPtr sal_uLong
virtual sal_uInt16 GetLevel() const =0
SwContentFrame * getLayoutFrame(const SwRootFrame *, const SwPosition *pPos=nullptr, std::pair< Point, bool > const *pViewPosAndCalcFrame=nullptr) const
Definition: node.cxx:1147
Definition: doc.hxx:185
only chapter number without post-/prefix
Definition: chpfld.hxx:35
std::shared_ptr< ToxTabStopTokenHandler > mTabStopTokenHandler
const std::shared_ptr< SfxItemSet > & GetStyleHandle() const
Definition: fmtautofmt.hxx:49
This class helps to remove unwanted whitespaces from a string to use in a Tox.
sal_uInt16 GetFormMax() const
Definition: tox.hxx:653
Dialog to specify the properties of date form field.
void SetLevel(sal_uInt8)
Definition: chpfld.cxx:80
sal_uInt16 Which() const
Definition: txatbase.hxx:110
sal_Int32 GetAnyEnd() const
end (if available), else start
Definition: txatbase.hxx:153
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
static OUString GetNumStringOfFirstNode(const SwTOXSortTabBase &rBase, bool bUsePrefix, sal_uInt8 nLevel, SwRootFrame const *pLayout)
This method will call GetNumStringOfFirstNode() of the first node in the provided SwTOXSortTabBase...
int GetActualListLevel() const
Returns the actual list level of this text node, when it is a list item.
Definition: ndtxt.cxx:4094
chapter number without post-/prefix and title
Definition: chpfld.hxx:36
virtual bool IsFullPara() const
Definition: txmsrt.cxx:192
const OUString & GetTitle(SwRootFrame const *pLayout=nullptr) const
Definition: chpfld.cxx:92
sal_Int32 ConvertToViewPosition(sal_Int32 nModelPos) const
Converts a model position into a view position.
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: fmtatr2.cxx:128
const OUString S_PAGE_DELI
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:425
#define RES_PARATR_TABSTOP
Definition: hintids.hxx:167
eField
Definition: fields.hxx:26
sal_Int32 GetStart() const
Definition: txatbase.hxx:82
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
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:1221
Describes parts of multiple text nodes, which will form a text frame, even when redlines are hidden a...
Definition: txtfrm.hxx:954
ToxTextGenerator(const SwForm &toxForm, std::shared_ptr< ToxTabStopTokenHandler > const &tabStopHandler)
virtual SwChapterField ObtainChapterField(SwChapterFieldType *chapterFieldType, const SwFormToken *chapterToken, const SwContentFrame *contentFrame, const SwContentNode *contentNode) const
Obtain a ChapterField to use for the text generation.
const OUString & getViewText() const
number and title
Definition: chpfld.hxx:34
const SwFormTokens & GetPattern(sal_uInt16 nLevel) const
Definition: tox.cxx:935
static OUString ConstructPageNumberPlaceholder(size_t numberOfToxSources)
Handle a page number token.
MetadataImporterPluginType * result
int i
Marks a character position inside a document model node.
Definition: index.hxx:37
SwNumRule * GetNumRule(bool bInParent=true) const
Returns numbering rule of this text node.
Definition: ndtxt.cxx:2810
sal_uInt16 nChapterFormat
Definition: tox.hxx:214
#define RES_CHRATR_ESCAPEMENT
Definition: hintids.hxx:75
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:693
const SwTextTOXMark * pTextMark
Definition: txmsrt.hxx:128
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:404
OUString GenerateTextForChapterToken(const SwFormToken &chapterToken, const SwContentFrame *contentFrame, const SwContentNode *contentNode, SwRootFrame const *pLayout) const
Generate the text for a chapter token.
const sal_Unicode C_END_PAGE_NUM
Definition: tox.cxx:47
SwTextNode * GetParaPropsNode(SwRootFrame const &rLayout, SwNodeIndex const &rNode)
Definition: txtfrm.cxx:336
ToxAuthorityField
Definition: toxe.hxx:82
only the chapter number
Definition: chpfld.hxx:32
OUString InsertText(const OUString &rStr, const SwIndex &rIdx, const SwInsertFlags nMode=SwInsertFlags::DEFAULT)
insert text content
Definition: ndtxt.cxx:2282
SwCharFormat * FindCharFormatByName(const OUString &rName) const
Definition: doc.hxx:767
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
ExpandMode
Some helpers for converting model strings to view strings.
OUString sText
Definition: txmsrt.hxx:60
#define RES_TXTATR_AUTOFMT
Definition: hintids.hxx:141
sal_Int32 GetPositionInStrippedString(sal_Int32 pos) const
An SwTextAttr container, stores all directly formatted text portions for a text node.
Definition: ndhints.hxx:67
void GenerateText(SwDoc *doc, 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).
void ChangeExpansion(const SwFrame &, const SwContentNode *, bool bSrchNum=false)
Definition: chpfld.cxx:127
unsigned char sal_uInt8
#define RES_CHRATR_POSTURE
Definition: hintids.hxx:80
#define RES_CHRATR_CTL_POSTURE
Definition: hintids.hxx:99
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:261
static std::shared_ptr< SfxItemSet > CollectAttributesForTox(const SwTextAttr &hint, SwAttrPool &pool)
Collect the attributes of a hint that shall be copied over to the TOX.
static void ApplyHandledTextToken(const HandledTextToken &htt, SwTextNode &targetNode)
Applies the result of a handled text token to a target node.
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding)...
Definition: rootfrm.hxx:416
const OUString & GetNumber(SwRootFrame const *pLayout=nullptr) const
Definition: chpfld.cxx:86
OUString GetNumString(const bool _bInclPrefixAndSuffixStrings=true, const unsigned int _nRestrictToThisLevel=MAXLEVEL, SwRootFrame const *pLayout=nullptr) const
Returns outline of numbering string.
Definition: ndtxt.cxx:3127
::cppu::ImplementationEntry const entries[]
static void GetAttributesForNode(HandledTextToken &rResult, sal_Int32 &rOffset, SwTextNode const &rNode, ToxWhitespaceStripper const &rStripper, SwAttrPool &rPool, SwRootFrame const *const pLayout)
const SwFormatAutoFormat & GetAutoFormat() const
Definition: txatbase.hxx:185
virtual void FillText(SwTextNode &rNd, const SwIndex &rInsPos, sal_uInt16 nAuthField, SwRootFrame const *pLayout) const
Definition: txmsrt.cxx:197
static HandledTextToken HandleTextToken(const SwTOXSortTabBase &source, SwAttrPool &attrPool, SwRootFrame const *const pLayout)
Append text (and selected attributes) to a target node.
TextAndReading const & GetText() const
Definition: txmsrt.hxx:176
Class for sorting directories.
Definition: txmsrt.hxx:120
std::vector< SwTOXSource > aTOXSources
Definition: txmsrt.hxx:125
A helper class for ToxTextGenerator.
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1309
only the title
Definition: chpfld.hxx:33
Base class of the Writer document model elements.
Definition: node.hxx:79