diff options
author | Justin Luth <justin_luth@sil.org> | 2018-03-30 18:06:17 +0300 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-04-08 15:19:34 +0200 |
commit | 818619b0f2f7813decb26d0b14362dec76a8ff37 (patch) | |
tree | 5ce2ed928087fb4371d8ce6430e5b12f9ab8458a /sw/qa | |
parent | e371819719a099e5c4fc0af1c2d1ee8ffc4e97c0 (diff) |
tdf#106062 ooxmlexport: hanging indent ? aesthetic tab : no
By default, LO footnote paragraph style has a hanging indent of .60cm.
In LO footnotes, the footnote character starts at the hanging indent
(position 0) and the footnote text "magically" starts at the left margin.
MSO doesn't do any magical formatting so exporting emulates that by
inserting a tab after the footnote character.
However, that aethetic tab was being inserted after EVERY footnote character,
regardless of whether the emulation was needed or not. That particularly
caused problems when the document was originally authored by MSO, which
typically has no margin or first line indent. In those cases, the
document is altered by gaining undesirable extra space.
Since the emulation is only of value with a hanging indent that is larger
than the footnote character, only add the tab when a hanging indent exists.
(Checking the size of the hanging indent could improve this even more,
but measuring font size etc adds too much complexity.)
The import code also knows about the fake tab and removes it.
Follow-up patches will change the import to ONLY remove the fake tab
if there is a hanging indent. (That is going to cause "regressions"
because tabs from some previously saved documents will now
show the "aesthetic tab" - just like MSO does.)
Change-Id: I371da3f2b09f600f027377a36583f91b39425151
Reviewed-on: https://gerrit.libreoffice.org/52171
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index fac212c3cfe9..fcfea4083551 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -983,12 +983,7 @@ DECLARE_OOXMLEXPORT_TEST(testTdf90810, "tdf90810short.docx") uno::Reference<text::XFootnote> xFootnote(xFootnoteIdxAcc->getByIndex(0), uno::UNO_QUERY); uno::Reference<text::XText> xFootnoteText(xFootnote, uno::UNO_QUERY); rtl::OUString sFootnoteText = xFootnoteText->getString(); - // Original document doesn't have a leading tab in the footnote, but the - // export adds one unconditionally. - if (mbExported) - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(90), sFootnoteText.getLength()); - else - CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(89), sFootnoteText.getLength()); + CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(89), sFootnoteText.getLength()); } DECLARE_OOXMLEXPORT_TEST(testTdf89165, "tdf89165.docx") |