summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2020-03-26 10:02:39 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2020-03-26 13:25:54 +0100
commitd7e9a1a5f7062749633418ed4971cecbbd5c409e (patch)
tree1d116bda99fb32de443cea8e6fbb88bcc5fd76f8 /sc
parent9e7c6ec4fae6fed40cbbf79a3e6e0b491357a178 (diff)
tdf#131593 ScOutputData::GetMergeOrigin: Handle cells outside own area
Rendering the bugdoc had regressed at commit 9113f17e65b1dafbc178fd269e2967c1e2632f0e ("LOK: fast tile rendering (text only)", 2016-06-04), which had changed the area covered by the ScTableInfo in use from the document's whole rendering area to that covered by the bounding rows and columns for the tile being rendered. For the bug doc, it was e.g. no longer detected that cell A10 (nX=0, nY=9) is merged to A1 when processing the "second tile in the second row of tiles" in ScOutputData::DrawEdit. Change-Id: I60c3ad43ad816d2186547486116f63e27ed3a166 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91094 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/output2.cxx28
1 files changed, 21 insertions, 7 deletions
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 141062fd19ca..aae2bc186617 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -917,19 +917,33 @@ bool ScOutputData::GetMergeOrigin( SCCOL nX, SCROW nY, SCSIZE nArrY,
bool bIsLeft = ( nX == nVisX1 );
bool bIsTop = ( nY == nVisY1 ) || bVisRowChanged;
- CellInfo* pInfo = &pRowInfo[nArrY].pCellInfo[nX+1];
- if ( pInfo->bHOverlapped && pInfo->bVOverlapped )
+ bool bHOver;
+ bool bVOver;
+ bool bHidden;
+
+ if (!mpDoc->ColHidden(nX, nTab) && nX >= nX1 && nX <= nX2
+ && !mpDoc->RowHidden(nY, nTab) && nY >= nY1 && nY <= nY2)
+ {
+ CellInfo* pInfo = &pRowInfo[nArrY].pCellInfo[nX+1];
+ bHOver = pInfo->bHOverlapped;
+ bVOver = pInfo->bVOverlapped;
+ }
+ else
+ {
+ ScMF nOverlap2 = mpDoc->GetAttr(nX, nY, nTab, ATTR_MERGE_FLAG)->GetValue();
+ bHOver = bool(nOverlap2 & ScMF::Hor);
+ bVOver = bool(nOverlap2 & ScMF::Ver);
+ }
+
+ if ( bHOver && bVOver )
bDoMerge = bIsLeft && bIsTop;
- else if ( pInfo->bHOverlapped )
+ else if ( bHOver )
bDoMerge = bIsLeft;
- else if ( pInfo->bVOverlapped )
+ else if ( bVOver )
bDoMerge = bIsTop;
rOverX = nX;
rOverY = nY;
- bool bHOver = pInfo->bHOverlapped;
- bool bVOver = pInfo->bVOverlapped;
- bool bHidden;
while (bHOver) // nY constant
{