tdf#148251 Use std::swap instead of using temporary values

Change-Id: Ibbc46bfb17d4d27dc40e63c65190b3f3a5f2d9c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138256
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
This commit is contained in:
Liu Hao
2022-08-23 10:45:41 +02:00
committed by Mike Kaganski
parent 27892a5e12
commit 3f284b6f12
33 changed files with 69 additions and 252 deletions
+3 -15
View File
@@ -74,23 +74,11 @@ GridLinePoints::GridLinePoints( const PlottingPositionHelper* pPosHelper, sal_In
pPosHelper->doLogicScaling( &MaxX,&MaxY,&MaxZ );
if(!pPosHelper->isMathematicalOrientationX())
{
double fHelp = MinX;
MinX = MaxX;
MaxX = fHelp;
}
std::swap( MinX, MaxX );
if(!pPosHelper->isMathematicalOrientationY())
{
double fHelp = MinY;
MinY = MaxY;
MaxY = fHelp;
}
std::swap( MinY, MaxY );
if(pPosHelper->isMathematicalOrientationZ())//z axis in draw is reverse to mathematical
{
double fHelp = MinZ;
MinZ = MaxZ;
MaxZ = fHelp;
}
std::swap( MinZ, MaxZ );
bool bSwapXY = pPosHelper->isSwapXAndY();
//P0: point on 'back' wall, not on 'left' wall
@@ -400,11 +400,7 @@ inline bool PlottingPositionHelper::clipYRange( double& rMin, double& rMax ) con
{
//returns true if something remains
if( rMin > rMax )
{
double fHelp = rMin;
rMin = rMax;
rMax = fHelp;
}
std::swap( rMin, rMax );
if( rMin > getLogicMaxY() )
return false;
if( rMax < getLogicMinY() )
@@ -418,11 +418,7 @@ double PolarPlottingPositionHelper::getWidthAngleDegree( double& fStartLogicValu
{
const ExplicitScaleData& rAngleScale = m_bSwapXAndY ? m_aScales[1] : m_aScales[0];
if( rAngleScale.Orientation != AxisOrientation_MATHEMATICAL )
{
double fHelp = fEndLogicValueOnAngleAxis;
fEndLogicValueOnAngleAxis = fStartLogicValueOnAngleAxis;
fStartLogicValueOnAngleAxis = fHelp;
}
std::swap( fStartLogicValueOnAngleAxis, fEndLogicValueOnAngleAxis );
double fStartAngleDegree = transformToAngleDegree( fStartLogicValueOnAngleAxis );
double fEndAngleDegree = transformToAngleDegree( fEndLogicValueOnAngleAxis );
+3 -7
View File
@@ -167,13 +167,9 @@ IMPL_LINK_NOARG( DlgQryJoin, LBChangeHdl, weld::ComboBox&, void )
eJoinType = LEFT_JOIN;
break;
case ID_RIGHT_JOIN:
{
pResId = STR_QUERY_LEFTRIGHT_JOIN;
eJoinType = RIGHT_JOIN;
OUString sTemp = sFirstWinName;
sFirstWinName = sSecondWinName;
sSecondWinName = sTemp;
}
pResId = STR_QUERY_LEFTRIGHT_JOIN;
eJoinType = RIGHT_JOIN;
std::swap( sFirstWinName, sSecondWinName );
break;
case ID_FULL_JOIN:
pResId = STR_QUERY_FULL_JOIN;
@@ -112,9 +112,7 @@ void ORelationTableConnectionData::ChangeOrientation()
}
// adapt member
TTableWindowData::value_type pTemp = m_pReferencingTable;
m_pReferencingTable = m_pReferencedTable;
m_pReferencedTable = pTemp;
std::swap( m_pReferencingTable, m_pReferencedTable );
}
void ORelationTableConnectionData::SetCardinality()
+14 -46
View File
@@ -1076,93 +1076,61 @@ void SAL_CALL OComponent::in_methodAll(
// INOUT -----------------------------------------------------------------------------------
void SAL_CALL OComponent::testinout_methodByte(sal_Int8& rOut) throw( RuntimeException )
{
sal_Int8 tmp = rOut;
rOut = m_int8;
m_int8 = tmp;
std::swap( m_int8, rOut );
}
void SAL_CALL OComponent::testinout_methodFloat(float& rOut) throw( RuntimeException )
{
float tmp = rOut;
rOut = m_float;
m_float = tmp;
std::swap( m_float, rOut );
}
void SAL_CALL OComponent::testinout_methodDouble(double& rOut) throw( RuntimeException )
{
double tmp = rOut;
rOut = m_double;
m_double = tmp;
std::swap( m_double, rOut );
}
void SAL_CALL OComponent::testinout_methodBool(sal_Bool& rOut) throw( RuntimeException )
{
sal_Bool tmp = rOut;
rOut = m_bool;
m_bool = tmp;
std::swap( m_bool, rOut );
}
void SAL_CALL OComponent::testinout_methodShort(sal_Int16& rOut) throw( RuntimeException )
{
sal_Int16 tmp= rOut;
rOut = m_int16;
m_int16 = tmp;
std::swap( m_int16, rOut );
}
void SAL_CALL OComponent::testinout_methodUShort(sal_uInt16& rOut) throw( RuntimeException )
{
sal_uInt16 tmp = rOut;
rOut = m_uint16;
m_uint16 = tmp;
std::swap( m_uint16, rOut );
}
void SAL_CALL OComponent::testinout_methodLong(sal_Int32& rOut) throw( RuntimeException )
{
sal_Int32 tmp = rOut;
rOut = m_int32;
m_int32 = tmp;
std::swap( m_int32, rOut );
}
void SAL_CALL OComponent::testinout_methodULong(sal_uInt32& rOut) throw( RuntimeException )
{
sal_uInt32 tmp = rOut;
rOut = m_uint32;
m_uint32 = tmp;
std::swap( m_uint32, rOut );
}
void SAL_CALL OComponent::testinout_methodHyper(sal_Int64& rOut) throw( RuntimeException )
{
sal_Int64 tmp = rOut;
rOut = m_int64;
m_int64 = tmp;
std::swap( m_int64, rOut );
}
void SAL_CALL OComponent::testinout_methodUHyper(sal_uInt64& rOut) throw( RuntimeException )
{
sal_uInt64 tmp = rOut;
rOut = m_uint64;
m_uint64 = tmp;
std::swap( m_uint64, rOut );
}
void SAL_CALL OComponent::testinout_methodString(OUString& rOut) throw( RuntimeException )
{
OUString tmp = rOut;
rOut = m_string;
m_string = tmp;
std::swap( m_string, rOut );
}
void SAL_CALL OComponent::testinout_methodChar(sal_Unicode& rOut) throw( RuntimeException)
{
sal_Unicode tmp = rOut;
rOut = m_char;
m_char = tmp;
std::swap( m_char, rOut );
}
void SAL_CALL OComponent::testinout_methodAny(Any& rOut) throw( RuntimeException)
{
Any tmp = rOut;
rOut = m_any;
m_any = tmp;
std::swap( m_any, rOut );
}
void SAL_CALL OComponent::testinout_methodType(Type& rOut) throw( RuntimeException)
{
Type tmp = rOut;
rOut = m_type;
m_type = tmp;
std::swap( m_type, rOut );
}
void SAL_CALL OComponent::testinout_methodSequence(Sequence< sal_Int32 >& rOut) throw( RuntimeException)
{
+1 -3
View File
@@ -2921,9 +2921,7 @@ void DffPropertyReader::ImportGradientColor( SfxItemSet& aSet, sal_uInt32 eMSO_F
aCol1 = aCol2;
aCol2 = aZwi;
//Swap two colors' transparency
double dTemp = dTrans;
dTrans = dBackTrans;
dBackTrans = dTemp;
std::swap( dTrans, dBackTrans );
}
//Construct gradient item
+2 -5
View File
@@ -4152,11 +4152,8 @@ void HwpReader::makePictureDRAW(HWPDrawingObject *drawobj, const Picture* hbox)
start_angle = atan2(pal.pt[0].y - pal.pt[1].y,pal.pt[1].x - pal.pt[0].x );
end_angle = atan2(pal.pt[2].y - pal.pt[1].y, pal.pt[1].x - pal.pt[2].x);
if( ( start_angle > end_angle ) && (start_angle - end_angle < M_PI )){
double tmp_angle = start_angle;
start_angle = end_angle;
end_angle = tmp_angle;
}
if( ( start_angle > end_angle ) && (start_angle - end_angle < M_PI ))
std::swap( start_angle, end_angle );
mxList->addAttribute("draw:start-angle", sXML_CDATA, OUString::number(basegfx::rad2deg(start_angle)));
mxList->addAttribute("draw:end-angle", sXML_CDATA, OUString::number(basegfx::rad2deg(end_angle)));
+1 -3
View File
@@ -988,10 +988,8 @@ bool ScConditionEntry::IsValid( double nArg, const ScAddress& rPos ) const
if ( eOp == ScConditionMode::Between || eOp == ScConditionMode::NotBetween )
if ( nComp1 > nComp2 )
{
// Right order for value range
double nTemp = nComp1; nComp1 = nComp2; nComp2 = nTemp;
}
std::swap( nComp1, nComp2 );
// All corner cases need to be tested with ::rtl::math::approxEqual!
bool bValid = false;
+1 -5
View File
@@ -756,11 +756,7 @@ bool ScTable::SearchAllStyle(
if (bFound)
{
if (nEndRow<nRow)
{
SCROW nTemp = nRow;
nRow = nEndRow;
nEndRow = nTemp;
}
std::swap( nRow, nEndRow );
rMatchedRanges.Join(ScRange(i, nRow, nTab, i, nEndRow, nTab));
nRow = nEndRow + 1;
bEverFound = true;
+1 -5
View File
@@ -535,11 +535,7 @@ void ScInterpreter::ScNetWorkdays( bool bOOXML_Version )
size_t nRef = 0;
bool bReverse = ( nDate1 > nDate2 );
if ( bReverse )
{
sal_uInt32 nTemp = nDate1;
nDate1 = nDate2;
nDate2 = nTemp;
}
std::swap( nDate1, nDate2 );
size_t nMax = nSortArray.size();
while ( nDate1 <= nDate2 )
{
+1 -5
View File
@@ -4445,11 +4445,7 @@ void ScInterpreter::ScProbability()
else
fLo = fUp;
if (fLo > fUp)
{
double fTemp = fLo;
fLo = fUp;
fUp = fTemp;
}
std::swap( fLo, fUp );
ScMatrixRef pMatP = GetMatrix();
ScMatrixRef pMatW = GetMatrix();
if (!pMatP || !pMatW)
+2 -6
View File
@@ -943,15 +943,11 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq )
if (wraparound > 0) {
if (eOper == ScConditionMode::Between) {
eOper = ScConditionMode::NotBetween;
OUString tmp = aExpr1;
aExpr1 = aExpr2;
aExpr2 = tmp;
std::swap( aExpr1, aExpr2 );
}
else if (eOper == ScConditionMode::NotBetween) {
eOper = ScConditionMode::Between;
OUString tmp = aExpr1;
aExpr1 = aExpr2;
aExpr2 = tmp;
std::swap( aExpr1, aExpr2 );
}
}
}
+1 -3
View File
@@ -200,9 +200,7 @@ void ScGridMerger::Flush()
// (nVarStart / nVarDiff can be modified, aren't used after Flush)
nVarDiff = -nVarDiff;
tools::Long nTemp = nVarStart;
nVarStart = nVarEnd;
nVarEnd = nTemp;
std::swap( nVarStart, nVarEnd );
}
pDev->DrawGrid( tools::Rectangle( nVarStart, nFixStart, nVarEnd, nFixEnd ),
Size( nVarDiff, nFixEnd - nFixStart ),
+3 -15
View File
@@ -1935,11 +1935,7 @@ ReferenceMark ScOutputData::FillReferenceMark( SCCOL nRefStartX, SCROW nRefStart
tools::Long nMaxX = nScrX + nScrW - 1;
tools::Long nMaxY = nScrY + nScrH - 1;
if ( bLayoutRTL )
{
tools::Long nTemp = nMinX;
nMinX = nMaxX;
nMaxX = nTemp;
}
std::swap( nMinX, nMaxX );
tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
bool bTop = false;
@@ -2027,11 +2023,7 @@ void ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY,
tools::Long nMaxX = nScrX + nScrW - 1;
tools::Long nMaxY = nScrY + nScrH - 1;
if ( bLayoutRTL )
{
tools::Long nTemp = nMinX;
nMinX = nMaxX;
nMaxX = nTemp;
}
std::swap( nMinX, nMaxX );
tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
bool bTop = false;
@@ -2154,11 +2146,7 @@ void ScOutputData::DrawOneChange( SCCOL nRefStartX, SCROW nRefStartY,
tools::Long nMaxX = nScrX+nScrW-1;
tools::Long nMaxY = nScrY+nScrH-1;
if ( bLayoutRTL )
{
tools::Long nTemp = nMinX;
nMinX = nMaxX;
nMaxX = nTemp;
}
std::swap( nMinX, nMaxX );
tools::Long nLayoutSign = bLayoutRTL ? -1 : 1;
bool bTop = false;
+1 -5
View File
@@ -2536,11 +2536,7 @@ void ScOutputData::DrawEditParam::getEngineSize(ScFieldEditEngine* pEngine, tool
tools::Long nEngineHeight = pEngine->GetTextHeight();
if (isVerticallyOriented())
{
tools::Long nTemp = nEngineWidth;
nEngineWidth = nEngineHeight;
nEngineHeight = nTemp;
}
std::swap( nEngineWidth, nEngineHeight );
if (meOrient == SvxCellOrientation::Stacked)
nEngineWidth = nEngineWidth * 11 / 10;
+2 -10
View File
@@ -345,11 +345,7 @@ sal_Int32 GetDiffDate( sal_Int32 nNullDate, sal_Int32 nStartDate, sal_Int32 nEnd
bool bNeg = nStartDate > nEndDate;
if( bNeg )
{
sal_Int32 n = nEndDate;
nEndDate = nStartDate;
nStartDate = n;
}
std::swap( nStartDate, nEndDate );
sal_Int32 nRet;
@@ -456,11 +452,7 @@ double GetYearFrac( sal_Int32 nNullDate, sal_Int32 nStartDate, sal_Int32 nEndDat
return 0.0; // nothing to do...
if( nStartDate > nEndDate )
{
sal_Int32 n = nEndDate;
nEndDate = nStartDate;
nStartDate = n;
}
std::swap( nStartDate, nEndDate );
sal_Int32 nDate1 = nStartDate + nNullDate;
sal_Int32 nDate2 = nEndDate + nNullDate;
+1 -5
View File
@@ -741,11 +741,7 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang
sal_Int16 nRubyPos = m_pParentDlg->m_xPositionLB->get_active();
if (nRubyPos == 1) // BOTTOM
{
tools::Long nTmp = nYRuby;
nYRuby = nYBase;
nYBase = nTmp;
}
std::swap(nYRuby, nYBase);
else if (nRubyPos == 2) // RIGHT ( vertically )
{
// Align the ruby text and base text to the vertical center.
+1 -5
View File
@@ -617,11 +617,7 @@ void XPolygon::CalcSmoothJoin(sal_uInt16 nCenter, sal_uInt16 nDrag, sal_uInt16 n
// If nPoint is no control point, i.e. cannot be moved, then
// move nDrag instead on the line between nCenter and nPnt
if ( !IsControl(nPnt) )
{
sal_uInt16 nTmp = nDrag;
nDrag = nPnt;
nPnt = nTmp;
}
std::swap( nDrag, nPnt );
Point* pPoints = pImpXPolygon->pPointAry.get();
Point aDiff = pPoints[nDrag] - pPoints[nCenter];
double fDiv = CalcDistance(nCenter, nDrag);
+1 -5
View File
@@ -3471,11 +3471,7 @@ bool SwAccessibleParagraph::GetSelectionAtIndex(
{
sal_Int32 nCaretPos = GetCaretPos();
if( nStart == nCaretPos )
{
sal_Int32 tmp = nStart;
nStart = nEnd;
nEnd = tmp;
}
std::swap( nStart, nEnd );
}
return bRet;
}
+1 -3
View File
@@ -133,9 +133,7 @@ class SwAccessibleParagraph :
static void OrderRange(sal_Int32& nBegin, sal_Int32& nEnd)
{
if( nBegin > nEnd )
{
sal_Int32 nTmp = nBegin; nBegin = nEnd; nEnd = nTmp;
}
std::swap( nBegin, nEnd );
}
const SwRangeRedline* GetRedlineAtIndex();
+1 -5
View File
@@ -3420,11 +3420,7 @@ bool SwCursorShell::IsSelFullPara() const
sal_Int32 nStt = m_pCurrentCursor->GetPoint()->GetContentIndex();
sal_Int32 nEnd = m_pCurrentCursor->GetMark()->GetContentIndex();
if( nStt > nEnd )
{
sal_Int32 nTmp = nStt;
nStt = nEnd;
nEnd = nTmp;
}
std::swap( nStt, nEnd );
const SwContentNode* pCNd = m_pCurrentCursor->GetPointContentNode();
bRet = pCNd && !nStt && nEnd == pCNd->Len();
}
+2 -6
View File
@@ -801,12 +801,8 @@ bool SwPaM::HasReadonlySel(bool bFormView, bool const isReplace) const
{
SwNodeOffset nSttIdx = GetMark()->GetNodeIndex(),
nEndIdx = GetPoint()->GetNodeIndex();
if( nEndIdx <= nSttIdx )
{
SwNodeOffset nTmp = nSttIdx;
nSttIdx = nEndIdx;
nEndIdx = nTmp;
}
if( nEndIdx < nSttIdx )
std::swap( nSttIdx, nEndIdx );
// If a protected section should be between nodes, then the
// selection needs to contain already x nodes.
+3 -11
View File
@@ -76,9 +76,7 @@ struct PercentHdl
{
bBack = (nStt > nEnd);
if( bBack )
{
sal_uLong n = nStt; nStt = nEnd; nEnd = n;
}
std::swap( nStt, nEnd );
::StartProgress( STR_STATSTR_SEARCH, nStt, nEnd );
}
@@ -101,9 +99,7 @@ struct PercentHdl
nActPos = nStt;
bBack = (nStt > nEnd );
if( bBack )
{
sal_uLong n = nStt; nStt = nEnd; nEnd = n;
}
std::swap( nStt, nEnd );
::StartProgress( STR_STATSTR_SEARCH, nStt, nEnd, pDSh );
}
@@ -304,11 +300,7 @@ bool SwCursor::IsSelOvr( SwCursorSelOverFlags eFlags )
SwNodeOffset nSttIdx = GetMark()->GetNodeIndex(),
nEndIdx = GetPoint()->GetNodeIndex();
if( nEndIdx <= nSttIdx )
{
SwNodeOffset nTmp = nSttIdx;
nSttIdx = nEndIdx;
nEndIdx = nTmp;
}
std::swap( nSttIdx, nEndIdx );
const SwSectionFormats& rFormats = rDoc.GetSections();
for( SwSectionFormats::size_type n = 0; n < rFormats.size(); ++n )
@@ -2714,7 +2714,8 @@ SwRedlineTable::size_type DocumentRedlineManager::GetRedlinePos( const SwNode& r
const SwRangeRedline* pTmp = maRedlineTable[ n ];
SwNodeOffset nPt = pTmp->GetPoint()->GetNodeIndex(),
nMk = pTmp->GetMark()->GetNodeIndex();
if( nPt < nMk ) { SwNodeOffset nTmp = nMk; nMk = nPt; nPt = nTmp; }
if( nPt < nMk )
std::swap( nMk, nPt );
if( ( RedlineType::Any == nType || nType == pTmp->GetType()) &&
nMk <= nNdIdx && nNdIdx <= nPt )
@@ -2956,7 +2957,8 @@ void DocumentRedlineManager::AcceptRedlineParagraphFormatting( const SwPaM &rPam
const SwRangeRedline* pTmp = maRedlineTable[ n ];
SwNodeOffset nPt = pTmp->GetPoint()->GetNodeIndex(),
nMk = pTmp->GetMark()->GetNodeIndex();
if( nPt < nMk ) { SwNodeOffset nTmp = nMk; nMk = nPt; nPt = nTmp; }
if( nPt < nMk )
std::swap( nMk, nPt );
if( RedlineType::ParagraphFormat == pTmp->GetType() &&
( (nSttIdx <= nMk && nMk <= nEndIdx) || (nSttIdx <= nPt && nPt <= nEndIdx) ) )
+2 -10
View File
@@ -754,11 +754,7 @@ void SwDoc::SetTabBorders( const SwCursor& rCursor, const SfxItemSet& rSet )
}
if ( bRTL )
{
bool bTmp = bRightOver;
bRightOver = bLeftOver;
bLeftOver = bTmp;
}
std::swap( bLeftOver, bRightOver );
// Do not set anything by default in HeadlineRepeats
if ( pTab->IsFollow() &&
@@ -1082,11 +1078,7 @@ void SwDoc::GetTabBorders( const SwCursor& rCursor, SfxItemSet& rSet )
}
if ( bRTL )
{
bool bTmp = bRightOver;
bRightOver = bLeftOver;
bLeftOver = bTmp;
}
std::swap( bLeftOver, bRightOver );
const SwFrameFormat *pFormat = pCell->GetFormat();
const SvxBoxItem &rBox = pFormat->GetBox();
+3 -13
View File
@@ -203,9 +203,7 @@ void GetTableSel( const SwCursor& rCursor, SwSelBoxes& rBoxes,
if ( nSttPos != USHRT_MAX && nEndPos != USHRT_MAX )
{
if( nEndPos < nSttPos ) // exchange
{
sal_uInt16 nTmp = nSttPos; nSttPos = nEndPos; nEndPos = nTmp;
}
std::swap( nSttPos, nEndPos );
bool bChkProtected( SwTableSearchType::Protect & eSearchType );
for( ; nSttPos <= nEndPos; ++nSttPos )
@@ -1857,17 +1855,9 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrame *pStart,
nEd2 = aRectFnSet.GetBottom(pTable->getFrameArea());
Point aSt, aEd;
if( nSt1 > nEd1 )
{
tools::Long nTmp = nSt1;
nSt1 = nEd1;
nEd1 = nTmp;
}
std::swap( nSt1, nEd1 );
if( nSt2 > nEd2 )
{
tools::Long nTmp = nSt2;
nSt2 = nEd2;
nEd2 = nTmp;
}
std::swap( nSt2, nEd2 );
if( aRectFnSet.IsVert() )
{
aSt = Point( nSt2, nSt1 );
+1 -5
View File
@@ -281,11 +281,7 @@ void SwHTMLParser::NewDivision( HtmlTokenId nToken )
{
nPos2 = aHRef.lastIndexOf( cDelim, nPos );
if( nPos2 != -1 )
{
sal_Int32 nTmp = nPos;
nPos = nPos2;
nPos2 = nTmp;
}
std::swap( nPos, nPos2 );
}
OUString aURL;
if( nPos == -1 )
+3 -9
View File
@@ -401,15 +401,9 @@ void Gradient::DrawLinearGradientToMetafile(tools::Rectangle const& rRect, GDIMe
// gradient style axial has exchanged start and end colors
if ( !bLinear)
{
tools::Long nTempColor = nStartRed;
nStartRed = nEndRed;
nEndRed = nTempColor;
nTempColor = nStartGreen;
nStartGreen = nEndGreen;
nEndGreen = nTempColor;
nTempColor = nStartBlue;
nStartBlue = nEndBlue;
nEndBlue = nTempColor;
std::swap( nStartRed, nEndRed );
std::swap( nStartGreen, nEndGreen );
std::swap( nStartBlue, nEndBlue );
}
sal_uInt8 nRed;
+3 -9
View File
@@ -269,15 +269,9 @@ void OutputDevice::DrawLinearGradient( const tools::Rectangle& rRect,
// gradient style axial has exchanged start and end colors
if ( !bLinear)
{
tools::Long nTempColor = nStartRed;
nStartRed = nEndRed;
nEndRed = nTempColor;
nTempColor = nStartGreen;
nStartGreen = nEndGreen;
nEndGreen = nTempColor;
nTempColor = nStartBlue;
nStartBlue = nEndBlue;
nEndBlue = nTempColor;
std::swap( nStartRed, nEndRed );
std::swap( nStartGreen, nEndGreen );
std::swap( nStartBlue, nEndBlue );
}
sal_uInt8 nRed;
+2 -10
View File
@@ -52,11 +52,7 @@ void ImplLayoutRuns::AddRun( int nCharPos0, int nCharPos1, bool bRTL )
// swap if needed
if( bRTL == (nCharPos0 < nCharPos1) )
{
int nTemp = nCharPos0;
nCharPos0 = nCharPos1;
nCharPos1 = nTemp;
}
std::swap( nCharPos0, nCharPos1 );
if (maRuns.size() >= 2 && nCharPos0 == maRuns[maRuns.size() - 2] && nCharPos1 == maRuns[maRuns.size() - 1])
{
@@ -77,11 +73,7 @@ bool ImplLayoutRuns::PosIsInRun( int nCharPos ) const
int nMinCharPos = maRuns[ mnRunIndex+0 ];
int nEndCharPos = maRuns[ mnRunIndex+1 ];
if( nMinCharPos > nEndCharPos ) // reversed in RTL case
{
int nTemp = nMinCharPos;
nMinCharPos = nEndCharPos;
nEndCharPos = nTemp;
}
std::swap( nMinCharPos, nEndCharPos );
if( nCharPos < nMinCharPos )
return false;
+1 -5
View File
@@ -853,11 +853,7 @@ void DecorationView::DrawHighlightFrame( const tools::Rectangle& rRect,
}
if ( nStyle == DrawHighlightFrameStyle::In )
{
Color aTempColor = aLightColor;
aLightColor = aShadowColor;
aShadowColor = aTempColor;
}
std::swap( aLightColor, aShadowColor );
DrawFrame( rRect, aLightColor, aShadowColor );
}
+1 -3
View File
@@ -2335,9 +2335,7 @@ void SplitWindow::SplitItem( sal_uInt16 nId, tools::Long nNewSize,
{
nPos--;
nDelta *= -1;
bool bTemp = bPropSmall;
bPropSmall = bPropGreat;
bPropGreat = bTemp;
std::swap( bPropSmall, bPropGreat );
}
sal_uInt16 n;