summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2019-09-26 16:13:01 +0300
committerJustin Luth <justin_luth@sil.org>2019-09-26 20:24:01 +0200
commit89f0107b8de21bbb22e850847348ab40cce24644 (patch)
tree2f14215dbfa9c599c82113f5892928b1cb2c1c98 /sw
parent5a1163c202f6c4eb519cac9732e681f3c5a4d516 (diff)
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>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlexport/data/tdf127316_autoEscapement.odtbin0 -> 11475 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport13.cxx7
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx4
3 files changed, 11 insertions, 0 deletions
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
--- /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 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);