[Libreoffice-commits] core.git: sw/qa sw/source
Justin Luth (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 28 15:07:03 UTC 2021
sw/qa/extras/ooxmlexport/data/tdf142404_tabSpacing.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 6 ++++++
sw/source/core/text/porlay.cxx | 4 ++--
3 files changed, 8 insertions(+), 2 deletions(-)
New commits:
commit 89e7341025b607491c90efdb74708e63d875c1e5
Author: Justin Luth <justin_luth at sil.org>
AuthorDate: Thu May 27 14:32:54 2021 +0200
Commit: Justin Luth <justin_luth at sil.org>
CommitDate: Fri May 28 17:06:17 2021 +0200
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 at sil.org>
Reviewed-by: Justin Luth <justin_luth at 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 000000000000..c819c55416fb
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf142404_tabSpacing.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index 1ce0a14556f3..c0bca8ebfb7b 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 ae4f499992b2..aeb12501ce4d 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() &&
More information about the Libreoffice-commits
mailing list