summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry Castro <hcvcastro@gmail.com>2015-01-09 09:12:40 -0400
committerEike Rathke <erack@redhat.com>2015-01-12 13:36:09 +0000
commitd987ed29051b184aeb5151c1e080ad22c4637835 (patch)
tree25989578175dc0b768c50bc1511cf338593abe7c
parent470fcca594ba4f6bf473d4d44b415c2ba151b0d9 (diff)
fdo#87382 Improper display of selected merged
When left most cell is not in the visible window, Visible Range was not checked merged cells. Change-Id: I3c375c0f584e29444472224c74442bbd3d97b3ac Reviewed-on: https://gerrit.libreoffice.org/13832 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--sc/source/ui/view/gridwin.cxx9
1 files changed, 7 insertions, 2 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index df91fca6793e..0907a3981910 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5740,12 +5740,17 @@ void ScGridWindow::UpdateCursorOverlay()
SCCOL nX = pViewData->GetCurX();
SCROW nY = pViewData->GetCurY();
- if (!maVisibleRange.isInside(nX, nY))
+ ScDocument* pDoc = pViewData->GetDocument();
+ const ScMergeAttr* pMerge = (const ScMergeAttr*) pDoc->GetAttr(nX, nY, nTab, ATTR_MERGE);
+
+ // fdo#87382 Also display the cell cursor for the visible part of merged
+ // cells if the cell position is part of merged cells.
+ if (!(maVisibleRange.isInside(nX, nY) ||
+ maVisibleRange.isInside(nX + pMerge->GetColMerge(), nY + pMerge->GetRowMerge())))
return;
// don't show the cursor in overlapped cells
- ScDocument* pDoc = pViewData->GetDocument();
const ScPatternAttr* pPattern = pDoc->GetPattern(nX,nY,nTab);
const ScMergeFlagAttr& rMergeFlag = static_cast<const ScMergeFlagAttr&>( pPattern->GetItem(ATTR_MERGE_FLAG) );
bool bOverlapped = rMergeFlag.IsOverlapped();