sc/source/ui/view/output2.cxx |   13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 8bf6b877c6c4ee53611569a28114e7bbae000479
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Mon Jul 24 21:40:23 2023 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Tue Jul 25 10:20:36 2023 +0200

    crashtesting: a lot of crashes on exporting to ods
    
    since:
    
    commit 1d2380516ac9871743c5a5455f0734d02be8eade
    Date:   Thu Apr 20 20:33:56 2023 +0530
    
        tdf#129847 Show "more content" red arrow along with ### indication
    
    e.g.
    
    soffice --headless --convert-to ods forums/xlsx/forum-mso-en4-566515.xlsx
    
     #3  0x00007ffff7b61662 in __assert_fail () from 
/lib/x86_64-linux-gnu/libc.so.6
     #4  0x00007fffe1f6cd02 in RowInfo::cellInfo (nCol=187, this=<optimized 
out>) at sc/inc/fillinfo.hxx:201
     #5  ScOutputData::LayoutStrings (this=this@entry=0x7fffffffb0d0, 
bPixelToLogic=bPixelToLogic@entry=false)
         at sc/source/ui/view/output2.cxx:1908
     #6  0x00007fffe1f6df21 in ScOutputData::DrawStrings 
(this=this@entry=0x7fffffffb0d0, bPixelToLogic=bPixelToLogic@entry=false)
         at sc/source/ui/view/output2.cxx:1478
     #7  0x00007fffe1f9d52e in ScPrintFunc::DrawToDev (rDoc=..., 
pDev=pDev@entry=0x5555567d9890, rBound=..., 
pViewData=pViewData@entry=0x7fffffffb270,
         bMetaFile=bMetaFile@entry=true) at sc/source/ui/view/printfun.cxx:619
     #8  0x00007fffe1a49150 in ScDocShell::Draw (this=0x55555652c630, 
pDev=0x5555567d9890, nAspect=<optimized out>)
         at sc/source/ui/docshell/docsh4.cxx:2205
     #9  0x00007ffff5c66771 in SfxObjectShell::DoDraw_Impl 
(this=this@entry=0x55555652c630, pDev=pDev@entry=0x5555567d9890, rViewPos=Point 
= {...}, rScaleX=...,
         rScaleY=..., rSetup=..., nAspect=2, bOutputForScreen=false) at 
sfx2/source/doc/objembed.cxx:204
     #10 0x00007ffff5c66976 in SfxObjectShell::DoDraw 
(this=this@entry=0x55555652c630, pDev=pDev@entry=0x5555567d9890, rObjPos=Point 
= {...}, rSize=Size = {...},
         rSetup=..., nAspect=nAspect@entry=2, bOutputForScreen=false) at 
sfx2/source/doc/objembed.cxx:151
     #11 0x00007ffff5c6207d in SfxObjectShell::CreatePreview_Impl 
(this=this@entry=0x55555652c630, bFullContent=bFullContent@entry=false, 
pDevice=0x5555567d9890,
         pFile=pFile@entry=0x0) at sfx2/source/doc/objcont.cxx:197
     #12 0x00007ffff5c6412c in SfxObjectShell::GetPreviewBitmap 
(this=this@entry=0x55555652c630) at include/rtl/ref.hxx:206
     #13 0x00007ffff5c9c5a4 in SfxObjectShell::WriteThumbnail 
(this=this@entry=0x55555652c630, bEncrypted=bEncrypted@entry=false, xStream=
         uno::Reference to (OWriteStream *) 0x555557e84818) at 
sfx2/source/doc/objstor.cxx:3748
    
    use the same guard around accessing cellInfo as used elsewhere in this
    method
    
    Change-Id: If1fd5cff92655f8b51436f27a9b3d22fdc7a390b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154879
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index f2596bca1161..a5008e37de31 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -1893,20 +1893,25 @@ void ScOutputData::LayoutStrings(bool bPixelToLogic)
 
                             if ( eOutHorJust == SvxCellHorJustify::Left )
                             {
-                                pRowInfo[nArrY].cellInfo(nCellX).nClipMark |= 
ScClipMark::Right;
+                                if ( nCellY == nY && nCellX >= nX1 && nCellX 
<= nX2 )
+                                    pRowInfo[nArrY].cellInfo(nCellX).nClipMark 
|= ScClipMark::Right;
                                 bAnyClipped = true;
                                 aAreaParam.maClipRect.AdjustRight( 
-(nMarkPixel * nLayoutSign) );
                             }
                             else if ( eOutHorJust == SvxCellHorJustify::Right )
                             {
-                                pRowInfo[nArrY].cellInfo(nCellX).nClipMark |= 
ScClipMark::Left;
+                                if ( nCellY == nY && nCellX >= nX1 && nCellX 
<= nX2 )
+                                    pRowInfo[nArrY].cellInfo(nCellX).nClipMark 
|= ScClipMark::Left;
                                 bAnyClipped = true;
                                 aAreaParam.maClipRect.AdjustLeft(nMarkPixel * 
nLayoutSign);
                             }
                             else
                             {
-                                pRowInfo[nArrY].cellInfo(nCellX).nClipMark |= 
ScClipMark::Right;
-                                pRowInfo[nArrY].cellInfo(nCellX).nClipMark |= 
ScClipMark::Left;
+                                if ( nCellY == nY && nCellX >= nX1 && nCellX 
<= nX2 )
+                                {
+                                    pRowInfo[nArrY].cellInfo(nCellX).nClipMark 
|= ScClipMark::Right;
+                                    pRowInfo[nArrY].cellInfo(nCellX).nClipMark 
|= ScClipMark::Left;
+                                }
                                 bAnyClipped = true;
                                 aAreaParam.maClipRect.AdjustRight( 
-(nMarkPixel * nLayoutSign) );
                                 aAreaParam.maClipRect.AdjustLeft(nMarkPixel * 
nLayoutSign);

Reply via email to