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#include <fmtftn.hxx>
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#include <unofootnote.hxx>
45
46namespace {
52 void lcl_FillUsedFootnoteRefNumbers(SwDoc &rDoc,
53 SwTextFootnote const *pExclude,
54 std::set<sal_uInt16> &rUsedRef,
55 std::vector<SwTextFootnote*> &rInvalid)
56 {
57 SwFootnoteIdxs& ftnIdxs = rDoc.GetFootnoteIdxs();
58
59 rInvalid.clear();
60
61 for( size_t n = 0; n < ftnIdxs.size(); ++n )
62 {
63 SwTextFootnote* pTextFootnote = ftnIdxs[ n ];
64 if ( pTextFootnote != pExclude )
65 {
66 if ( USHRT_MAX == pTextFootnote->GetSeqRefNo() )
67 {
68 rInvalid.push_back(pTextFootnote);
69 }
70 else
71 {
72 rUsedRef.insert( pTextFootnote->GetSeqRefNo() );
73 }
74 }
75 }
76 }
77
82 bool lcl_IsRefNumAvailable(std::set<sal_uInt16> const &rUsedNums,
83 sal_uInt16 requested)
84 {
85 if ( USHRT_MAX == requested )
86 return false; // Invalid sequence number.
87 if ( rUsedNums.count(requested) )
88 return false; // Number already used.
89 return true;
90 }
91
96 void lcl_FillUnusedSeqRefNums(std::vector<sal_uInt16> &rLowestUnusedNums,
97 const std::set<sal_uInt16> &rUsedNums,
98 size_t numRequired)
99 {
100 if (!numRequired)
101 return;
102
103 rLowestUnusedNums.reserve(numRequired);
104 sal_uInt16 newNum = 0;
105 //Start by using numbers from gaps in rUsedNums
106 for( const auto& rNum : rUsedNums )
107 {
108 while ( newNum < rNum )
109 {
110 rLowestUnusedNums.push_back( newNum++ );
111 if ( --numRequired == 0)
112 return;
113 }
114 newNum++;
115 }
116 //Filled in all gaps. Fill the rest of the list with new numbers.
117 do
118 {
119 rLowestUnusedNums.push_back( newNum++ );
120 }
121 while ( --numRequired > 0 );
122 }
123
124}
125
128 , sw::BroadcastingModify()
129 , m_pTextAttr(nullptr)
130 , m_nNumber(0)
131 , m_nNumberRLHidden(0)
132 , m_bEndNote(bEndNote)
133{
134}
135
137{ m_wXFootnote = xNote.get(); }
138
140{
141 assert(SfxPoolItem::operator==(rAttr));
142 return m_nNumber == static_cast<const SwFormatFootnote&>(rAttr).m_nNumber &&
143 //FIXME?
144 m_aNumber == static_cast<const SwFormatFootnote&>(rAttr).m_aNumber &&
145 m_bEndNote == static_cast<const SwFormatFootnote&>(rAttr).m_bEndNote;
146}
147
149{
151 pNew->m_aNumber = m_aNumber;
152 pNew->m_nNumber = m_nNumber;
154 pNew->m_bEndNote = m_bEndNote;
155 return pNew;
156}
157
159{
160 if (rHint.GetId() != SfxHintId::SwLegacyModify)
161 return;
162 auto pLegacy = static_cast<const sw::LegacyModifyHint*>(&rHint);
163 CallSwClientNotify(rHint);
164 if(RES_REMOVE_UNO_OBJECT == pLegacy->GetWhich())
165 SetXFootnote(nullptr);
166}
167
169{
171 &static_cast<sw::BroadcastingModify&>(*this)); // cast to base class (void*)
172 CallSwClientNotify(sw::LegacyModifyHint(&item, &item));
173}
174
176{
177 if ( b != m_bEndNote )
178 {
179 if ( GetTextFootnote() )
180 {
181 GetTextFootnote()->DelFrames(nullptr);
182 }
183 m_bEndNote = b;
184 }
185}
186
188{
189}
190
191OUString SwFormatFootnote::GetFootnoteText(SwRootFrame const& rLayout) const
192{
193 OUStringBuffer buf;
195 {
196 SwNodeIndex aIdx( *m_pTextAttr->GetStartNode(), 1 );
197 SwContentNode* pCNd = aIdx.GetNode().GetTextNode();
198 if( !pCNd )
199 pCNd = aIdx.GetNodes().GoNext( &aIdx );
200
201 if( pCNd->IsTextNode() ) {
202 buf.append(static_cast<SwTextNode*>(pCNd)->GetExpandText(&rLayout));
203
204 ++aIdx;
205 while ( !aIdx.GetNode().IsEndNode() ) {
206 if ( aIdx.GetNode().IsTextNode() )
207 {
208 buf.append(" ");
209 buf.append(aIdx.GetNode().GetTextNode()->GetExpandText(&rLayout));
210 }
211 ++aIdx;
212 }
213 }
214 }
215 return buf.makeStringAndClear();
216}
217
220 SwRootFrame const*const pLayout, bool bInclStrings) const
221{
222 OUString sRet( GetNumStr() );
223 if( sRet.isEmpty() )
224 {
225 // in this case the number is needed, get it via SwDoc's FootnoteInfo
226 bool bMakeNum = true;
227 const SwSectionNode* pSectNd = m_pTextAttr
229 : nullptr;
230 sal_uInt16 const nNumber(pLayout && pLayout->IsHideRedlines()
232 : GetNumber());
233
234 if( pSectNd )
235 {
236 const SwFormatFootnoteEndAtTextEnd& rFootnoteEnd = static_cast<const SwFormatFootnoteEndAtTextEnd&>(
237 pSectNd->GetSection().GetFormat()->GetFormatAttr(
238 IsEndNote() ?
239 o3tl::narrowing<sal_uInt16>(RES_END_AT_TXTEND) :
240 o3tl::narrowing<sal_uInt16>(RES_FTN_AT_TXTEND) ) );
241
242 if( FTNEND_ATTXTEND_OWNNUMANDFMT == rFootnoteEnd.GetValue() )
243 {
244 bMakeNum = false;
245 sRet = rFootnoteEnd.GetSwNumType().GetNumStr( nNumber );
246 if( bInclStrings )
247 {
248 sRet = rFootnoteEnd.GetPrefix() + sRet + rFootnoteEnd.GetSuffix();
249 }
250 }
251 }
252
253 if( bMakeNum )
254 {
255 const SwEndNoteInfo* pInfo;
256 if( IsEndNote() )
257 pInfo = &rDoc.GetEndNoteInfo();
258 else
259 pInfo = &rDoc.GetFootnoteInfo();
260 sRet = pInfo->m_aFormat.GetNumStr( nNumber );
261 if( bInclStrings )
262 {
263 sRet = pInfo->GetPrefix() + sRet + pInfo->GetSuffix();
264 }
265 }
266 }
267 return sRet;
268}
269
270uno::Reference<text::XTextRange> SwFormatFootnote::getAnchor(SwDoc& rDoc) const
271{
272 SolarMutexGuard aGuard;
273 if (!m_pTextAttr)
274 return uno::Reference<text::XTextRange>();
276 aPam.SetMark();
277 aPam.GetMark()->AdjustContent(+1);
279 SwXTextRange::CreateXTextRange(rDoc, *aPam.Start(), aPam.End());
280 return xRet;
281}
282
284{
285 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwFormatFootnote"));
286 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("ptr"), "%p", this);
287 (void)xmlTextWriterWriteFormatAttribute(pWriter, BAD_CAST("text-attr"), "%p", m_pTextAttr);
288 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("endnote"),
289 BAD_CAST(OString::boolean(m_bEndNote).getStr()));
290
291 SfxPoolItem::dumpAsXml(pWriter);
292
293 (void)xmlTextWriterEndElement(pWriter);
294}
295
297 : SwTextAttr( rAttr, nStartPos )
298 , m_pTextNode( nullptr )
299 , m_nSeqNo( USHRT_MAX )
300{
301 rAttr.m_pTextAttr = this;
302 SetHasDummyChar(true);
303}
304
306{
307 SetStartNode( nullptr );
308}
309
310void SwTextFootnote::SetStartNode( const SwNodeIndex *pNewNode, bool bDelNode )
311{
312 if( pNewNode )
313 {
314 m_oStartNode = *pNewNode;
315 }
316 else if ( m_oStartNode )
317 {
318 // need to do 2 things:
319 // 1) unregister footnotes at their pages
320 // 2) delete the footnote section in the Inserts of the nodes-array
321 SwDoc* pDoc;
322 if ( m_pTextNode )
323 {
324 pDoc = &m_pTextNode->GetDoc();
325 }
326 else
327 {
328 //JP 27.01.97: the sw3-Reader creates a StartNode but the
329 // attribute isn't anchored in the TextNode yet.
330 // If it is deleted (e.g. Insert File with footnote
331 // inside fly frame), the content must also be deleted.
332 pDoc = &m_oStartNode->GetNodes().GetDoc();
333 }
334
335 // If called from ~SwDoc(), must not delete the footnote nodes,
336 // and not necessary to delete the footnote frames.
337 if( !pDoc->IsInDtor() )
338 {
339 if( bDelNode )
340 {
341 // 2) delete the section for the footnote nodes
342 // it's possible that the Inserts have already been deleted (how???)
344 }
345 else
346 // If the nodes are not deleted, their frames must be removed
347 // from the page (deleted), there is nothing else that deletes
348 // them (particularly not Undo)
349 DelFrames( nullptr );
350 }
351 m_oStartNode.reset();
352
353 // remove the footnote from the SwDoc's array
354 for( size_t n = 0; n < pDoc->GetFootnoteIdxs().size(); ++n )
355 if( this == pDoc->GetFootnoteIdxs()[n] )
356 {
357 pDoc->GetFootnoteIdxs().erase( pDoc->GetFootnoteIdxs().begin() + n );
358 // if necessary, update following footnotes
359 if( !pDoc->IsInDtor() && n < pDoc->GetFootnoteIdxs().size() )
360 {
361 pDoc->GetFootnoteIdxs().UpdateFootnote( pDoc->GetFootnoteIdxs()[n]->GetTextNode() );
362 }
363 break;
364 }
365 }
366}
367
368void SwTextFootnote::SetNumber(const sal_uInt16 nNewNum,
369 sal_uInt16 const nNumberRLHidden, const OUString &sNumStr)
370{
371 SwFormatFootnote& rFootnote = const_cast<SwFormatFootnote&>(GetFootnote());
372
373 rFootnote.m_aNumber = sNumStr;
374 if ( sNumStr.isEmpty() )
375 {
376 rFootnote.m_nNumber = nNewNum;
377 rFootnote.m_nNumberRLHidden = nNumberRLHidden;
378 }
380}
381
383{
384 assert(m_pTextNode);
385 SwNodes &rNodes = m_pTextNode->GetDoc().GetNodes();
386 const sw::LegacyModifyHint aHint(nullptr, &GetFootnote());
388 if ( m_oStartNode )
389 {
390 // must iterate over all TextNodes because of footnotes on other pages
391 SwNodeOffset nSttIdx = m_oStartNode->GetIndex() + 1;
392 SwNodeOffset nEndIdx = m_oStartNode->GetNode().EndOfSectionIndex();
393 for( ; nSttIdx < nEndIdx; ++nSttIdx )
394 {
395 SwNode* pNd;
396 if( ( pNd = rNodes[ nSttIdx ] )->IsTextNode() )
397 static_cast<SwTextNode*>(pNd)->TriggerNodeUpdate(aHint);
398 }
399 }
400}
401
403 SwTextFootnote & rDest,
404 SwTextNode & rDestNode ) const
405{
406 if (m_oStartNode && !rDest.GetStartNode())
407 {
408 // dest missing node section? create it here!
409 // (happens in SwTextNode::CopyText if pDest == this)
410 rDest.MakeNewTextSection( rDestNode.GetNodes() );
411 }
412 if (m_oStartNode && rDest.GetStartNode())
413 {
414 // footnotes not necessarily in same document!
415 SwDoc& rDstDoc = rDestNode.GetDoc();
416 SwNodes &rDstNodes = rDstDoc.GetNodes();
417
418 // copy only the content of the section
419 SwNodeRange aRg( m_oStartNode->GetNode(), SwNodeOffset(1),
420 *m_oStartNode->GetNode().EndOfSectionNode() );
421
422 // insert at the end of rDest, i.e., the nodes are appended.
423 // nDestLen contains number of ContentNodes in rDest _before_ copy.
424 SwNodeIndex aStart( *(rDest.GetStartNode()) );
425 SwNodeIndex aEnd( *aStart.GetNode().EndOfSectionNode() );
426 SwNodeOffset nDestLen = aEnd.GetIndex() - aStart.GetIndex() - 1;
427
429
430 // in case the destination section was not empty, delete the old nodes
431 // before: Src: SxxxE, Dst: SnE
432 // now: Src: SxxxE, Dst: SnxxxE
433 // after: Src: SxxxE, Dst: SxxxE
434 ++aStart;
435 rDstNodes.Delete( aStart, nDestLen );
436 }
437
438 // also copy user defined number string
439 if( !GetFootnote().m_aNumber.isEmpty() )
440 {
441 const_cast<SwFormatFootnote &>(rDest.GetFootnote()).m_aNumber = GetFootnote().m_aNumber;
442 }
443}
444
447{
448 if ( m_oStartNode )
449 return;
450
451 // set the footnote style on the SwTextNode
452 SwTextFormatColl *pFormatColl;
453 const SwEndNoteInfo* pInfo;
454 sal_uInt16 nPoolId;
455
456 if( GetFootnote().IsEndNote() )
457 {
458 pInfo = &rNodes.GetDoc().GetEndNoteInfo();
459 nPoolId = RES_POOLCOLL_ENDNOTE;
460 }
461 else
462 {
463 pInfo = &rNodes.GetDoc().GetFootnoteInfo();
464 nPoolId = RES_POOLCOLL_FOOTNOTE;
465 }
466
467 pFormatColl = pInfo->GetFootnoteTextColl();
468 if( nullptr == pFormatColl )
469 pFormatColl = rNodes.GetDoc().getIDocumentStylePoolAccess().GetTextCollFromPool( nPoolId );
470
471 SwStartNode* pSttNd = rNodes.MakeTextSection( rNodes.GetEndOfInserts(),
472 SwFootnoteStartNode, pFormatColl );
473 m_oStartNode = *pSttNd;
474}
475
477{
478 // delete the FootnoteFrames from the pages
479 OSL_ENSURE( m_pTextNode, "SwTextFootnote: where is my TextNode?" );
480 if ( !m_pTextNode )
481 return;
482
483 bool bFrameFnd = false;
484 {
486 for( SwContentFrame* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
487 {
488 if( pRoot != pFnd->getRootFrame() && pRoot )
489 continue;
490 SwPageFrame* pPage = pFnd->FindPageFrame();
491 if( pPage )
492 {
493 // note: we have found the correct frame only if the footnote
494 // was actually removed; in case this is called from
495 // SwTextFrame::DestroyImpl(), then that frame isn't connected
496 // to SwPageFrame any more, and RemoveFootnote on any follow
497 // must not prevent the fall-back to the !bFrameFnd code.
498 bFrameFnd = pPage->RemoveFootnote(pFnd, this);
499 }
500 }
501 }
502 //JP 13.05.97: if the layout is deleted before the footnotes are deleted,
503 // try to delete the footnote's frames by another way
504 if ( bFrameFnd || !m_oStartNode )
505 return;
506
507 SwNodeIndex aIdx( *m_oStartNode );
508 SwContentNode* pCNd = m_pTextNode->GetNodes().GoNext( &aIdx );
509 if( !pCNd )
510 return;
511
513 for( SwContentFrame* pFnd = aIter.First(); pFnd; pFnd = aIter.Next() )
514 {
515 if( pRoot != pFnd->getRootFrame() && pRoot )
516 continue;
517 SwPageFrame* pPage = pFnd->FindPageFrame();
518
519 SwFrame *pFrame = pFnd->GetUpper();
520 while ( pFrame && !pFrame->IsFootnoteFrame() )
521 pFrame = pFrame->GetUpper();
522
523 SwFootnoteFrame *pFootnote = static_cast<SwFootnoteFrame*>(pFrame);
524 while ( pFootnote && pFootnote->GetMaster() )
525 pFootnote = pFootnote->GetMaster();
526 OSL_ENSURE( pFootnote->GetAttr() == this, "Footnote mismatch error." );
527
528 while ( pFootnote )
529 {
530 SwFootnoteFrame *pFoll = pFootnote->GetFollow();
531 pFootnote->Cut();
532 SwFrame::DestroyFrame(pFootnote);
533 pFootnote = pFoll;
534 }
535
536 // #i20556# During hiding of a section, the connection
537 // to the layout is already lost. pPage may be 0:
538 if ( pPage )
539 pPage->UpdateFootnoteNum();
540 }
541}
542
546{
547 if( !m_pTextNode )
548 return;
549
550 SwDoc& rDoc = m_pTextNode->GetDoc();
551 if( rDoc.IsInReading() )
552 return;
553
554 std::set<sal_uInt16> aUsedNums;
555 std::vector<SwTextFootnote*> badRefNums;
556 ::lcl_FillUsedFootnoteRefNumbers(rDoc, this, aUsedNums, badRefNums);
557 if ( ::lcl_IsRefNumAvailable(aUsedNums, m_nSeqNo) )
558 return;
559 std::vector<sal_uInt16> unused;
560 ::lcl_FillUnusedSeqRefNums(unused, aUsedNums, 1);
561 m_nSeqNo = unused[0];
562}
563
567{
568 std::set<sal_uInt16> aUsedNums;
569 std::vector<SwTextFootnote*> badRefNums;
570 ::lcl_FillUsedFootnoteRefNumbers(rDoc, nullptr, aUsedNums, badRefNums);
571 std::vector<sal_uInt16> aUnused;
572 ::lcl_FillUnusedSeqRefNums(aUnused, aUsedNums, badRefNums.size());
573
574 for (size_t i = 0; i < badRefNums.size(); ++i)
575 {
576 badRefNums[i]->m_nSeqNo = aUnused[i];
577 }
578}
579
581{
582 if( GetStartNode() )
583 static_cast<SwStartNode&>(GetStartNode()->GetNode()).CheckSectionCondColl();
584}
585
587{
588 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("SwTextFootnote"));
589 SwTextAttr::dumpAsXml(pWriter);
590
591 if (m_oStartNode)
592 {
593 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("m_oStartNode"));
594 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("index"),
595 BAD_CAST(OString::number(sal_Int32(m_oStartNode->GetIndex())).getStr()));
596 (void)xmlTextWriterEndElement(pWriter);
597 }
598 if (m_pTextNode)
599 {
600 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("m_pTextNode"));
601 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("index"),
602 BAD_CAST(OString::number(sal_Int32(m_pTextNode->GetIndex())).getStr()));
603 (void)xmlTextWriterEndElement(pWriter);
604 }
605 (void)xmlTextWriterStartElement(pWriter, BAD_CAST("m_nSeqNo"));
606 (void)xmlTextWriterWriteAttribute(pWriter, BAD_CAST("value"),
607 BAD_CAST(OString::number(m_nSeqNo).getStr()));
608 (void)xmlTextWriterEndElement(pWriter);
609
610 (void)xmlTextWriterEndElement(pWriter);
611}
612
613/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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
virtual void dumpAsXml(xmlTextWriterPtr pWriter) 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:59
Definition: doc.hxx:195
bool IsInReading() const
Definition: doc.hxx:965
const SwFootnoteInfo & GetFootnoteInfo() const
Definition: doc.hxx:641
bool IsInDtor() const
Definition: doc.hxx:415
IDocumentContentOperations const & getIDocumentContentOperations() const
Definition: doc.cxx:323
SwNodes & GetNodes()
Definition: doc.hxx:420
SwFootnoteIdxs & GetFootnoteIdxs()
Definition: doc.hxx:645
const SwEndNoteInfo & GetEndNoteInfo() const
Definition: doc.hxx:643
IDocumentStylePoolAccess const & getIDocumentStylePoolAccess() const
Definition: doc.cxx:434
::sw::DocumentContentOperationsManager const & GetDocumentContentOperationsManager() const
Definition: doc.cxx:333
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
Represents one footnote or endnote in the layout.
Definition: ftnfrm.hxx:82
const SwFootnoteFrame * GetFollow() const
Definition: ftnfrm.hxx:118
virtual void Cut() override
Definition: ftnfrm.cxx:541
const SwFootnoteFrame * GetMaster() const
Definition: ftnfrm.hxx:121
const SwTextFootnote * GetAttr() const
Definition: ftnfrm.hxx:124
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:270
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:136
void SetEndNote(bool b)
Definition: atrftn.cxx:175
virtual SwFormatFootnote * Clone(SfxItemPool *pPool=nullptr) const override
Definition: atrftn.cxx:148
OUString GetViewNumStr(const SwDoc &rDoc, SwRootFrame const *pLayout, bool bInclStrings=false) const
Returns string to be displayed of footnote / endnote.
Definition: atrftn.cxx:219
sal_uInt16 GetNumberRLHidden() const
Definition: fmtftn.hxx:72
bool IsEndNote() const
Definition: fmtftn.hxx:73
virtual ~SwFormatFootnote() override
Definition: atrftn.cxx:187
OUString GetFootnoteText(SwRootFrame const &rLayout) const
Definition: atrftn.cxx:191
const SwTextFootnote * GetTextFootnote() const
Definition: fmtftn.hxx:85
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: atrftn.cxx:158
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrftn.cxx:283
void InvalidateFootnote()
Definition: atrftn.cxx:168
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:139
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:1208
SwLayoutFrame * GetUpper()
Definition: frame.hxx:684
SwRootFrame * getRootFrame()
Definition: frame.hxx:685
SwPageFrame * FindPageFrame()
Definition: frame.hxx:686
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
Definition: ssfrm.cxx:390
TElementType * Next()
Definition: calbck.hxx:380
TElementType * First()
Definition: calbck.hxx:372
Marks a node in the document model.
Definition: ndindex.hxx:31
const SwNodes & GetNodes() const
Definition: ndindex.hxx:119
SwNode & GetNode() const
Definition: ndindex.hxx:123
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:111
Base class of the Writer document model elements.
Definition: node.hxx:98
SwTextNode * GetTextNode()
Inline methods from Node.hxx.
Definition: ndtxt.hxx:903
SwNodeOffset GetIndex() const
Definition: node.hxx:312
SwNodes & GetNodes()
Node is in which nodes-array/doc?
Definition: node.hxx:744
SwDoc & GetDoc()
Definition: node.hxx:233
bool IsEndNode() const
Definition: node.hxx:683
bool IsTextNode() const
Definition: node.hxx:687
const SwEndNode * EndOfSectionNode() const
Definition: node.hxx:733
void Delete(const SwNodeIndex &rPos, SwNodeOffset nNodes=SwNodeOffset(1))
Definition: nodes.cxx:1070
SwStartNode * MakeTextSection(const SwNode &rWhere, SwStartNodeType eSttNdTyp, SwTextFormatColl *pColl)
Definition: nodes.cxx:1925
SwContentNode * GoNext(SwNodeIndex *) const
Definition: nodes.cxx:1299
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:59
void UpdateFootnoteNum()
Definition: ftnfrm.cxx:2431
The root element of a Writer document layout.
Definition: rootfrm.hxx:83
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding).
Definition: rootfrm.hxx:425
A section node represents the start of a section on the UI, i.e.
Definition: node.hxx:575
const SwSection & GetSection() const
Definition: node.hxx:590
SwSectionFormat * GetFormat()
Definition: section.hxx:339
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
SwTextAttr subclass for footnotes and endnotes.
Definition: txtftn.hxx:34
static void SetUniqueSeqRefNo(SwDoc &rDoc)
Set a unique sequential reference number for every footnote in the document.
Definition: atrftn.cxx:566
virtual ~SwTextFootnote() override
Definition: atrftn.cxx:305
void CheckCondColl()
Definition: atrftn.cxx:580
void InvalidateNumberInLayout()
Definition: atrftn.cxx:382
void MakeNewTextSection(SwNodes &rNodes)
create a new nodes-array section for the footnote
Definition: atrftn.cxx:446
void CopyFootnote(SwTextFootnote &rDest, SwTextNode &rDestNode) const
Definition: atrftn.cxx:402
void SetSeqRefNo()
Set the sequence number for the current footnote.
Definition: atrftn.cxx:545
SwTextFootnote(SwFormatFootnote &rAttr, sal_Int32 nStart)
Definition: atrftn.cxx:296
void SetNumber(sal_uInt16 nNumber, sal_uInt16 nNumberRLHidden, const OUString &sNumStr)
Definition: atrftn.cxx:368
const SwNodeIndex * GetStartNode() const
Definition: txtftn.hxx:43
void DelFrames(const SwRootFrame *)
Definition: atrftn.cxx:476
std::optional< SwNodeIndex > m_oStartNode
Definition: txtftn.hxx:35
sal_uInt16 m_nSeqNo
Definition: txtftn.hxx:37
void dumpAsXml(xmlTextWriterPtr pWriter) const override
Definition: atrftn.cxx:586
const SwTextNode & GetTextNode() const
Definition: txtftn.hxx:72
SwTextNode * m_pTextNode
Definition: txtftn.hxx:36
void SetStartNode(const SwNodeIndex *pNode, bool bDelNodes=true)
Definition: atrftn.cxx:310
sal_uInt16 GetSeqRefNo() const
Definition: txtftn.hxx:66
Represents the style of a paragraph.
Definition: fmtcol.hxx:61
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
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:3530
void TriggerNodeUpdate(const sw::LegacyModifyHint &)
for hanging TextFormatCollections somewhere else (Outline-Numbering!)
Definition: ndtxt.cxx:5474
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:1199
const_iterator begin() const
size_type erase(const Value &x)
size_type size() const
std::pair< const_iterator, bool > insert(Value &&x)
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...
struct _xmlTextWriter * xmlTextWriterPtr
@ FTNEND_ATTXTEND_OWNNUMANDFMT
-""- and with own numberformat
Definition: fmtftntx.hxx:33
constexpr TypedWhichId< SwPtrMsgPoolItem > RES_REMOVE_UNO_OBJECT(181)
constexpr TypedWhichId< SwFormatEndAtTextEnd > RES_END_AT_TXTEND(124)
constexpr TypedWhichId< SwFormatFootnoteAtTextEnd > RES_FTN_AT_TXTEND(123)
constexpr TypedWhichId< SwFormatFootnote > RES_TXTATR_FTN(59)
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