[Libreoffice-commits] core.git: sw/qa writerfilter/source
Justin Luth (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jun 1 12:57:55 UTC 2021
sw/qa/extras/ooxmlexport/data/tdf142404_tabOverMarginC15.docx |binary
sw/qa/extras/ooxmlexport/ooxmlexport16.cxx | 8 ++++++++
writerfilter/source/dmapper/SettingsTable.cxx | 1 +
writerfilter/source/filter/WriterFilter.cxx | 1 -
4 files changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 29bd00f7628e7a54e69cabcc7e2a1792c24aa55c
Author: Justin Luth <justin_luth at sil.org>
AuthorDate: Fri May 28 11:38:12 2021 +0200
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Jun 1 14:57:02 2021 +0200
tdf#142404 DOCX c15: TabOverMargin no longer true in 2013+
When compatibilityMode is 15, TabOverMargin no longer
seems to apply. This is a dramatic visual change in docx
that I didn't find any documentation about,
but the visual change is obvious enough proof.
LibreOffice started saving DOCX as c15 mode in 7.0.
[P.S. related TabOverflow also seems to be false with c15,
but it acts differently than what LO's tabOverflow
code does. That was discussed in a different patch
and seems to be a dead end, so I'm ignoring that aspect.
Way too many complications and effects on LO native mode.]
Change-Id: I5a0a6d695d6825444cf6a362a81803f306e6c6e3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116337
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth at sil.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf142404_tabOverMarginC15.docx b/sw/qa/extras/ooxmlexport/data/tdf142404_tabOverMarginC15.docx
new file mode 100644
index 000000000000..60af474b5c7d
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf142404_tabOverMarginC15.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
index c0bca8ebfb7b..045102438c90 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport16.cxx
@@ -218,6 +218,14 @@ DECLARE_OOXMLEXPORT_TEST(testTdf142404_tabSpacing, "tdf142404_tabSpacing.docx")
CPPUNIT_ASSERT_EQUAL_MESSAGE("too big for one page", 2, getPages());
}
+DECLARE_OOXMLEXPORT_TEST(testTdf142404_tabOverMarginC15, "tdf142404_tabOverMarginC15.docx")
+{
+ // TabOverMargin no longer applies to compatibilityMode 15 DOCX files. In Word 2016 this is 3pg.
+ // One page long if tabOverMargin is true. Two pages long if tabOverflow is true.
+ // Really should be 3 pages long, when tabOverflow is also false, but inadequate implementation.
+ 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/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx
index 02e0a6f8c4a1..12ec66a54152 100644
--- a/writerfilter/source/dmapper/SettingsTable.cxx
+++ b/writerfilter/source/dmapper/SettingsTable.cxx
@@ -758,6 +758,7 @@ void SettingsTable::ApplyProperties(uno::Reference<text::XTextDocument> const& x
uno::Reference<lang::XMultiServiceFactory> xTextFactory(xDoc, uno::UNO_QUERY_THROW);
uno::Reference<beans::XPropertySet> xDocumentSettings(xTextFactory->createInstance("com.sun.star.document.Settings"), uno::UNO_QUERY_THROW);
xDocumentSettings->setPropertyValue("MsWordCompMinLineHeightByFly", uno::makeAny(true));
+ xDocumentSettings->setPropertyValue("TabOverMargin", uno::makeAny(true));
}
// Show changes value
diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx
index 772ca5032b76..55bb89f1e21b 100644
--- a/writerfilter/source/filter/WriterFilter.cxx
+++ b/writerfilter/source/filter/WriterFilter.cxx
@@ -324,7 +324,6 @@ void WriterFilter::setTargetDocument(const uno::Reference<lang::XComponent>& xDo
xSettings->setPropertyValue("FloattableNomargins", uno::makeAny(true));
xSettings->setPropertyValue("ClippedPictures", uno::makeAny(true));
xSettings->setPropertyValue("BackgroundParaOverDrawings", uno::makeAny(true));
- xSettings->setPropertyValue("TabOverMargin", uno::makeAny(true));
xSettings->setPropertyValue("TreatSingleColumnBreakAsPageBreak", uno::makeAny(true));
xSettings->setPropertyValue("PropLineSpacingShrinksFirstLine", uno::makeAny(true));
xSettings->setPropertyValue("DoNotCaptureDrawObjsOnPage", uno::makeAny(true));
More information about the Libreoffice-commits
mailing list