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