LibreOffice Module sw (master) 1
hffrm.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 <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>
37
39{
40 const SwFormatFrameSize &rSz = rFrame.GetFormat()->GetFrameSize();
41 SwTwips nMinHeight;
42
43 switch (rSz.GetHeightSizeType())
44 {
46 nMinHeight = rSz.GetHeight();
47
48 break;
49
50 default:
51 nMinHeight = 0;
52 }
53
54 return nMinHeight;
55}
56
58{
59 SwTwips nRemaining = 0;
60 SwFrame* pFrame = frm.Lower();
61
62 while ( pFrame )
63 {
64 SwTwips nTmp;
65
66 nTmp = pFrame->getFrameArea().Height();
67 nRemaining += nTmp;
68 if( pFrame->IsTextFrame() && static_cast<SwTextFrame*>(pFrame)->IsUndersized() )
69 {
70 nTmp = static_cast<SwTextFrame*>(pFrame)->GetParHeight()
71 - pFrame->getFramePrintArea().Height();
72 // This TextFrame would like to be a bit bigger
73 nRemaining += nTmp;
74 }
75 else if( pFrame->IsSctFrame() && static_cast<SwSectionFrame*>(pFrame)->IsUndersized() )
76 {
77 nTmp = static_cast<SwSectionFrame*>(pFrame)->Undersize();
78 nRemaining += nTmp;
79 }
80 pFrame = pFrame->GetNext();
81 }
82
83 return nRemaining;
84}
85
87{
88 SwTwips nMinHeight = lcl_GetFrameMinHeight(rFrame);
89
90 if (rFrame.getFrameArea().Height() < nMinHeight)
91 {
92 rFrame.Grow(nMinHeight - rFrame.getFrameArea().Height());
93 }
94}
95
97 : SwLayoutFrame( pFormat, pSib )
98{
99 mnFrameType = nTypeIn;
100 SetDerivedVert( false );
101
102 const SwFormatContent &rCnt = pFormat->GetContent();
103
104 OSL_ENSURE( rCnt.GetContentIdx(), "No content for Header." );
105
106 // Have the objects created right now for header and footer
107 bool bOld = bObjsDirect;
108 bObjsDirect = true;
110 ::InsertCnt_( this, pFormat->GetDoc(), ++nIndex );
111 bObjsDirect = bOld;
112}
113
115{
116 if (GetEatSpacing())
117 {
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);
121
122 nMinHeight -= pAttrs->CalcTop();
123 nMinHeight -= pAttrs->CalcBottom();
124
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)
129 {
130 nOverlap = -nMinHeight;
131 nMinHeight = 0;
132 }
133
134 /* Calculate desired height of content. The minimal height has to be
135 adhered. */
136 SwTwips nHeight;
137
138 if ( ! HasFixSize() )
139 nHeight = lcl_CalcContentHeight(*this);
140 else
141 nHeight = nMinHeight;
142
143 if (nHeight < nMinHeight)
144 nHeight = nMinHeight;
145
146 /* calculate initial spacing/line space */
147 SwTwips nSpace, nLine;
148
149 if (IsHeaderFrame())
150 {
151 nSpace = pAttrs->CalcBottom();
152 nLine = pAttrs->CalcBottomLine();
153 }
154 else
155 {
156 nSpace = pAttrs->CalcTop();
157 nLine = pAttrs->CalcTopLine();
158 }
159
160 /* calculate overlap and correct spacing */
161 nOverlap += nHeight - nMinHeight;
162 if (nOverlap < nSpace - nLine)
163 nSpace -= nOverlap;
164 else
165 nSpace = nLine;
166
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;
172
173 /* set print area */
174 SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this );
176
177 aPrt.Left(pAttrs->CalcLeft(this));
178
179 if (IsHeaderFrame())
180 {
181 aPrt.Top(pAttrs->CalcTop());
182 }
183 else
184 {
185 aPrt.Top(nSpace);
186 }
187
188 aPrt.Width(getFrameArea().Width() - nLR);
189
190 SwTwips nNewHeight;
191
192 if (nUL < getFrameArea().Height())
193 {
194 nNewHeight = getFrameArea().Height() - nUL;
195 }
196 else
197 {
198 nNewHeight = 0;
199 }
200
201 aPrt.Height(nNewHeight);
202 }
203 else
204 {
205 // Set position
207 aPrt.Left( pAttrs->CalcLeft( this ) );
208 aPrt.Top ( pAttrs->CalcTop() );
209
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 );
215 }
216
218}
219
221{
222 if ( !HasFixSize() )
223 {
224 if( !IsColLocked() )
225 {
228
229 const SwTwips nBorder = nUL;
230 SwTwips nMinHeight = lcl_GetFrameMinHeight(*this);
231 nMinHeight -= pAttrs->CalcTop();
232 nMinHeight -= pAttrs->CalcBottom();
233
234 if (nMinHeight < 0)
235 nMinHeight = 0;
236
237 ColLock();
238
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;
245
246 do
247 {
248 nOldHeight = getFramePrintArea().Height();
249 SwFrame* pFrame = Lower();
250 // #i64301#
251 if ( pFrame &&
252 aOldFooterPrtPos != ( getFrameArea().Pos() + getFramePrintArea().Pos() ) )
253 {
254 pFrame->InvalidatePos_();
255 aOldFooterPrtPos = getFrameArea().Pos() + getFramePrintArea().Pos();
256 }
257 int nLoopControl = 0;
258 while( pFrame )
259 {
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." );
270
271 if ( pFrame->IsTextFrame() && pFrame->isFrameAreaDefinitionValid() )
272 {
274 *(pFrame->FindPageFrame()) ) )
275 {
276 if (nLoopControl++ < 20)
277 {
278 // restart format with first content
279 pFrame = Lower();
280 continue;
281 }
282 else
283 SAL_WARN("sw", "SwHeadFootFrame::FormatSize: loop detection triggered");
284 }
285 }
286 pFrame = pFrame->GetNext();
287 }
288 nRemaining = 0;
289 pFrame = Lower();
290
291 while ( pFrame )
292 {
293 nRemaining += pFrame->getFrameArea().Height();
294
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();
304 }
305 if ( nRemaining < nMinHeight )
306 nRemaining = nMinHeight;
307
308 SwTwips nDiff = nRemaining - nOldHeight;
309
310 if( !nDiff )
311 break;
312 if( nDiff < 0 )
313 {
314 nMaxHeight = nOldHeight;
315
316 if( nRemaining <= nMinHeight )
317 nRemaining = ( nMaxHeight + nMinHeight + 1 ) / 2;
318 }
319 else
320 {
321 if (nOldHeight > nMinHeight)
322 nMinHeight = nOldHeight;
323
324 if( nRemaining >= nMaxHeight )
325 nRemaining = ( nMaxHeight + nMinHeight + 1 ) / 2;
326 }
327
328 nDiff = nRemaining - nOldHeight;
329
330 if ( nDiff )
331 {
332 ColUnlock();
333 if ( nDiff > 0 )
334 {
335 if ( Grow( nDiff ) )
336 {
337 pFrame = Lower();
338
339 while ( pFrame )
340 {
341 if( pFrame->IsTextFrame())
342 {
343 SwTextFrame * pTmpFrame = static_cast<SwTextFrame*>(pFrame);
344 if (pTmpFrame->IsUndersized() )
345 {
346 pTmpFrame->InvalidateSize();
348 }
349 }
350 /* #i3568# Undersized sections need to be
351 invalidated too. */
352 else if (pFrame->IsSctFrame())
353 {
354 SwSectionFrame * pTmpFrame =
355 static_cast<SwSectionFrame*>(pFrame);
356 if (pTmpFrame->IsUndersized() )
357 {
358 pTmpFrame->InvalidateSize();
360 }
361 }
362 pFrame = pFrame->GetNext();
363 }
364 }
365 }
366 else
367 Shrink( -nDiff );
368 // Quickly update the position
369
370 MakePos();
371 ColLock();
372 }
373 else
374 break;
375 // Don't overwrite the lower edge of the upper
376 if ( GetUpper() && getFrameArea().Height() )
377 {
378 const SwTwips nDeadLine = GetUpper()->getFrameArea().Top() + GetUpper()->getFramePrintArea().Bottom();
379 const SwTwips nBot = getFrameArea().Bottom();
380
381 if ( nBot > nDeadLine )
382 {
384 aFrm.Bottom( nDeadLine );
385
387 aPrt.Height( getFrameArea().Height() - nBorder );
388 }
389 }
390
393 } while( nRemaining<=nMaxHeight && nOldHeight!=getFramePrintArea().Height() );
394 ColUnlock();
395 }
396
399 }
400 else //if (GetType() & FRM_HEADFOOT)
401 {
402 do
403 {
404 if ( getFrameArea().Height() != pAttrs->GetSize().Height() )
405 {
406 ChgSize( Size( getFrameArea().Width(), pAttrs->GetSize().Height()));
407 }
408
410 MakePos();
411 } while ( !isFrameAreaSizeValid() );
412 }
413}
414
415void SwHeadFootFrame::Format(vcl::RenderContext* pRenderContext, const SwBorderAttrs * pAttrs)
416{
417 OSL_ENSURE( pAttrs, "SwFooterFrame::Format, pAttrs is 0." );
418
420 return;
421
422 if ( ! GetEatSpacing() && IsHeaderFrame())
423 {
424 SwLayoutFrame::Format(pRenderContext, pAttrs);
425 }
426 else
427 {
429
430 SwTwips nUL = pAttrs->CalcTop() + pAttrs->CalcBottom();
431
432 if ( !isFramePrintAreaValid() )
433 FormatPrt(nUL, pAttrs);
434
435 if ( !isFrameAreaSizeValid() )
436 FormatSize(nUL, pAttrs);
437 }
438}
439
440SwTwips SwHeadFootFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
441{
442 SwTwips nResult;
443
444 if ( IsColLocked() )
445 {
446 nResult = 0;
447 }
448 else if (!GetEatSpacing())
449 {
450 nResult = SwLayoutFrame::GrowFrame(nDist, bTst, bInfo);
451 }
452 else
453 {
454 nResult = 0;
455
456 std::optional<SwBorderAttrAccess> oAccess(std::in_place, SwFrame::GetCache(), this);
457 OSL_ENSURE(oAccess, "no border attributes");
458
459 SwBorderAttrs * pAttrs = oAccess->Get();
460
461 /* First assume the whole amount to grow can be provided by eating
462 spacing. */
463 SwTwips nEat = nDist;
464 SwTwips nMaxEat;
465
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();
471
472 if (nMaxEat < 0)
473 nMaxEat = 0;
474
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();
479
480 if (nFrameTooSmall > 0)
481 nEat -= nFrameTooSmall;
482
483 /* No negative eating, not eating more than allowed. */
484 if (nEat < 0)
485 nEat = 0;
486 else if (nEat > nMaxEat)
487 nEat = nMaxEat;
488
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)
494 {
495 if ( ! bTst)
496 {
497 if (! IsHeaderFrame())
498 {
500 aPrt.Top(aPrt.Top() - nEat);
501 aPrt.Height(aPrt.Height() - nEat);
502 }
503
505 }
506
507 nResult += nEat;
508 // trigger fly frame notify.
509 if ( IsHeaderFrame() )
510 {
511 bNotifyFlys = true;
512 }
513 }
514
515 if (nDist - nEat > 0)
516 {
517 const SwTwips nFrameGrow =
518 SwLayoutFrame::GrowFrame( nDist - nEat, bTst, bInfo );
519
520 nResult += nFrameGrow;
521 if ( nFrameGrow > 0 )
522 {
523 bNotifyFlys = false;
524 }
525 }
526
527 // notify fly frames, if necessary and triggered.
528 if ( ( nResult > 0 ) && bNotifyFlys )
529 {
531 }
532 }
533
534 if ( nResult && !bTst )
536
537 return nResult;
538}
539
540SwTwips SwHeadFootFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
541{
542 SwTwips nResult;
543
544 if ( IsColLocked() )
545 {
546 nResult = 0;
547 }
548 else if (! GetEatSpacing())
549 {
550 nResult = SwLayoutFrame::ShrinkFrame(nDist, bTst, bInfo);
551 }
552 else
553 {
554 nResult = 0;
555
556 SwTwips nMinHeight = lcl_GetFrameMinHeight(*this);
557 SwTwips nOldHeight = getFrameArea().Height();
558 SwTwips nRest = 0; // Amount to shrink by spitting out spacing
559
560 if ( nOldHeight >= nMinHeight )
561 {
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. */
566
567 SwTwips nBiggerThanMin = nOldHeight - nMinHeight;
568
569 if (nBiggerThanMin < nDist)
570 {
571 nRest = nDist - nBiggerThanMin;
572 }
573 /* info: declaration of nRest -> else nRest = 0 */
574 }
575 else
576 /* The frame cannot shrink. Provide shrinking by spitting out
577 spacing. */
578 nRest = nDist;
579
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)
584 {
585 std::optional<SwBorderAttrAccess> oAccess(std::in_place, SwFrame::GetCache(), this);
586 OSL_ENSURE(oAccess, "no border attributes");
587
588 SwBorderAttrs * pAttrs = oAccess->Get();
589
590 /* minimal height of print area */
591 SwTwips nMinPrtHeight = nMinHeight
592 - pAttrs->CalcTop()
593 - pAttrs->CalcBottom();
594
595 if (nMinPrtHeight < 0)
596 nMinPrtHeight = 0;
597
598 /* assume all shrinking can be provided */
599 SwTwips nShrink = nRest;
600
601 /* calculate maximum shrinking */
602 SwTwips nMaxShrink = getFramePrintArea().Height() - nMinPrtHeight;
603
604 /* shrink no more than maximum shrinking */
605 if (nShrink > nMaxShrink)
606 {
607 //nRest -= nShrink - nMaxShrink;
608 nShrink = nMaxShrink;
609 }
610
611 if (!bTst)
612 {
613 if (! IsHeaderFrame() )
614 {
616 aPrt.Top(aPrt.Top() + nShrink);
617 aPrt.Height(aPrt.Height() - nShrink);
618 }
619
621 }
622 nResult += nShrink;
623 // Trigger fly frame notify.
624 if ( IsHeaderFrame() )
625 {
626 bNotifyFlys = true;
627 }
628 }
629
630 /* The shrinking not providable by spitting out spacing has to be done
631 by the frame. */
632 if (nDist - nRest > 0)
633 {
634 SwTwips nShrinkAmount = SwLayoutFrame::ShrinkFrame( nDist - nRest, bTst, bInfo );
635 nResult += nShrinkAmount;
636 if ( nShrinkAmount > 0 )
637 {
638 bNotifyFlys = false;
639 }
640 }
641
642 // Notify fly frames, if necessary.
643 if ( ( nResult > 0 ) && bNotifyFlys )
644 {
646 }
647 }
648
649 return nResult;
650}
651
653{
654 const SwFrameFormat * pFormat = GetFormat();
655 OSL_ENSURE(pFormat, "SwHeadFootFrame: no format?");
656
657 return pFormat->GetHeaderAndFooterEatSpacing().GetValue();
658}
659
660static void DelFlys( const SwLayoutFrame& rFrame, SwPageFrame &rPage)
661{
662 size_t i = 0;
663 while ( rPage.GetSortedObjs() &&
664 rPage.GetSortedObjs()->size() &&
665 i < rPage.GetSortedObjs()->size() )
666 {
667 SwAnchoredObject* pObj = (*rPage.GetSortedObjs())[i];
668 if (SwFlyFrame* pFlyFrame = pObj->DynCastFlyFrame())
669 {
670 if (rFrame.IsAnLower(pFlyFrame))
671 {
672 SwFrame::DestroyFrame(pFlyFrame);
673 // Do not increment index, in this case
674 continue;
675 }
676 }
677 ++i;
678 }
679}
680
683{
684 SwLayoutFrame *pLay = static_cast<SwLayoutFrame*>(Lower());
685 if ( !pLay )
686 return;
687
688 const SwFormatHeader &rH = static_cast<SwFrameFormat*>(GetDep())->GetHeader();
689
690 const SwViewShell *pSh = getRootFrame()->GetCurrShell();
691 const bool bOn = !(pSh && (pSh->GetViewOptions()->getBrowseMode() ||
693
694 if ( bOn && rH.IsActive() )
695 { //Implant header, but remove first, if already present
696 OSL_ENSURE( rH.GetHeaderFormat(), "FrameFormat for Header not found." );
697
698 if ( pLay->GetFormat() == rH.GetHeaderFormat() )
699 return; // Header is already the correct one.
700
701 if ( pLay->IsHeaderFrame() )
702 { SwLayoutFrame *pDel = pLay;
703 pLay = static_cast<SwLayoutFrame*>(pLay->GetNext());
704 ::DelFlys(*pDel, *this);
705 pDel->Cut();
707 }
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 );
713 }
714 else if (pLay->IsHeaderFrame())
715 { // Remove header if present.
716 ::DelFlys(*pLay, *this);
717 pLay->Cut();
719 }
720}
721
724{
725 SwLayoutFrame *pLay = static_cast<SwLayoutFrame*>(Lower());
726 if ( !pLay )
727 return;
728
729 const SwFormatFooter &rF = static_cast<SwFrameFormat*>(GetDep())->GetFooter();
730 while ( pLay->GetNext() )
731 pLay = static_cast<SwLayoutFrame*>(pLay->GetNext());
732
733 const SwViewShell *pSh = getRootFrame()->GetCurrShell();
734 const bool bOn = !(pSh && (pSh->GetViewOptions()->getBrowseMode() ||
736
737 if ( bOn && rF.IsActive() )
738 { //Implant footer, but remove first, if already present
739 OSL_ENSURE( rF.GetFooterFormat(), "FrameFormat for Footer not found." );
740
741 if ( pLay->GetFormat() == rF.GetFooterFormat() )
742 return; // Footer is already the correct one.
743
744 if ( pLay->IsFooterFrame() )
745 {
746 ::DelFlys(*pLay, *this);
747 pLay->Cut();
749 }
750 SwFooterFrame *pF = new SwFooterFrame( const_cast<SwFrameFormat*>(rF.GetFooterFormat()), this );
751 pF->Paste( this );
752 if ( GetUpper() )
753 ::RegistFlys( this, pF );
754 }
755 else if ( pLay->IsFooterFrame() )
756 {
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();
765 }
766}
767
768/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GetValue() const
constexpr tools::Long Height() const
static bool IsLocked()
Definition: frmtool.hxx:478
tools::Long GetHeight() const
wrapper class for the positioning of Writer fly frames and drawing objects
virtual const SwFlyFrame * DynCastFlyFrame() const
const Size & GetSize() const
Definition: frmtool.hxx:412
tools::Long CalcLeft(const SwFrame *pCaller) const
Definition: frmtool.cxx:2378
sal_uInt16 CalcTopLine() const
Definition: frmtool.hxx:510
sal_uInt16 CalcTop() const
Definition: frmtool.hxx:534
sal_uInt16 CalcBottomLine() const
Definition: frmtool.hxx:516
tools::Long CalcRight(const SwFrame *pCaller) const
Definition: frmtool.cxx:2316
sal_uInt16 CalcBottom() const
Definition: frmtool.hxx:540
general base class for all free-flowing frames
Definition: flyfrm.hxx:79
Footer in the document layout, inside a page.
Definition: hffrm.hxx:51
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:32
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:65
bool IsActive() const
Definition: fmthdft.hxx:89
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
SwFrameSize GetHeightSizeType() const
Definition: fmtfsize.hxx:80
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:34
bool IsActive() const
Definition: fmthdft.hxx:58
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:139
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
const SwHeaderAndFooterEatSpacingItem & GetHeaderAndFooterEatSpacing(bool=true) const
const SwRect & getFrameArea() const
Definition: frame.hxx:179
bool isFrameAreaDefinitionValid() const
Definition: frame.hxx:171
const SwRect & getFramePrintArea() const
Definition: frame.hxx:180
void setFramePrintAreaValid(bool bNew)
Definition: wsfrm.cxx:100
bool isFramePrintAreaValid() const
Definition: frame.hxx:168
bool isFrameAreaSizeValid() const
Definition: frame.hxx:167
void setFrameAreaSizeValid(bool bNew)
Definition: wsfrm.cxx:92
Style of a layout element.
Definition: frmfmt.hxx:62
Base class of the Writer layout elements.
Definition: frame.hxx:315
SwTwips Grow(SwTwips, bool bTst=false, bool bInfo=false)
Definition: wsfrm.cxx:1510
bool IsTextFrame() const
Definition: frame.hxx:1234
virtual bool Prepare(const PrepareHint ePrep=PrepareHint::Clear, const void *pVoid=nullptr, bool bNotify=true)
Definition: wsfrm.cxx:603
void InvalidateAll()
Definition: frame.hxx:1055
SwTwips Shrink(SwTwips, bool bTst=false, bool bInfo=false)
Definition: wsfrm.cxx:1554
SwFrame * GetNext()
Definition: frame.hxx:676
bool HasFixSize() const
Definition: frame.hxx:670
bool IsColLocked() const
Definition: frame.hxx:886
SwFrameType mnFrameType
Definition: frame.hxx:414
void ColUnlock()
Definition: frame.hxx:449
void InvalidatePos_()
Definition: frame.hxx:787
bool IsHeaderFrame() const
Definition: frame.hxx:1190
virtual void Calc(vcl::RenderContext *pRenderContext) const
Definition: trvlfrm.cxx:1799
virtual void MakePos()
Definition: calcmove.cxx:526
static SwCache & GetCache()
Definition: frame.hxx:521
void ColLock()
Definition: frame.hxx:448
bool IsFooterFrame() const
Definition: frame.hxx:1194
SwLayoutFrame * GetUpper()
Definition: frame.hxx:678
SwRootFrame * getRootFrame()
Definition: frame.hxx:679
void SetCompletePaint() const
Definition: frame.hxx:994
SwFrame * GetPrev()
Definition: frame.hxx:677
bool IsSctFrame() const
Definition: frame.hxx:1214
void InvalidateSize()
Definition: frame.hxx:1029
SwPageFrame * FindPageFrame()
Definition: frame.hxx:680
sw::BroadcastingModify * GetDep()
use these so we can grep for SwFrame's GetRegisteredIn accesses beware that SwTextFrame may return sw...
Definition: frame.hxx:476
virtual Size ChgSize(const Size &aNewSize)
Definition: wsfrm.cxx:737
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
Definition: ssfrm.cxx:388
void SetDerivedVert(bool bNew)
Definition: frame.hxx:629
SwHeadFootFrame(SwFrameFormat *pFrame, SwFrame *, SwFrameType aType)
Definition: hffrm.cxx:96
virtual SwTwips ShrinkFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: hffrm.cxx:540
void FormatPrt(SwTwips &nUL, const SwBorderAttrs *pAttrs)
Definition: hffrm.cxx:114
virtual SwTwips GrowFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: hffrm.cxx:440
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"Formats" the Frame; Frame and PrtArea.
Definition: hffrm.cxx:415
bool GetEatSpacing() const
Definition: hffrm.cxx:652
void FormatSize(SwTwips nUL, const SwBorderAttrs *pAttrs)
Definition: hffrm.cxx:220
Header in the document layout, inside a page.
Definition: hffrm.hxx:44
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
Definition: layfrm.hxx:36
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"Formats" the Frame; Frame and PrtArea.
Definition: wsfrm.cxx:3443
bool IsAnLower(const SwFrame *) const
Definition: findfrm.cxx:231
virtual const SwFrameFormat * GetFormat() const
Definition: ssfrm.cxx:399
virtual SwTwips GrowFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: wsfrm.cxx:2633
virtual void Paste(SwFrame *pParent, SwFrame *pSibling=nullptr) override
Definition: wsfrm.cxx:1344
virtual SwTwips ShrinkFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: wsfrm.cxx:2817
void NotifyLowerObjs(const bool _bUnlockPosOfObjs=false)
force an unlockposition call for the lower objects.
Definition: fly.cxx:2440
const SwFrame * Lower() const
Definition: layfrm.hxx:101
virtual void Cut() override
Definition: wsfrm.cxx:1441
SwNodeOffset GetIndex() const
Definition: ndindex.hxx:171
static bool FormatObjsAtFrame(SwFrame &_rAnchorFrame, const SwPageFrame &_rPageFrame, SwLayAction *_pLayAction=nullptr)
method to format all floating screen objects at the given anchor frame
A page of the document layout.
Definition: pagefrm.hxx:58
void PrepareFooter()
Creates or removes footer.
Definition: hffrm.cxx:723
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:132
void PrepareHeader()
Make this public, so that the SwViewShell can access it when switching from browse mode Add/remove he...
Definition: hffrm.cxx:682
void Height(tools::Long nNew)
Definition: swrect.hxx:193
bool HasArea() const
Definition: swrect.hxx:300
void Top(const tools::Long nTop)
Definition: swrect.hxx:206
void Bottom(const tools::Long nBottom)
Definition: swrect.hxx:211
void Pos(const Point &rNew)
Definition: swrect.hxx:171
void Left(const tools::Long nLeft)
Definition: swrect.hxx:197
void Width(tools::Long nNew)
Definition: swrect.hxx:189
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:208
SwTwips Undersize()
Returns the size delta that the section would like to be greater if it has undersized TextFrames in i...
Definition: sectfrm.cxx:2830
size_t size() const
Definition: sortedobjs.cxx:43
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:165
virtual bool Prepare(const PrepareHint ePrep=PrepareHint::Clear, const void *pVoid=nullptr, bool bNotify=true) override
SwContentFrame: the shortcut for the Frames If the void* casts wrongly, it's its own fault!...
Definition: txtfrm.cxx:2748
bool getBrowseMode() const
Definition: viewopt.hxx:580
bool IsWhitespaceHidden() const
Definition: viewopt.hxx:596
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:433
const SwRect & VisArea() const
Definition: viewsh.cxx:630
void InvalidateWindows(const SwRect &rRect)
Definition: viewsh.cxx:556
@ Minimum
Value in Var-direction gives minimum (can be exceeded but not be less).
SwFrameType
Definition: frame.hxx:75
void RegistFlys(SwPageFrame *, const SwLayoutFrame *)
Definition: frmtool.cxx:3233
void InsertCnt_(SwLayoutFrame *pLay, SwDoc *pDoc, SwNodeOffset nIndex, bool bPages=false, SwNodeOffset nEndIndex=SwNodeOffset(0), SwFrame *pPrv=nullptr, sw::FrameMode eMode=sw::FrameMode::New)
Definition: frmtool.cxx:1490
bool bObjsDirect
Definition: frmtool.cxx:104
static void lcl_LayoutFrameEnsureMinHeight(SwLayoutFrame &rFrame)
Definition: hffrm.cxx:86
static SwTwips lcl_GetFrameMinHeight(const SwLayoutFrame &rFrame)
Definition: hffrm.cxx:38
static SwTwips lcl_CalcContentHeight(SwLayoutFrame &frm)
Definition: hffrm.cxx:57
static void DelFlys(const SwLayoutFrame &rFrame, SwPageFrame &rPage)
Definition: hffrm.cxx:660
sal_Int32 nIndex
const long LONG_MAX
#define SAL_WARN(area, stream)
tools::Long const nBorder
int i
tools::Long SwTwips
Definition: swtypes.hxx:51
@ AdjustSizeWithoutFormatting