summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorLiu Hao <ianahao331@gmail.com>2022-08-15 00:11:55 +0800
committerMike Kaganski <mike.kaganski@collabora.com>2022-08-23 10:45:41 +0200
commit3f284b6f12e3eb047398998b223663b38a9bfec8 (patch)
tree2ab2974b217af76f37a38fdf34f7e5703d974f09 /svx/source
parent27892a5e12dada80226f778ab2bd14b1bdaab58a (diff)
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
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/dialog/rubydialog.cxx6
-rw-r--r--svx/source/xoutdev/_xpoly.cxx6
2 files changed, 2 insertions, 10 deletions
diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx
index 135090c87211..3abd7e9b3517 100644
--- a/svx/source/dialog/rubydialog.cxx
+++ b/svx/source/dialog/rubydialog.cxx
@@ -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.
diff --git a/svx/source/xoutdev/_xpoly.cxx b/svx/source/xoutdev/_xpoly.cxx
index 4d556b1f9feb..e9f0f1ebad15 100644
--- a/svx/source/xoutdev/_xpoly.cxx
+++ b/svx/source/xoutdev/_xpoly.cxx
@@ -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);