sw/source/core/text/itrcrsr.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 48d5d19716b941a67492989ea30fb76f65696841
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Fri Mar 24 11:08:33 2023 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Fri Mar 24 19:27:54 2023 +0000

    sw: fix crashtesting assert on ooo55147-1.doc
    
    frmpaint.cxx:801: SwTextFrame::PaintSwFrame: Assertion 
`!isPDFTaggingEnabled || oTaggedParagraph || 
rRect.GetIntersection(getFrameArea()) != getFrameArea()' failed.
    
    This happens because the SwNumberPortion is outside of the
    SwTextFrame 16's area so it is not painted at all (table cell clipping).
    
    The first-line indent is incorrect 1233 instead of 2084
    because in SwTextMargin::CtorInitTextMargin() the mnLeft is incorrect
    2084 instead of 2935 because it erroneously took the branch to set
    mnLeft = m_pFrame->getFramePrintArea().Left() + 
m_pFrame->getFrameArea().Left()
    because the nLMWithNum check wasn't adapted to the change of including
    the text-left-margin in it.
    
    (regression from commit 92280ad0c65a3d1b5aa8ac77c87ec6a964389a01)
    
    Change-Id: Ic7cd2b272a79e70cb5e0313bb6bcf1e909c3a68a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149538
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 7963b0aa177c..ba6641e7cdab 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -225,7 +225,8 @@ void SwTextMargin::CtorInitTextMargin( SwTextFrame 
*pNewFrame, SwTextSizeInfo *p
          // paras inside cells inside new documents:
         ( 
pNode->getIDocumentSettingAccess()->get(DocumentSettingId::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING)
 ||
           !m_pFrame->IsInTab() ||
-          ( !nLMWithNum && (!bLabelAlignmentActive || 
bListLevelIndentsApplicable) ) ) )
+          (bListLevelIndentsApplicable && nLMWithNum == 
rTextLeftMargin.GetTextLeft())
+          || (!bLabelAlignmentActive && nLMWithNum == 0)))
     {
         mnLeft = m_pFrame->getFramePrintArea().Left() + 
m_pFrame->getFrameArea().Left();
         if( mnLeft >= mnRight )   // e.g. with large paragraph indentations in 
slim table columns

Reply via email to