diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2022-04-11 11:49:59 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2022-04-11 13:19:07 +0200 |
commit | 9c5facd726e3d5148d17ad547213afe0874ea910 (patch) | |
tree | 0d6c643a67eb9fc96ea5a6da1de08dd3e305d191 | |
parent | bdfab729df65d782bdc1aad53b8b1a413062847d (diff) |
android: Pass variable for "selected" param
... of the CalcHeaderCell ctor, to simplify this a bit.
Change-Id: I02ff00acccaec26de54534c6c021b9cd05f1d472
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132813
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r-- | android/source/src/java/org/libreoffice/overlay/CalcHeadersView.java | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/android/source/src/java/org/libreoffice/overlay/CalcHeadersView.java b/android/source/src/java/org/libreoffice/overlay/CalcHeadersView.java index a8b2d2048409..50a1bfbdc6b0 100644 --- a/android/source/src/java/org/libreoffice/overlay/CalcHeadersView.java +++ b/android/source/src/java/org/libreoffice/overlay/CalcHeadersView.java @@ -101,12 +101,8 @@ public class CalcHeadersView extends View { bottom = -origin.y + zoom*mDimens.get(i); if (top <= getHeight() && bottom >= 0) { inRangeOfVisibleHeaders = true; - if (mCellCursorRect != null && bottom > mCellCursorRect.top - origin.y && top < mCellCursorRect.bottom - origin.y) { - // if cell is within current selected portion - new CalcHeaderCell(0f, top, getWidth(), bottom - top, mLabels.get(i), true).onDraw(canvas); - } else { - new CalcHeaderCell(0f, top, getWidth(), bottom - top, mLabels.get(i), false).onDraw(canvas); - } + boolean isSelected = mCellCursorRect != null && bottom > mCellCursorRect.top - origin.y && top < mCellCursorRect.bottom - origin.y; + new CalcHeaderCell(0f, top, getWidth(), bottom - top, mLabels.get(i), isSelected).onDraw(canvas); } else { if (inRangeOfVisibleHeaders) { break; @@ -116,12 +112,8 @@ public class CalcHeadersView extends View { left = -origin.x + zoom*mDimens.get(i-1); right = -origin.x + zoom*mDimens.get(i); if (left <= getWidth() && right >= 0) { - if (mCellCursorRect != null && right > mCellCursorRect.left - origin.x && left < mCellCursorRect.right - origin.x) { - // if cell is within current selected portion - new CalcHeaderCell(left, 0f, right - left, getHeight(), mLabels.get(i), true).onDraw(canvas); - } else { - new CalcHeaderCell(left, 0f, right - left, getHeight(), mLabels.get(i), false).onDraw(canvas); - } + boolean isSelected = mCellCursorRect != null && right > mCellCursorRect.left - origin.x && left < mCellCursorRect.right - origin.x; + new CalcHeaderCell(left, 0f, right - left, getHeight(), mLabels.get(i), isSelected).onDraw(canvas); } else { if (inRangeOfVisibleHeaders) { break; |