Skip to content

Commit

Permalink
crashtesting: assert on reloading .docx output of fdo60683-2.odt
Browse files Browse the repository at this point in the history
maybe since:

commit 8cb4db9
CommitDate: Wed Aug 31 08:29:49 2022 +0200

    tdf#30731: Improve caret travelling in Writer

 #3  0x00007ffff74dabf0 in std::__glibcxx_assert_fail(char const*, int, char const*, char const*) () at /lib64/libstdc++.so.6
 #4  0x00007fffce3e97b3 in std::clamp<int> (__val=@0x7ffffffe52b4: 1897, __lo=@0x7ffffffe51f0: 1900, __hi=@0x7ffffffe51e8: 1897)
     at /usr/bin/../lib/gcc/x86_64-redhat-linux/14/../../../../include/c++/14/bits/stl_algo.h:3625
 #5  0x00007fffce3e41ff in GetTextArray
     (rDevice=..., rStr='x' <repeats 200 times>..., rDXAry=std::__debug::vector of length 0, capacity 0, nIndex=1875, nLen=25, nLayoutContext=std::optional = {...}, nMaxAscent=0x7ffffffe5680, nMaxDescent=0x7ffffffe5678, bCaret=true, layoutCache=0x0) at core/sw/source/core/txtnode/fntcache.cxx:763
 #6  0x00007fffce3e2a47 in SwFntObj::GetTextSize (this=0x6134340, rInf=...) at core/sw/source/core/txtnode/fntcache.cxx:1734
 #7  0x00007fffce461147 in SwSubFont::GetTextSize_ (this=0x6281450, rInf=...) at core/sw/source/core/txtnode/swfont.cxx:1039
 #8  0x00007fffce1f953c in SwFont::GetTextSize_ (this=0x6281450, rInf=...) at sw/source/core/inc/swfont.hxx:321
 #9  0x00007fffce2234e2 in SwTextSizeInfo::GetTextSize (this=0x7ffffffe6b80, nLayoutContext=std::optional = {...}) at core/sw/source/core/text/inftxt.cxx:439
 #10 0x00007fffce2f2217 in SwTextPortion::GetTextSize (this=0x62a3d40, rInf=...) at core/sw/source/core/text/portxt.cxx:586
 #11 0x00007fffce250b8c in SwTextCursor::GetCharRect_ (this=0x7ffffffe6fc8, pOrig=0x7ffffffe81c8, nOfst=..., pCMS=0x7ffffffe6e20) at core/sw/source/core/text/itrcrsr.cxx:956
 #12 0x00007fffce24d978 in SwTextCursor::GetCharRect (this=0x7ffffffe6fc8, pOrig=0x7ffffffe81c8, nOfst=..., pCMS=0x7ffffffe6e20, nMax=20604)
     at core/sw/source/core/text/itrcrsr.cxx:1281
 #13 0x00007fffce1f08c1 in SwTextFrame::GetAutoPos (this=0x6259250, rOrig=SwRect = {...}, rPos=SwPosition (node 28, offset 1897)) at core/sw/source/core/text/frmcrsr.cxx:430

Change-Id: I8230c9cbb99126b513bea38517b1dbfac5a50f4b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180131
Reviewed-by: Caolán McNamara <[email protected]>
Tested-by: Jenkins
(cherry picked from commit 029540b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180158
  • Loading branch information
caolanm committed Jan 13, 2025
1 parent 43fdd32 commit d0bba69
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sw/source/core/text/itrcrsr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,8 @@ void SwTextCursor::GetCharRect_( SwRect* pOrig, TextFrameIndex const nOfst,
// give the wrong width if nOfst is in e.g. the middle
// of a ligature. See SwFntObj::DrawText().
TextFrameIndex const nOldLen = pPor->GetLen();
aInf.SetLen( pPor->GetLen() );
TextFrameIndex nMaxLen = TextFrameIndex(aInf.GetText().getLength()) - aInf.GetIdx();
aInf.SetLen( std::min(nMaxLen, pPor->GetLen()) );
pPor->SetLen( nOfst - aInf.GetIdx() );
aInf.SetMeasureLen(pPor->GetLen());
if (aInf.GetLen() < aInf.GetMeasureLen())
Expand Down

0 comments on commit d0bba69

Please sign in to comment.