sw/qa/extras/ooxmlexport/data/tdf127316_autoEscapement.odt |binary sw/qa/extras/ooxmlexport/ooxmlexport13.cxx | 7 +++++++ sw/source/filter/ww8/docxattributeoutput.cxx | 4 ++++ 3 files changed, 11 insertions(+)
New commits: commit b00313c982ca3cf92abac9e2e0f5cdf7efc1456f Author: Justin Luth <justin_l...@sil.org> AuthorDate: Thu Sep 26 16:13:01 2019 +0300 Commit: László Németh <nem...@numbertext.org> CommitDate: Fri Sep 27 07:50:43 2019 +0200 tdf#127316 docxexport: use default escapement for AUTO Previously it looked bad, but not horrendous when AUTO was 101. Now that AUTO is 13999, it is obviously wrong. Better to use the default of 33. The import algorithm still could use some work since it round-trips as 51% and not 33%. Change-Id: Id984ea3e6e0b50014389ec8a86668b7a271b96f4 Reviewed-on: https://gerrit.libreoffice.org/79628 Reviewed-by: Justin Luth <justin_l...@sil.org> Tested-by: Justin Luth <justin_l...@sil.org> (cherry picked from commit 89f0107b8de21bbb22e850847348ab40cce24644) Reviewed-on: https://gerrit.libreoffice.org/79656 Tested-by: Jenkins Reviewed-by: László Németh <nem...@numbertext.org> diff --git a/sw/qa/extras/ooxmlexport/data/tdf127316_autoEscapement.odt b/sw/qa/extras/ooxmlexport/data/tdf127316_autoEscapement.odt new file mode 100644 index 000000000000..95987d4562cc Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf127316_autoEscapement.odt differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx index cb06ef8f331f..f81a52e852c8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx @@ -94,6 +94,13 @@ DECLARE_OOXMLEXPORT_TEST(testTbrlTextbox, "tbrl-textbox.docx") aGeometry["TextPreRotateAngle"].get<sal_Int32>()); } +DECLARE_OOXMLEXPORT_TEST(testTdf127316_autoEscapement, "tdf127316_autoEscapement.odt") +{ + uno::Reference<text::XTextRange> xPara = getParagraph(1); + CPPUNIT_ASSERT_DOUBLES_EQUAL( 0.f, getProperty<float>(getRun(xPara, 1), "CharEscapement"), 0); + CPPUNIT_ASSERT_DOUBLES_EQUAL(33.f, getProperty<float>(getRun(xPara, 2), "CharEscapement"), 20); +} + DECLARE_OOXMLEXPORT_TEST(testTdf124637_sectionMargin, "tdf124637_sectionMargin.docx") { uno::Reference<text::XTextSectionsSupplier> xTextSectionsSupplier(mxComponent, uno::UNO_QUERY); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index ff208c98ef22..0be232d6569f 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -6831,6 +6831,10 @@ void DocxAttributeOutput::CharEscapement( const SvxEscapementItem& rEscapement ) else if ( DFLT_ESC_SUPER == nEsc || DFLT_ESC_AUTO_SUPER == nEsc ) sIss = OString( "superscript" ); } + else if ( DFLT_ESC_AUTO_SUPER == nEsc ) + nEsc = DFLT_ESC_SUPER; + else if ( DFLT_ESC_AUTO_SUB == nEsc ) + nEsc = DFLT_ESC_SUB; if ( !sIss.isEmpty() ) m_pSerializer->singleElementNS(XML_w, XML_vertAlign, FSNS(XML_w, XML_val), sIss); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits