cui/source/tabpages/chardlg.cxx | 3 +++ editeng/source/items/textitem.cxx | 3 ++- sw/qa/extras/ooxmlexport/data/test_tdf120412.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport10.cxx | 11 +++++++++++ writerfilter/source/dmapper/DomainMapper.cxx | 2 ++ 5 files changed, 18 insertions(+), 1 deletion(-)
New commits: commit 868d9212a1b4cce7faa3eabc047ab7f312c613de Author: László Németh <[email protected]> AuthorDate: Wed May 29 11:56:50 2019 +0200 Commit: László Németh <[email protected]> CommitDate: Wed May 29 14:31:15 2019 +0200 tdf#120412 character formatting UI: allow >100% raising in superscript/subscript text positions instead of changing the greater values (eg. imported from DOCX) to 100% by accident, simply using the character formatting window. Change-Id: I3adf6445070c183bd6005a02239962f18f504f9d Reviewed-on: https://gerrit.libreoffice.org/73151 Tested-by: Jenkins Reviewed-by: László Németh <[email protected]> diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 9236a26a2dbd..d1340a4463b3 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -2704,6 +2704,9 @@ void SvxCharPositionPage::Reset( const SfxItemSet* rSet ) m_nSuperProp = static_cast<sal_uInt8>(sUser.getToken( 0, ';', nIdx ).toInt32()); m_nSubProp = static_cast<sal_uInt8>(sUser.getToken( 0, ';', nIdx ).toInt32()); + // tdf#120412 up to 14400% (eg. 1584 pt with 11 pt letters) + m_xHighLowMF->set_max(14400, FieldUnit::PERCENT); + //fdo#75307 validate all the entries and discard all of them if any are //out of range bool bValid = true; commit bdfb3edb981ff04f1f3f6dc1ef335e37a0980245 Author: Jozsef Szakacs <[email protected]> AuthorDate: Wed Mar 13 12:32:20 2019 +0100 Commit: László Németh <[email protected]> CommitDate: Wed May 29 14:31:03 2019 +0200 tdf#120412 DOCX filter: fix missing superscript by editeng support of large superscript raising. Maximal raising of superscript text is 1584 pt in MSO, while LibreOffice didn't import the values greater than 100% of the current font height. Using the maximal percent value of the default 11 pt font, the limit is 14400% now, fixing most of the import problems. Greater raisings will be limited to 14400% during the DOCX import. Note: the standard doesn't limit the bigger percent values, see "20.374 style:text-position" and "18.3.23 percent" in OpenDocument 1.2. Change-Id: I3d0d08f273f2067180f74fba40c47d62364fcc59 Reviewed-on: https://gerrit.libreoffice.org/69164 Tested-by: Jenkins Reviewed-by: László Németh <[email protected]> diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 13c5c04ffbbe..e4ce386c68c9 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -1782,7 +1782,8 @@ bool SvxEscapementItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) case MID_ESC: { sal_Int16 nVal = sal_Int16(); - if( (rVal >>= nVal) && (std::abs(nVal) <= 101)) + // tdf#120412 up to 14400% (eg. 1584 pt with 11 pt letters) + if( (rVal >>= nVal) && (std::abs(nVal) <= 14400)) nEsc = nVal; else return false; diff --git a/sw/qa/extras/ooxmlexport/data/test_tdf120412.docx b/sw/qa/extras/ooxmlexport/data/test_tdf120412.docx new file mode 100644 index 000000000000..6ce527842c9b Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/test_tdf120412.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx index 3b1250f11fd9..9cb85a8d11f0 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport10.cxx @@ -203,6 +203,17 @@ DECLARE_OOXMLEXPORT_TEST(textboxWpgOnly, "textbox-wpg-only.docx") CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xText), 1), "CharEscapementHeight")); } +DECLARE_OOXMLEXPORT_TEST(testFontEsc, "test_tdf120412.docx") +{ + xmlDocPtr pXmlDoc =parseExport("word/document.xml"); + if (!pXmlDoc) + return; + // don't lose the run with superscript formatting + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r", 2); + // raising is greater, than 100% + assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r[2]/w:rPr/w:position","val", "24"); +} + DECLARE_OOXMLEXPORT_TEST(testMceWpg, "mce-wpg.docx") { // Make sure that we read the primary branch, if wpg is requested as a feature. diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx index cc7b7c720e05..6276d56a1b01 100644 --- a/writerfilter/source/dmapper/DomainMapper.cxx +++ b/writerfilter/source/dmapper/DomainMapper.cxx @@ -2839,6 +2839,8 @@ void DomainMapper::processDeferredCharacterProperties( const std::map< sal_Int32 nEscapement = ( nIntValue > 0 ) ? 58: -58; } } + // tdf#120412 up to 14400% (eg. 1584 pt with 11 pt letters) + if( nEscapement > 14400 ) nEscapement = 14400; rContext->Insert(PROP_CHAR_ESCAPEMENT, uno::makeAny( nEscapement ) ); rContext->Insert(PROP_CHAR_ESCAPEMENT_HEIGHT, uno::makeAny( nProp ) ); } _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
