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 <sal/log.hxx>
36 
38 {
39  const SwFormatFrameSize &rSz = rFrame.GetFormat()->GetFrameSize();
40  SwTwips nMinHeight;
41 
42  switch (rSz.GetHeightSizeType())
43  {
45  nMinHeight = rSz.GetHeight();
46 
47  break;
48 
49  default:
50  nMinHeight = 0;
51  }
52 
53  return nMinHeight;
54 }
55 
57 {
58  SwTwips nRemaining = 0;
59  SwFrame* pFrame = frm.Lower();
60 
61  while ( pFrame )
62  {
63  SwTwips nTmp;
64 
65  nTmp = pFrame->getFrameArea().Height();
66  nRemaining += nTmp;
67  if( pFrame->IsTextFrame() && static_cast<SwTextFrame*>(pFrame)->IsUndersized() )
68  {
69  nTmp = static_cast<SwTextFrame*>(pFrame)->GetParHeight()
70  - pFrame->getFramePrintArea().Height();
71  // This TextFrame would like to be a bit bigger
72  nRemaining += nTmp;
73  }
74  else if( pFrame->IsSctFrame() && static_cast<SwSectionFrame*>(pFrame)->IsUndersized() )
75  {
76  nTmp = static_cast<SwSectionFrame*>(pFrame)->Undersize();
77  nRemaining += nTmp;
78  }
79  pFrame = pFrame->GetNext();
80  }
81 
82  return nRemaining;
83 }
84 
86 {
87  SwTwips nMinHeight = lcl_GetFrameMinHeight(rFrame);
88 
89  if (rFrame.getFrameArea().Height() < nMinHeight)
90  {
91  rFrame.Grow(nMinHeight - rFrame.getFrameArea().Height());
92  }
93 }
94 
96  : SwLayoutFrame( pFormat, pSib )
97 {
98  mnFrameType = nTypeIn;
99  SetDerivedVert( false );
100 
101  const SwFormatContent &rCnt = pFormat->GetContent();
102 
103  OSL_ENSURE( rCnt.GetContentIdx(), "No content for Header." );
104 
105  // Have the objects created right now for header and footer
106  bool bOld = bObjsDirect;
107  bObjsDirect = true;
109  ::InsertCnt_( this, pFormat->GetDoc(), ++nIndex );
110  bObjsDirect = bOld;
111 }
112 
114 {
115  if (GetEatSpacing())
116  {
117  /* The minimal height of the print area is the minimal height of the
118  frame without the height needed for borders and shadow. */
119  SwTwips nMinHeight = lcl_GetFrameMinHeight(*this);
120 
121  nMinHeight -= pAttrs->CalcTop();
122  nMinHeight -= pAttrs->CalcBottom();
123 
124  /* If the minimal height of the print area is negative, try to
125  compensate by overlapping */
126  SwTwips nOverlap = 0;
127  if (nMinHeight < 0)
128  {
129  nOverlap = -nMinHeight;
130  nMinHeight = 0;
131  }
132 
133  /* Calculate desired height of content. The minimal height has to be
134  adhered. */
135  SwTwips nHeight;
136 
137  if ( ! HasFixSize() )
138  nHeight = lcl_CalcContentHeight(*this);
139  else
140  nHeight = nMinHeight;
141 
142  if (nHeight < nMinHeight)
143  nHeight = nMinHeight;
144 
145  /* calculate initial spacing/line space */
146  SwTwips nSpace, nLine;
147 
148  if (IsHeaderFrame())
149  {
150  nSpace = pAttrs->CalcBottom();
151  nLine = pAttrs->CalcBottomLine();
152  }
153  else
154  {
155  nSpace = pAttrs->CalcTop();
156  nLine = pAttrs->CalcTopLine();
157  }
158 
159  /* calculate overlap and correct spacing */
160  nOverlap += nHeight - nMinHeight;
161  if (nOverlap < nSpace - nLine)
162  nSpace -= nOverlap;
163  else
164  nSpace = nLine;
165 
166  /* calculate real vertical space between frame and print area */
167  if (IsHeaderFrame())
168  nUL = pAttrs->CalcTop() + nSpace;
169  else
170  nUL = pAttrs->CalcBottom() + nSpace;
171 
172  /* set print area */
173  SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this );
175 
176  aPrt.Left(pAttrs->CalcLeft(this));
177 
178  if (IsHeaderFrame())
179  {
180  aPrt.Top(pAttrs->CalcTop());
181  }
182  else
183  {
184  aPrt.Top(nSpace);
185  }
186 
187  aPrt.Width(getFrameArea().Width() - nLR);
188 
189  SwTwips nNewHeight;
190 
191  if (nUL < getFrameArea().Height())
192  {
193  nNewHeight = getFrameArea().Height() - nUL;
194  }
195  else
196  {
197  nNewHeight = 0;
198  }
199 
200  aPrt.Height(nNewHeight);
201  }
202  else
203  {
204  // Set position
206  aPrt.Left( pAttrs->CalcLeft( this ) );
207  aPrt.Top ( pAttrs->CalcTop() );
208 
209  // Set sizes - the sizes are given by the surrounding Frame, just
210  // subtract the borders.
211  SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this );
212  aPrt.Width ( getFrameArea().Width() - nLR );
213  aPrt.Height( getFrameArea().Height()- nUL );
214  }
215 
217 }
218 
220 {
221  if ( !HasFixSize() )
222  {
223  if( !IsColLocked() )
224  {
226  setFrameAreaSizeValid(true);
227 
228  const SwTwips nBorder = nUL;
229  SwTwips nMinHeight = lcl_GetFrameMinHeight(*this);
230  nMinHeight -= pAttrs->CalcTop();
231  nMinHeight -= pAttrs->CalcBottom();
232 
233  if (nMinHeight < 0)
234  nMinHeight = 0;
235 
236  ColLock();
237 
238  SwTwips nMaxHeight = LONG_MAX;
239  SwTwips nRemaining, nOldHeight;
240  // #i64301#
241  // use the position of the footer printing area to control invalidation
242  // of the first footer content.
243  Point aOldFooterPrtPos;
244 
245  do
246  {
247  nOldHeight = getFramePrintArea().Height();
248  SwFrame* pFrame = Lower();
249  // #i64301#
250  if ( pFrame &&
251  aOldFooterPrtPos != ( getFrameArea().Pos() + getFramePrintArea().Pos() ) )
252  {
253  pFrame->InvalidatePos_();
254  aOldFooterPrtPos = getFrameArea().Pos() + getFramePrintArea().Pos();
255  }
256  int nLoopControl = 0;
257  while( pFrame )
258  {
259  pFrame->Calc(getRootFrame()->GetCurrShell()->GetOut());
260  // #i43771# - format also object anchored
261  // at the frame
262  // #i46941# - frame has to be valid.
263  // Note: frame could be invalid after calling its format,
264  // if it's locked
265  OSL_ENSURE( StackHack::IsLocked() || !pFrame->IsTextFrame() ||
266  pFrame->isFrameAreaDefinitionValid() ||
267  static_cast<SwTextFrame*>(pFrame)->IsJoinLocked(),
268  "<SwHeadFootFrame::FormatSize(..)> - text frame invalid and not locked." );
269 
270  if ( pFrame->IsTextFrame() && pFrame->isFrameAreaDefinitionValid() )
271  {
273  *(pFrame->FindPageFrame()) ) )
274  {
275  if (nLoopControl++ < 20)
276  {
277  // restart format with first content
278  pFrame = Lower();
279  continue;
280  }
281  else
282  SAL_WARN("sw", "SwHeadFootFrame::FormatSize: loop detection triggered");
283  }
284  }
285  pFrame = pFrame->GetNext();
286  }
287  nRemaining = 0;
288  pFrame = Lower();
289 
290  while ( pFrame )
291  {
292  nRemaining += pFrame->getFrameArea().Height();
293 
294  if( pFrame->IsTextFrame() &&
295  static_cast<SwTextFrame*>(pFrame)->IsUndersized() )
296  // This TextFrame would like to be a bit bigger
297  nRemaining += static_cast<SwTextFrame*>(pFrame)->GetParHeight()
298  - pFrame->getFramePrintArea().Height();
299  else if( pFrame->IsSctFrame() &&
300  static_cast<SwSectionFrame*>(pFrame)->IsUndersized() )
301  nRemaining += static_cast<SwSectionFrame*>(pFrame)->Undersize();
302  pFrame = pFrame->GetNext();
303  }
304  if ( nRemaining < nMinHeight )
305  nRemaining = nMinHeight;
306 
307  SwTwips nDiff = nRemaining - nOldHeight;
308 
309  if( !nDiff )
310  break;
311  if( nDiff < 0 )
312  {
313  nMaxHeight = nOldHeight;
314 
315  if( nRemaining <= nMinHeight )
316  nRemaining = ( nMaxHeight + nMinHeight + 1 ) / 2;
317  }
318  else
319  {
320  if (nOldHeight > nMinHeight)
321  nMinHeight = nOldHeight;
322 
323  if( nRemaining >= nMaxHeight )
324  nRemaining = ( nMaxHeight + nMinHeight + 1 ) / 2;
325  }
326 
327  nDiff = nRemaining - nOldHeight;
328 
329  if ( nDiff )
330  {
331  ColUnlock();
332  if ( nDiff > 0 )
333  {
334  if ( Grow( nDiff ) )
335  {
336  pFrame = Lower();
337 
338  while ( pFrame )
339  {
340  if( pFrame->IsTextFrame())
341  {
342  SwTextFrame * pTmpFrame = static_cast<SwTextFrame*>(pFrame);
343  if (pTmpFrame->IsUndersized() )
344  {
345  pTmpFrame->InvalidateSize();
347  }
348  }
349  /* #i3568# Undersized sections need to be
350  invalidated too. */
351  else if (pFrame->IsSctFrame())
352  {
353  SwSectionFrame * pTmpFrame =
354  static_cast<SwSectionFrame*>(pFrame);
355  if (pTmpFrame->IsUndersized() )
356  {
357  pTmpFrame->InvalidateSize();
359  }
360  }
361  pFrame = pFrame->GetNext();
362  }
363  }
364  }
365  else
366  Shrink( -nDiff );
367  // Quickly update the position
368 
369  MakePos();
370  ColLock();
371  }
372  else
373  break;
374  // Don't overwrite the lower edge of the upper
375  if ( GetUpper() && getFrameArea().Height() )
376  {
377  const SwTwips nDeadLine = GetUpper()->getFrameArea().Top() + GetUpper()->getFramePrintArea().Bottom();
378  const SwTwips nBot = getFrameArea().Bottom();
379 
380  if ( nBot > nDeadLine )
381  {
383  aFrm.Bottom( nDeadLine );
384 
386  aPrt.Height( getFrameArea().Height() - nBorder );
387  }
388  }
389 
391  setFrameAreaSizeValid(true);
392  } while( nRemaining<=nMaxHeight && nOldHeight!=getFramePrintArea().Height() );
393  ColUnlock();
394  }
395 
397  setFrameAreaSizeValid(true);
398  }
399  else //if (GetType() & FRM_HEADFOOT)
400  {
401  do
402  {
403  if ( getFrameArea().Height() != pAttrs->GetSize().Height() )
404  {
405  ChgSize( Size( getFrameArea().Width(), pAttrs->GetSize().Height()));
406  }
407 
408  setFrameAreaSizeValid(true);
409  MakePos();
410  } while ( !isFrameAreaSizeValid() );
411  }
412 }
413 
414 void SwHeadFootFrame::Format(vcl::RenderContext* pRenderContext, const SwBorderAttrs * pAttrs)
415 {
416  OSL_ENSURE( pAttrs, "SwFooterFrame::Format, pAttrs is 0." );
417 
419  return;
420 
421  if ( ! GetEatSpacing() && IsHeaderFrame())
422  {
423  SwLayoutFrame::Format(pRenderContext, pAttrs);
424  }
425  else
426  {
428 
429  long nUL = pAttrs->CalcTop() + pAttrs->CalcBottom();
430 
431  if ( !isFramePrintAreaValid() )
432  FormatPrt(nUL, pAttrs);
433 
434  if ( !isFrameAreaSizeValid() )
435  FormatSize(nUL, pAttrs);
436  }
437 }
438 
439 SwTwips SwHeadFootFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
440 {
441  SwTwips nResult;
442 
443  if ( IsColLocked() )
444  {
445  nResult = 0;
446  }
447  else if (!GetEatSpacing())
448  {
449  nResult = SwLayoutFrame::GrowFrame(nDist, bTst, bInfo);
450  }
451  else
452  {
453  nResult = 0;
454 
455  auto pAccess = std::make_unique<SwBorderAttrAccess>(SwFrame::GetCache(), this);
456  OSL_ENSURE(pAccess, "no border attributes");
457 
458  SwBorderAttrs * pAttrs = pAccess->Get();
459 
460  /* First assume the whole amount to grow can be provided by eating
461  spacing. */
462  SwTwips nEat = nDist;
463  SwTwips nMaxEat;
464 
465  /* calculate maximum eatable spacing */
466  if (IsHeaderFrame())
467  nMaxEat = getFrameArea().Height() - getFramePrintArea().Top() - getFramePrintArea().Height() - pAttrs->CalcBottomLine();
468  else
469  nMaxEat = getFramePrintArea().Top() - pAttrs->CalcTopLine();
470 
471  if (nMaxEat < 0)
472  nMaxEat = 0;
473 
474  /* If the frame is too small, eat less spacing thus letting the frame
475  grow more. */
476  SwTwips nMinHeight = lcl_GetFrameMinHeight(*this);
477  SwTwips nFrameTooSmall = nMinHeight - getFrameArea().Height();
478 
479  if (nFrameTooSmall > 0)
480  nEat -= nFrameTooSmall;
481 
482  /* No negative eating, not eating more than allowed. */
483  if (nEat < 0)
484  nEat = 0;
485  else if (nEat > nMaxEat)
486  nEat = nMaxEat;
487 
488  // Notify fly frame, if header frame
489  // grows. Consider, that 'normal' grow of layout frame already notifies
490  // the fly frames.
491  bool bNotifyFlys = false;
492  if (nEat > 0)
493  {
494  if ( ! bTst)
495  {
496  if (! IsHeaderFrame())
497  {
499  aPrt.Top(aPrt.Top() - nEat);
500  aPrt.Height(aPrt.Height() - nEat);
501  }
502 
503  InvalidateAll();
504  }
505 
506  nResult += nEat;
507  // trigger fly frame notify.
508  if ( IsHeaderFrame() )
509  {
510  bNotifyFlys = true;
511  }
512  }
513 
514  if (nDist - nEat > 0)
515  {
516  const SwTwips nFrameGrow =
517  SwLayoutFrame::GrowFrame( nDist - nEat, bTst, bInfo );
518 
519  nResult += nFrameGrow;
520  if ( nFrameGrow > 0 )
521  {
522  bNotifyFlys = false;
523  }
524  }
525 
526  // notify fly frames, if necessary and triggered.
527  if ( ( nResult > 0 ) && bNotifyFlys )
528  {
529  NotifyLowerObjs();
530  }
531  }
532 
533  if ( nResult && !bTst )
535 
536  return nResult;
537 }
538 
539 SwTwips SwHeadFootFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
540 {
541  SwTwips nResult;
542 
543  if ( IsColLocked() )
544  {
545  nResult = 0;
546  }
547  else if (! GetEatSpacing())
548  {
549  nResult = SwLayoutFrame::ShrinkFrame(nDist, bTst, bInfo);
550  }
551  else
552  {
553  nResult = 0;
554 
555  SwTwips nMinHeight = lcl_GetFrameMinHeight(*this);
556  SwTwips nOldHeight = getFrameArea().Height();
557  SwTwips nRest = 0; // Amount to shrink by spitting out spacing
558 
559  if ( nOldHeight >= nMinHeight )
560  {
561  /* If the frame's height is bigger than its minimum height, shrink
562  the frame towards its minimum height. If this is not sufficient
563  to provide the shrinking requested provide the rest by spitting
564  out spacing. */
565 
566  SwTwips nBiggerThanMin = nOldHeight - nMinHeight;
567 
568  if (nBiggerThanMin < nDist)
569  {
570  nRest = nDist - nBiggerThanMin;
571  }
572  /* info: declaration of nRest -> else nRest = 0 */
573  }
574  else
575  /* The frame cannot shrink. Provide shrinking by spitting out
576  spacing. */
577  nRest = nDist;
578 
579  // Notify fly frame, if header/footer frame shrinks.
580  // Consider, that 'normal' shrink of layout frame already notifies the fly frames.
581  bool bNotifyFlys = false;
582  if (nRest > 0)
583  {
584  auto pAccess = std::make_unique<SwBorderAttrAccess>(SwFrame::GetCache(), this);
585  OSL_ENSURE(pAccess, "no border attributes");
586 
587  SwBorderAttrs * pAttrs = pAccess->Get();
588 
589  /* minimal height of print area */
590  SwTwips nMinPrtHeight = nMinHeight
591  - pAttrs->CalcTop()
592  - pAttrs->CalcBottom();
593 
594  if (nMinPrtHeight < 0)
595  nMinPrtHeight = 0;
596 
597  /* assume all shrinking can be provided */
598  SwTwips nShrink = nRest;
599 
600  /* calculate maximum shrinking */
601  SwTwips nMaxShrink = getFramePrintArea().Height() - nMinPrtHeight;
602 
603  /* shrink no more than maximum shrinking */
604  if (nShrink > nMaxShrink)
605  {
606  //nRest -= nShrink - nMaxShrink;
607  nShrink = nMaxShrink;
608  }
609 
610  if (!bTst)
611  {
612  if (! IsHeaderFrame() )
613  {
615  aPrt.Top(aPrt.Top() + nShrink);
616  aPrt.Height(aPrt.Height() - nShrink);
617  }
618 
619  InvalidateAll();
620  }
621  nResult += nShrink;
622  // Trigger fly frame notify.
623  if ( IsHeaderFrame() )
624  {
625  bNotifyFlys = true;
626  }
627  }
628 
629  /* The shrinking not providable by spitting out spacing has to be done
630  by the frame. */
631  if (nDist - nRest > 0)
632  {
633  SwTwips nShrinkAmount = SwLayoutFrame::ShrinkFrame( nDist - nRest, bTst, bInfo );
634  nResult += nShrinkAmount;
635  if ( nShrinkAmount > 0 )
636  {
637  bNotifyFlys = false;
638  }
639  }
640 
641  // Notify fly frames, if necessary.
642  if ( ( nResult > 0 ) && bNotifyFlys )
643  {
644  NotifyLowerObjs();
645  }
646  }
647 
648  return nResult;
649 }
650 
652 {
653  const SwFrameFormat * pFormat = GetFormat();
654  OSL_ENSURE(pFormat, "SwHeadFootFrame: no format?");
655 
656  return pFormat->GetHeaderAndFooterEatSpacing().GetValue();
657 }
658 
659 static void DelFlys( SwLayoutFrame const *pFrame, SwPageFrame *pPage )
660 {
661  size_t i = 0;
662  while ( pPage->GetSortedObjs() &&
663  pPage->GetSortedObjs()->size() &&
664  i < pPage->GetSortedObjs()->size() )
665  {
666  SwAnchoredObject* pObj = (*pPage->GetSortedObjs())[i];
667  if ( dynamic_cast< const SwFlyFrame *>( pObj ) != nullptr )
668  {
669  SwFlyFrame* pFlyFrame = static_cast<SwFlyFrame*>(pObj);
670  if ( pFrame->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();
706  SwFrame::DestroyFrame(pDel);
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();
718  SwFrame::DestroyFrame(pLay);
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();
748  SwFrame::DestroyFrame(pLay);
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  { // Remove footer if already present
757  ::DelFlys( pLay, this );
758  SwViewShell *pShell;
759  if ( pLay->GetPrev() && nullptr != (pShell = getRootFrame()->GetCurrShell()) &&
760  pShell->VisArea().HasArea() )
761  pShell->InvalidateWindows( pShell->VisArea() );
762  pLay->Cut();
763  SwFrame::DestroyFrame(pLay);
764  }
765 }
766 
767 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsAnLower(const SwFrame *) const
Definition: findfrm.cxx:206
bool GetValue() const
sal_uInt16 CalcBottomLine() const
Definition: frmtool.hxx:505
Base class of the Writer layout elements.
Definition: frame.hxx:297
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:151
static SwTwips lcl_GetFrameMinHeight(const SwLayoutFrame &rFrame)
Definition: hffrm.cxx:37
sal_Int32 nIndex
virtual SwTwips ShrinkFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: hffrm.cxx:539
void InsertCnt_(SwLayoutFrame *pLay, SwDoc *pDoc, sal_uLong nIndex, bool bPages=false, sal_uLong nEndIndex=0, SwFrame *pPrv=nullptr, sw::FrameMode eMode=sw::FrameMode::New)
Definition: frmtool.cxx:1416
Header in the document layout, inside a page.
Definition: hffrm.hxx:43
void FormatPrt(SwTwips &nUL, const SwBorderAttrs *pAttrs)
Definition: hffrm.cxx:113
SwTwips Grow(SwTwips, bool bTst=false, bool bInfo=false)
Definition: wsfrm.cxx:1469
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"Formats" the Frame; Frame and PrtArea.
Definition: wsfrm.cxx:3360
bool IsColLocked() const
Definition: frame.hxx:864
long Height() const
void SetCompletePaint() const
Definition: frame.hxx:972
virtual bool Prepare(const PrepareHint ePrep=PrepareHint::Clear, const void *pVoid=nullptr, bool bNotify=true)
Definition: wsfrm.cxx:587
SwModify * GetDep()
use these so we can grep for SwFrame's GetRegisteredIn accesses beware that SwTextFrame may return sw...
Definition: frame.hxx:459
sal_uIntPtr sal_uLong
const SwRect & getFramePrintArea() const
Definition: frame.hxx:178
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! The void*...
Definition: txtfrm.cxx:2712
static SwCache & GetCache()
Definition: frame.hxx:502
void Height(long nNew)
Definition: swrect.hxx:191
virtual void Paste(SwFrame *pParent, SwFrame *pSibling=nullptr) override
Definition: wsfrm.cxx:1303
long SwTwips
Definition: swtypes.hxx:49
Content, content of frame (header, footer, fly).
Definition: fmtcntnt.hxx:31
sal_uInt16 CalcTopLine() const
Definition: frmtool.hxx:499
static void DestroyFrame(SwFrame *const pFrame)
this is the only way to delete a SwFrame instance
Definition: ssfrm.cxx:382
void Pos(const Point &rNew)
Definition: swrect.hxx:169
virtual void Calc(vcl::RenderContext *pRenderContext) const
Definition: trvlfrm.cxx:1787
long CalcRight(const SwFrame *pCaller) const
Definition: frmtool.cxx:2199
bool isFrameAreaDefinitionValid() const
Definition: frame.hxx:169
Value in Var-direction gives minimum (can be exceeded but not be less).
bool IsActive() const
Definition: fmthdft.hxx:89
long CalcLeft(const SwFrame *pCaller) const
Definition: frmtool.cxx:2247
wrapper class for the positioning of Writer fly frames and drawing objects
void Top(const long nTop)
Definition: swrect.hxx:204
const SwRect & getFrameArea() const
Definition: frame.hxx:177
bool getBrowseMode() const
Definition: viewopt.hxx:454
virtual Size ChgSize(const Size &aNewSize)
Definition: wsfrm.cxx:721
void FormatSize(SwTwips nUL, const SwBorderAttrs *pAttrs)
Definition: hffrm.cxx:219
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
sal_uLong GetIndex() const
Definition: ndindex.hxx:152
bool IsTextFrame() const
Definition: frame.hxx:1212
void setFramePrintAreaValid(bool bNew)
Definition: wsfrm.cxx:97
bool IsSctFrame() const
Definition: frame.hxx:1192
void PrepareFooter()
Creates or removes footer.
Definition: hffrm.cxx:723
void SetDerivedVert(bool bNew)
Definition: frame.hxx:609
Style of a layout element.
Definition: frmfmt.hxx:57
const SwSortedObjs * GetSortedObjs() const
Definition: pagefrm.hxx:119
int i
const SwRect & VisArea() const
Definition: viewsh.cxx:560
const SwFrameFormat * GetFooterFormat() const
Definition: fmthdft.hxx:85
SwFrameType
Definition: frame.hxx:72
virtual SwTwips GrowFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: hffrm.cxx:439
size_t size() const
Definition: sortedobjs.cxx:42
void ColUnlock()
Definition: frame.hxx:432
SwPageFrame * FindPageFrame()
Definition: frame.hxx:660
virtual void Cut() override
Definition: wsfrm.cxx:1400
const SwFrame * Lower() const
Definition: layfrm.hxx:101
SwLayoutFrame * GetUpper()
Definition: frame.hxx:658
bool HasArea() const
Definition: swrect.hxx:288
bool isFramePrintAreaValid() const
Definition: frame.hxx:166
bool IsUndersized() const
Definition: flowfrm.hxx:158
long const nBorder
SwFrame * GetPrev()
Definition: frame.hxx:657
const SwDoc * GetDoc() const
The document is set in SwAttrPool now, therefore you always can access it.
Definition: format.hxx:119
void PrepareHeader()
Make this public, so that the SwViewShell can access it when switching from browse mode Add/remove he...
Definition: hffrm.cxx:682
bool HasFixSize() const
Definition: frame.hxx:650
bool bObjsDirect
Definition: frmtool.cxx:81
bool isFrameAreaSizeValid() const
Definition: frame.hxx:165
void InvalidatePos_()
Definition: frame.hxx:767
A page of the document layout.
Definition: pagefrm.hxx:41
void InvalidateWindows(const SwRect &rRect)
Definition: viewsh.cxx:541
static void DelFlys(SwLayoutFrame const *pFrame, SwPageFrame *pPage)
Definition: hffrm.cxx:659
const long LONG_MAX
sal_uInt16 CalcTop() const
Definition: frmtool.hxx:523
SwTwips Shrink(SwTwips, bool bTst=false, bool bInfo=false)
Definition: wsfrm.cxx:1514
void InvalidateSize()
Definition: frame.hxx:1007
const SwNodeIndex * GetContentIdx() const
Definition: fmtcntnt.hxx:46
SwHeadFootFrame(SwFrameFormat *pFrame, SwFrame *, SwFrameType aType)
Definition: hffrm.cxx:95
static bool FormatObjsAtFrame(SwFrame &_rAnchorFrame, const SwPageFrame &_rPageFrame, SwLayAction *_pLayAction=nullptr)
method to format all floating screen objects at the given anchor frame
void Left(const long nLeft)
Definition: swrect.hxx:195
void Bottom(const long nBottom)
Definition: swrect.hxx:209
general base class for all free-flowing frames
Definition: flyfrm.hxx:60
virtual SwTwips ShrinkFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: wsfrm.cxx:2752
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:424
void Width(long nNew)
Definition: swrect.hxx:187
void NotifyLowerObjs(const bool _bUnlockPosOfObjs=false)
force an unlockposition call for the lower objects.
Definition: fly.cxx:2352
sal_uInt16 CalcBottom() const
Definition: frmtool.hxx:529
static void lcl_LayoutFrameEnsureMinHeight(SwLayoutFrame &rFrame)
Definition: hffrm.cxx:85
void setFrameAreaSizeValid(bool bNew)
Definition: wsfrm.cxx:89
SwFrameType mnFrameType
Definition: frame.hxx:397
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
static bool IsLocked()
Definition: frmtool.hxx:467
const SwFormatFrameSize & GetFrameSize(bool=true) const
Definition: fmtfsize.hxx:104
const Size & GetSize() const
Definition: frmtool.hxx:400
const SwFormatContent & GetContent(bool=true) const
Definition: fmtcntnt.hxx:55
const SwHeaderAndFooterEatSpacingItem & GetHeaderAndFooterEatSpacing(bool=true) const
#define SAL_WARN(area, stream)
void InvalidateAll()
Definition: frame.hxx:1033
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
Definition: layfrm.hxx:35
bool GetEatSpacing() const
Definition: hffrm.cxx:651
void RegistFlys(SwPageFrame *, const SwLayoutFrame *)
Definition: frmtool.cxx:3091
virtual void MakePos()
Definition: calcmove.cxx:534
virtual SwTwips GrowFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: wsfrm.cxx:2580
bool IsActive() const
Definition: fmthdft.hxx:58
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"Formats" the Frame; Frame and PrtArea.
Definition: hffrm.cxx:414
bool IsWhitespaceHidden() const
Definition: viewopt.hxx:470
long GetHeight() const
SwViewShell * GetCurrShell() const
Definition: rootfrm.hxx:205
void ColLock()
Definition: frame.hxx:431
Footer in the document layout, inside a page.
Definition: hffrm.hxx:50
bool IsFooterFrame() const
Definition: frame.hxx:1172
SwRootFrame * getRootFrame()
Definition: frame.hxx:659
static SwTwips lcl_CalcContentHeight(SwLayoutFrame &frm)
Definition: hffrm.cxx:56
const SwFrameFormat * GetHeaderFormat() const
Definition: fmthdft.hxx:54
bool IsHeaderFrame() const
Definition: frame.hxx:1168
virtual const SwFrameFormat * GetFormat() const
Definition: ssfrm.cxx:393
SwFrameSize GetHeightSizeType() const
Definition: fmtfsize.hxx:80
SwFrame * GetNext()
Definition: frame.hxx:656