summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-03-31 13:15:23 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-04-07 09:18:09 +0200
commit2f230dbb13455f045aed156d55ea5776b305a4f5 (patch)
tree166e4fad0b4707ca41c887f6602a68202c4f5520
parent21bc58db192459313669ae7ca58d2e003c8c8a20 (diff)
sc tiled editing: Show the cell cursor as a rect, not as a frame.
Change-Id: I323f38fffb354b8f5701780b9078aefbfe3e8040
-rw-r--r--sc/source/ui/view/gridwin.cxx61
1 files changed, 37 insertions, 24 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 7b1959f5f49b..69ed68c4300d 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5838,7 +5838,10 @@ void ScGridWindow::UpdateCursorOverlay()
Size aOutSize = GetOutputSizePixel();
bMaybeVisible = ( aScrPos.X() <= aOutSize.Width() + 2 && aScrPos.Y() <= aOutSize.Height() + 2 );
}
- if ( bMaybeVisible )
+
+ // in the tiled rendering case, don't limit to the screen size
+ bool bIsTiledRendering = pDoc->GetDrawLayer()->isTiledRendering();
+ if (bMaybeVisible || bIsTiledRendering)
{
long nSizeXPix;
long nSizeYPix;
@@ -5847,36 +5850,46 @@ void ScGridWindow::UpdateCursorOverlay()
if (bLayoutRTL)
aScrPos.X() -= nSizeXPix - 2; // move instead of mirroring
- Rectangle aRect( aScrPos, Size( nSizeXPix - 1, nSizeYPix - 1) );
+ 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));
- 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);
+ }
}
}