sc/source/ui/view/output2.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
New commits: commit 09a055c7457b005e1d7c733dc951dd8469c75411 Author: Tibor Nagy <tibor.nagy.ext...@allotropia.de> AuthorDate: Wed Mar 13 08:28:41 2024 +0100 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Sun Apr 7 21:38:18 2024 +0200 tdf#156655 sc: fix disappear text in merged cell The text does not appear if the first row or column of the merged cell is hidden. Change-Id: I398f0d572226e44ffaa4e33c066b51480ad124cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164757 Tested-by: Jenkins Reviewed-by: Nagy Tibor <tibor.nagy.ext...@allotropia.de> (cherry picked from commit d5f25d9c0026ec06a0b46e1560e26adba2725290) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165835 Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index d419981d8edb..877675c0ac48 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1877,8 +1877,7 @@ void ScOutputData::LayoutStrings(bool bPixelToLogic) // Cells to the left are marked directly, cells to the // right are handled by the flag for nX2 SCCOL nMarkX = ( nCellX <= nX2 ) ? nCellX : nX2; - RowInfo* pMarkRowInfo = ( nCellY == nY ) ? pThisRowInfo : &pRowInfo[0]; - pMarkRowInfo->basicCellInfo(nMarkX).bEditEngine = true; + pThisRowInfo->basicCellInfo(nMarkX).bEditEngine = true; bDoCell = false; // don't draw here } if ( bDoCell ) @@ -4429,14 +4428,17 @@ void ScOutputData::DrawEdit(bool bPixelToLogic) SCROW nCellY = nY; bool bDoCell = false; + // if merged cell contains hidden row or column or both + const ScMergeFlagAttr* pMergeFlag = mpDoc->GetAttr(nX, nY, nTab, ATTR_MERGE_FLAG); + bool bOverlapped = (pMergeFlag->IsHorOverlapped() || pMergeFlag->IsVerOverlapped()); + tools::Long nPosY = nRowPosY; - if ( nArrY == 0 ) + if (bOverlapped) { - nPosY = nScrY; - nY = pRowInfo[1].nRowNo; + nY = pRowInfo[nArrY].nRowNo; SCCOL nOverX; // start of the merged cells SCROW nOverY; - if (GetMergeOrigin( nX,nY, 1, nOverX,nOverY, true )) + if (GetMergeOrigin( nX,nY, nArrY, nOverX,nOverY, true )) { nCellX = nOverX; nCellY = nOverY;