summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2015-03-31 14:35:17 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-04-07 09:18:10 +0200
commit4d9532d7ce625a5c0f9efd2655bb3cada92cf84f (patch)
treeb6a21351f4674ecffe0eb49b1546aec49ba86b8e
parent0877317247a78c7d38eeff16c252a50f8f9b61eb (diff)
sc tiled editing: Don't show the cell selection when editing text in shape.
Change-Id: I1ddaa02e64a912c880faec9f907e9526432f6bcd
-rw-r--r--sc/source/ui/view/gridwin.cxx29
1 files changed, 18 insertions, 11 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 69ed68c4300d..509831373f2f 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5764,6 +5764,22 @@ 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->HasEditView(eWhich)))
+ {
+ return;
+ }
+
MapMode aDrawMode = GetDrawMapMode();
MapMode aOldMode = GetMapMode();
if ( aOldMode != aDrawMode )
@@ -5782,7 +5798,6 @@ void ScGridWindow::UpdateCursorOverlay()
SCCOL nX = pViewData->GetCurX();
SCROW nY = pViewData->GetCurY();
- ScDocument* pDoc = pViewData->GetDocument();
const ScPatternAttr* pPattern = pDoc->GetPattern(nX,nY,nTab);
if (!maVisibleRange.isInside(nX, nY))
@@ -5840,7 +5855,6 @@ void ScGridWindow::UpdateCursorOverlay()
}
// in the tiled rendering case, don't limit to the screen size
- bool bIsTiledRendering = pDoc->GetDrawLayer()->isTiledRendering();
if (bMaybeVisible || bIsTiledRendering)
{
long nSizeXPix;
@@ -5925,15 +5939,8 @@ void ScGridWindow::UpdateCursorOverlay()
mpOOCursors.reset(new sdr::overlay::OverlayObjectList);
mpOOCursors->append(*pOverlay);
- // notify the LibreOfficeKit too, but only if there's no
- // selection yet (either cell selection, or graphic object),
- // to avoid setting the LOK selection twice
- // (once for the cell only, and then for the selection)
- if (!pViewData->GetMarkData().IsMarked() && !pViewData->GetMarkData().IsMultiMarked() &&
- !pViewData->GetViewShell()->GetScDrawView()->IsMarking())
- {
- updateLibreOfficeKitSelection(pViewData, pDoc->GetDrawLayer(), aPixelRects);
- }
+ // notify the LibreOfficeKit too
+ updateLibreOfficeKitSelection(pViewData, pDoc->GetDrawLayer(), aPixelRects);
}
}