Kaydet (Commit) 118dfcf1 authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS sw011 (1.22.2.2.26); FILE MERGED

2003/04/11 13:21:35 od 1.22.2.2.26.3: #108824# <SwFrm::GetPrevSctLeaf(..)> - consider zombie sections, but investigate next frames of found zombie section
2003/04/11 07:06:46 fme 1.22.2.2.26.2: #108619# #108745# Fly frames and footer loops
2003/04/07 10:48:25 od 1.22.2.2.26.1: #108446# - <SwSectionFrm::CalcFtnCntnt()> - consider that footnote/endnote can move; include changes from 108339
üst a9b6109c
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: sectfrm.cxx,v $ * $RCSfile: sectfrm.cxx,v $
* *
* $Revision: 1.26 $ * $Revision: 1.27 $
* *
* last change: $Author: vg $ $Date: 2003-04-17 14:15:25 $ * last change: $Author: vg $ $Date: 2003-04-17 16:07:52 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -1350,7 +1350,7 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr ) ...@@ -1350,7 +1350,7 @@ void SwSectionFrm::Format( const SwBorderAttrs *pAttr )
{ {
if( !GetNext() ) if( !GetNext() )
SetRetouche(); // Dann muessen wir die Retusche selbst uebernehmen SetRetouche(); // Dann muessen wir die Retusche selbst uebernehmen
if( GetUpper() ) if( GetUpper() && !GetUpper()->IsFooterFrm() )
GetUpper()->Shrink( nDiff PHEIGHT ); GetUpper()->Shrink( nDiff PHEIGHT );
} }
if( IsUndersized() ) if( IsUndersized() )
...@@ -1680,10 +1680,24 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType eMakeFtn ) ...@@ -1680,10 +1680,24 @@ SwLayoutFrm *SwFrm::GetPrevSctLeaf( MakePageType eMakeFtn )
// If there is a pLayLeaf has a lower pLayLeaf is the frame we are looking for. // If there is a pLayLeaf has a lower pLayLeaf is the frame we are looking for.
// Exception: pLayLeaf->Lower() is a zombie section frame // Exception: pLayLeaf->Lower() is a zombie section frame
const SwFrm* pTmp = pLayLeaf->Lower(); const SwFrm* pTmp = pLayLeaf->Lower();
// OD 11.04.2003 #108824# - consider, that the zombie section frame
// can have frame below it in the found layout leaf.
// Thus, skipping zombie section frame, if possible.
while ( pTmp && pTmp->IsSctFrm() &&
!( static_cast<const SwSectionFrm*>(pTmp)->GetSection() ) &&
pTmp->GetNext()
)
{
pTmp = pTmp->GetNext();
}
if ( pTmp && if ( pTmp &&
( ! pTmp->IsSctFrm() || ( !pTmp->IsSctFrm() ||
((SwSectionFrm*)pTmp)->GetSection() ) ) ( static_cast<const SwSectionFrm*>(pTmp)->GetSection() )
)
)
{
break; break;
}
pPrevLeaf = pLayLeaf; pPrevLeaf = pLayLeaf;
pLayLeaf = pLayLeaf->GetPrevLayoutLeaf(); pLayLeaf = pLayLeaf->GetPrevLayoutLeaf();
if ( pLayLeaf ) if ( pLayLeaf )
...@@ -1858,8 +1872,7 @@ SwTwips SwSectionFrm::_Grow( SwTwips nDist, BOOL bTst ) ...@@ -1858,8 +1872,7 @@ SwTwips SwSectionFrm::_Grow( SwTwips nDist, BOOL bTst )
SetCompletePaint(); SetCompletePaint();
InvalidatePage(); InvalidatePage();
} }
if( GetUpper() && ( GetUpper()->IsHeaderFrm() || if( GetUpper() && GetUpper()->IsHeaderFrm() )
GetUpper()->IsFooterFrm() ) )
GetUpper()->InvalidateSize(); GetUpper()->InvalidateSize();
} }
(Frm().*fnRect->fnAddBottom)( nGrow ); (Frm().*fnRect->fnAddBottom)( nGrow );
...@@ -1939,7 +1952,24 @@ SwTwips SwSectionFrm::_Shrink( SwTwips nDist, BOOL bTst ) ...@@ -1939,7 +1952,24 @@ SwTwips SwSectionFrm::_Shrink( SwTwips nDist, BOOL bTst )
(Frm().*fnRect->fnAddBottom)( -nDist ); (Frm().*fnRect->fnAddBottom)( -nDist );
long nPrtHeight = (Prt().*fnRect->fnGetHeight)() - nDist; long nPrtHeight = (Prt().*fnRect->fnGetHeight)() - nDist;
(Prt().*fnRect->fnSetHeight)( nPrtHeight ); (Prt().*fnRect->fnSetHeight)( nPrtHeight );
const SwTwips nReal = GetUpper()->Shrink( nDist, bTst );
SwTwips nReal = 0;
// We do not allow a section frame to shrink the its upper
// footer frame. This is because in the calculation of a
// footer frame, the content of the section frame is _not_
// calculated. If there is a fly frame overlapping with the
// footer frame, the section frame is not affected by this
// during the calculation of the footer frame size.
// The footer frame does not grow in its FormatSize function
// but during the calculation of the content of the section
// frame. The section frame grows until some of its text is
// located on top of the fly frame. The next call of CalcCntnt
// tries to shrink the section and here it would also shrink
// the footer. This may not happen, because shrinking the footer
// would cause the top of the section frame to overlap with the
// fly frame again, this would result in a perfect loop.
if( !GetUpper()->IsFooterFrm() )
nReal = GetUpper()->Shrink( nDist, bTst );
if( Lower() && Lower()->IsColumnFrm() && Lower()->GetNext() ) if( Lower() && Lower()->IsColumnFrm() && Lower()->GetNext() )
{ {
...@@ -2426,6 +2456,11 @@ long SwSectionFrm::Undersize( BOOL bOverSize ) ...@@ -2426,6 +2456,11 @@ long SwSectionFrm::Undersize( BOOL bOverSize )
return nRet; return nRet;
} }
/// OD 01.04.2003 #108446# - determine next frame for footnote/endnote formatting
/// before format of current one, because current one can move backward.
/// After moving backward to a previous page method <FindNext()> will return
/// the text frame presenting the first page footnote, if it exists. Thus, the
/// rest of the footnote/endnote container would not be formatted.
void SwSectionFrm::CalcFtnCntnt() void SwSectionFrm::CalcFtnCntnt()
{ {
SwFtnContFrm* pCont = ContainsFtnCont(); SwFtnContFrm* pCont = ContainsFtnCont();
...@@ -2439,17 +2474,20 @@ void SwSectionFrm::CalcFtnCntnt() ...@@ -2439,17 +2474,20 @@ void SwSectionFrm::CalcFtnCntnt()
SwFtnFrm* pFtn = pFrm->FindFtnFrm(); SwFtnFrm* pFtn = pFrm->FindFtnFrm();
if( pFtn ) if( pFtn )
pFtn->Calc(); pFtn->Calc();
pFrm->Calc(); // OD 01.04.2003 #108446# - determine next frame before format current frame.
if( pFrm->IsSctFrm() ) SwFrm* pNextFrm = 0;
{ {
SwFrm *pTmp = ((SwSectionFrm*)pFrm)->ContainsAny(); if( pFrm->IsSctFrm() )
if( pTmp )
{ {
pFrm = pTmp; pNextFrm = static_cast<SwSectionFrm*>(pFrm)->ContainsAny();
continue; }
if( !pNextFrm )
{
pNextFrm = pFrm->FindNext();
} }
} }
pFrm = pFrm->FindNext(); pFrm->Calc();
pFrm = pNextFrm;
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment