[Libreoffice-commits] core.git: sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Sep 15 00:06:52 PDT 2015
sw/source/core/inc/txtfrm.hxx | 8 ++++----
sw/source/core/text/frmform.cxx | 16 ++++++++--------
sw/source/core/text/frmpaint.cxx | 4 ++--
sw/source/core/text/txtfly.cxx | 8 ++++----
sw/source/core/text/txtfrm.cxx | 10 +++++-----
sw/source/core/text/txtftn.cxx | 8 ++++----
sw/source/core/text/widorp.cxx | 10 +++++-----
7 files changed, 32 insertions(+), 32 deletions(-)
New commits:
commit a8139ccef665f6a6c8a01b06e83b83ba0cc2e058
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Sep 15 09:05:32 2015 +0200
sw: SWAP_IF_ -> SwSwapIf
It's a class, not a macro anymore.
Change-Id: Ia8414d430b2889c834457d8bfd2aa338f2ed994a
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index cc9e9d5..3d4fa5a 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 2a17ffa..9ff3f4d 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 03bce14..bfda652 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 a959e71..0b43c8d 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 c996bdc..2e2e590 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 4a85368..d3b4b30 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 3ff2662..5ee3ce3 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;
More information about the Libreoffice-commits
mailing list