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_luth@sil.org>
Tested-by: Justin Luth <justin_luth@sil.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 0000000..95987d4
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/tdf127316_autoEscapement.odt
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
index dc237f1..7d94913 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport13.cxx
@@ -216,6 +216,13 @@ DECLARE_OOXMLEXPORT_TEST(testBtlrShape, "btlr-textbox.docx")
rFormats[1]->GetAttrSet().GetFrameDir().GetValue());
}
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 f4812c4..2be50ad 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);