sc/source/ui/view/output2.cxx |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

New commits:
commit d5f25d9c0026ec06a0b46e1560e26adba2725290
Author:     Tibor Nagy <tibor.nagy.ext...@allotropia.de>
AuthorDate: Wed Mar 13 08:28:41 2024 +0100
Commit:     Nagy Tibor <tibor.nagy.ext...@allotropia.de>
CommitDate: Thu Mar 14 01:09:04 2024 +0100

    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>

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 2b6b5a27100b..dd9a7ba0e1a5 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1909,8 +1909,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
 
                     // Mark the tagged "TD" structure element to be drawn in 
DrawEdit
@@ -4485,14 +4484,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;

Reply via email to