Update ooo320-m1
[ooovba.git] / sw / source / core / layout / hffrm.cxx
blobc766427f4a27734a71578695a4fccdaa585d6d28
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: hffrm.cxx,v $
10 * $Revision: 1.27 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
34 #include "pagefrm.hxx"
35 #include "viewsh.hxx"
36 #include "doc.hxx"
37 #include "errhdl.hxx"
38 #include <fmtcntnt.hxx>
39 #include <fmthdft.hxx>
40 #include <fmtfsize.hxx>
41 #include "hffrm.hxx"
42 #include "txtfrm.hxx"
43 #include "sectfrm.hxx"
44 #include "flyfrm.hxx"
45 #include "frmtool.hxx"
46 #include "dflyobj.hxx"
47 #include "frmfmt.hxx"
48 #include "ndindex.hxx"
49 #include "hfspacingitem.hxx"
50 // OD 2004-05-24 #i28701#
51 #include <sortedobjs.hxx>
52 // --> OD 2005-03-03 #i43771#
53 #include <objectformatter.hxx>
54 // <--
56 extern BOOL bObjsDirect; //frmtool.cxx
58 static SwTwips lcl_GetFrmMinHeight(const SwLayoutFrm & rFrm)
60 const SwFmtFrmSize &rSz = rFrm.GetFmt()->GetFrmSize();
61 SwTwips nMinHeight;
63 switch (rSz.GetHeightSizeType())
65 case ATT_MIN_SIZE:
66 nMinHeight = rSz.GetHeight();
68 break;
70 default:
71 nMinHeight = 0;
75 return nMinHeight;
79 static SwTwips lcl_CalcContentHeight(SwLayoutFrm & frm)
81 SwFrm* pFrm = frm.Lower();
83 SwTwips nRemaining = 0;
84 USHORT nNum = 0;
85 pFrm = frm.Lower();
86 while ( pFrm )
88 SwTwips nTmp;
90 nTmp = pFrm->Frm().Height();
91 nRemaining += nTmp;
92 if( pFrm->IsTxtFrm() && ((SwTxtFrm*)pFrm)->IsUndersized() )
94 nTmp = ((SwTxtFrm*)pFrm)->GetParHeight()
95 - pFrm->Prt().Height();
96 // Dieser TxtFrm waere gern ein bisschen groesser
97 nRemaining += nTmp;
99 else if( pFrm->IsSctFrm() && ((SwSectionFrm*)pFrm)->IsUndersized() )
101 nTmp = ((SwSectionFrm*)pFrm)->Undersize();
102 nRemaining += nTmp;
104 pFrm = pFrm->GetNext();
106 nNum++;
109 return nRemaining;
112 static void lcl_LayoutFrmEnsureMinHeight(SwLayoutFrm & rFrm,
113 const SwBorderAttrs * )
115 SwTwips nMinHeight = lcl_GetFrmMinHeight(rFrm);
117 if (rFrm.Frm().Height() < nMinHeight)
119 rFrm.Grow(nMinHeight - rFrm.Frm().Height());
123 SwHeadFootFrm::SwHeadFootFrm( SwFrmFmt * pFmt, USHORT nTypeIn)
124 : SwLayoutFrm(pFmt)
126 nType = nTypeIn;
127 SetDerivedVert( FALSE );
129 const SwFmtCntnt &rCnt = pFmt->GetCntnt();
131 ASSERT( rCnt.GetCntntIdx(), "Kein Inhalt fuer Header." );
133 //Fuer Header Footer die Objekte gleich erzeugen lassen.
134 BOOL bOld = bObjsDirect;
135 bObjsDirect = TRUE;
136 ULONG nIndex = rCnt.GetCntntIdx()->GetIndex();
137 ::_InsertCnt( this, pFmt->GetDoc(), ++nIndex );
138 bObjsDirect = bOld;
141 void SwHeadFootFrm::FormatPrt(SwTwips & nUL, const SwBorderAttrs * pAttrs)
143 if (GetEatSpacing())
145 /* The minimal height of the print area is the minimal height of the
146 frame without the height needed for borders and shadow. */
147 SwTwips nMinHeight = lcl_GetFrmMinHeight(*this);
149 nMinHeight -= pAttrs->CalcTop();
150 nMinHeight -= pAttrs->CalcBottom();
152 /* If the minimal height of the print area is negative, try to
153 compensate by overlapping */
154 SwTwips nOverlap = 0;
155 if (nMinHeight < 0)
157 nOverlap = -nMinHeight;
158 nMinHeight = 0;
161 /* Calculate desired height of content. The minimal height has to be
162 adhered. */
163 SwTwips nHeight;
165 if ( ! HasFixSize() )
166 nHeight = lcl_CalcContentHeight(*this);
167 else
168 nHeight = nMinHeight;
170 if (nHeight < nMinHeight)
171 nHeight = nMinHeight;
173 /* calculate initial spacing/line space */
174 SwTwips nSpace, nLine;
176 if (IsHeaderFrm())
178 nSpace = pAttrs->CalcBottom();
179 nLine = pAttrs->CalcBottomLine();
181 else
183 nSpace = pAttrs->CalcTop();
184 nLine = pAttrs->CalcTopLine();
187 /* calculate overlap and correct spacing */
188 nOverlap += nHeight - nMinHeight;
189 if (nOverlap < nSpace - nLine)
190 nSpace -= nOverlap;
191 else
192 nSpace = nLine;
194 /* calculate real vertical space between frame and print area */
195 if (IsHeaderFrm())
196 nUL = pAttrs->CalcTop() + nSpace;
197 else
198 nUL = pAttrs->CalcBottom() + nSpace;
200 /* set print area */
201 // OD 23.01.2003 #106895# - add first parameter to <SwBorderAttrs::CalcRight(..)>
202 SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this );
204 aPrt.Left(pAttrs->CalcLeft(this));
206 if (IsHeaderFrm())
207 aPrt.Top(pAttrs->CalcTop());
208 else
209 aPrt.Top(nSpace);
211 aPrt.Width(aFrm.Width() - nLR);
213 SwTwips nNewHeight;
215 if (nUL < aFrm.Height())
216 nNewHeight = aFrm.Height() - nUL;
217 else
218 nNewHeight = 0;
220 aPrt.Height(nNewHeight);
223 else
225 //Position einstellen.
226 aPrt.Left( pAttrs->CalcLeft( this ) );
227 aPrt.Top ( pAttrs->CalcTop() );
229 //Sizes einstellen; die Groesse gibt der umgebende Frm vor, die
230 //die Raender werden einfach abgezogen.
231 // OD 23.01.2003 #106895# - add first parameter to <SwBorderAttrs::CalcRight(..)>
232 SwTwips nLR = pAttrs->CalcLeft( this ) + pAttrs->CalcRight( this );
233 aPrt.Width ( aFrm.Width() - nLR );
234 aPrt.Height( aFrm.Height()- nUL );
238 bValidPrtArea = TRUE;
241 void SwHeadFootFrm::FormatSize(SwTwips nUL, const SwBorderAttrs * pAttrs)
243 if ( !HasFixSize() )
245 if( !IsColLocked() )
247 bValidSize = bValidPrtArea = TRUE;
249 const SwTwips nBorder = nUL;
250 SwTwips nMinHeight = lcl_GetFrmMinHeight(*this);
251 nMinHeight -= pAttrs->CalcTop();
252 nMinHeight -= pAttrs->CalcBottom();
254 if (nMinHeight < 0)
255 nMinHeight = 0;
257 ColLock();
259 SwTwips nMaxHeight = LONG_MAX;
260 SwTwips nRemaining, nOldHeight;
261 // --> OD 2006-05-24 #i64301#
262 // use the position of the footer printing area to control invalidation
263 // of the first footer content.
264 Point aOldFooterPrtPos;
265 // <--
269 nOldHeight = Prt().Height();
270 SwFrm* pFrm = Lower();
271 // --> OD 2006-05-24 #i64301#
272 if ( pFrm &&
273 aOldFooterPrtPos != ( Frm().Pos() + Prt().Pos() ) )
275 pFrm->_InvalidatePos();
276 aOldFooterPrtPos = Frm().Pos() + Prt().Pos();
278 // <--
279 while( pFrm )
281 pFrm->Calc();
282 // --> OD 2005-03-03 #i43771# - format also object anchored
283 // at the frame
284 // --> OD 2005-05-03 #i46941# - frame has to be valid.
285 // Note: frame could be invalid after calling its format,
286 // if it's locked
287 ASSERT( StackHack::IsLocked() || !pFrm->IsTxtFrm() ||
288 pFrm->IsValid() ||
289 static_cast<SwTxtFrm*>(pFrm)->IsJoinLocked(),
290 "<SwHeadFootFrm::FormatSize(..)> - text frame invalid and not locked." );
291 if ( pFrm->IsTxtFrm() && pFrm->IsValid() )
293 if ( !SwObjectFormatter::FormatObjsAtFrm( *pFrm,
294 *(pFrm->FindPageFrm()) ) )
296 // restart format with first content
297 pFrm = Lower();
298 continue;
301 // <--
302 pFrm = pFrm->GetNext();
304 nRemaining = 0;
305 pFrm = Lower();
307 while ( pFrm )
309 nRemaining += pFrm->Frm().Height();
311 if( pFrm->IsTxtFrm() &&
312 ((SwTxtFrm*)pFrm)->IsUndersized() )
313 // Dieser TxtFrm waere gern ein bisschen groesser
314 nRemaining += ((SwTxtFrm*)pFrm)->GetParHeight()
315 - pFrm->Prt().Height();
316 else if( pFrm->IsSctFrm() &&
317 ((SwSectionFrm*)pFrm)->IsUndersized() )
318 nRemaining += ((SwSectionFrm*)pFrm)->Undersize();
319 pFrm = pFrm->GetNext();
321 if ( nRemaining < nMinHeight )
322 nRemaining = nMinHeight;
324 SwTwips nDiff = nRemaining - nOldHeight;
326 if( !nDiff )
327 break;
328 if( nDiff < 0 )
330 nMaxHeight = nOldHeight;
332 if( nRemaining <= nMinHeight )
333 nRemaining = ( nMaxHeight + nMinHeight + 1 ) / 2;
335 else
337 if (nOldHeight > nMinHeight)
338 nMinHeight = nOldHeight;
340 if( nRemaining >= nMaxHeight )
341 nRemaining = ( nMaxHeight + nMinHeight + 1 ) / 2;
344 nDiff = nRemaining - nOldHeight;
346 if ( nDiff )
348 ColUnlock();
349 if ( nDiff > 0 )
351 if ( Grow( nDiff ) )
353 pFrm = Lower();
355 while ( pFrm )
357 if( pFrm->IsTxtFrm())
359 SwTxtFrm * pTmpFrm = (SwTxtFrm*) pFrm;
360 if (pTmpFrm->IsUndersized() )
362 pTmpFrm->InvalidateSize();
363 pTmpFrm->Prepare(PREP_ADJUST_FRM);
366 /* #i3568# Undersized sections need to be
367 invalidated too. */
368 else if (pFrm->IsSctFrm())
370 SwSectionFrm * pTmpFrm =
371 (SwSectionFrm*) pFrm;
372 if (pTmpFrm->IsUndersized() )
374 pTmpFrm->InvalidateSize();
375 pTmpFrm->Prepare(PREP_ADJUST_FRM);
378 pFrm = pFrm->GetNext();
382 else
383 Shrink( -nDiff );
384 //Schnell auf dem kurzen Dienstweg die Position updaten.
386 MakePos();
387 ColLock();
389 else
390 break;
391 //Unterkante des Uppers nicht ueberschreiten.
392 if ( GetUpper() && Frm().Height() )
394 const SwTwips nDeadLine = GetUpper()->Frm().Top() +
395 GetUpper()->Prt().Bottom();
396 const SwTwips nBot = Frm().Bottom();
397 if ( nBot > nDeadLine )
399 Frm().Bottom( nDeadLine );
400 Prt().SSize().Height() = Frm().Height() - nBorder;
403 bValidSize = bValidPrtArea = TRUE;
404 } while( nRemaining<=nMaxHeight && nOldHeight!=Prt().Height() );
405 ColUnlock();
407 bValidSize = bValidPrtArea = TRUE;
409 else //if ( GetType() & 0x0018 )
413 if ( Frm().Height() != pAttrs->GetSize().Height() )
414 ChgSize( Size( Frm().Width(), pAttrs->GetSize().Height()));
415 bValidSize = TRUE;
416 MakePos();
417 } while ( !bValidSize );
421 void SwHeadFootFrm::Format(const SwBorderAttrs * pAttrs)
423 ASSERT( pAttrs, "SwFooterFrm::Format, pAttrs ist 0." );
425 if ( bValidPrtArea && bValidSize )
426 return;
428 if ( ! GetEatSpacing() && IsHeaderFrm())
430 SwLayoutFrm::Format(pAttrs);
432 else
434 lcl_LayoutFrmEnsureMinHeight(*this, pAttrs);
436 long nUL = pAttrs->CalcTop() + pAttrs->CalcBottom();
438 if ( !bValidPrtArea )
439 FormatPrt(nUL, pAttrs);
441 if ( !bValidSize )
442 FormatSize(nUL, pAttrs);
446 SwTwips SwHeadFootFrm::GrowFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
448 SwTwips nResult;
450 if ( IsColLocked() )
452 nResult = 0;
454 else if (!GetEatSpacing())
456 nResult = SwLayoutFrm::GrowFrm(nDist, bTst, bInfo);
458 else
460 nResult = 0;
462 SwBorderAttrAccess * pAccess =
463 new SwBorderAttrAccess( SwFrm::GetCache(), this );
464 ASSERT(pAccess, "no border attributes");
466 SwBorderAttrs * pAttrs = pAccess->Get();
468 /* First assume the whole amount to grow can be provided by eating
469 spacing. */
470 SwTwips nEat = nDist;
471 SwTwips nMaxEat;
473 /* calculate maximum eatable spacing */
474 if (IsHeaderFrm())
475 nMaxEat = aFrm.Height() - aPrt.Top() - aPrt.Height() - pAttrs->CalcBottomLine();
476 else
477 nMaxEat = aPrt.Top() - pAttrs->CalcTopLine();
479 delete pAccess;
481 if (nMaxEat < 0)
482 nMaxEat = 0;
484 /* If the frame is too small, eat less spacing thus letting the frame
485 grow more. */
486 SwTwips nMinHeight = lcl_GetFrmMinHeight(*this);
487 SwTwips nFrameTooSmall = nMinHeight - Frm().Height();
489 if (nFrameTooSmall > 0)
490 nEat -= nFrameTooSmall;
492 /* No negative eating, not eating more than allowed. */
493 if (nEat < 0)
494 nEat = 0;
495 else if (nEat > nMaxEat)
496 nEat = nMaxEat;
498 // OD 10.04.2003 #108719# - Notify fly frame, if header frame
499 // grows. Consider, that 'normal' grow of layout frame already notifys
500 // the fly frames.
501 sal_Bool bNotifyFlys = sal_False;
502 if (nEat > 0)
504 if ( ! bTst)
506 if (! IsHeaderFrm())
508 aPrt.Top(aPrt.Top() - nEat);
509 aPrt.Height(aPrt.Height() - nEat);
512 InvalidateAll();
515 nResult += nEat;
516 // OD 14.04.2003 #108719# - trigger fly frame notify.
517 if ( IsHeaderFrm() )
519 bNotifyFlys = sal_True;
523 if (nDist - nEat > 0)
525 SwTwips nFrmGrow =
526 SwLayoutFrm::GrowFrm( nDist - nEat, bTst, bInfo );
528 nResult += nFrmGrow;
529 if ( nFrmGrow > 0 )
531 bNotifyFlys = sal_False;
535 // OD 10.04.2003 #108719# - notify fly frames, if necessary and triggered.
536 if ( ( nResult > 0 ) && bNotifyFlys )
538 NotifyLowerObjs();
542 if ( nResult && !bTst )
543 SetCompletePaint();
545 return nResult;
548 SwTwips SwHeadFootFrm::ShrinkFrm( SwTwips nDist, BOOL bTst, BOOL bInfo )
550 SwTwips nResult;
552 if ( IsColLocked() )
554 nResult = 0;
556 else if (! GetEatSpacing())
558 nResult = SwLayoutFrm::ShrinkFrm(nDist, bTst, bInfo);
560 else
562 nResult = 0;
564 SwTwips nMinHeight = lcl_GetFrmMinHeight(*this);
565 SwTwips nOldHeight = Frm().Height();
566 SwTwips nRest = 0; // Amount to shrink by spitting out spacing
568 if ( nOldHeight >= nMinHeight )
570 /* If the frame's height is bigger than its minimum height, shrink
571 the frame towards its minimum height. If this is not sufficient
572 to provide the shrinking requested provide the rest by spitting
573 out spacing. */
575 SwTwips nBiggerThanMin = nOldHeight - nMinHeight;
577 if (nBiggerThanMin < nDist)
579 nRest = nDist - nBiggerThanMin;
581 /* info: declaration of nRest -> else nRest = 0 */
583 else
584 /* The frame cannot shrink. Provide shrinking by spitting out
585 spacing. */
586 nRest = nDist;
588 // OD 10.04.2003 #108719# - Notify fly frame, if header/footer frame
589 // shrinks. Consider, that 'normal' shrink of layout frame already notifys
590 // the fly frames.
591 sal_Bool bNotifyFlys = sal_False;
592 if (nRest > 0)
595 SwBorderAttrAccess * pAccess =
596 new SwBorderAttrAccess( SwFrm::GetCache(), this );
597 ASSERT(pAccess, "no border attributes");
599 SwBorderAttrs * pAttrs = pAccess->Get();
601 /* minimal height of print area */
602 SwTwips nMinPrtHeight = nMinHeight
603 - pAttrs->CalcTop()
604 - pAttrs->CalcBottom();
606 if (nMinPrtHeight < 0)
607 nMinPrtHeight = 0;
609 delete pAccess;
611 /* assume all shrinking can be provided */
612 SwTwips nShrink = nRest;
614 /* calculate maximum shrinking */
615 SwTwips nMaxShrink = aPrt.Height() - nMinPrtHeight;
617 /* shrink no more than maximum shrinking */
618 if (nShrink > nMaxShrink)
620 //nRest -= nShrink - nMaxShrink;
621 nShrink = nMaxShrink;
624 if (!bTst)
626 if (! IsHeaderFrm() )
628 aPrt.Top(aPrt.Top() + nShrink);
629 aPrt.Height(aPrt.Height() - nShrink);
632 InvalidateAll();
634 nResult += nShrink;
635 // OD 14.04.2003 #108719# - trigger fly frame notify.
636 if ( IsHeaderFrm() )
638 bNotifyFlys = sal_True;
642 /* The shrinking not providable by spitting out spacing has to be done
643 by the frame. */
644 if (nDist - nRest > 0)
646 SwTwips nShrinkAmount = SwLayoutFrm::ShrinkFrm( nDist - nRest, bTst, bInfo );
647 nResult += nShrinkAmount;
648 if ( nShrinkAmount > 0 )
650 bNotifyFlys = sal_False;
654 // OD 10.04.2003 #108719# - notify fly frames, if necessary.
655 if ( ( nResult > 0 ) && bNotifyFlys )
657 NotifyLowerObjs();
661 return nResult;
664 BOOL SwHeadFootFrm::GetEatSpacing() const
666 const SwFrmFmt * pFmt = GetFmt();
667 ASSERT(pFmt, "SwHeadFootFrm: no format?");
669 if (pFmt->GetHeaderAndFooterEatSpacing().GetValue())
670 return TRUE;
672 return FALSE;
676 /*************************************************************************
678 |* SwPageFrm::PrepareHeader()
680 |* Beschreibung Erzeugt oder Entfernt Header
681 |* Ersterstellung MA 04. Feb. 93
682 |* Letzte Aenderung MA 12. May. 96
684 |*************************************************************************/
687 void DelFlys( SwLayoutFrm *pFrm, SwPageFrm *pPage )
689 for ( int i = 0; pPage->GetSortedObjs() &&
690 pPage->GetSortedObjs()->Count() &&
691 i < (int)pPage->GetSortedObjs()->Count(); ++i )
693 SwAnchoredObject* pObj = (*pPage->GetSortedObjs())[i];
694 if ( pObj->ISA(SwFlyFrm) )
696 SwFlyFrm* pFlyFrm = static_cast<SwFlyFrm*>(pObj);
697 if ( pFrm->IsAnLower( pFlyFrm ) )
699 delete pFlyFrm;
700 --i;
708 void SwPageFrm::PrepareHeader()
710 SwLayoutFrm *pLay = (SwLayoutFrm*)Lower();
711 if ( !pLay )
712 return;
714 const SwFmtHeader &rH = ((SwFrmFmt*)pRegisteredIn)->GetHeader();
716 const BOOL bOn = !((SwFrmFmt*)pRegisteredIn)->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
718 if ( bOn && rH.IsActive() )
719 { //Header einsetzen, vorher entfernen falls vorhanden.
720 ASSERT( rH.GetHeaderFmt(), "FrmFmt fuer Header nicht gefunden." );
722 if ( pLay->GetFmt() == (SwFrmFmt*)rH.GetHeaderFmt() )
723 return; //Der Footer ist bereits der richtige
725 if ( pLay->IsHeaderFrm() )
726 { SwLayoutFrm *pDel = pLay;
727 pLay = (SwLayoutFrm*)pLay->GetNext();
728 ::DelFlys( pDel, this );
729 pDel->Cut();
730 delete pDel;
732 ASSERT( pLay, "Wohin mit dem Header?" );
733 SwHeaderFrm *pH = new SwHeaderFrm( (SwFrmFmt*)rH.GetHeaderFmt() );
734 pH->Paste( this, pLay );
735 if ( GetUpper() )
736 ::RegistFlys( this, pH );
738 else if ( pLay && pLay->IsHeaderFrm() )
739 { //Header entfernen falls vorhanden.
740 ::DelFlys( pLay, this );
741 pLay->Cut();
742 delete pLay;
745 /*************************************************************************
747 |* SwPageFrm::PrepareFooter()
749 |* Beschreibung Erzeugt oder Entfernt Footer
750 |* Ersterstellung MA 04. Feb. 93
751 |* Letzte Aenderung MA 12. May. 96
753 |*************************************************************************/
756 void SwPageFrm::PrepareFooter()
758 SwLayoutFrm *pLay = (SwLayoutFrm*)Lower();
759 if ( !pLay )
760 return;
762 const SwFmtFooter &rF = ((SwFrmFmt*)pRegisteredIn)->GetFooter();
763 while ( pLay->GetNext() )
764 pLay = (SwLayoutFrm*)pLay->GetNext();
766 const BOOL bOn = !((SwFrmFmt*)pRegisteredIn)->getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE);
768 if ( bOn && rF.IsActive() )
769 { //Footer einsetzen, vorher entfernen falls vorhanden.
770 ASSERT( rF.GetFooterFmt(), "FrmFmt fuer Footer nicht gefunden." );
772 if ( pLay->GetFmt() == (SwFrmFmt*)rF.GetFooterFmt() )
773 return; //Der Footer ist bereits der richtige.
775 if ( pLay->IsFooterFrm() )
776 { ::DelFlys( pLay, this );
777 pLay->Cut();
778 delete pLay;
780 SwFooterFrm *pF = new SwFooterFrm( (SwFrmFmt*)rF.GetFooterFmt() );
781 pF->Paste( this );
782 if ( GetUpper() )
783 ::RegistFlys( this, pF );
785 else if ( pLay && pLay->IsFooterFrm() )
786 { //Footer entfernen falls vorhanden.
787 ::DelFlys( pLay, this );
788 ViewShell *pSh;
789 if ( pLay->GetPrev() && 0 != (pSh = GetShell()) &&
790 pSh->VisArea().HasArea() )
791 pSh->InvalidateWindows( pSh->VisArea() );
792 pLay->Cut();
793 delete pLay;