sw/source/core/table/swnewtable.cxx |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit a8c7e5ea607fbc5451a167ada35c6dff9c89abf6
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Dec 20 17:44:49 2022 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Tue Dec 20 17:51:08 2022 +0000

    sw: ODF import: fix assert in SwTable::ConvertSubtableBox()
    
    Assert in swnewtable.cxx:2179 fires:
    
    For ooo98643-1.odt the conversion is not possible, the default for row
    height is "variable" which wasn't handled.
    
    For ooo27428-1.sxw the conversion is possible so remove the assert;
    the sum of the inner row fixed height is just smaller than the outer
    row's but unsurprisingly the subtables is layouted such that the last
    row gets the extra space, same as the conversion does.
    
    (regression from commit 4757dfc2a520f63fba0b27cc161fe732231dbd0e)
    
    Change-Id: I2635179f350c8b5b84016dc82625b73364df92a2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144622
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/table/swnewtable.cxx 
b/sw/source/core/table/swnewtable.cxx
index a0c420b1876c..cd98b4fb186a 100644
--- a/sw/source/core/table/swnewtable.cxx
+++ b/sw/source/core/table/swnewtable.cxx
@@ -2176,7 +2176,6 @@ void SwTable::ConvertSubtableBox(sal_uInt16 const nRow, 
sal_uInt16 const nBox)
             && outerSize.GetHeightSizeType() != SwFrameSize::Variable
             && minHeights < outerSize.GetHeight())
         {
-            assert(false); // this should be impossible currently, such 
subtable isn't converted because layout is needed to determine how much space 
is taken up by variable height rows
             SwFormatFrameSize 
lastSize(pNewLine->GetFrameFormat()->GetFrameSize());
             lastSize.SetHeight(lastSize.GetHeight() + outerSize.GetHeight() - 
minHeights);
             if (lastSize.GetHeightSizeType() == SwFrameSize::Variable)
@@ -2326,6 +2325,10 @@ bool SwTable::CanConvertSubtables() const
                             haveNonFixedInnerLine = true;
                         }
                     }
+                    else
+                    {
+                        haveNonFixedInnerLine = true; // default
+                    }
                     for (SwTableBox const*const pInnerBox : 
pInnerLine->GetTabBoxes())
                     {
                         if (!pInnerBox->GetTabLines().empty())

Reply via email to