diff options
author | Rodolfo Ribeiro Gomes <rodolforg@gmail.com> | 2013-11-03 22:57:26 -0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2013-11-04 04:10:57 -0600 |
commit | 0432f847bba2e2d074d72a9ff794d680e0f46785 (patch) | |
tree | c85ca9604323819fe47d53618e45ed346d0be95e | |
parent | b64d19a6520871eaee908c79e9aaf76ee477e143 (diff) |
minor cleanup in ScHeaderControl: nCount is always greater than 0
Change-Id: Ia50265e397704131dc948bc2bcbf80a442054b71
Signed-off-by: Rodolfo Ribeiro Gomes <rodolforg@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/6538
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | sc/source/ui/view/hdrcont.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx index 93b57940da24..d5367801f0d4 100644 --- a/sc/source/ui/view/hdrcont.cxx +++ b/sc/source/ui/view/hdrcont.cxx @@ -563,9 +563,9 @@ void ScHeaderControl::Paint( const Rectangle& rRect ) SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, bool& rBorder ) const { bool bFound = false; - SCCOLROW nCount = 1; SCCOLROW nPos = GetPos(); SCCOLROW nHitNo = nPos; + SCCOLROW nEntryNo = 1 + nPos; long nScrPos; long nMousePos = bVertical ? rMEvt.GetPosPixel().Y() : rMEvt.GetPosPixel().X(); long nDif; @@ -579,22 +579,20 @@ SCCOLROW ScHeaderControl::GetMousePos( const MouseEvent& rMEvt, bool& rBorder ) nScrPos = GetScrPos( nPos ) - nLayoutSign; do { - SCCOLROW nEntryNo = nCount + nPos; - if (nEntryNo > nSize) nScrPos = nEndPos + nLayoutSign; else nScrPos += GetEntrySize( nEntryNo - 1 ) * nLayoutSign; //! GetHiddenCount() ?? nDif = nMousePos - nScrPos; - if (nDif >= -2 && nDif <= 2 && nCount > 0) + if (nDif >= -2 && nDif <= 2) { bFound = true; nHitNo=nEntryNo-1; } else if (nDif * nLayoutSign >= 0 && nEntryNo < nSize) nHitNo = nEntryNo; - ++nCount; + ++nEntryNo; } while ( nScrPos * nLayoutSign < nEndPos * nLayoutSign && nDif * nLayoutSign > 0 ); |