Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / core / layout / hffrm.cxx
blobe15b308176df14037c9d7eb7735d17f74f960ea1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <pagefrm.hxx>
21 #include <fmtcntnt.hxx>
22 #include <fmthdft.hxx>
23 #include <fmtfsize.hxx>
24 #include <viewopt.hxx>
25 #include <hffrm.hxx>
26 #include <rootfrm.hxx>
27 #include <txtfrm.hxx>
28 #include <sectfrm.hxx>
29 #include <flyfrm.hxx>
30 #include <frmtool.hxx>
31 #include <hfspacingitem.hxx>
32 #include <sortedobjs.hxx>
33 #include <objectformatter.hxx>
34 #include <ndindex.hxx>
35 #include <osl/diagnose.h>
36 #include <sal/log.hxx>
38 static SwTwips lcl_GetFrameMinHeight(const SwLayoutFrame & rFrame)
40 const SwFormatFrameSize &rSz = rFrame.GetFormat()->GetFrameSize();
41 SwTwips nMinHeight;
43 switch (rSz.GetHeightSizeType())
45 case SwFrameSize::Minimum:
46 nMinHeight = rSz.GetHeight();
48 break;
50 default:
51 nMinHeight = 0;
54 return nMinHeight;
57 static SwTwips lcl_CalcContentHeight(SwLayoutFrame & frm)
59 SwTwips nRemaining = 0;
60 SwFrame* pFrame = frm.Lower();
62 while ( pFrame )
64 SwTwips nTmp;
66 nTmp = pFrame->getFrameArea().Height();
67 nRemaining += nTmp;
68 if( pFrame->IsTextFrame() && static_cast<SwTextFrame*>(pFrame)->IsUndersized() )
70 nTmp = static_cast<SwTextFrame*>(pFrame)->GetParHeight()
71 - pFrame->getFramePrintArea().Height();
72 // This TextFrame would like to be a bit bigger
73 nRemaining += nTmp;
75 else if( pFrame->IsSctFrame() && static_cast<SwSectionFrame*>(pFrame)->IsUndersized() )
77 nTmp = static_cast<SwSectionFrame*>(pFrame)->Undersize();
78 nRemaining += nTmp;
80 pFrame = pFrame->GetNext();
83 return nRemaining;
86 static void lcl_LayoutFrameEnsureMinHeight(SwLayoutFrame & rFrame)
88 SwTwips nMinHeight = lcl_GetFrameMinHeight(rFrame);
90 if (rFrame.getFrameArea().Height() < nMinHeight)
92 rFrame.Grow(nMinHeight - rFrame.getFrameArea().Height());
96 SwHeadFootFrame::SwHeadFootFrame( SwFrameFormat * pFormat, SwFrame* pSib, SwFrameType nTypeIn)
97 : SwLayoutFrame( pFormat, pSib )
99 mnFrameType = nTypeIn;
100 SetDerivedVert( false );
102 const SwFormatContent &rCnt = pFormat->GetContent();
104 OSL_ENSURE( rCnt.GetContentIdx(), "No content for Header." );
106 // Have the objects created right now for header and footer
107 bool bOld = bObjsDirect;
108 bObjsDirect = true;
109 SwNodeOffset nIndex = rCnt.GetContentIdx()->GetIndex();
110 ::InsertCnt_( this, pFormat->GetDoc(), ++nIndex );
111 bObjsDirect = bOld;
114 void SwHeadFootFrame::FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs)
116 if (GetEatSpacing())
118 /* The minimal height of the print area is the minimal height of the
119 frame without the height needed for borders and shadow. */
120 SwTwips nMinHeight = lcl_GetFrameMinHeight(*this);
122 nMinHeight -= pAttrs->CalcTop();
123 nMinHeight -= pAttrs->CalcBottom();
125 /* If the minimal height of the print area is negative, try to
126 compensate by overlapping */
127 SwTwips nOverlap = 0;
128 if (nMinHeight < 0)
130 nOverlap = -nMinHeight;
131 nMinHeight = 0;
134 /* Calculate desired height of content. The minimal height has to be
135 adhered. */
136 SwTwips nHeight;
138 if ( ! HasFixSize() )
139 nHeight = lcl_CalcContentHeight(*this);
140 else
141 nHeight = nMinHeight;
143 if (nHeight < nMinHeight)
144 nHeight = nMinHeight;
146 /* calculate initial spacing/line space */
147 SwTwips nSpace, nLine;
149 if (IsHeaderFrame())
151 nSpace = pAttrs->CalcBottom();
152 nLine = pAttrs->CalcBottomLine();
154 else
156 nSpace = pAttrs->CalcTop();
157 nLine = pAttrs->CalcTopLine();
160 /* calculate overlap and correct spacing */
161 nOverlap += nHeight - nMinHeight;
162 if (nOverlap < nSpace - nLine)
163 nSpace -= nOverlap;
164 else
165 nSpace = nLine;
167 /* calculate real vertical space between frame and print area */
168 if (IsHeaderFrame())
169 nUL = pAttrs->CalcTop() + nSpace;
170 else
171 nUL = pAttrs->CalcBottom() + nSpace;
173 /* set print area */
174 SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this );
175 SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
177 aPrt.Left(pAttrs->CalcLeft(this));
179 if (IsHeaderFrame())
181 aPrt.Top(pAttrs->CalcTop());
183 else
185 aPrt.Top(nSpace);
188 aPrt.Width(getFrameArea().Width() - nLR);
190 SwTwips nNewHeight;
192 if (nUL < getFrameArea().Height())
194 nNewHeight = getFrameArea().Height() - nUL;
196 else
198 nNewHeight = 0;
201 aPrt.Height(nNewHeight);
203 else
205 // Set position
206 SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
207 aPrt.Left( pAttrs->CalcLeft( this ) );
208 aPrt.Top ( pAttrs->CalcTop() );
210 // Set sizes - the sizes are given by the surrounding Frame, just
211 // subtract the borders.
212 SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this );
213 aPrt.Width ( getFrameArea().Width() - nLR );
214 aPrt.Height( getFrameArea().Height()- nUL );
217 setFramePrintAreaValid(true);
220 void SwHeadFootFrame::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
222 if ( !HasFixSize() )
224 if( !IsColLocked() )
226 setFramePrintAreaValid(true);
227 setFrameAreaSizeValid(true);
229 const SwTwips nBorder = nUL;
230 SwTwips nMinHeight = lcl_GetFrameMinHeight(*this);
231 nMinHeight -= pAttrs->CalcTop();
232 nMinHeight -= pAttrs->CalcBottom();
234 if (nMinHeight < 0)
235 nMinHeight = 0;
237 ColLock();
239 SwTwips nMaxHeight = LONG_MAX;
240 SwTwips nRemaining, nOldHeight;
241 // #i64301#
242 // use the position of the footer printing area to control invalidation
243 // of the first footer content.
244 Point aOldFooterPrtPos;
248 nOldHeight = getFramePrintArea().Height();
249 SwFrame* pFrame = Lower();
250 // #i64301#
251 if ( pFrame &&
252 aOldFooterPrtPos != ( getFrameArea().Pos() + getFramePrintArea().Pos() ) )
254 pFrame->InvalidatePos_();
255 aOldFooterPrtPos = getFrameArea().Pos() + getFramePrintArea().Pos();
257 int nLoopControl = 0;
258 while( pFrame )
260 pFrame->Calc(getRootFrame()->GetCurrShell()->GetOut());
261 // #i43771# - format also object anchored
262 // at the frame
263 // #i46941# - frame has to be valid.
264 // Note: frame could be invalid after calling its format,
265 // if it's locked
266 OSL_ENSURE( StackHack::IsLocked() || !pFrame->IsTextFrame() ||
267 pFrame->isFrameAreaDefinitionValid() ||
268 static_cast<SwTextFrame*>(pFrame)->IsJoinLocked(),
269 "<SwHeadFootFrame::FormatSize(..)> - text frame invalid and not locked." );
271 if ( pFrame->IsTextFrame() && pFrame->isFrameAreaDefinitionValid() )
273 if ( !SwObjectFormatter::FormatObjsAtFrame( *pFrame,
274 *(pFrame->FindPageFrame()) ) )
276 if (nLoopControl++ < 20)
278 // restart format with first content
279 pFrame = Lower();
280 continue;
282 else
283 SAL_WARN("sw", "SwHeadFootFrame::FormatSize: loop detection triggered");
286 pFrame = pFrame->GetNext();
288 nRemaining = 0;
289 pFrame = Lower();
291 while ( pFrame )
293 nRemaining += pFrame->getFrameArea().Height();
295 if( pFrame->IsTextFrame() &&
296 static_cast<SwTextFrame*>(pFrame)->IsUndersized() )
297 // This TextFrame would like to be a bit bigger
298 nRemaining += static_cast<SwTextFrame*>(pFrame)->GetParHeight()
299 - pFrame->getFramePrintArea().Height();
300 else if( pFrame->IsSctFrame() &&
301 static_cast<SwSectionFrame*>(pFrame)->IsUndersized() )
302 nRemaining += static_cast<SwSectionFrame*>(pFrame)->Undersize();
303 pFrame = pFrame->GetNext();
305 if ( nRemaining < nMinHeight )
306 nRemaining = nMinHeight;
308 SwTwips nDiff = nRemaining - nOldHeight;
310 if( !nDiff )
311 break;
312 if( nDiff < 0 )
314 nMaxHeight = nOldHeight;
316 if( nRemaining <= nMinHeight )
317 nRemaining = ( nMaxHeight + nMinHeight + 1 ) / 2;
319 else
321 if (nOldHeight > nMinHeight)
322 nMinHeight = nOldHeight;
324 if( nRemaining >= nMaxHeight )
325 nRemaining = ( nMaxHeight + nMinHeight + 1 ) / 2;
328 nDiff = nRemaining - nOldHeight;
330 if ( nDiff )
332 ColUnlock();
333 if ( nDiff > 0 )
335 if ( Grow( nDiff ) )
337 pFrame = Lower();
339 while ( pFrame )
341 if( pFrame->IsTextFrame())
343 SwTextFrame * pTmpFrame = static_cast<SwTextFrame*>(pFrame);
344 if (pTmpFrame->IsUndersized() )
346 pTmpFrame->InvalidateSize();
347 pTmpFrame->Prepare(PrepareHint::AdjustSizeWithoutFormatting);
350 /* #i3568# Undersized sections need to be
351 invalidated too. */
352 else if (pFrame->IsSctFrame())
354 SwSectionFrame * pTmpFrame =
355 static_cast<SwSectionFrame*>(pFrame);
356 if (pTmpFrame->IsUndersized() )
358 pTmpFrame->InvalidateSize();
359 pTmpFrame->Prepare(PrepareHint::AdjustSizeWithoutFormatting);
362 pFrame = pFrame->GetNext();
366 else
367 Shrink( -nDiff );
368 // Quickly update the position
370 MakePos();
371 ColLock();
373 else
374 break;
375 // Don't overwrite the lower edge of the upper
376 if ( GetUpper() && getFrameArea().Height() )
378 const SwTwips nDeadLine = GetUpper()->getFrameArea().Top() + GetUpper()->getFramePrintArea().Bottom();
379 const SwTwips nBot = getFrameArea().Bottom();
381 if ( nBot > nDeadLine )
383 SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this);
384 aFrm.Bottom( nDeadLine );
386 SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
387 aPrt.Height( getFrameArea().Height() - nBorder );
391 setFramePrintAreaValid(true);
392 setFrameAreaSizeValid(true);
393 } while( nRemaining<=nMaxHeight && nOldHeight!=getFramePrintArea().Height() );
394 ColUnlock();
397 setFramePrintAreaValid(true);
398 setFrameAreaSizeValid(true);
400 else //if (GetType() & FRM_HEADFOOT)
404 if ( getFrameArea().Height() != pAttrs->GetSize().Height() )
406 ChgSize( Size( getFrameArea().Width(), pAttrs->GetSize().Height()));
409 setFrameAreaSizeValid(true);
410 MakePos();
411 } while ( !isFrameAreaSizeValid() );
415 void SwHeadFootFrame::Format(vcl::RenderContext* pRenderContext, const SwBorderAttrs * pAttrs)
417 OSL_ENSURE( pAttrs, "SwFooterFrame::Format, pAttrs is 0." );
419 if ( isFramePrintAreaValid() && isFrameAreaSizeValid() )
420 return;
422 if ( ! GetEatSpacing() && IsHeaderFrame())
424 SwLayoutFrame::Format(pRenderContext, pAttrs);
426 else
428 lcl_LayoutFrameEnsureMinHeight(*this);
430 SwTwips nUL = pAttrs->CalcTop() + pAttrs->CalcBottom();
432 if ( !isFramePrintAreaValid() )
433 FormatPrt(nUL, pAttrs);
435 if ( !isFrameAreaSizeValid() )
436 FormatSize(nUL, pAttrs);
440 SwTwips SwHeadFootFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
442 SwTwips nResult;
444 if ( IsColLocked() )
446 nResult = 0;
448 else if (!GetEatSpacing())
450 nResult = SwLayoutFrame::GrowFrame(nDist, bTst, bInfo);
452 else
454 nResult = 0;
456 std::optional<SwBorderAttrAccess> oAccess(std::in_place, SwFrame::GetCache(), this);
457 OSL_ENSURE(oAccess, "no border attributes");
459 SwBorderAttrs * pAttrs = oAccess->Get();
461 /* First assume the whole amount to grow can be provided by eating
462 spacing. */
463 SwTwips nEat = nDist;
464 SwTwips nMaxEat;
466 /* calculate maximum eatable spacing */
467 if (IsHeaderFrame())
468 nMaxEat = getFrameArea().Height() - getFramePrintArea().Top() - getFramePrintArea().Height() - pAttrs->CalcBottomLine();
469 else
470 nMaxEat = getFramePrintArea().Top() - pAttrs->CalcTopLine();
472 if (nMaxEat < 0)
473 nMaxEat = 0;
475 /* If the frame is too small, eat less spacing thus letting the frame
476 grow more. */
477 SwTwips nMinHeight = lcl_GetFrameMinHeight(*this);
478 SwTwips nFrameTooSmall = nMinHeight - getFrameArea().Height();
480 if (nFrameTooSmall > 0)
481 nEat -= nFrameTooSmall;
483 /* No negative eating, not eating more than allowed. */
484 if (nEat < 0)
485 nEat = 0;
486 else if (nEat > nMaxEat)
487 nEat = nMaxEat;
489 // Notify fly frame, if header frame
490 // grows. Consider, that 'normal' grow of layout frame already notifies
491 // the fly frames.
492 bool bNotifyFlys = false;
493 if (nEat > 0)
495 if ( ! bTst)
497 if (! IsHeaderFrame())
499 SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
500 aPrt.Top(aPrt.Top() - nEat);
501 aPrt.Height(aPrt.Height() - nEat);
504 InvalidateAll();
507 nResult += nEat;
508 // trigger fly frame notify.
509 if ( IsHeaderFrame() )
511 bNotifyFlys = true;
515 if (nDist - nEat > 0)
517 const SwTwips nFrameGrow =
518 SwLayoutFrame::GrowFrame( nDist - nEat, bTst, bInfo );
520 nResult += nFrameGrow;
521 if ( nFrameGrow > 0 )
523 bNotifyFlys = false;
527 // notify fly frames, if necessary and triggered.
528 if ( ( nResult > 0 ) && bNotifyFlys )
530 NotifyLowerObjs();
534 if ( nResult && !bTst )
535 SetCompletePaint();
537 return nResult;
540 SwTwips SwHeadFootFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
542 SwTwips nResult;
544 if ( IsColLocked() )
546 nResult = 0;
548 else if (! GetEatSpacing())
550 nResult = SwLayoutFrame::ShrinkFrame(nDist, bTst, bInfo);
552 else
554 nResult = 0;
556 SwTwips nMinHeight = lcl_GetFrameMinHeight(*this);
557 SwTwips nOldHeight = getFrameArea().Height();
558 SwTwips nRest = 0; // Amount to shrink by spitting out spacing
560 if ( nOldHeight >= nMinHeight )
562 /* If the frame's height is bigger than its minimum height, shrink
563 the frame towards its minimum height. If this is not sufficient
564 to provide the shrinking requested provide the rest by spitting
565 out spacing. */
567 SwTwips nBiggerThanMin = nOldHeight - nMinHeight;
569 if (nBiggerThanMin < nDist)
571 nRest = nDist - nBiggerThanMin;
573 /* info: declaration of nRest -> else nRest = 0 */
575 else
576 /* The frame cannot shrink. Provide shrinking by spitting out
577 spacing. */
578 nRest = nDist;
580 // Notify fly frame, if header/footer frame shrinks.
581 // Consider, that 'normal' shrink of layout frame already notifies the fly frames.
582 bool bNotifyFlys = false;
583 if (nRest > 0)
585 std::optional<SwBorderAttrAccess> oAccess(std::in_place, SwFrame::GetCache(), this);
586 OSL_ENSURE(oAccess, "no border attributes");
588 SwBorderAttrs * pAttrs = oAccess->Get();
590 /* minimal height of print area */
591 SwTwips nMinPrtHeight = nMinHeight
592 - pAttrs->CalcTop()
593 - pAttrs->CalcBottom();
595 if (nMinPrtHeight < 0)
596 nMinPrtHeight = 0;
598 /* assume all shrinking can be provided */
599 SwTwips nShrink = nRest;
601 /* calculate maximum shrinking */
602 SwTwips nMaxShrink = getFramePrintArea().Height() - nMinPrtHeight;
604 /* shrink no more than maximum shrinking */
605 if (nShrink > nMaxShrink)
607 //nRest -= nShrink - nMaxShrink;
608 nShrink = nMaxShrink;
611 if (!bTst)
613 if (! IsHeaderFrame() )
615 SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this);
616 aPrt.Top(aPrt.Top() + nShrink);
617 aPrt.Height(aPrt.Height() - nShrink);
620 InvalidateAll();
622 nResult += nShrink;
623 // Trigger fly frame notify.
624 if ( IsHeaderFrame() )
626 bNotifyFlys = true;
630 /* The shrinking not providable by spitting out spacing has to be done
631 by the frame. */
632 if (nDist - nRest > 0)
634 SwTwips nShrinkAmount = SwLayoutFrame::ShrinkFrame( nDist - nRest, bTst, bInfo );
635 nResult += nShrinkAmount;
636 if ( nShrinkAmount > 0 )
638 bNotifyFlys = false;
642 // Notify fly frames, if necessary.
643 if ( ( nResult > 0 ) && bNotifyFlys )
645 NotifyLowerObjs();
649 return nResult;
652 bool SwHeadFootFrame::GetEatSpacing() const
654 const SwFrameFormat * pFormat = GetFormat();
655 OSL_ENSURE(pFormat, "SwHeadFootFrame: no format?");
657 return pFormat->GetHeaderAndFooterEatSpacing().GetValue();
660 static void DelFlys( const SwLayoutFrame& rFrame, SwPageFrame &rPage)
662 size_t i = 0;
663 while ( rPage.GetSortedObjs() &&
664 rPage.GetSortedObjs()->size() &&
665 i < rPage.GetSortedObjs()->size() )
667 SwAnchoredObject* pObj = (*rPage.GetSortedObjs())[i];
668 if (SwFlyFrame* pFlyFrame = pObj->DynCastFlyFrame())
670 if (rFrame.IsAnLower(pFlyFrame))
672 SwFrame::DestroyFrame(pFlyFrame);
673 // Do not increment index, in this case
674 continue;
677 ++i;
681 /// Creates or removes headers
682 void SwPageFrame::PrepareHeader()
684 SwLayoutFrame *pLay = static_cast<SwLayoutFrame*>(Lower());
685 if ( !pLay )
686 return;
688 const SwFormatHeader &rH = static_cast<SwFrameFormat*>(GetDep())->GetHeader();
690 const SwViewShell *pSh = getRootFrame()->GetCurrShell();
691 const bool bOn = !(pSh && (pSh->GetViewOptions()->getBrowseMode() ||
692 pSh->GetViewOptions()->IsWhitespaceHidden()));
694 if ( bOn && rH.IsActive() )
695 { //Implant header, but remove first, if already present
696 OSL_ENSURE( rH.GetHeaderFormat(), "FrameFormat for Header not found." );
698 if ( pLay->GetFormat() == rH.GetHeaderFormat() )
699 return; // Header is already the correct one.
701 if ( pLay->IsHeaderFrame() )
702 { SwLayoutFrame *pDel = pLay;
703 pLay = static_cast<SwLayoutFrame*>(pLay->GetNext());
704 ::DelFlys(*pDel, *this);
705 pDel->Cut();
706 SwFrame::DestroyFrame(pDel);
708 OSL_ENSURE( pLay, "Where to with the Header?" );
709 SwHeaderFrame *pH = new SwHeaderFrame( const_cast<SwFrameFormat*>(rH.GetHeaderFormat()), this );
710 pH->Paste( this, pLay );
711 if ( GetUpper() )
712 ::RegistFlys( this, pH );
714 else if (pLay->IsHeaderFrame())
715 { // Remove header if present.
716 ::DelFlys(*pLay, *this);
717 pLay->Cut();
718 SwFrame::DestroyFrame(pLay);
722 /// Creates or removes footer
723 void SwPageFrame::PrepareFooter()
725 SwLayoutFrame *pLay = static_cast<SwLayoutFrame*>(Lower());
726 if ( !pLay )
727 return;
729 const SwFormatFooter &rF = static_cast<SwFrameFormat*>(GetDep())->GetFooter();
730 while ( pLay->GetNext() )
731 pLay = static_cast<SwLayoutFrame*>(pLay->GetNext());
733 const SwViewShell *pSh = getRootFrame()->GetCurrShell();
734 const bool bOn = !(pSh && (pSh->GetViewOptions()->getBrowseMode() ||
735 pSh->GetViewOptions()->IsWhitespaceHidden()));
737 if ( bOn && rF.IsActive() )
738 { //Implant footer, but remove first, if already present
739 OSL_ENSURE( rF.GetFooterFormat(), "FrameFormat for Footer not found." );
741 if ( pLay->GetFormat() == rF.GetFooterFormat() )
742 return; // Footer is already the correct one.
744 if ( pLay->IsFooterFrame() )
746 ::DelFlys(*pLay, *this);
747 pLay->Cut();
748 SwFrame::DestroyFrame(pLay);
750 SwFooterFrame *pF = new SwFooterFrame( const_cast<SwFrameFormat*>(rF.GetFooterFormat()), this );
751 pF->Paste( this );
752 if ( GetUpper() )
753 ::RegistFlys( this, pF );
755 else if ( pLay->IsFooterFrame() )
757 // Remove footer if already present
758 ::DelFlys(*pLay, *this);
759 SwViewShell *pShell;
760 if ( pLay->GetPrev() && nullptr != (pShell = getRootFrame()->GetCurrShell()) &&
761 pShell->VisArea().HasArea() )
762 pShell->InvalidateWindows( pShell->VisArea() );
763 pLay->Cut();
764 SwFrame::DestroyFrame(pLay);
768 void SwHeaderFrame::dumpAsXml(xmlTextWriterPtr writer) const
770 (void)xmlTextWriterStartElement(writer, reinterpret_cast<const xmlChar*>("header"));
771 dumpAsXmlAttributes(writer);
773 (void)xmlTextWriterStartElement(writer, BAD_CAST("infos"));
774 dumpInfosAsXml(writer);
775 (void)xmlTextWriterEndElement(writer);
776 dumpChildrenAsXml(writer);
778 (void)xmlTextWriterEndElement(writer);
781 void SwFooterFrame::dumpAsXml(xmlTextWriterPtr writer) const
783 (void)xmlTextWriterStartElement(writer, reinterpret_cast<const xmlChar*>("footer"));
784 dumpAsXmlAttributes(writer);
786 (void)xmlTextWriterStartElement(writer, BAD_CAST("infos"));
787 dumpInfosAsXml(writer);
788 (void)xmlTextWriterEndElement(writer);
789 dumpChildrenAsXml(writer);
791 (void)xmlTextWriterEndElement(writer);
794 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */