tdf#121049 - Preserve super/subscript when pasting HTML with class definition
Change-Id: Icb5c1e1536a57caf4f31f5dca49ee70174b798db Reviewed-on: https://gerrit.libreoffice.org/c/core/+/207588 Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> Tested-by: Jenkins
This commit is contained in:
@@ -0,0 +1 @@
|
||||
<p><sub class="sub">sub</sub></p>
|
||||
@@ -0,0 +1 @@
|
||||
<p><sup class="sup">sup</sup></p>
|
||||
@@ -9,6 +9,8 @@
|
||||
|
||||
#include <swmodeltestbase.hxx>
|
||||
|
||||
#include <editeng/escapementitem.hxx>
|
||||
|
||||
#include <com/sun/star/awt/FontSlant.hpp>
|
||||
#include <com/sun/star/awt/FontUnderline.hpp>
|
||||
#include <com/sun/star/awt/FontStrikeout.hpp>
|
||||
@@ -342,6 +344,30 @@ CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf80194_subscript)
|
||||
CPPUNIT_ASSERT( 70 < getProperty<sal_Int8>(xRun, u"CharEscapementHeight"_ustr));
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf121049Superscript)
|
||||
{
|
||||
createSwWebDoc("tdf121049-superscript-class.html");
|
||||
|
||||
// Without the accompanying fix in place, this test would have failed with:
|
||||
// - Expected: 33 (DFLT_ESC_SUPER)
|
||||
// - Actual : 0 (SvxEscapement::Off)
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE(
|
||||
"Superscript for <sup> missing", sal_Int32(DFLT_ESC_SUPER),
|
||||
getProperty<sal_Int32>(getRun(getParagraph(1), 1), u"CharEscapement"_ustr));
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(HtmlImportTest, testTdf121049Subscript)
|
||||
{
|
||||
createSwWebDoc("tdf121049-subscript-class.html");
|
||||
|
||||
// Without the accompanying fix in place, this test would have failed with:
|
||||
// - Expected: -8 (DFLT_ESC_SUB)
|
||||
// - Actual : 0 (SvxEscapement::Off)
|
||||
CPPUNIT_ASSERT_EQUAL_MESSAGE(
|
||||
"Subscript for <sub> missing", sal_Int32(DFLT_ESC_SUB),
|
||||
getProperty<sal_Int32>(getRun(getParagraph(1), 1), u"CharEscapement"_ustr));
|
||||
}
|
||||
|
||||
CPPUNIT_TEST_FIXTURE(HtmlImportTest, testReqIfTable)
|
||||
{
|
||||
setImportFilterName(TestFilter::HTML_WRITER);
|
||||
|
||||
@@ -77,6 +77,8 @@ const sal_uInt16 aItemIds[] =
|
||||
RES_BREAK,
|
||||
RES_PAGEDESC,
|
||||
RES_KEEP,
|
||||
// tdf#121049 - preserve superscript/subscript when pasting HTML with class definition
|
||||
RES_CHRATR_ESCAPEMENT,
|
||||
};
|
||||
|
||||
void SwCSS1Parser::ChgPageDesc( const SwPageDesc *pPageDesc,
|
||||
|
||||
Reference in New Issue
Block a user