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