summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMaxime de Roucy <mderoucy@linagora.com>2012-03-13 17:10:55 +0100
committerCédric Bosdonnat <cedric.bosdonnat.ooo@free.fr>2012-03-15 16:57:45 +0100
commitcc8047941dc93d686568541391af56209df53f0a (patch)
tree6231db2ee47fdedbfaff3564b9cbab67419493c2 /sw
parent5f679b3e8109cac5881d244a63bcdbc8fd21341d (diff)
SwEditShell : use of the STL swap function
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/editsh.hxx1
-rw-r--r--sw/source/core/edit/edattr.cxx14
2 files changed, 5 insertions, 10 deletions
diff --git a/sw/inc/editsh.hxx b/sw/inc/editsh.hxx
index 02b61f16a509..a160b6ef909c 100644
--- a/sw/inc/editsh.hxx
+++ b/sw/inc/editsh.hxx
@@ -44,6 +44,7 @@
#include <tblenum.hxx>
#include <IMark.hxx>
+#include <algorithm>
#include <vector>
#include <set>
#include <swundo.hxx>
diff --git a/sw/source/core/edit/edattr.cxx b/sw/source/core/edit/edattr.cxx
index 7f53689a18c1..b189c992e879 100644
--- a/sw/source/core/edit/edattr.cxx
+++ b/sw/source/core/edit/edattr.cxx
@@ -116,8 +116,8 @@ sal_Bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
if( nSttNd > nEndNd || ( nSttNd == nEndNd && nSttCnt > nEndCnt ))
{
- sal_uLong nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp;
- nTmp = nSttCnt; nSttCnt = nEndCnt; nEndCnt = (xub_StrLen)nTmp;
+ std::swap(nSttNd, nEndNd);
+ std::swap(nSttCnt, nEndCnt);
}
if( nEndNd - nSttNd >= getMaxLookup() )
@@ -195,11 +195,7 @@ SwTxtFmtColl* SwEditShell::GetPaMTxtFmtColl( SwPaM* pPaM ) const
// reverse start and end if they aren't sorted correctly
if( nSttNd > nEndNd )
- {
- sal_uLong tmpNd = nSttNd;
- nSttNd = nEndNd;
- nEndNd = tmpNd;
- }
+ std::swap(nSttNd, nEndNd);
// for all the nodes in the current Point and Mark
for( sal_uLong n = nSttNd; n <= nEndNd; ++n )
@@ -343,9 +339,7 @@ sal_Bool SwEditShell::IsMoveLeftMargin( sal_Bool bRight, sal_Bool bModulus ) con
nEndNd = PCURCRSR->GetPoint()->nNode.GetIndex();
if( nSttNd > nEndNd )
- {
- sal_uLong nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp;
- }
+ std::swap(nSttNd, nEndNd);
SwCntntNode* pCNd;
for( sal_uLong n = nSttNd; bRet && n <= nEndNd; ++n )