tdf#142404 sw compat layout: ignore blank size only on one-liners

If the paragraph is longer than one line,
then do not IgnoreBlanksAndTabsForLineHeightCalculation,
which was introduced in LO 4.0.

This is a preliminary step for fixing bug 142404.

I found a few pre-existing unit tests that triggered this,
but none were good examples to use as proofs.

ooxmlexport7: 77219 - not sure where - no visual difference.
ooxmlexport10: 92157 compatibilityMode15, but visual too little.
ooxmlexport11: 88496 - not sure where.
ooxmlexport13: 121374_sectionHF2.doc -tabOverMargin in header

NOTE: This patch could be seen as a BAD THING in the case where
tabOverMargin normally hides EVERYTHING. We don't handle
that situation yet, so a very long series of tabs could
take up several lines of space (which isn't done in Word).
Now with this change it could take even more space.

Well, the proper fix would be to not show any of those.
Perhaps we could just set the width of the portion to
zero if it sails past the end of the page?
Anyway, the point is that this it-isn't-right-anyway
situation should not block pushing this patch through.

Change-Id: Iaea8e0edf78c8fbe319aadbc6d62fc0bdd180814
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116317
Tested-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Justin Luth <justin_luth@sil.org>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf142404_tabSpacing.docx b/sw/qa/extras/ooxmlexport/data/tdf142404_tabSpacing.docx
new file mode 100644
index 0000000..c819c55
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf142404_tabSpacing.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 1ce0a14..c0bca8e 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -212,6 +212,12 @@ DECLARE_OOXMLEXPORT_TEST(testTdf141173_missingFrames, "tdf141173_missingFrames.r
    CPPUNIT_ASSERT_EQUAL(13, getShapes());
}

DECLARE_OOXMLEXPORT_TEST(testTdf142404_tabSpacing, "tdf142404_tabSpacing.docx")
{
    // The tabstops should be laid out as triple-spaced when the paragraph takes multiple lines.
    CPPUNIT_ASSERT_EQUAL_MESSAGE("too big for one page", 2, getPages());
}

DECLARE_OOXMLEXPORT_TEST(testTdf139580, "tdf139580.odt")
{
    // Without the fix in place, this test would have crashed at export time
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index ae4f499..aeb1250 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
ignore/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
@@ -410,7 +410,7 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf )
                AddPrtWidth( pPos->Width() );

                // #i3952#
                if ( bIgnoreBlanksAndTabsForLineHeightCalculation )
                if (bIgnoreBlanksAndTabsForLineHeightCalculation && !rInf.GetLineStart())
                {
                    if ( pPos->InTabGrp() || pPos->IsHolePortion() ||
                            ( pPos->IsTextPortion() &&