Kaydet (Commit) cc804794 authored tarafından Maxime de Roucy's avatar Maxime de Roucy Kaydeden (comit) Cédric Bosdonnat

SwEditShell : use of the STL swap function

üst 5f679b3e
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <tblenum.hxx> #include <tblenum.hxx>
#include <IMark.hxx> #include <IMark.hxx>
#include <algorithm>
#include <vector> #include <vector>
#include <set> #include <set>
#include <swundo.hxx> #include <swundo.hxx>
......
...@@ -116,8 +116,8 @@ sal_Bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet, ...@@ -116,8 +116,8 @@ sal_Bool SwEditShell::GetPaMAttr( SwPaM* pPaM, SfxItemSet& rSet,
if( nSttNd > nEndNd || ( nSttNd == nEndNd && nSttCnt > nEndCnt )) if( nSttNd > nEndNd || ( nSttNd == nEndNd && nSttCnt > nEndCnt ))
{ {
sal_uLong nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp; std::swap(nSttNd, nEndNd);
nTmp = nSttCnt; nSttCnt = nEndCnt; nEndCnt = (xub_StrLen)nTmp; std::swap(nSttCnt, nEndCnt);
} }
if( nEndNd - nSttNd >= getMaxLookup() ) if( nEndNd - nSttNd >= getMaxLookup() )
...@@ -195,11 +195,7 @@ SwTxtFmtColl* SwEditShell::GetPaMTxtFmtColl( SwPaM* pPaM ) const ...@@ -195,11 +195,7 @@ SwTxtFmtColl* SwEditShell::GetPaMTxtFmtColl( SwPaM* pPaM ) const
// reverse start and end if they aren't sorted correctly // reverse start and end if they aren't sorted correctly
if( nSttNd > nEndNd ) if( nSttNd > nEndNd )
{ std::swap(nSttNd, nEndNd);
sal_uLong tmpNd = nSttNd;
nSttNd = nEndNd;
nEndNd = tmpNd;
}
// for all the nodes in the current Point and Mark // for all the nodes in the current Point and Mark
for( sal_uLong n = nSttNd; n <= nEndNd; ++n ) for( sal_uLong n = nSttNd; n <= nEndNd; ++n )
...@@ -343,9 +339,7 @@ sal_Bool SwEditShell::IsMoveLeftMargin( sal_Bool bRight, sal_Bool bModulus ) con ...@@ -343,9 +339,7 @@ sal_Bool SwEditShell::IsMoveLeftMargin( sal_Bool bRight, sal_Bool bModulus ) con
nEndNd = PCURCRSR->GetPoint()->nNode.GetIndex(); nEndNd = PCURCRSR->GetPoint()->nNode.GetIndex();
if( nSttNd > nEndNd ) if( nSttNd > nEndNd )
{ std::swap(nSttNd, nEndNd);
sal_uLong nTmp = nSttNd; nSttNd = nEndNd; nEndNd = nTmp;
}
SwCntntNode* pCNd; SwCntntNode* pCNd;
for( sal_uLong n = nSttNd; bRet && n <= nEndNd; ++n ) for( sal_uLong n = nSttNd; bRet && n <= nEndNd; ++n )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment