[Libreoffice-commits] core.git: sw/qa sw/source

Justin Luth (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 26 18:25:17 UTC 2019


 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 89f0107b8de21bbb22e850847348ab40cce24644
Author:     Justin Luth <justin_luth at sil.org>
AuthorDate: Thu Sep 26 16:13:01 2019 +0300
Commit:     Justin Luth <justin_luth at sil.org>
CommitDate: Thu Sep 26 20:24:01 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_luth at sil.org>
    Tested-by: Justin Luth <justin_luth at 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 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 dc237f18ac4d..7d94913e9449 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 f4812c4613ec..2be50ad0ece1 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);


More information about the Libreoffice-commits mailing list