diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-06-29 07:54:17 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-06-29 10:51:11 +0200 |
commit | 761d3a128214b48645f00e2ff094e0f8928d1ee1 (patch) | |
tree | 5b86dd3344617260176d4ec0fb1e50f2981dff49 /sw/source/core/text/portxt.cxx | |
parent | 6ab6f7bf61efe7f42161a2d5760763bf39f8795a (diff) |
This reverts commit 7ef9c3ef30023cc40068e1f735aa4bec4811288b (plus relevant part
of c08d71a0e0015ec7857335b68a354df04fa04a0c "Fix typos" follow-up). It started
to cause <https://ci.libreoffice.org/job/lo_ubsan/2441/> to fail with
> /sw/source/core/text/itrcrsr.cxx:1659:50: runtime error: downcast of address 0x60700059b250 which does not point to an object of type 'SwTextPortion'
> 0x60700059b250: note: object is of type 'SwHolePortion'
> 00 00 00 00 90 23 40 a7 6f 7f 00 00 e1 03 00 00 00 00 00 00 0d 01 00 00 00 00 00 00 00 00 00 00
> ^~~~~~~~~~~~~~~~~~~~~~~
> vptr for 'SwHolePortion'
> #0 0x7f6f9f1777f0 in SwTextCursor::GetModelPositionForViewPoint(SwPosition*, Point const&, bool, SwCursorMoveState*) const /sw/source/core/text/itrcrsr.cxx:1659:50
> #1 0x7f6f9efc2b39 in SwTextFrame::UnitDown_(SwPaM*, long, bool) const /sw/source/core/text/frmcrsr.cxx:1200:49
> #2 0x7f6f9efc5b50 in SwTextFrame::UnitDown(SwPaM*, long, bool) const /sw/source/core/text/frmcrsr.cxx:1298:31
> #3 0x7f6f9be4bac8 in SwCursor::UpDown(bool, unsigned short, Point const*, long, SwRootFrame&) /sw/source/core/crsr/swcrsr.cxx:2062:31
> #4 0x7f6f9bf0692b in SwShellCursor::UpDown(bool, unsigned short) /sw/source/core/crsr/viscrs.cxx:1025:22
> #5 0x7f6f9bb840c0 in SwCursorShell::UpDown(bool, unsigned short) /sw/source/core/crsr/crsrsh.cxx:511:29
> #6 0x7f6fa37f131d in SwCursorShell::Down(unsigned short) /sw/inc/crsrsh.hxx:359:50
> #7 0x7f6fa37dcfc9 in SwWrtShell::Down(bool, unsigned short, bool) /sw/source/uibase/wrtsh/move.cxx:171:27
> #8 0x7f6fb6aa1325 in testTdf43100_CursorMoveToSpacesOverMargin::TestBody() /sw/qa/core/text/text.cxx:532:20
during CppunitTest_sw_core_text
CPPUNIT_TEST_NAME=testTdf43100_CursorMoveToSpacesOverMargin::TestBody
Change-Id: I37947825ec9db826446ed28fa87a23ee60749b82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136549
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/core/text/portxt.cxx')
-rw-r--r-- | sw/source/core/text/portxt.cxx | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx index c0f66496f134..a5ae0ea7e287 100644 --- a/sw/source/core/text/portxt.cxx +++ b/sw/source/core/text/portxt.cxx @@ -321,7 +321,6 @@ bool SwTextPortion::Format_( SwTextFormatInfo &rInf ) if ( !bFull ) { Width( aGuess.BreakWidth() ); - ExtraBlankWidth(aGuess.ExtraBlankWidth()); // Caution! if( !InExpGrp() || InFieldGrp() ) SetLen( rInf.GetLen() ); @@ -410,8 +409,6 @@ bool SwTextPortion::Format_( SwTextFormatInfo &rInf ) { SwHolePortion *pNew = new SwHolePortion( *this ); pNew->SetLen( nRealStart - aGuess.BreakPos() ); - pNew->Width(0); - pNew->ExtraBlankWidth( aGuess.ExtraBlankWidth() ); Insert( pNew ); } } @@ -752,29 +749,12 @@ SwHolePortion::SwHolePortion( const SwTextPortion &rPor ) { SetLen( TextFrameIndex(1) ); Height( rPor.Height() ); - Width(0); SetAscent( rPor.GetAscent() ); SetWhichPor( PortionType::Hole ); } SwLinePortion *SwHolePortion::Compress() { return this; } -// The GetTextSize() assumes that the own length is correct -SwPosSize SwHolePortion::GetTextSize(const SwTextSizeInfo& rInf) const -{ - SwPosSize aSize = rInf.GetTextSize(); - if (!GetJoinBorderWithPrev()) - aSize.Width(aSize.Width() + rInf.GetFont()->GetLeftBorderSpace()); - if (!GetJoinBorderWithNext()) - aSize.Width(aSize.Width() + rInf.GetFont()->GetRightBorderSpace()); - - aSize.Height(aSize.Height() + - rInf.GetFont()->GetTopBorderSpace() + - rInf.GetFont()->GetBottomBorderSpace()); - - return aSize; -} - void SwHolePortion::Paint( const SwTextPaintInfo &rInf ) const { if( !rInf.GetOut() ) |