summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-04-07 23:54:49 +0200
committerJan Holesovsky <kendy@collabora.com>2015-04-08 00:04:07 +0200
commit2bbce7dcd46e8aca716808602aa152ecd85b42af (patch)
tree5feecd524470804874702cf002a8188f86b469e3 /sc
parent3a864cdb556a583ad4cec2bbeef9c7959d56dd91 (diff)
sc tiled editing: Never show the cell cursor.
With the current behavior, showing the cell cursor is counter-intuitive and counter productive - we focus more on the editing itself. It is still possible to select just one cell though - it is the cell selection that starts and ends in the same cell. Change-Id: Ie6d96783d486c6fcda5b4c4f6acf91c1926cdf6c
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/gridwin.cxx78
1 files changed, 30 insertions, 48 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d7d56e0d671e..770166d9d5cb 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5782,21 +5782,12 @@ static void updateLibreOfficeKitSelection(ScViewData* pViewData, ScDrawLayer* pD
void ScGridWindow::UpdateCursorOverlay()
{
ScDocument* pDoc = pViewData->GetDocument();
- bool bIsTiledRendering = pDoc->GetDrawLayer()->isTiledRendering();
-
- // in the tiled rendering case, exit early if we are not supposed to draw
- // the cell cursor:
- // - there is a selection (either cell selection, or graphic object)
- // - the user is typing inside a shape or so
- if (bIsTiledRendering &&
- (pViewData->GetMarkData().IsMarked() || pViewData->GetMarkData().IsMultiMarked() ||
- pViewData->GetViewShell()->GetScDrawView()->IsMarking() ||
- pViewData->GetViewShell()->GetScDrawView()->IsTextEdit() ||
- pViewData->GetViewShell()->GetScDrawView()->GetDragStat().IsShown() ||
- pViewData->HasEditView(eWhich)))
- {
+
+ // never show the cell cursor when the tiled rendering is going on; either
+ // we want to show the editeng selection, or the cell selection, but not
+ // the cell cursor by itself
+ if (pDoc->GetDrawLayer()->isTiledRendering())
return;
- }
MapMode aDrawMode = GetDrawMapMode();
MapMode aOldMode = GetMapMode();
@@ -5873,7 +5864,7 @@ void ScGridWindow::UpdateCursorOverlay()
}
// in the tiled rendering case, don't limit to the screen size
- if (bMaybeVisible || bIsTiledRendering)
+ if (bMaybeVisible)
{
long nSizeXPix;
long nSizeYPix;
@@ -5882,46 +5873,37 @@ void ScGridWindow::UpdateCursorOverlay()
if (bLayoutRTL)
aScrPos.X() -= nSizeXPix - 2; // move instead of mirroring
- if (bIsTiledRendering)
- {
- // just forward the area to LOK
- Rectangle aRect(aScrPos, Size(nSizeXPix, nSizeYPix));
- aPixelRects.push_back(aRect);
- }
- else
- {
- // show the cursor as 4 (thin) rectangles
- Rectangle aRect(aScrPos, Size(nSizeXPix - 1, nSizeYPix - 1));
+ // show the cursor as 4 (thin) rectangles
+ Rectangle aRect(aScrPos, Size(nSizeXPix - 1, nSizeYPix - 1));
- sal_Int32 nScale = GetDPIScaleFactor();
+ sal_Int32 nScale = GetDPIScaleFactor();
- long aCursorWidth = 1 * nScale;
+ long aCursorWidth = 1 * nScale;
- Rectangle aLeft = Rectangle(aRect);
- aLeft.Top() -= aCursorWidth;
- aLeft.Bottom() += aCursorWidth;
- aLeft.Right() = aLeft.Left();
- aLeft.Left() -= aCursorWidth;
+ Rectangle aLeft = Rectangle(aRect);
+ aLeft.Top() -= aCursorWidth;
+ aLeft.Bottom() += aCursorWidth;
+ aLeft.Right() = aLeft.Left();
+ aLeft.Left() -= aCursorWidth;
- Rectangle aRight = Rectangle(aRect);
- aRight.Top() -= aCursorWidth;
- aRight.Bottom() += aCursorWidth;
- aRight.Left() = aRight.Right();
- aRight.Right() += aCursorWidth;
+ Rectangle aRight = Rectangle(aRect);
+ aRight.Top() -= aCursorWidth;
+ aRight.Bottom() += aCursorWidth;
+ aRight.Left() = aRight.Right();
+ aRight.Right() += aCursorWidth;
- Rectangle aTop = Rectangle(aRect);
- aTop.Bottom() = aTop.Top();
- aTop.Top() -= aCursorWidth;
+ Rectangle aTop = Rectangle(aRect);
+ aTop.Bottom() = aTop.Top();
+ aTop.Top() -= aCursorWidth;
- Rectangle aBottom = Rectangle(aRect);
- aBottom.Top() = aBottom.Bottom();
- aBottom.Bottom() += aCursorWidth;
+ Rectangle aBottom = Rectangle(aRect);
+ aBottom.Top() = aBottom.Bottom();
+ aBottom.Bottom() += aCursorWidth;
- aPixelRects.push_back(aLeft);
- aPixelRects.push_back(aRight);
- aPixelRects.push_back(aTop);
- aPixelRects.push_back(aBottom);
- }
+ aPixelRects.push_back(aLeft);
+ aPixelRects.push_back(aRight);
+ aPixelRects.push_back(aTop);
+ aPixelRects.push_back(aBottom);
}
}