diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-03-24 04:17:07 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-03-24 05:14:17 +0100 |
commit | bfa20cd32c825cfe8dbdb93399ed99544d8c8647 (patch) | |
tree | ae42deccf556dfa26bf00092267ebd23fd02f715 /sc | |
parent | bf535cbfdaa3edde7afaa6167092717ca7b98b9f (diff) |
simplify the use of nMaxTab a bit
Change-Id: I8b21575f7a9e659e9b00f381c2fd7a1e117d67cb
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/tool/address.cxx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 7b70845a9236..abae2c31f8ef 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1944,7 +1944,7 @@ void ScRange::Format( OUString& r, sal_uInt16 nFlags, const ScDocument* pDoc, bool ScAddress::Move( SCsCOL dx, SCsROW dy, SCsTAB dz, ScDocument* pDoc ) { - SCsTAB nMaxTab = pDoc ? pDoc->GetTableCount() : MAXTAB+1; + SCsTAB nMaxTab = pDoc ? pDoc->GetTableCount() : MAXTAB; dx = Col() + dx; dy = Row() + dy; dz = Tab() + dz; @@ -1959,8 +1959,8 @@ bool ScAddress::Move( SCsCOL dx, SCsROW dy, SCsTAB dz, ScDocument* pDoc ) dy = MAXROW, bValid =false; if( dz < 0 ) dz = 0, bValid = false; - else if( dz >= nMaxTab ) - dz = nMaxTab-1, bValid =false; + else if( dz > nMaxTab ) + dz = nMaxTab, bValid =false; Set( dx, dy, dz ); return bValid; } |