diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-15 09:05:32 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-15 09:06:25 +0200 |
commit | a8139ccef665f6a6c8a01b06e83b83ba0cc2e058 (patch) | |
tree | efe699a9f804a540d81e160030220e30ed60c979 /sw | |
parent | 7c9a484249da249dea7129ca93f5d1cbf5fbe462 (diff) |
sw: SWAP_IF_ -> SwSwapIf
It's a class, not a macro anymore.
Change-Id: Ia8414d430b2889c834457d8bfd2aa338f2ed994a
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/inc/txtfrm.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/text/frmform.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/text/frmpaint.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/txtfly.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/text/txtfrm.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/text/txtftn.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/text/widorp.cxx | 10 |
7 files changed, 32 insertions, 32 deletions
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx index cc9e9d5871b9..3d4fa5a253ea 100644 --- a/sw/source/core/inc/txtfrm.hxx +++ b/sw/source/core/inc/txtfrm.hxx @@ -763,15 +763,15 @@ private: bool undo_; }; -class SWAP_IF_SWAPPED: private TemporarySwap { +class SwSwapIfSwapped: private TemporarySwap { public: - explicit SWAP_IF_SWAPPED(SwTextFrm * frame): + explicit SwSwapIfSwapped(SwTextFrm* frame): TemporarySwap(frame, frame->IsSwapped()) {} }; -class SWAP_IF_NOT_SWAPPED: private TemporarySwap { +class SwSwapIfNotSwapped: private TemporarySwap { public: - explicit SWAP_IF_NOT_SWAPPED(SwTextFrm * frame): + explicit SwSwapIfNotSwapped(SwTextFrm* frame): TemporarySwap(frame, !frame->IsSwapped()) {} }; diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx index 2a17ffa80eb7..9ff3f4d89a54 100644 --- a/sw/source/core/text/frmform.cxx +++ b/sw/source/core/text/frmform.cxx @@ -80,7 +80,7 @@ void SwTextFrm::ValidateFrm() { vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut(); // Validate surroundings to avoid oscillation - SWAP_IF_SWAPPED swap( this ); + SwSwapIfSwapped swap( this ); if ( !IsInFly() && !IsInTab() ) { // Only validate 'this' when inside a fly, the rest should actually only be @@ -134,7 +134,7 @@ void _ValidateBodyFrm( SwFrm *pFrm ) void SwTextFrm::ValidateBodyFrm() { - SWAP_IF_SWAPPED swap( this ); + SwSwapIfSwapped swap( this ); // See comment in ValidateFrm() if ( !IsInFly() && !IsInTab() && @@ -144,7 +144,7 @@ void SwTextFrm::ValidateBodyFrm() bool SwTextFrm::_GetDropRect( SwRect &rRect ) const { - SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(this)); + SwSwapIfNotSwapped swap(const_cast<SwTextFrm *>(this)); OSL_ENSURE( HasPara(), "SwTextFrm::_GetDropRect: try again next year." ); SwTextSizeInfo aInf( const_cast<SwTextFrm*>(this) ); @@ -182,7 +182,7 @@ const SwBodyFrm *SwTextFrm::FindBodyFrm() const bool SwTextFrm::CalcFollow( const sal_Int32 nTextOfst ) { vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut(); - SWAP_IF_SWAPPED swap( this ); + SwSwapIfSwapped swap( this ); OSL_ENSURE( HasFollow(), "CalcFollow: missing Follow." ); @@ -353,7 +353,7 @@ void SwTextFrm::AdjustFrm( const SwTwips nChgHght, bool bHasToFit ) // AdjustFrm is called with a swapped frame during // formatting but the frame is not swapped during FormatEmpty - SWAP_IF_SWAPPED swap( this ); + SwSwapIfSwapped swap( this ); SWRECTFN ( this ) // The Frame's size variable is incremented by Grow or decremented by Shrink. @@ -665,7 +665,7 @@ SwContentFrm *SwTextFrm::JoinFrm() SwContentFrm *SwTextFrm::SplitFrm( const sal_Int32 nTextPos ) { - SWAP_IF_SWAPPED swap( this ); + SwSwapIfSwapped swap( this ); // The Paste sends a Modify() to me // I lock myself, so that my data does not disappear @@ -857,7 +857,7 @@ bool SwTextFrm::CalcPreps() } { - SWAP_IF_NOT_SWAPPED swap( this ); + SwSwapIfNotSwapped swap( this ); SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this ); SwTextFormatter aLine( this, &aInf ); @@ -952,7 +952,7 @@ void SwTextFrm::FormatAdjust( SwTextFormatter &rLine, const sal_Int32 nStrLen, const bool bDummy ) { - SWAP_IF_NOT_SWAPPED swap( this ); + SwSwapIfNotSwapped swap( this ); SwParaPortion *pPara = rLine.GetInfo().GetParaPortion(); diff --git a/sw/source/core/text/frmpaint.cxx b/sw/source/core/text/frmpaint.cxx index 03bce1496595..bfda652d1bc4 100644 --- a/sw/source/core/text/frmpaint.cxx +++ b/sw/source/core/text/frmpaint.cxx @@ -300,7 +300,7 @@ void SwTextFrm::PaintExtraData( const SwRect &rRect ) const return; SwViewShell *pSh = getRootFrm()->GetCurrShell(); - SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(this)); + SwSwapIfNotSwapped swap(const_cast<SwTextFrm *>(this)); SwRect rOldRect( rRect ); if ( IsVertical() ) @@ -647,7 +647,7 @@ void SwTextFrm::Paint(vcl::RenderContext& rRenderContext, SwRect const& rRect, S SwRect aOldRect( rRect ); { - SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(this)); + SwSwapIfNotSwapped swap(const_cast<SwTextFrm *>(this)); if ( IsVertical() ) SwitchVerticalToHorizontal( (SwRect&)rRect ); diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx index a959e71ed576..0b43c8d00edb 100644 --- a/sw/source/core/text/txtfly.cxx +++ b/sw/source/core/text/txtfly.cxx @@ -410,7 +410,7 @@ SwRect SwTextFly::_GetFrm( const SwRect &rRect, bool bTop ) const bool SwTextFly::IsAnyFrm() const { - SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pCurrFrm)); + SwSwapIfSwapped swap(const_cast<SwTextFrm *>(pCurrFrm)); OSL_ENSURE( bOn, "IsAnyFrm: Why?" ); SwRect aRect( pCurrFrm->Frm().Pos() + pCurrFrm->Prt().Pos(), @@ -861,7 +861,7 @@ SwAnchoredObjList* SwTextFly::InitAnchoredObjList() // #i68520# OSL_ENSURE( !mpAnchoredObjList, "InitFlyList: FlyList already initialized" ); - SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pCurrFrm)); + SwSwapIfSwapped swap(const_cast<SwTextFrm *>(pCurrFrm)); const SwSortedObjs *pSorted = pPage->GetSortedObjs(); const size_t nCount = pSorted ? pSorted->size() : 0; @@ -1023,7 +1023,7 @@ SwTwips SwTextFly::CalcMinBottom() const bool SwTextFly::ForEach( const SwRect &rRect, SwRect* pRect, bool bAvoid ) const { - SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pCurrFrm)); + SwSwapIfSwapped swap(const_cast<SwTextFrm *>(pCurrFrm)); bool bRet = false; // #i68520# @@ -1406,7 +1406,7 @@ SwSurround SwTextFly::_GetSurroundForTextWrap( const SwAnchoredObject* pAnchored bool SwTextFly::IsAnyFrm( const SwRect &rLine ) const { - SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(pCurrFrm)); + SwSwapIfSwapped swap(const_cast<SwTextFrm *>(pCurrFrm)); OSL_ENSURE( bOn, "IsAnyFrm: Why?" ); diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index c996bdcefa3a..2e2e590d498c 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -272,7 +272,7 @@ SwFrmSwapper::~SwFrmSwapper() void SwTextFrm::SwitchLTRtoRTL( SwRect& rRect ) const { - SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(this)); + SwSwapIfNotSwapped swap(const_cast<SwTextFrm *>(this)); long nWidth = rRect.Width(); rRect.Left( 2 * ( Frm().Left() + Prt().Left() ) + @@ -283,7 +283,7 @@ void SwTextFrm::SwitchLTRtoRTL( SwRect& rRect ) const void SwTextFrm::SwitchLTRtoRTL( Point& rPoint ) const { - SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(this)); + SwSwapIfNotSwapped swap(const_cast<SwTextFrm *>(this)); rPoint.X() = 2 * ( Frm().Left() + Prt().Left() ) + Prt().Width() - rPoint.X() - 1; } @@ -1382,7 +1382,7 @@ void SwTextFrm::PrepWidows( const sal_uInt16 nNeed, bool bNotify ) sal_uInt16 nHave = nNeed; // We yield a few lines and shrink in CalcPreps() - SWAP_IF_NOT_SWAPPED swap( this ); + SwSwapIfNotSwapped swap( this ); SwTextSizeInfo aInf( this ); SwTextMargin aLine( this, &aInf ); @@ -1992,7 +1992,7 @@ bool SwTextFrm::WouldFit( SwTwips &rMaxHeight, bool &bSplit, bool bTst ) } } - SWAP_IF_NOT_SWAPPED swap( this ); + SwSwapIfNotSwapped swap( this ); SwTextSizeInfo aInf( this ); SwTextMargin aLine( this, &aInf ); @@ -2063,7 +2063,7 @@ sal_uInt16 SwTextFrm::GetParHeight() const SwTextFrm* SwTextFrm::GetFormatted( bool bForceQuickFormat ) { vcl::RenderContext* pRenderContext = getRootFrm()->GetCurrShell()->GetOut(); - SWAP_IF_SWAPPED swap( this ); + SwSwapIfSwapped swap( this ); // The IdleCollector could've removed my cached information // Calc() calls our format diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx index 4a85368a1f6c..d3b4b305cd3f 100644 --- a/sw/source/core/text/txtftn.cxx +++ b/sw/source/core/text/txtftn.cxx @@ -270,7 +270,7 @@ SwTwips SwTextFrm::GetFootnoteLine( const SwTextFootnote *pFootnote ) const SwTwips nRet; { - SWAP_IF_NOT_SWAPPED swap(const_cast<SwTextFrm *>(this)); + SwSwapIfNotSwapped swap(const_cast<SwTextFrm *>(this)); SwTextInfo aInf( pThis ); SwTextIter aLine( pThis, &aInf ); @@ -303,7 +303,7 @@ SwTwips SwTextFrm::_GetFootnoteFrmHeight() const GetFootnote().IsEndNote() ) ) return 0; - SWAP_IF_SWAPPED swap(const_cast<SwTextFrm *>(this)); + SwSwapIfSwapped swap(const_cast<SwTextFrm *>(this)); SwTwips nHeight = pRef->IsInFootnoteConnect() ? 1 : pRef->GetFootnoteLine( pFootnoteFrm->GetAttr() ); @@ -804,7 +804,7 @@ SwFootnotePortion *SwTextFormatter::NewFootnotePortion( SwTextFormatInfo &rInf, if( rInf.IsTest() ) return new SwFootnotePortion( rFootnote.GetViewNumStr( *pDoc ), pFootnote ); - SWAP_IF_SWAPPED swap(pFrm); + SwSwapIfSwapped swap(pFrm); sal_uInt16 nReal; { @@ -1105,7 +1105,7 @@ sal_Int32 SwTextFormatter::FormatQuoVadis( const sal_Int32 nOffset ) sal_Int32 nRet; { - SWAP_IF_NOT_SWAPPED swap(pFrm); + SwSwapIfNotSwapped swap(pFrm); nRet = FormatLine( nStart ); } diff --git a/sw/source/core/text/widorp.cxx b/sw/source/core/text/widorp.cxx index 3ff2662ea7cd..5ee3ce3c707d 100644 --- a/sw/source/core/text/widorp.cxx +++ b/sw/source/core/text/widorp.cxx @@ -57,7 +57,7 @@ inline bool IsNastyFollow( const SwTextFrm *pFrm ) SwTextFrmBreak::SwTextFrmBreak( SwTextFrm *pNewFrm, const SwTwips nRst ) : nRstHeight(nRst), pFrm(pNewFrm) { - SWAP_IF_SWAPPED swap(pFrm); + SwSwapIfSwapped swap(pFrm); SWRECTFN( pFrm ) nOrigin = (pFrm->*fnRect->fnGetPrtTop)(); bKeep = !pFrm->IsMoveable() || IsNastyFollow( pFrm ); @@ -104,7 +104,7 @@ bool SwTextFrmBreak::IsInside( SwTextMargin &rLine ) const { bool bFit = false; - SWAP_IF_SWAPPED swap(pFrm); + SwSwapIfSwapped swap(pFrm); SWRECTFN( pFrm ) // nOrigin is an absolut value, rLine referes to the swapped situation. @@ -161,7 +161,7 @@ bool SwTextFrmBreak::IsInside( SwTextMargin &rLine ) const bool SwTextFrmBreak::IsBreakNow( SwTextMargin &rLine ) { - SWAP_IF_SWAPPED swap(pFrm); + SwSwapIfSwapped swap(pFrm); // bKeep is stronger than IsBreakNow() // Is there enough space ? @@ -220,7 +220,7 @@ WidowsAndOrphans::WidowsAndOrphans( SwTextFrm *pNewFrm, const SwTwips nRst, bool bChkKeep ) : SwTextFrmBreak( pNewFrm, nRst ), nWidLines( 0 ), nOrphLines( 0 ) { - SWAP_IF_SWAPPED swap(pFrm); + SwSwapIfSwapped swap(pFrm); if( bKeep ) { @@ -302,7 +302,7 @@ bool WidowsAndOrphans::FindBreak( SwTextFrm *pFrame, SwTextMargin &rLine, // Thus, assertion on situation, that these are different to figure out why. OSL_ENSURE( pFrm == pFrame, "<WidowsAndOrphans::FindBreak> - pFrm != pFrame" ); - SWAP_IF_SWAPPED swap(pFrm); + SwSwapIfSwapped swap(pFrm); bool bRet = true; sal_uInt16 nOldOrphans = nOrphLines; |