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 <libxml/xmlwriter.h>
21
22#include <fmtftn.hxx>
23
24#include <doc.hxx>
27#include <cntfrm.hxx>
28#include <rootfrm.hxx>
29#include <pagefrm.hxx>
30#include <txtftn.hxx>
31#include <ftnidx.hxx>
32#include <ftninfo.hxx>
33#include <ndtxt.hxx>
34#include <poolfmt.hxx>
35#include <ftnfrm.hxx>
36#include <ndindex.hxx>
37#include <fmtftntx.hxx>
38#include <section.hxx>
39#include <calbck.hxx>
40#include <hints.hxx>
41#include <pam.hxx>
42#include <rtl/ustrbuf.hxx>
43#include <vcl/svapp.hxx>
44#include <unotextrange.hxx>
45#include <osl/diagnose.h>
46#include <unofootnote.hxx>
47
48namespace {
54 void lcl_FillUsedFootnoteRefNumbers(SwDoc &rDoc,
55 SwTextFootnote const *pExclude,
56 std::set<sal_uInt16> &rUsedRef,
57 std::vector<SwTextFootnote*> &rInvalid)
58 {
59 SwFootnoteIdxs& ftnIdxs = rDoc.GetFootnoteIdxs();
60
61 rInvalid.clear();
62
63 for( size_t n = 0; n < ftnIdxs.size(); ++n )
64 {
65 SwTextFootnote* pTextFootnote = ftnIdxs[ n ];
66 if ( pTextFootnote != pExclude )
67 {
68 if ( USHRT_MAX == pTextFootnote->GetSeqRefNo() )
69 {
70 rInvalid.push_back(pTextFootnote);
71 }
72 else
73 {
74 rUsedRef.insert( pTextFootnote->GetSeqRefNo() );
75 }
76 }
77 }
78 }
79
84 bool lcl_IsRefNumAvailable(std::set<sal_uInt16> const &rUsedNums,
85 sal_uInt16 requested)
86 {
87 if ( USHRT_MAX == requested )
88 return false; // Invalid sequence number.
89 if ( rUsedNums.count(requested) )
90 return false; // Number already used.
91 return true;
92 }
93
98 void lcl_FillUnusedSeqRefNums(std::vector<sal_uInt16> &rLowestUnusedNums,
99 const std::set<sal_uInt16> &rUsedNums,
100 size_t numRequired)
101 {
102 if (!numRequired)
103 return;
104
105 rLowestUnusedNums.reserve(numRequired);
106 sal_uInt16 newNum = 0;
107 //Start by using numbers from gaps in rUsedNums
108 for( const auto& rNum : rUsedNums )
109 {
110 while ( newNum < rNum )
111 {
112 rLowestUnusedNums.push_back( newNum++ );
113 if ( --numRequired == 0)
114 return;
115 }
116 newNum++;
117 }
118 //Filled in all gaps. Fill the rest of the list with new numbers.
119 do
120 {
121 rLowestUnusedNums.push_back( newNum++ );
122 }
123 while ( --numRequired > 0 );
124 }
125
126}
127
130 , sw::BroadcastingModify()
131 , m_pTextAttr(nullptr)
132 , m_nNumber(0)
133 , m_nNumberRLHidden(0)
134 , m_bEndNote(bEndNote)
135{
136}
137
139{ m_wXFootnote = xNote.get(); }
140
142{
143 assert(SfxPoolItem::operator==(rAttr));
144 return m_nNumber == static_cast<const SwFormatFootnote&>(rAttr).m_nNumber &&
145 //FIXME?
146 m_aNumber == static_cast<const SwFormatFootnote&>(rAttr).m_aNumber &&
147 m_bEndNote == static_cast<const SwFormatFootnote&>(rAttr).m_bEndNote;
148}
149
151{
153 pNew->m_aNumber = m_aNumber;
154 pNew->m_nNumber = m_nNumber;
156 pNew->m_bEndNote = m_bEndNote;
157 return pNew;
158}
159
161{
162 if (rHint.GetId() != SfxHintId::SwLegacyModify)
163 return;
164 auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
165 CallSwClientNotify(rHint);
166 if(RES_REMOVE_UNO_OBJECT == pLegacy->GetWhich())
167 SetXFootnote(nullptr);
168}
169
171{
173 &static_cast<sw::BroadcastingModify&>(*this)); // cast to base class (void*)
175}
176
178{
179 if ( b != m_bEndNote )
180 {
181 if ( GetTextFootnote() )
182 {
183 GetTextFootnote()->DelFrames(nullptr);
184 }
185 m_bEndNote = b;
186 }
187}
188
190{
191}
192
193OUString SwFormatFootnote::GetFootnoteText(SwRootFrame const& rLayout) const
194{
195 OUStringBuffer buf;
197 {
198 SwNodeIndex aIdx( *m_pTextAttr->GetStartNode(), 1 );
199 SwContentNode* pCNd = aIdx.GetNode().GetTextNode();
200 if( !pCNd )
201 pCNd = aIdx.GetNodes().GoNext( &aIdx );
202
203 if( pCNd->IsTextNode() ) {
204 buf.append(static_cast<SwTextNode*>(pCNd)->GetExpandText(&rLayout));
205
206 ++aIdx;
207 while ( !aIdx.GetNode().IsEndNode() ) {
208 if ( aIdx.GetNode().IsTextNode() )
209 {
210 buf.append(" ");
211 buf.append(aIdx.GetNode().GetTextNode()->GetExpandText(&rLayout));
212 }
213 ++aIdx;
214 }
215 }
216 }
217 return buf.makeStringAndClear();
218}
219
222 SwRootFrame const*const pLayout, bool bInclStrings) const
223{
224 OUString sRet( GetNumStr() );
225 if( sRet.isEmpty() )
226 {
227 // in this case the number is needed, get it via SwDoc's FootnoteInfo
228 bool bMakeNum = true;
229 const SwSectionNode* pSectNd = m_pTextAttr
231 : nullptr;
232 sal_uInt16 const nNumber(pLayout && pLayout->IsHideRedlines()
234 : GetNumber());
235
236 if( pSectNd )
237 {
238 const SwFormatFootnoteEndAtTextEnd& rFootnoteEnd = static_cast<const SwFormatFootnoteEndAtTextEnd&>(
239 pSectNd->GetSection().GetFormat()->GetFormatAttr(
240 IsEndNote() ?
241 o3tl::narrowing<sal_uInt16>(RES_END_AT_TXTEND) :
242 o3tl::narrowing<sal_uInt16>(RES_FTN_AT_TXTEND) ) );
243
244 if( FTNEND_ATTXTEND_OWNNUMANDFMT == rFootnoteEnd.GetValue() )
245 {
246 bMakeNum = false;
247 sRet = rFootnoteEnd.GetSwNumType().GetNumStr( nNumber );
248 if( bInclStrings )
249 {
250 sRet = rFootnoteEnd.GetPrefix() + sRet + rFootnoteEnd.GetSuffix();
251 }
252 }
253 }
254
255 if( bMakeNum )
256 {
257 const SwEndNoteInfo* pInfo;
258 if( IsEndNote() )
259 pInfo = &rDoc.GetEndNoteInfo();
260 else
261 pInfo = &rDoc.GetFootnoteInfo();
262 sRet = pInfo->m_aFormat.GetNumStr( nNumber );
263 if( bInclStrings )
264 {
265 sRet = pInfo->GetPrefix() + sRet + pInfo->GetSuffix();
266 }
267 }
268 }
269 return sRet;
270}
271
272uno::Reference<text::XTextRange> SwFormatFootnote::getAnchor(SwDoc& rDoc) const
273{
274 SolarMutexGuard aGuard;
275 if (!m_pTextAttr)
276 return uno::Reference<text::XTextRange>();
278 aPam.SetMark();
279 aPam.GetMark()->AdjustContent(+1);
281 SwXTextRange::CreateXTextRange(rDoc, *aPam.Start(), aPam.End());
282 return xRet;
283}
284
286 : SwTextAttr( rAttr, nStartPos )
287 , m_pTextNode( nullptr )
288 , m_nSeqNo( USHRT_MAX )
289{
290 rAttr.m_pTextAttr = this;
291 SetHasDummyChar(true);
292}
293
295{
296 SetStartNode( nullptr );
297}
298
299void SwTextFootnote::SetStartNode( const SwNodeIndex *pNewNode, bool bDelNode )
300{
301 if( pNewNode )
302 {
303 m_oStartNode = *pNewNode;
304 }
305 else if ( m_oStartNode )
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_oStartNode->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_oStartNode.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 pDoc->GetFootnoteIdxs().UpdateFootnote( pDoc->GetFootnoteIdxs()[n]->GetTextNode() );
351 }
352 break;
353 }
354 }
355}
356
357void 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 SwNodes &rNodes = m_pTextNode->GetDoc().GetNodes();
375 const sw::LegacyModifyHint aHint(nullptr, &GetFootnote());
377 if ( m_oStartNode )
378 {
379 // must iterate over all TextNodes because of footnotes on other pages
380 SwNodeOffset nSttIdx = m_oStartNode->GetIndex() + 1;
381 SwNodeOffset nEndIdx = m_oStartNode->GetNode().EndOfSectionIndex();
382 for( ; nSttIdx < nEndIdx; ++nSttIdx )
383 {
384 SwNode* pNd;
385 if( ( pNd = rNodes[ nSttIdx ] )->IsTextNode() )
386 static_cast<SwTextNode*>(pNd)->TriggerNodeUpdate(aHint);
387 }
388 }
389}
390
392 SwTextFootnote & rDest,
393 SwTextNode & rDestNode ) const
394{
395 if (m_oStartNode && !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_oStartNode && rDest.GetStartNode())
402 {
403 // footnotes not necessarily in same document!
404 SwDoc& rDstDoc = rDestNode.GetDoc();
405 SwNodes &rDstNodes = rDstDoc.GetNodes();
406
407 // copy only the content of the section
408 SwNodeRange aRg( m_oStartNode->GetNode(), SwNodeOffset(1),
409 *m_oStartNode->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 SwNodeOffset 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_oStartNode )
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 pFormatColl = pInfo->GetFootnoteTextColl();
457 if( nullptr == pFormatColl )
458 pFormatColl = rNodes.GetDoc().getIDocumentStylePoolAccess().GetTextCollFromPool( nPoolId );
459
460 SwStartNode* pSttNd = rNodes.MakeTextSection( rNodes.GetEndOfInserts(),
461 SwFootnoteStartNode, pFormatColl );
462 m_oStartNode = *pSttNd;
463}
464
466{
467 // delete the FootnoteFrames from the pages
468 OSL_ENSURE( m_pTextNode, "SwTextFootnote: where is my TextNode?" );
469 if ( !m_pTextNode )
470 return;
471
472 bool bFrameFnd = false;
473 {
475 for( SwContentFrame* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
476 {
477 if( pRoot != pFnd->getRootFrame() && pRoot )
478 continue;
479 SwPageFrame* pPage = pFnd->FindPageFrame();
480 if( pPage )
481 {
482 // note: we have found the correct frame only if the footnote
483 // was actually removed; in case this is called from
484 // SwTextFrame::DestroyImpl(), then that frame isn't connected
485 // to SwPageFrame any more, and RemoveFootnote on any follow
486 // must not prevent the fall-back to the !bFrameFnd code.
487 bFrameFnd = pPage->RemoveFootnote(pFnd, this);
488 }
489 }
490 }
491 //JP 13.05.97: if the layout is deleted before the footnotes are deleted,
492 // try to delete the footnote's frames by another way
493 if ( bFrameFnd || !m_oStartNode )
494 return;
495
496 SwNodeIndex aIdx( *m_oStartNode );
497 SwContentNode* pCNd = m_pTextNode->GetNodes().GoNext( &aIdx );
498 if( !pCNd )
499 return;
500
502 for( SwContentFrame* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
503 {
504 if( pRoot != pFnd->getRootFrame() && pRoot )
505 continue;
506 SwPageFrame* pPage = pFnd->FindPageFrame();
507
508 SwFrame *pFrame = pFnd->GetUpper();
509 while ( pFrame && !pFrame->IsFootnoteFrame() )
510 pFrame = pFrame->GetUpper();
511
512 SwFootnoteFrame *pFootnote = static_cast<SwFootnoteFrame*>(pFrame);
513 while ( pFootnote && pFootnote->GetMaster() )
514 pFootnote = pFootnote->GetMaster();
515 OSL_ENSURE( pFootnote->GetAttr() == this, "Footnote mismatch error." );
516
517 while ( pFootnote )
518 {
519 SwFootnoteFrame *pFoll = pFootnote->GetFollow();
520 pFootnote->Cut();
521 SwFrame::DestroyFrame(pFootnote);
522 pFootnote = pFoll;
523 }
524
525 // #i20556# During hiding of a section, the connection
526 // to the layout is already lost. pPage may be 0:
527 if ( pPage )
528 pPage->UpdateFootnoteNum();
529 }
530}
531
535{
536 if( !m_pTextNode )
537 return;
538
539 SwDoc& rDoc = m_pTextNode->GetDoc();
540 if( rDoc.IsInReading() )
541 return;
542
543 std::set<sal_uInt16> aUsedNums;
544 std::vector<SwTextFootnote*> badRefNums;
545 ::lcl_FillUsedFootnoteRefNumbers(rDoc, this, aUsedNums, badRefNums);
546 if ( ::lcl_IsRefNumAvailable(aUsedNums, m_nSeqNo) )
547 return;
548 std::vector<sal_uInt16> unused;
549 ::lcl_FillUnusedSeqRefNums(unused, aUsedNums, 1);
550 m_nSeqNo = unused[0];
551}
552
556{
557 std::set<sal_uInt16> aUsedNums;
558 std::vector<SwTextFootnote*> badRefNums;
559 ::lcl_FillUsedFootnoteRefNumbers(rDoc, nullptr, aUsedNums, badRefNums);
560 std::vector<sal_uInt16> aUnused;
561 ::lcl_FillUnusedSeqRefNums(aUnused, aUsedNums, badRefNums.size());
562
563 for (size_t i = 0; i < badRefNums.size(); ++i)
564 {
565 badRefNums[i]->m_nSeqNo = aUnused[i];
566 }
567}
568
570{
571//FEATURE::CONDCOLL
572 if( GetStartNode() )
573 static_cast<SwStartNode&>(GetStartNode()->GetNode()).CheckSectionCondColl();
574//FEATURE::CONDCOLL
575}
576
578{
579 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwTextFootnote"));
580 SwTextAttr::dumpAsXml(pWriter);
581
582 if (m_oStartNode)
583 {
584 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("m_oStartNode"));
585 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("index"),
586 BAD_CAST(OString::number(sal_Int32(m_oStartNode->GetIndex())).getStr()));
587 (void)xmlTextWriterEndElement(pWriter);
588 }
589 if (m_pTextNode)
590 {
591 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("m_pTextNode"));
592 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("index"),
593 BAD_CAST(OString::number(sal_Int32(m_pTextNode->GetIndex())).getStr()));
594 (void)xmlTextWriterEndElement(pWriter);
595 }
596 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("m_nSeqNo"));
597 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
598 BAD_CAST(OString::number(m_nSeqNo).getStr()));
599 (void)xmlTextWriterEndElement(pWriter);
600
601 (void)xmlTextWriterEndElement(pWriter);
602}
603
604/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _xmlTextWriter * xmlTextWriterPtr
virtual void DeleteSection(SwNode *pNode)=0
Delete section containing the node.
virtual SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId, bool bRegardLanguage=true)=0
Return "Auto-Collection with ID.
EnumT GetValue() const
SfxHintId GetId() const
OUString GetNumStr(sal_Int32 nNo) const
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:58
Definition: doc.hxx:194
bool IsInReading() const
Definition: doc.hxx:962
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:638
bool IsInDtor() const
Definition: doc.hxx:412
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:321
SwNodes & GetNodes()
Definition: doc.hxx:417
SwFootnoteIdxs & GetFootnoteIdxs()
Definition: doc.hxx:642
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:640
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:432
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
Definition: doc.cxx:331
const OUString & GetPrefix() const
Definition: ftninfo.hxx:70
const OUString & GetSuffix() const
Definition: ftninfo.hxx:71
SvxNumberType m_aFormat
Definition: ftninfo.hxx:46
SwTextFormatColl * GetFootnoteTextColl() const
Definition: ftninfo.hxx:55
bool RemoveFootnote(const SwContentFrame *, const SwTextFootnote *, bool bPrep=true)
Definition: ftnfrm.cxx:1734
const SwFootnoteFrame * GetFollow() const
Definition: ftnfrm.hxx:116
virtual void Cut() override
Definition: ftnfrm.cxx:541
const SwFootnoteFrame * GetMaster() const
Definition: ftnfrm.hxx:119
const SwTextFootnote * GetAttr() const
Definition: ftnfrm.hxx:122
void UpdateFootnote(const SwNode &rStt)
Definition: ftnidx.cxx:59
SfxPoolItem subclass that is a wrapper around an SwFootnoteEndPosEnum, i.e.
Definition: fmtftntx.hxx:43
const SvxNumberType & GetSwNumType() const
Definition: fmtftntx.hxx:77
const OUString & GetPrefix() const
Definition: fmtftntx.hxx:82
const OUString & GetSuffix() const
Definition: fmtftntx.hxx:85
OUString m_aNumber
User-defined 'Number'.
Definition: fmtftn.hxx:48
css::uno::Reference< css::text::XTextRange > getAnchor(SwDoc &rDoc) const
Definition: atrftn.cxx:272
SwTextFootnote * m_pTextAttr
My TextAttribute.
Definition: fmtftn.hxx:47
sal_uInt16 GetNumber() const
Definition: fmtftn.hxx:71
sal_uInt16 m_nNumber
automatic sequence number
Definition: fmtftn.hxx:49
sal_uInt16 m_nNumberRLHidden
automatic sequence number (hidden redlines)
Definition: fmtftn.hxx:50
const OUString & GetNumStr() const
Definition: fmtftn.hxx:70
void SetXFootnote(rtl::Reference< SwXFootnote > const &xNote)
Definition: atrftn.cxx:138
void SetEndNote(bool b)
Definition: atrftn.cxx:177
virtual SwFormatFootnote * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrftn.cxx:150
OUString GetViewNumStr(const SwDoc &rDoc, SwRootFrame const *pLayout, bool bInclStrings=false) const
Returns string to be displayed of footnote / endnote.
Definition: atrftn.cxx:221
sal_uInt16 GetNumberRLHidden() const
Definition: fmtftn.hxx:72
bool IsEndNote() const
Definition: fmtftn.hxx:73
virtual ~SwFormatFootnote() override
Definition: atrftn.cxx:189
OUString GetFootnoteText(SwRootFrame const &rLayout) const
Definition: atrftn.cxx:193
const SwTextFootnote * GetTextFootnote() const
Definition: fmtftn.hxx:85
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: atrftn.cxx:160
void InvalidateFootnote()
Definition: atrftn.cxx:170
SwFormatFootnote(const SwFormatFootnote &)=delete
bool m_bEndNote
Is it an End note?
Definition: fmtftn.hxx:51
unotools::WeakReference< SwXFootnote > m_wXFootnote
Definition: fmtftn.hxx:53
virtual bool operator==(const SfxPoolItem &) const override
"Pure virtual methods" of SfxPoolItem.
Definition: atrftn.cxx:141
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:366
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool IsFootnoteFrame() const
Definition: frame.hxx:1202
SwLayoutFrame * GetUpper()
Definition: frame.hxx:678
SwRootFrame * getRootFrame()
Definition: frame.hxx:679
SwPageFrame * FindPageFrame()
Definition: frame.hxx:680
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
Definition: ssfrm.cxx:388
TElementType * Next()
Definition: calbck.hxx:371
TElementType * First()
Definition: calbck.hxx:363
Marks a node in the document model.
Definition: ndindex.hxx:31
const SwNodes & GetNodes() const
Definition: ndindex.hxx:175
SwNode & GetNode() const
Definition: ndindex.hxx:136
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:171
Base class of the Writer document model elements.
Definition: node.hxx:98
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:897
SwNodeOffset GetIndex() const
Definition: node.hxx:312
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:742
SwDoc & GetDoc()
Definition: node.hxx:233
bool IsEndNode() const
Definition: node.hxx:681
bool IsTextNode() const
Definition: node.hxx:685
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:731
void Delete(const SwNodeIndex &rPos, SwNodeOffset nNodes=SwNodeOffset(1))
Definition: nodes.cxx:1071
SwStartNode * MakeTextSection(const SwNode &rWhere, SwStartNodeType eSttNdTyp, SwTextFormatColl *pColl)
Definition: nodes.cxx:1926
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1300
SwNode & GetEndOfInserts() const
Section for all footnotes.
Definition: ndarr.hxx:156
SwDoc & GetDoc()
Which Doc contains the nodes-array?
Definition: ndarr.hxx:311
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:187
const SwPosition * GetMark() const
Definition: pam.hxx:263
virtual void SetMark()
Unless this is called, the getter method of Mark will return Point.
Definition: pam.cxx:642
const SwPosition * End() const
Definition: pam.hxx:271
const SwPosition * Start() const
Definition: pam.hxx:266
A page of the document layout.
Definition: pagefrm.hxx:58
void UpdateFootnoteNum()
Definition: ftnfrm.cxx:2430
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding).
Definition: rootfrm.hxx:421
const SwSection & GetSection() const
Definition: node.hxx:588
SwSectionFormat * GetFormat()
Definition: section.hxx:337
Starts a section of nodes in the document model.
Definition: node.hxx:348
A wrapper around SfxPoolItem to store the start position of (usually) a text portion,...
Definition: txatbase.hxx:44
virtual void dumpAsXml(xmlTextWriterPtr pWriter) const
Definition: txatbase.cxx:89
const SwFormatFootnote & GetFootnote() const
Definition: txatbase.hxx:208
sal_Int32 GetStart() const
Definition: txatbase.hxx:88
void SetHasDummyChar(const bool bFlag)
Definition: txatbase.hxx:78
static void SetUniqueSeqRefNo(SwDoc &rDoc)
Set a unique sequential reference number for every footnote in the document.
Definition: atrftn.cxx:555
virtual ~SwTextFootnote() override
Definition: atrftn.cxx:294
void CheckCondColl()
Definition: atrftn.cxx:569
void InvalidateNumberInLayout()
Definition: atrftn.cxx:371
void MakeNewTextSection(SwNodes &rNodes)
create a new nodes-array section for the footnote
Definition: atrftn.cxx:435
void CopyFootnote(SwTextFootnote &rDest, SwTextNode &rDestNode) const
Definition: atrftn.cxx:391
void SetSeqRefNo()
Set the sequence number for the current footnote.
Definition: atrftn.cxx:534
SwTextFootnote(SwFormatFootnote &rAttr, sal_Int32 nStart)
Definition: atrftn.cxx:285
void SetNumber(sal_uInt16 nNumber, sal_uInt16 nNumberRLHidden, const OUString &sNumStr)
Definition: atrftn.cxx:357
const SwNodeIndex * GetStartNode() const
Definition: txtftn.hxx:41
void DelFrames(const SwRootFrame *)
Definition: atrftn.cxx:465
std::optional< SwNodeIndex > m_oStartNode
Definition: txtftn.hxx:33
sal_uInt16 m_nSeqNo
Definition: txtftn.hxx:35
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrftn.cxx:577
const SwTextNode & GetTextNode() const
Definition: txtftn.hxx:70
SwTextNode * m_pTextNode
Definition: txtftn.hxx:34
void SetStartNode(const SwNodeIndex *pNode, bool bDelNodes=true)
Definition: atrftn.cxx:299
sal_uInt16 GetSeqRefNo() const
Definition: txtftn.hxx:64
Represents the style of a paragraph.
Definition: fmtcol.hxx:59
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:111
OUString GetExpandText(SwRootFrame const *pLayout, const sal_Int32 nIdx=0, const sal_Int32 nLen=-1, const bool bWithNum=false, const bool bAddSpaceAfterListLabelStr=false, const bool bWithSpacesForLevel=false, const ExpandMode eAdditionalMode=ExpandMode::ExpandFootnote|ExpandMode::HideFieldmarkCommands) const
add 4th optional parameter <bAddSpaceAfterListLabelStr> indicating, when <bWithNum = true> that a spa...
Definition: ndtxt.cxx:3485
void TriggerNodeUpdate(const sw::LegacyModifyHint &)
for hanging TextFormatCollections somewhere else (Outline-Numbering!)
Definition: ndtxt.cxx:5412
static const SwSectionNode * FindSectNdWithEndAttr(const SwTextFootnote &rTextFootnote)
Definition: ftnidx.cxx:444
static rtl::Reference< SwXTextRange > CreateXTextRange(SwDoc &rDoc, const SwPosition &rPos, const SwPosition *const pMark)
Definition: unoobj2.cxx:1210
const_iterator begin() const
size_type erase(const Value &x)
size_type size() const
std::pair< const_iterator, bool > insert(Value &&x)
virtual void CallSwClientNotify(const SfxHint &rHint) const override
Definition: calbck.cxx:325
void CopyWithFlyInFly(const SwNodeRange &rRg, SwNode &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...
@ FTNEND_ATTXTEND_OWNNUMANDFMT
-""- and with own numberformat
Definition: fmtftntx.hxx:33
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_REMOVE_UNO_OBJECT(181)
constexpr TypedWhichId< SwFormatFootnote > RES_TXTATR_FTN(59)
constexpr TypedWhichId< SwFormatEndAtTextEnd > RES_END_AT_TXTEND(118)
constexpr TypedWhichId< SwFormatFootnoteAtTextEnd > RES_FTN_AT_TXTEND(117)
sal_Int64 n
size
int i
Dialog to specify the properties of date form field.
@ SwFootnoteStartNode
Definition: ndtyp.hxx:55
@ RES_POOLCOLL_FOOTNOTE
Footnotes.
Definition: poolfmt.hxx:353
@ RES_POOLCOLL_ENDNOTE
Endnotes.
Definition: poolfmt.hxx:356
void AdjustContent(sal_Int32 nDelta)
Adjust content index, only valid to call this if the position points to a SwContentNode subclass.
Definition: pam.cxx:261