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