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