Kaydet (Commit) c725ebac authored tarafından Stephan Bergmann's avatar Stephan Bergmann

brown paper bag

Change-Id: If290c03d86d691674b6a50f20f818f2e80d530ac
üst e17fa49d
...@@ -79,7 +79,7 @@ void ValidateText( SwFrm *pFrm ) // Friend of frame ...@@ -79,7 +79,7 @@ void ValidateText( SwFrm *pFrm ) // Friend of frame
void SwTextFrm::ValidateFrm() void SwTextFrm::ValidateFrm()
{ {
// Validate surroundings to avoid oscillation // Validate surroundings to avoid oscillation
SWAP_IF_SWAPPED( this ); SWAP_IF_SWAPPED swap( this );
if ( !IsInFly() && !IsInTab() ) if ( !IsInFly() && !IsInTab() )
{ // Only validate 'this' when inside a fly, the rest should actually only be { // Only validate 'this' when inside a fly, the rest should actually only be
...@@ -132,7 +132,7 @@ void _ValidateBodyFrm( SwFrm *pFrm ) ...@@ -132,7 +132,7 @@ void _ValidateBodyFrm( SwFrm *pFrm )
void SwTextFrm::ValidateBodyFrm() void SwTextFrm::ValidateBodyFrm()
{ {
SWAP_IF_SWAPPED( this ); SWAP_IF_SWAPPED swap( this );
// See comment in ValidateFrm() // See comment in ValidateFrm()
if ( !IsInFly() && !IsInTab() && if ( !IsInFly() && !IsInTab() &&
...@@ -142,7 +142,7 @@ void SwTextFrm::ValidateBodyFrm() ...@@ -142,7 +142,7 @@ void SwTextFrm::ValidateBodyFrm()
bool SwTextFrm::_GetDropRect( SwRect &rRect ) const bool SwTextFrm::_GetDropRect( SwRect &rRect ) const
{ {
SWAP_IF_NOT_SWAPPED(const_cast<SwTextFrm *>(this)); SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(this));
OSL_ENSURE( HasPara(), "SwTextFrm::_GetDropRect: try again next year." ); OSL_ENSURE( HasPara(), "SwTextFrm::_GetDropRect: try again next year." );
SwTextSizeInfo aInf( const_cast<SwTextFrm*>(this) ); SwTextSizeInfo aInf( const_cast<SwTextFrm*>(this) );
...@@ -179,7 +179,7 @@ const SwBodyFrm *SwTextFrm::FindBodyFrm() const ...@@ -179,7 +179,7 @@ const SwBodyFrm *SwTextFrm::FindBodyFrm() const
bool SwTextFrm::CalcFollow( const sal_Int32 nTextOfst ) bool SwTextFrm::CalcFollow( const sal_Int32 nTextOfst )
{ {
SWAP_IF_SWAPPED( this ); SWAP_IF_SWAPPED swap( this );
OSL_ENSURE( HasFollow(), "CalcFollow: missing Follow." ); OSL_ENSURE( HasFollow(), "CalcFollow: missing Follow." );
...@@ -349,7 +349,7 @@ void SwTextFrm::AdjustFrm( const SwTwips nChgHght, bool bHasToFit ) ...@@ -349,7 +349,7 @@ void SwTextFrm::AdjustFrm( const SwTwips nChgHght, bool bHasToFit )
// AdjustFrm is called with a swapped frame during // AdjustFrm is called with a swapped frame during
// formatting but the frame is not swapped during FormatEmpty // formatting but the frame is not swapped during FormatEmpty
SWAP_IF_SWAPPED( this ); SWAP_IF_SWAPPED swap( this );
SWRECTFN ( this ) SWRECTFN ( this )
// The Frame's size variable is incremented by Grow or decremented by Shrink. // The Frame's size variable is incremented by Grow or decremented by Shrink.
...@@ -661,7 +661,7 @@ SwContentFrm *SwTextFrm::JoinFrm() ...@@ -661,7 +661,7 @@ SwContentFrm *SwTextFrm::JoinFrm()
SwContentFrm *SwTextFrm::SplitFrm( const sal_Int32 nTextPos ) SwContentFrm *SwTextFrm::SplitFrm( const sal_Int32 nTextPos )
{ {
SWAP_IF_SWAPPED( this ); SWAP_IF_SWAPPED swap( this );
// The Paste sends a Modify() to me // The Paste sends a Modify() to me
// I lock myself, so that my data does not disappear // I lock myself, so that my data does not disappear
...@@ -853,7 +853,7 @@ bool SwTextFrm::CalcPreps() ...@@ -853,7 +853,7 @@ bool SwTextFrm::CalcPreps()
} }
{ {
SWAP_IF_NOT_SWAPPED( this ); SWAP_IF_NOT_SWAPPED swap( this );
SwTextFormatInfo aInf( this ); SwTextFormatInfo aInf( this );
SwTextFormatter aLine( this, &aInf ); SwTextFormatter aLine( this, &aInf );
...@@ -948,7 +948,7 @@ void SwTextFrm::FormatAdjust( SwTextFormatter &rLine, ...@@ -948,7 +948,7 @@ void SwTextFrm::FormatAdjust( SwTextFormatter &rLine,
const sal_Int32 nStrLen, const sal_Int32 nStrLen,
const bool bDummy ) const bool bDummy )
{ {
SWAP_IF_NOT_SWAPPED( this ); SWAP_IF_NOT_SWAPPED swap( this );
SwParaPortion *pPara = rLine.GetInfo().GetParaPortion(); SwParaPortion *pPara = rLine.GetInfo().GetParaPortion();
......
...@@ -300,7 +300,7 @@ void SwTextFrm::PaintExtraData( const SwRect &rRect ) const ...@@ -300,7 +300,7 @@ void SwTextFrm::PaintExtraData( const SwRect &rRect ) const
return; return;
SwViewShell *pSh = getRootFrm()->GetCurrShell(); SwViewShell *pSh = getRootFrm()->GetCurrShell();
SWAP_IF_NOT_SWAPPED(const_cast<SwTextFrm *>(this)); SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(this));
SwRect rOldRect( rRect ); SwRect rOldRect( rRect );
if ( IsVertical() ) if ( IsVertical() )
...@@ -647,7 +647,7 @@ void SwTextFrm::Paint(SwRect const& rRect, SwPrintData const*const) const ...@@ -647,7 +647,7 @@ void SwTextFrm::Paint(SwRect const& rRect, SwPrintData const*const) const
SwRect aOldRect( rRect ); SwRect aOldRect( rRect );
{ {
SWAP_IF_NOT_SWAPPED(const_cast<SwTextFrm *>(this)); SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(this));
if ( IsVertical() ) if ( IsVertical() )
SwitchVerticalToHorizontal( (SwRect&)rRect ); SwitchVerticalToHorizontal( (SwRect&)rRect );
......
...@@ -410,7 +410,7 @@ SwRect SwTextFly::_GetFrm( const SwRect &rRect, bool bTop ) const ...@@ -410,7 +410,7 @@ SwRect SwTextFly::_GetFrm( const SwRect &rRect, bool bTop ) const
bool SwTextFly::IsAnyFrm() const bool SwTextFly::IsAnyFrm() const
{ {
SWAP_IF_SWAPPED(const_cast<SwTextFrm *>(pCurrFrm)); SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pCurrFrm));
OSL_ENSURE( bOn, "IsAnyFrm: Why?" ); OSL_ENSURE( bOn, "IsAnyFrm: Why?" );
SwRect aRect( pCurrFrm->Frm().Pos() + pCurrFrm->Prt().Pos(), SwRect aRect( pCurrFrm->Frm().Pos() + pCurrFrm->Prt().Pos(),
...@@ -861,7 +861,7 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList() ...@@ -861,7 +861,7 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList()
// #i68520# // #i68520#
OSL_ENSURE( !mpAnchoredObjList, "InitFlyList: FlyList already initialized" ); OSL_ENSURE( !mpAnchoredObjList, "InitFlyList: FlyList already initialized" );
SWAP_IF_SWAPPED(const_cast<SwTextFrm *>(pCurrFrm)); SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pCurrFrm));
const SwSortedObjs *pSorted = pPage->GetSortedObjs(); const SwSortedObjs *pSorted = pPage->GetSortedObjs();
const size_t nCount = pSorted ? pSorted->size() : 0; const size_t nCount = pSorted ? pSorted->size() : 0;
...@@ -1023,7 +1023,7 @@ SwTwips SwTextFly::CalcMinBottom() const ...@@ -1023,7 +1023,7 @@ SwTwips SwTextFly::CalcMinBottom() const
bool SwTextFly::ForEach( const SwRect &rRect, SwRect* pRect, bool bAvoid ) const bool SwTextFly::ForEach( const SwRect &rRect, SwRect* pRect, bool bAvoid ) const
{ {
SWAP_IF_SWAPPED(const_cast<SwTextFrm *>(pCurrFrm)); SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pCurrFrm));
bool bRet = false; bool bRet = false;
// #i68520# // #i68520#
...@@ -1406,7 +1406,7 @@ SwSurround SwTextFly::_GetSurroundForTextWrap( const SwAnchoredObject* pAnchored ...@@ -1406,7 +1406,7 @@ SwSurround SwTextFly::_GetSurroundForTextWrap( const SwAnchoredObject* pAnchored
bool SwTextFly::IsAnyFrm( const SwRect &rLine ) const bool SwTextFly::IsAnyFrm( const SwRect &rLine ) const
{ {
SWAP_IF_SWAPPED(const_cast<SwTextFrm *>(pCurrFrm)); SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pCurrFrm));
OSL_ENSURE( bOn, "IsAnyFrm: Why?" ); OSL_ENSURE( bOn, "IsAnyFrm: Why?" );
......
...@@ -271,7 +271,7 @@ SwFrmSwapper::~SwFrmSwapper() ...@@ -271,7 +271,7 @@ SwFrmSwapper::~SwFrmSwapper()
void SwTextFrm::SwitchLTRtoRTL( SwRect& rRect ) const void SwTextFrm::SwitchLTRtoRTL( SwRect& rRect ) const
{ {
SWAP_IF_NOT_SWAPPED(const_cast<SwTextFrm *>(this)); SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(this));
long nWidth = rRect.Width(); long nWidth = rRect.Width();
rRect.Left( 2 * ( Frm().Left() + Prt().Left() ) + rRect.Left( 2 * ( Frm().Left() + Prt().Left() ) +
...@@ -282,7 +282,7 @@ void SwTextFrm::SwitchLTRtoRTL( SwRect& rRect ) const ...@@ -282,7 +282,7 @@ void SwTextFrm::SwitchLTRtoRTL( SwRect& rRect ) const
void SwTextFrm::SwitchLTRtoRTL( Point& rPoint ) const void SwTextFrm::SwitchLTRtoRTL( Point& rPoint ) const
{ {
SWAP_IF_NOT_SWAPPED(const_cast<SwTextFrm *>(this)); SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(this));
rPoint.X() = 2 * ( Frm().Left() + Prt().Left() ) + Prt().Width() - rPoint.X() - 1; rPoint.X() = 2 * ( Frm().Left() + Prt().Left() ) + Prt().Width() - rPoint.X() - 1;
} }
...@@ -1378,7 +1378,7 @@ void SwTextFrm::PrepWidows( const sal_uInt16 nNeed, bool bNotify ) ...@@ -1378,7 +1378,7 @@ void SwTextFrm::PrepWidows( const sal_uInt16 nNeed, bool bNotify )
sal_uInt16 nHave = nNeed; sal_uInt16 nHave = nNeed;
// We yield a few lines and shrink in CalcPreps() // We yield a few lines and shrink in CalcPreps()
SWAP_IF_NOT_SWAPPED( this ); SWAP_IF_NOT_SWAPPED swap( this );
SwTextSizeInfo aInf( this ); SwTextSizeInfo aInf( this );
SwTextMargin aLine( this, &aInf ); SwTextMargin aLine( this, &aInf );
...@@ -1974,7 +1974,7 @@ bool SwTextFrm::WouldFit( SwTwips &rMaxHeight, bool &bSplit, bool bTst ) ...@@ -1974,7 +1974,7 @@ bool SwTextFrm::WouldFit( SwTwips &rMaxHeight, bool &bSplit, bool bTst )
} }
} }
SWAP_IF_NOT_SWAPPED( this ); SWAP_IF_NOT_SWAPPED swap( this );
SwTextSizeInfo aInf( this ); SwTextSizeInfo aInf( this );
SwTextMargin aLine( this, &aInf ); SwTextMargin aLine( this, &aInf );
...@@ -2044,7 +2044,7 @@ sal_uInt16 SwTextFrm::GetParHeight() const ...@@ -2044,7 +2044,7 @@ sal_uInt16 SwTextFrm::GetParHeight() const
*/ */
SwTextFrm* SwTextFrm::GetFormatted( bool bForceQuickFormat ) SwTextFrm* SwTextFrm::GetFormatted( bool bForceQuickFormat )
{ {
SWAP_IF_SWAPPED( this ); SWAP_IF_SWAPPED swap( this );
// The IdleCollector could've removed my cached information // The IdleCollector could've removed my cached information
// Calc() calls our format // Calc() calls our format
......
...@@ -270,7 +270,7 @@ SwTwips SwTextFrm::GetFootnoteLine( const SwTextFootnote *pFootnote ) const ...@@ -270,7 +270,7 @@ SwTwips SwTextFrm::GetFootnoteLine( const SwTextFootnote *pFootnote ) const
SwTwips nRet; SwTwips nRet;
{ {
SWAP_IF_NOT_SWAPPED(const_cast<SwTextFrm *>(this)); SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(this));
SwTextInfo aInf( pThis ); SwTextInfo aInf( pThis );
SwTextIter aLine( pThis, &aInf ); SwTextIter aLine( pThis, &aInf );
...@@ -303,7 +303,7 @@ SwTwips SwTextFrm::_GetFootnoteFrmHeight() const ...@@ -303,7 +303,7 @@ SwTwips SwTextFrm::_GetFootnoteFrmHeight() const
GetFootnote().IsEndNote() ) ) GetFootnote().IsEndNote() ) )
return 0; return 0;
SWAP_IF_SWAPPED(const_cast<SwTextFrm *>(this)); SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(this));
SwTwips nHeight = pRef->IsInFootnoteConnect() ? SwTwips nHeight = pRef->IsInFootnoteConnect() ?
1 : pRef->GetFootnoteLine( pFootnoteFrm->GetAttr() ); 1 : pRef->GetFootnoteLine( pFootnoteFrm->GetAttr() );
...@@ -804,7 +804,7 @@ SwFootnotePortion *SwTextFormatter::NewFootnotePortion( SwTextFormatInfo &rInf, ...@@ -804,7 +804,7 @@ SwFootnotePortion *SwTextFormatter::NewFootnotePortion( SwTextFormatInfo &rInf,
if( rInf.IsTest() ) if( rInf.IsTest() )
return new SwFootnotePortion( rFootnote.GetViewNumStr( *pDoc ), pFootnote ); return new SwFootnotePortion( rFootnote.GetViewNumStr( *pDoc ), pFootnote );
SWAP_IF_SWAPPED(const_cast<SwTextFrm *>(pFrm)); SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pFrm));
sal_uInt16 nReal; sal_uInt16 nReal;
{ {
...@@ -1105,7 +1105,7 @@ sal_Int32 SwTextFormatter::FormatQuoVadis( const sal_Int32 nOffset ) ...@@ -1105,7 +1105,7 @@ sal_Int32 SwTextFormatter::FormatQuoVadis( const sal_Int32 nOffset )
sal_Int32 nRet; sal_Int32 nRet;
{ {
SWAP_IF_NOT_SWAPPED(const_cast<SwTextFrm *>(pFrm)); SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(pFrm));
nRet = FormatLine( nStart ); nRet = FormatLine( nStart );
} }
......
...@@ -57,7 +57,7 @@ inline bool IsNastyFollow( const SwTextFrm *pFrm ) ...@@ -57,7 +57,7 @@ inline bool IsNastyFollow( const SwTextFrm *pFrm )
SwTextFrmBreak::SwTextFrmBreak( SwTextFrm *pNewFrm, const SwTwips nRst ) SwTextFrmBreak::SwTextFrmBreak( SwTextFrm *pNewFrm, const SwTwips nRst )
: nRstHeight(nRst), pFrm(pNewFrm) : nRstHeight(nRst), pFrm(pNewFrm)
{ {
SWAP_IF_SWAPPED(const_cast<SwTextFrm *>(pFrm)); SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pFrm));
SWRECTFN( pFrm ) SWRECTFN( pFrm )
nOrigin = (pFrm->*fnRect->fnGetPrtTop)(); nOrigin = (pFrm->*fnRect->fnGetPrtTop)();
bKeep = !pFrm->IsMoveable() || IsNastyFollow( pFrm ); bKeep = !pFrm->IsMoveable() || IsNastyFollow( pFrm );
...@@ -104,7 +104,7 @@ bool SwTextFrmBreak::IsInside( SwTextMargin &rLine ) const ...@@ -104,7 +104,7 @@ bool SwTextFrmBreak::IsInside( SwTextMargin &rLine ) const
{ {
bool bFit = false; bool bFit = false;
SWAP_IF_SWAPPED(const_cast<SwTextFrm *>(pFrm)); SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pFrm));
SWRECTFN( pFrm ) SWRECTFN( pFrm )
// nOrigin is an absolut value, rLine referes to the swapped situation. // nOrigin is an absolut value, rLine referes to the swapped situation.
...@@ -161,7 +161,7 @@ bool SwTextFrmBreak::IsInside( SwTextMargin &rLine ) const ...@@ -161,7 +161,7 @@ bool SwTextFrmBreak::IsInside( SwTextMargin &rLine ) const
bool SwTextFrmBreak::IsBreakNow( SwTextMargin &rLine ) bool SwTextFrmBreak::IsBreakNow( SwTextMargin &rLine )
{ {
SWAP_IF_SWAPPED(const_cast<SwTextFrm *>(pFrm)); SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pFrm));
// bKeep is stronger than IsBreakNow() // bKeep is stronger than IsBreakNow()
// Is there enough space ? // Is there enough space ?
...@@ -220,7 +220,7 @@ WidowsAndOrphans::WidowsAndOrphans( SwTextFrm *pNewFrm, const SwTwips nRst, ...@@ -220,7 +220,7 @@ WidowsAndOrphans::WidowsAndOrphans( SwTextFrm *pNewFrm, const SwTwips nRst,
bool bChkKeep ) bool bChkKeep )
: SwTextFrmBreak( pNewFrm, nRst ), nWidLines( 0 ), nOrphLines( 0 ) : SwTextFrmBreak( pNewFrm, nRst ), nWidLines( 0 ), nOrphLines( 0 )
{ {
SWAP_IF_SWAPPED(const_cast<SwTextFrm *>(pFrm)); SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pFrm));
if( bKeep ) if( bKeep )
{ {
...@@ -302,7 +302,7 @@ bool WidowsAndOrphans::FindBreak( SwTextFrm *pFrame, SwTextMargin &rLine, ...@@ -302,7 +302,7 @@ bool WidowsAndOrphans::FindBreak( SwTextFrm *pFrame, SwTextMargin &rLine,
// Thus, assertion on situation, that these are different to figure out why. // Thus, assertion on situation, that these are different to figure out why.
OSL_ENSURE( pFrm == pFrame, "<WidowsAndOrphans::FindBreak> - pFrm != pFrame" ); OSL_ENSURE( pFrm == pFrame, "<WidowsAndOrphans::FindBreak> - pFrm != pFrame" );
SWAP_IF_SWAPPED(const_cast<SwTextFrm *>(pFrm)); SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pFrm));
bool bRet = true; bool bRet = true;
sal_uInt16 nOldOrphans = nOrphLines; sal_uInt16 nOldOrphans = nOrphLines;
......
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