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>
(cherry picked from commit 89f0107b8de21bbb22e850847348ab40cce24644)
Reviewed-on: https://gerrit.libreoffice.org/79656
Tested-by: Jenkins
Reviewed-by: László Németh <nemeth@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 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 cb06ef8..f81a52e 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 ff208c9..0be232d 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);