LibreOffice Module sw (master)  1
atrftn.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 <fmtftn.hxx>
21 
22 #include <doc.hxx>
25 #include <cntfrm.hxx>
26 #include <rootfrm.hxx>
27 #include <pagefrm.hxx>
28 #include <txtftn.hxx>
29 #include <ftnidx.hxx>
30 #include <ftninfo.hxx>
31 #include <swfont.hxx>
32 #include <ndtxt.hxx>
33 #include <poolfmt.hxx>
34 #include <ftnfrm.hxx>
35 #include <ndindex.hxx>
36 #include <fmtftntx.hxx>
37 #include <section.hxx>
38 #include <calbck.hxx>
39 #include <hints.hxx>
40 
41 namespace {
47  void lcl_FillUsedFootnoteRefNumbers(SwDoc &rDoc,
48  SwTextFootnote const *pExclude,
49  std::set<sal_uInt16> &rUsedRef,
50  std::vector<SwTextFootnote*> &rInvalid)
51  {
52  SwFootnoteIdxs& ftnIdxs = rDoc.GetFootnoteIdxs();
53 
54  rInvalid.clear();
55 
56  for( size_t n = 0; n < ftnIdxs.size(); ++n )
57  {
58  SwTextFootnote* pTextFootnote = ftnIdxs[ n ];
59  if ( pTextFootnote != pExclude )
60  {
61  if ( USHRT_MAX == pTextFootnote->GetSeqRefNo() )
62  {
63  rInvalid.push_back(pTextFootnote);
64  }
65  else
66  {
67  rUsedRef.insert( pTextFootnote->GetSeqRefNo() );
68  }
69  }
70  }
71  }
72 
77  bool lcl_IsRefNumAvailable(std::set<sal_uInt16> const &rUsedNums,
78  sal_uInt16 requested)
79  {
80  if ( USHRT_MAX == requested )
81  return false; // Invalid sequence number.
82  if ( rUsedNums.count(requested) )
83  return false; // Number already used.
84  return true;
85  }
86 
91  void lcl_FillUnusedSeqRefNums(std::vector<sal_uInt16> &rLowestUnusedNums,
92  const std::set<sal_uInt16> &rUsedNums,
93  size_t numRequired)
94  {
95  if (!numRequired)
96  return;
97 
98  rLowestUnusedNums.reserve(numRequired);
99  sal_uInt16 newNum = 0;
100  //Start by using numbers from gaps in rUsedNums
101  for( const auto& rNum : rUsedNums )
102  {
103  while ( newNum < rNum )
104  {
105  rLowestUnusedNums.push_back( newNum++ );
106  if ( --numRequired == 0)
107  return;
108  }
109  newNum++;
110  }
111  //Filled in all gaps. Fill the rest of the list with new numbers.
112  do
113  {
114  rLowestUnusedNums.push_back( newNum++ );
115  }
116  while ( --numRequired > 0 );
117  }
118 
119 }
120 
123  , SwModify(nullptr)
124  , m_pTextAttr(nullptr)
125  , m_nNumber(0)
126  , m_nNumberRLHidden(0)
127  , m_bEndNote(bEndNote)
128 {
129 }
130 
131 bool SwFormatFootnote::operator==( const SfxPoolItem& rAttr ) const
132 {
133  assert(SfxPoolItem::operator==(rAttr));
134  return m_nNumber == static_cast<const SwFormatFootnote&>(rAttr).m_nNumber &&
135  //FIXME?
136  m_aNumber == static_cast<const SwFormatFootnote&>(rAttr).m_aNumber &&
137  m_bEndNote == static_cast<const SwFormatFootnote&>(rAttr).m_bEndNote;
138 }
139 
141 {
143  pNew->m_aNumber = m_aNumber;
144  pNew->m_nNumber = m_nNumber;
146  pNew->m_bEndNote = m_bEndNote;
147  return pNew;
148 }
149 
150 void SwFormatFootnote::Modify(SfxPoolItem const* pOld, SfxPoolItem const* pNew)
151 {
152  NotifyClients(pOld, pNew);
153  if (pOld && (RES_REMOVE_UNO_OBJECT == pOld->Which()))
154  { // invalidate cached UNO object
155  SetXFootnote(css::uno::Reference<css::text::XFootnote>(nullptr));
156  }
157 }
158 
160 {
162  &static_cast<SwModify&>(*this)); // cast to base class (void*)
163  NotifyClients(&item, &item);
164 }
165 
167 {
168  if ( b != m_bEndNote )
169  {
170  if ( GetTextFootnote() )
171  {
172  GetTextFootnote()->DelFrames(nullptr);
173  }
174  m_bEndNote = b;
175  }
176 }
177 
179 {
180 }
181 
182 OUString SwFormatFootnote::GetFootnoteText(SwRootFrame const& rLayout) const
183 {
184  OUStringBuffer buf;
185  if( m_pTextAttr->GetStartNode() )
186  {
187  SwNodeIndex aIdx( *m_pTextAttr->GetStartNode(), 1 );
188  SwContentNode* pCNd = aIdx.GetNode().GetTextNode();
189  if( !pCNd )
190  pCNd = aIdx.GetNodes().GoNext( &aIdx );
191 
192  if( pCNd->IsTextNode() ) {
193  buf.append(static_cast<SwTextNode*>(pCNd)->GetExpandText(&rLayout));
194 
195  ++aIdx;
196  while ( !aIdx.GetNode().IsEndNode() ) {
197  if ( aIdx.GetNode().IsTextNode() )
198  {
199  buf.append(" ");
200  buf.append(aIdx.GetNode().GetTextNode()->GetExpandText(&rLayout));
201  }
202  ++aIdx;
203  }
204  }
205  }
206  return buf.makeStringAndClear();
207 }
208 
211  SwRootFrame const*const pLayout, bool bInclStrings) const
212 {
213  OUString sRet( GetNumStr() );
214  if( sRet.isEmpty() )
215  {
216  // in this case the number is needed, get it via SwDoc's FootnoteInfo
217  bool bMakeNum = true;
218  const SwSectionNode* pSectNd = m_pTextAttr
220  : nullptr;
221  sal_uInt16 const nNumber(pLayout && pLayout->IsHideRedlines()
223  : GetNumber());
224 
225  if( pSectNd )
226  {
227  const SwFormatFootnoteEndAtTextEnd& rFootnoteEnd = static_cast<const SwFormatFootnoteEndAtTextEnd&>(
228  pSectNd->GetSection().GetFormat()->GetFormatAttr(
229  IsEndNote() ?
230  static_cast<sal_uInt16>(RES_END_AT_TXTEND) :
231  static_cast<sal_uInt16>(RES_FTN_AT_TXTEND) ) );
232 
233  if( FTNEND_ATTXTEND_OWNNUMANDFMT == rFootnoteEnd.GetValue() )
234  {
235  bMakeNum = false;
236  sRet = rFootnoteEnd.GetSwNumType().GetNumStr( nNumber );
237  if( bInclStrings )
238  {
239  sRet = rFootnoteEnd.GetPrefix() + sRet + rFootnoteEnd.GetSuffix();
240  }
241  }
242  }
243 
244  if( bMakeNum )
245  {
246  const SwEndNoteInfo* pInfo;
247  if( IsEndNote() )
248  pInfo = &rDoc.GetEndNoteInfo();
249  else
250  pInfo = &rDoc.GetFootnoteInfo();
251  sRet = pInfo->aFormat.GetNumStr( nNumber );
252  if( bInclStrings )
253  {
254  sRet = pInfo->GetPrefix() + sRet + pInfo->GetSuffix();
255  }
256  }
257  }
258  return sRet;
259 }
260 
261 SwTextFootnote::SwTextFootnote( SwFormatFootnote& rAttr, sal_Int32 nStartPos )
262  : SwTextAttr( rAttr, nStartPos )
263  , m_pTextNode( nullptr )
264  , m_nSeqNo( USHRT_MAX )
265 {
266  rAttr.m_pTextAttr = this;
267  SetHasDummyChar(true);
268 }
269 
271 {
272  SetStartNode( nullptr );
273 }
274 
275 void SwTextFootnote::SetStartNode( const SwNodeIndex *pNewNode, bool bDelNode )
276 {
277  if( pNewNode )
278  {
279  if ( !m_pStartNode )
280  {
281  m_pStartNode.reset(new SwNodeIndex(*pNewNode));
282  }
283  else
284  {
285  *m_pStartNode = *pNewNode;
286  }
287  }
288  else if ( m_pStartNode )
289  {
290  // need to do 2 things:
291  // 1) unregister footnotes at their pages
292  // 2) delete the footnote section in the Inserts of the nodes-array
293  SwDoc* pDoc;
294  if ( m_pTextNode )
295  {
296  pDoc = m_pTextNode->GetDoc();
297  }
298  else
299  {
300  //JP 27.01.97: the sw3-Reader creates a StartNode but the
301  // attribute isn't anchored in the TextNode yet.
302  // If it is deleted (e.g. Insert File with footnote
303  // inside fly frame), the content must also be deleted.
304  pDoc = m_pStartNode->GetNodes().GetDoc();
305  }
306 
307  // If called from ~SwDoc(), must not delete the footnote nodes,
308  // and not necessary to delete the footnote frames.
309  if( !pDoc->IsInDtor() )
310  {
311  if( bDelNode )
312  {
313  // 2) delete the section for the footnote nodes
314  // it's possible that the Inserts have already been deleted (how???)
316  }
317  else
318  // If the nodes are not deleted, their frames must be removed
319  // from the page (deleted), there is nothing else that deletes
320  // them (particularly not Undo)
321  DelFrames( nullptr );
322  }
323  m_pStartNode.reset();
324 
325  // remove the footnote from the SwDoc's array
326  for( size_t n = 0; n < pDoc->GetFootnoteIdxs().size(); ++n )
327  if( this == pDoc->GetFootnoteIdxs()[n] )
328  {
329  pDoc->GetFootnoteIdxs().erase( pDoc->GetFootnoteIdxs().begin() + n );
330  // if necessary, update following footnotes
331  if( !pDoc->IsInDtor() && n < pDoc->GetFootnoteIdxs().size() )
332  {
333  SwNodeIndex aTmp( pDoc->GetFootnoteIdxs()[n]->GetTextNode() );
334  pDoc->GetFootnoteIdxs().UpdateFootnote( aTmp );
335  }
336  break;
337  }
338  }
339 }
340 
341 void SwTextFootnote::SetNumber(const sal_uInt16 nNewNum,
342  sal_uInt16 const nNumberRLHidden, const OUString &sNumStr)
343 {
344  SwFormatFootnote& rFootnote = const_cast<SwFormatFootnote&>(GetFootnote());
345 
346  rFootnote.m_aNumber = sNumStr;
347  if ( sNumStr.isEmpty() )
348  {
349  rFootnote.m_nNumber = nNewNum;
350  rFootnote.m_nNumberRLHidden = nNumberRLHidden;
351  }
353 }
354 
356 {
357  assert(m_pTextNode);
358  SwFormatFootnote const& rFootnote(GetFootnote());
359  SwNodes &rNodes = m_pTextNode->GetDoc()->GetNodes();
360  m_pTextNode->ModifyNotification( nullptr, &rFootnote );
361  if ( m_pStartNode )
362  {
363  // must iterate over all TextNodes because of footnotes on other pages
364  sal_uLong nSttIdx = m_pStartNode->GetIndex() + 1;
365  sal_uLong nEndIdx = m_pStartNode->GetNode().EndOfSectionIndex();
366  for( ; nSttIdx < nEndIdx; ++nSttIdx )
367  {
368  SwNode* pNd;
369  if( ( pNd = rNodes[ nSttIdx ] )->IsTextNode() )
370  static_cast<SwTextNode*>(pNd)->ModifyNotification( nullptr, &rFootnote );
371  }
372  }
373 }
374 
376  SwTextFootnote & rDest,
377  SwTextNode & rDestNode ) const
378 {
379  if (m_pStartNode && !rDest.GetStartNode())
380  {
381  // dest missing node section? create it here!
382  // (happens in SwTextNode::CopyText if pDest == this)
383  rDest.MakeNewTextSection( rDestNode.GetNodes() );
384  }
385  if (m_pStartNode && rDest.GetStartNode())
386  {
387  // footnotes not necessarily in same document!
388  SwDoc *const pDstDoc = rDestNode.GetDoc();
389  SwNodes &rDstNodes = pDstDoc->GetNodes();
390 
391  // copy only the content of the section
392  SwNodeRange aRg( *m_pStartNode, 1,
393  *m_pStartNode->GetNode().EndOfSectionNode() );
394 
395  // insert at the end of rDest, i.e., the nodes are appended.
396  // nDestLen contains number of ContentNodes in rDest _before_ copy.
397  SwNodeIndex aStart( *(rDest.GetStartNode()) );
398  SwNodeIndex aEnd( *aStart.GetNode().EndOfSectionNode() );
399  sal_uLong nDestLen = aEnd.GetIndex() - aStart.GetIndex() - 1;
400 
402 
403  // in case the destination section was not empty, delete the old nodes
404  // before: Src: SxxxE, Dst: SnE
405  // now: Src: SxxxE, Dst: SnxxxE
406  // after: Src: SxxxE, Dst: SxxxE
407  ++aStart;
408  rDstNodes.Delete( aStart, nDestLen );
409  }
410 
411  // also copy user defined number string
412  if( !GetFootnote().m_aNumber.isEmpty() )
413  {
414  const_cast<SwFormatFootnote &>(rDest.GetFootnote()).m_aNumber = GetFootnote().m_aNumber;
415  }
416 }
417 
420 {
421  if ( m_pStartNode )
422  return;
423 
424  // set the footnote style on the SwTextNode
425  SwTextFormatColl *pFormatColl;
426  const SwEndNoteInfo* pInfo;
427  sal_uInt16 nPoolId;
428 
429  if( GetFootnote().IsEndNote() )
430  {
431  pInfo = &rNodes.GetDoc()->GetEndNoteInfo();
432  nPoolId = RES_POOLCOLL_ENDNOTE;
433  }
434  else
435  {
436  pInfo = &rNodes.GetDoc()->GetFootnoteInfo();
437  nPoolId = RES_POOLCOLL_FOOTNOTE;
438  }
439 
440  if( nullptr == (pFormatColl = pInfo->GetFootnoteTextColl() ) )
441  pFormatColl = rNodes.GetDoc()->getIDocumentStylePoolAccess().GetTextCollFromPool( nPoolId );
442 
443  SwStartNode* pSttNd = rNodes.MakeTextSection( SwNodeIndex( rNodes.GetEndOfInserts() ),
444  SwFootnoteStartNode, pFormatColl );
445  m_pStartNode.reset(new SwNodeIndex(*pSttNd));
446 }
447 
448 void SwTextFootnote::DelFrames(SwRootFrame const*const pRoot)
449 {
450  // delete the FootnoteFrames from the pages
451  OSL_ENSURE( m_pTextNode, "SwTextFootnote: where is my TextNode?" );
452  if ( !m_pTextNode )
453  return;
454 
455  bool bFrameFnd = false;
456  {
458  for( SwContentFrame* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
459  {
460  if( pRoot != pFnd->getRootFrame() && pRoot )
461  continue;
462  SwPageFrame* pPage = pFnd->FindPageFrame();
463  if( pPage )
464  {
465  // note: we have found the correct frame only if the footnote
466  // was actually removed; in case this is called from
467  // SwTextFrame::DestroyImpl(), then that frame isn't connected
468  // to SwPageFrame any more, and RemoveFootnote on any follow
469  // must not prevent the fall-back to the !bFrameFnd code.
470  bFrameFnd = pPage->RemoveFootnote(pFnd, this);
471  }
472  }
473  }
474  //JP 13.05.97: if the layout is deleted before the footnotes are deleted,
475  // try to delete the footnote's frames by another way
476  if ( !bFrameFnd && m_pStartNode )
477  {
478  SwNodeIndex aIdx( *m_pStartNode );
479  SwContentNode* pCNd = m_pTextNode->GetNodes().GoNext( &aIdx );
480  if( pCNd )
481  {
483  for( SwContentFrame* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
484  {
485  if( pRoot != pFnd->getRootFrame() && pRoot )
486  continue;
487  SwPageFrame* pPage = pFnd->FindPageFrame();
488 
489  SwFrame *pFrame = pFnd->GetUpper();
490  while ( pFrame && !pFrame->IsFootnoteFrame() )
491  pFrame = pFrame->GetUpper();
492 
493  SwFootnoteFrame *pFootnote = static_cast<SwFootnoteFrame*>(pFrame);
494  while ( pFootnote && pFootnote->GetMaster() )
495  pFootnote = pFootnote->GetMaster();
496  OSL_ENSURE( pFootnote->GetAttr() == this, "Footnote mismatch error." );
497 
498  while ( pFootnote )
499  {
500  SwFootnoteFrame *pFoll = pFootnote->GetFollow();
501  pFootnote->Cut();
502  SwFrame::DestroyFrame(pFootnote);
503  pFootnote = pFoll;
504  }
505 
506  // #i20556# During hiding of a section, the connection
507  // to the layout is already lost. pPage may be 0:
508  if ( pPage )
509  pPage->UpdateFootnoteNum();
510  }
511  }
512  }
513 }
514 
518 {
519  if( !m_pTextNode )
520  return;
521 
522  SwDoc* pDoc = m_pTextNode->GetDoc();
523  if( pDoc->IsInReading() )
524  return;
525 
526  std::set<sal_uInt16> aUsedNums;
527  std::vector<SwTextFootnote*> badRefNums;
528  ::lcl_FillUsedFootnoteRefNumbers(*pDoc, this, aUsedNums, badRefNums);
529  if ( ::lcl_IsRefNumAvailable(aUsedNums, m_nSeqNo) )
530  return;
531  std::vector<sal_uInt16> unused;
532  ::lcl_FillUnusedSeqRefNums(unused, aUsedNums, 1);
533  m_nSeqNo = unused[0];
534 }
535 
539 {
540  std::set<sal_uInt16> aUsedNums;
541  std::vector<SwTextFootnote*> badRefNums;
542  ::lcl_FillUsedFootnoteRefNumbers(rDoc, nullptr, aUsedNums, badRefNums);
543  std::vector<sal_uInt16> aUnused;
544  ::lcl_FillUnusedSeqRefNums(aUnused, aUsedNums, badRefNums.size());
545 
546  for (size_t i = 0; i < badRefNums.size(); ++i)
547  {
548  badRefNums[i]->m_nSeqNo = aUnused[i];
549  }
550 }
551 
553 {
554 //FEATURE::CONDCOLL
555  if( GetStartNode() )
556  static_cast<SwStartNode&>(GetStartNode()->GetNode()).CheckSectionCondColl();
557 //FEATURE::CONDCOLL
558 }
559 
560 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString GetNumStr(sal_Int32 nNo) const
Starts a section of nodes in the document model.
Definition: node.hxx:303
Base class of the Writer layout elements.
Definition: frame.hxx:295
#define RES_FTN_AT_TXTEND
Definition: hintids.hxx:222
void SetEndNote(bool b)
Definition: atrftn.cxx:166
SwNode & GetEndOfInserts() const
Section fpr all footnotes.
Definition: ndarr.hxx:155
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrftn.cxx:131
#define RES_END_AT_TXTEND
Definition: hintids.hxx:223
SwFormatFootnote(const SwFormatFootnote &)=delete
virtual void ModifyNotification(const SfxPoolItem *pOld, const SfxPoolItem *pNew) override
Definition: node.hxx:475
void SetStartNode(const SwNodeIndex *pNode, bool bDelNodes=true)
Definition: atrftn.cxx:275
const OUString & GetSuffix() const
Definition: ftninfo.hxx:71
void SetHasDummyChar(const bool bFlag)
Definition: txatbase.hxx:68
void SetXFootnote(css::uno::Reference< css::text::XFootnote > const &xNote)
Definition: fmtftn.hxx:96
sal_uIntPtr sal_uLong
-""- and with own numberformat
Definition: fmtftntx.hxx:33
void CheckCondColl()
Definition: atrftn.cxx:552
const OUString & GetSuffix() const
Definition: fmtftntx.hxx:80
Definition: doc.hxx:185
TElementType * Next()
Definition: calbck.hxx:376
void UpdateFootnoteNum()
Definition: ftnfrm.cxx:2375
SwTextFootnote(SwFormatFootnote &rAttr, sal_Int32 nStart)
Definition: atrftn.cxx:261
SwNode & GetNode() const
Definition: ndindex.hxx:118
SwSectionFormat * GetFormat()
Definition: section.hxx:337
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
Definition: ssfrm.cxx:382
SwTextFootnote * m_pTextAttr
My TextAttribute.
Definition: fmtftn.hxx:45
bool IsEndNote() const
Definition: fmtftn.hxx:73
virtual void Cut() override
Definition: ftnfrm.cxx:499
#define RES_REMOVE_UNO_OBJECT
Definition: hintids.hxx:304
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:347
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
bool IsFootnoteFrame() const
Definition: frame.hxx:1178
OUString GetViewNumStr(const SwDoc &rDoc, SwRootFrame const *pLayout, bool bInclStrings=false) const
Returns string to be displayed of footnote / endnote.
Definition: atrftn.cxx:210
SwTextFormatColl * GetFootnoteTextColl() const
Definition: ftninfo.hxx:55
const SwSection & GetSection() const
Definition: node.hxx:541
void Delete(const SwNodeIndex &rPos, sal_uLong nNodes=1)
delete nodes
Definition: nodes.cxx:1063
virtual ~SwFormatFootnote() override
Definition: atrftn.cxx:178
const SwTextFootnote * GetTextFootnote() const
Definition: fmtftn.hxx:85
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:458
sal_uLong GetIndex() const
Definition: ndindex.hxx:151
SvxNumberType aFormat
Definition: ftninfo.hxx:46
virtual void DeleteSection(SwNode *pNode)=0
Delete section containing the node.
const OUString & GetNumStr() const
Definition: fmtftn.hxx:70
const SvxNumberType & GetSwNumType() const
Definition: fmtftntx.hxx:72
std::unique_ptr< SwNodeIndex > m_pStartNode
Definition: txtftn.hxx:33
size_type size() const
sal_uInt16 GetSeqRefNo() const
Definition: txtftn.hxx:64
virtual ~SwTextFootnote() override
Definition: atrftn.cxx:270
SwStartNode * MakeTextSection(const SwNodeIndex &rWhere, SwStartNodeType eSttNdTyp, SwTextFormatColl *pColl)
Definition: nodes.cxx:1900
void SetNumber(sal_uInt16 nNumber, sal_uInt16 nNumberRLHidden, const OUString &sNumStr)
Definition: atrftn.cxx:341
sal_uInt16 m_nNumber
automatic sequence number
Definition: fmtftn.hxx:47
sal_uInt16 m_nSeqNo
Definition: txtftn.hxx:35
OUString m_aNumber
User-defined 'Number'.
Definition: fmtftn.hxx:46
#define RES_TXTATR_FTN
Definition: hintids.hxx:152
SwPageFrame * FindPageFrame()
Definition: frame.hxx:658
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
Definition: doc.cxx:357
TElementType * First()
Definition: calbck.hxx:345
int i
OUString GetFootnoteText(SwRootFrame const &rLayout) const
Definition: atrftn.cxx:182
SwDoc * GetDoc()
Definition: node.hxx:702
SwLayoutFrame * GetUpper()
Definition: frame.hxx:656
sal_uInt16 GetNumberRLHidden() const
Definition: fmtftn.hxx:72
void MakeNewTextSection(SwNodes &rNodes)
create a new nodes-array section for the footnote
Definition: atrftn.cxx:419
void CopyWithFlyInFly(const SwNodeRange &rRg, const sal_Int32 nEndContentIndex, const SwNodeIndex &rInsPos, const std::pair< const SwPaM &, const SwPosition & > *pCopiedPaM=nullptr, bool bMakeNewFrames=true, bool bDelRedlines=true, bool bCopyFlyAtFly=false) const
void InvalidateNumberInLayout()
Definition: atrftn.cxx:355
Marks a node in the document model.
Definition: ndindex.hxx:31
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:693
A page of the document layout.
Definition: pagefrm.hxx:40
const SwFormatFootnote & GetFootnote() const
Definition: txatbase.hxx:194
bool IsInReading() const
Definition: doc.hxx:948
const OUString & GetPrefix() const
Definition: fmtftntx.hxx:77
const SwFootnoteFrame * GetMaster() const
Definition: ftnfrm.hxx:104
SwDoc * GetDoc()
Which Doc contains the nodes-array?
Definition: ndarr.hxx:305
const_iterator begin() const
void NotifyClients(const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue)
Definition: calbck.cxx:167
sal_uInt16 m_nNumberRLHidden
automatic sequence number (hidden redlines)
Definition: fmtftn.hxx:48
bool RemoveFootnote(const SwContentFrame *, const SwTextFootnote *, bool bPrep=true)
Definition: ftnfrm.cxx:1671
SwTextNode * m_pTextNode
Definition: txtftn.hxx:34
const OUString & GetPrefix() const
Definition: ftninfo.hxx:70
void UpdateFootnote(const SwNodeIndex &rStt)
Definition: ftnidx.cxx:60
static void SetUniqueSeqRefNo(SwDoc &rDoc)
Set a unique sequential reference number for every footnote in the document.
Definition: atrftn.cxx:538
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
bool m_bEndNote
Is it an End note?
Definition: fmtftn.hxx:49
void CopyFootnote(SwTextFootnote &rDest, SwTextNode &rDestNode) const
Definition: atrftn.cxx:375
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:259
const SwFootnoteFrame * GetFollow() const
Definition: ftnfrm.hxx:101
SwNodes & GetNodes()
Definition: doc.hxx:403
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
const SwTextFootnote * GetAttr() const
Definition: ftnfrm.hxx:107
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:379
void InvalidateFootnote()
Definition: atrftn.cxx:159
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding)...
Definition: rootfrm.hxx:416
void DelFrames(const SwRootFrame *)
Definition: atrftn.cxx:448
void SetSeqRefNo()
Set the sequence number for the current footnote.
Definition: atrftn.cxx:517
bool IsInDtor() const
Definition: doc.hxx:398
SwNodeIndex * GetStartNode() const
Definition: txtftn.hxx:41
SwFootnoteIdxs & GetFootnoteIdxs()
Definition: doc.hxx:628
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrftn.cxx:140
static const SwSectionNode * FindSectNdWithEndAttr(const SwTextFootnote &rTextFootnote)
Definition: ftnidx.cxx:445
virtual void Modify(SfxPoolItem const *pOld, SfxPoolItem const *pNew) override
Definition: atrftn.cxx:150
std::pair< const_iterator, bool > insert(Value &&x)
sal_uInt16 GetNumber() const
Definition: fmtftn.hxx:71
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1273
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:624
sal_uInt16 Which() const
SwRootFrame * getRootFrame()
Definition: frame.hxx:657
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:626
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:842
size_type erase(const Value &x)
Base class of the Writer document model elements.
Definition: node.hxx:79
EnumT GetValue() const