Bugzilla – Attachment 185955 Details for
Bug 153878
Right-aligned list numbers in table cells show left-aligned when the cell width is decreased, but still enough
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to illustrate the problem better
0001-Related-tdf-153878-patch-to-illustrate-the-problem.patch (text/plain), 4.30 KB, created by
Caolán McNamara
on 2023-03-14 15:56:06 UTC
(
hide
)
Description:
patch to illustrate the problem better
Filename:
MIME Type:
Creator:
Caolán McNamara
Created:
2023-03-14 15:56:06 UTC
Size:
4.30 KB
patch
obsolete
>From b4a939341c4da83c36a36725a7704af949baa8ae Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com> >Date: Tue, 14 Mar 2023 15:50:20 +0000 >Subject: [PATCH] Related: tdf#153878 patch to illustrate the problem > >The column is 0.92cm wide, so ~521 twips wide. The numbering is aligned >at 0.50cm, so there are 283 twips to the left of the alignment and 238 >to the right of the alignment. > >As far as I can see the initial calculation for these numbering portions >is done with a width of *238*, not 283. So the width of 11 is 231 and is >considered ok, but 10 is 240 which is wider than the 238, so 10 is line >wrapped to give just 1 and that 10 positioned as if it was only 1 > >Change-Id: I863b82574a394b5c0367c7fd14194c25fed38cdf >--- > sw/source/core/text/itrform2.cxx | 13 ++++++++----- > sw/source/core/text/itrform2.hxx | 4 ++-- > sw/source/core/text/txtfrm.cxx | 1 + > 3 files changed, 11 insertions(+), 7 deletions(-) > >diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx >index 3e5d03ff7521..466df721ffeb 100644 >--- a/sw/source/core/text/itrform2.cxx >+++ b/sw/source/core/text/itrform2.cxx >@@ -2230,7 +2230,7 @@ void SwTextFormatter::CalcRealHeight( bool bNewLine ) > m_pCurr->SetRealHeight( nLineHeight ); > } > >-void SwTextFormatter::FeedInf( SwTextFormatInfo &rInf ) const >+void SwTextFormatter::FeedInf( SwTextFormatInfo &rInf, bool bHack ) const > { > // delete Fly in any case! > ClearFly( rInf ); >@@ -2245,7 +2245,10 @@ void SwTextFormatter::FeedInf( SwTextFormatInfo &rInf ) const > rInf.First( FirstLeft() ); > rInf.LeftMargin(GetLeftMargin()); > >- rInf.RealWidth( sal_uInt16(rInf.Right() - GetLeftMargin()) ); >+ if (!bHack) >+ rInf.RealWidth( sal_uInt16(rInf.Right() - GetLeftMargin()) ); >+ else >+ rInf.RealWidth( sal_uInt16(GetLeftMargin() - rInf.Left()) ); > rInf.Width( rInf.RealWidth() ); > if( const_cast<SwTextFormatter*>(this)->GetRedln() ) > { >@@ -2254,7 +2257,7 @@ void SwTextFormatter::FeedInf( SwTextFormatInfo &rInf ) const > } > } > >-void SwTextFormatter::FormatReset( SwTextFormatInfo &rInf ) >+void SwTextFormatter::FormatReset( SwTextFormatInfo &rInf, bool bHack ) > { > m_pFirstOfBorderMerge = nullptr; > m_pCurr->Truncate(); >@@ -2264,7 +2267,7 @@ void SwTextFormatter::FormatReset( SwTextFormatInfo &rInf ) > m_pCurr->FinishSpaceAdd(); > m_pCurr->FinishKanaComp(); > m_pCurr->ResetFlags(); >- FeedInf( rInf ); >+ FeedInf( rInf, bHack ); > } > > bool SwTextFormatter::CalcOnceMore() >@@ -2307,7 +2310,7 @@ SwTwips SwTextFormatter::CalcBottomLine() const > // FME/OD: This routine does a limited text formatting. > SwTwips SwTextFormatter::CalcFitToContent_() > { >- FormatReset( GetInfo() ); >+ FormatReset( GetInfo(), true ); > BuildPortions( GetInfo() ); > m_pCurr->CalcLine( *this, GetInfo() ); > return m_pCurr->Width(); >diff --git a/sw/source/core/text/itrform2.hxx b/sw/source/core/text/itrform2.hxx >index 2d71fad34cd5..82b10e831a74 100644 >--- a/sw/source/core/text/itrform2.hxx >+++ b/sw/source/core/text/itrform2.hxx >@@ -89,7 +89,7 @@ class SwTextFormatter : public SwTextPainter > void CalcRealHeight( bool bNewLine = false ); > > // Transfers the data to rInf >- void FeedInf( SwTextFormatInfo &rInf ) const; >+ void FeedInf( SwTextFormatInfo &rInf, bool bHack = false) const; > > // Treats underflow situations > SwLinePortion *Underflow( SwTextFormatInfo &rInf ); >@@ -101,7 +101,7 @@ class SwTextFormatter : public SwTextPainter > bool AllowRepaintOpt() const; > > // Is called by FormatLine >- void FormatReset( SwTextFormatInfo &rInf ); >+ void FormatReset( SwTextFormatInfo &rInf, bool bHack = false ); > > /** > The position of the portions changes with the adjustment. >diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx >index 6ae786f8b435..57a8b3eff35d 100644 >--- a/sw/source/core/text/txtfrm.cxx >+++ b/sw/source/core/text/txtfrm.cxx >@@ -3565,6 +3565,7 @@ void SwTextFrame::CalcAdditionalFirstLineOffset() > if ( pFirstPortion->InNumberGrp() && !pFirstPortion->IsFootnoteNumPortion() ) > { > SwTwips nNumberPortionWidth( pFirstPortion->Width() ); >+ fprintf(stderr, "portion width is %ld for number text\n", nNumberPortionWidth); > > const SwLinePortion* pPortion = pFirstPortion->GetNextPortion(); > while ( pPortion && >-- >2.39.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 153878
:
185632
|
185952
| 185955