diff options
author | Attila Bakos <bakos.attilakaroly@nisz.hu> | 2020-05-07 10:40:44 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2020-05-12 12:03:35 +0200 |
commit | 1237acf9851f8b12d1ccd929e2aa8b184c06d552 (patch) | |
tree | ad6b438253aab2311e4ddcf5f75d5834d9d262d5 /sw | |
parent | e21ef73de4591c0d8e11920b7c21d7bbfeddc701 (diff) |
tdf#132811 DOCX: fix formula alignment – part 2
Formula are aligned inline again, but in the
right position, fixing both import and export.
This partially reverts
commit 8b613c4603047dc24aa9b03fb49f4fe1b65af2a3
(tdf#121525 OOXML import: fix formula alignment).
Co-author: Tibor Nagy (NISZ)
Change-Id: If5c13db749fe5c3b1aee754b47dabc9fabd7ebb9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93631
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index 358ed59bd4ae..8c40788c3dd9 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -48,27 +48,30 @@ DECLARE_OOXMLIMPORT_TEST(Tdf130907,"tdf130907.docx") { uno::Reference<text::XTextRange> xPara1 = getParagraph(2); CPPUNIT_ASSERT(xPara1.is()); - uno::Reference<beans::XPropertySet> xFormula1Props = getParagraphAnchoredObject(0, xPara1); + uno::Reference<beans::XPropertySet> xFormula1Props(xPara1, uno::UNO_QUERY); CPPUNIT_ASSERT(xFormula1Props.is()); sal_Int16 nHOri1; - xFormula1Props->getPropertyValue("HoriOrient") >>= nHOri1; - CPPUNIT_ASSERT_EQUAL_MESSAGE("The alignment of the equation is not left!",sal_Int16(3),nHOri1); + xFormula1Props->getPropertyValue("ParaAdjust") >>= nHOri1; + CPPUNIT_ASSERT_EQUAL_MESSAGE("The alignment of the equation is not left!", + sal_Int16(style::ParagraphAdjust::ParagraphAdjust_LEFT), nHOri1); uno::Reference<text::XTextRange> xPara2 = getParagraph(3); CPPUNIT_ASSERT(xPara2.is()); - uno::Reference<beans::XPropertySet> xFormula2Props = getParagraphAnchoredObject(0, xPara2); + uno::Reference<beans::XPropertySet> xFormula2Props(xPara2, uno::UNO_QUERY); CPPUNIT_ASSERT(xFormula2Props.is()); sal_Int16 nHOri2; - xFormula2Props->getPropertyValue("HoriOrient") >>= nHOri2; - CPPUNIT_ASSERT_EQUAL_MESSAGE("The alignment of the equation is not center!", sal_Int16(2), nHOri2); + xFormula2Props->getPropertyValue("ParaAdjust") >>= nHOri2; + CPPUNIT_ASSERT_EQUAL_MESSAGE("The alignment of the equation is not center!", + sal_Int16(style::ParagraphAdjust::ParagraphAdjust_CENTER), nHOri2); uno::Reference<text::XTextRange> xPara3 = getParagraph(5); CPPUNIT_ASSERT(xPara3.is()); - uno::Reference<beans::XPropertySet> xFormula3Props = getParagraphAnchoredObject(0, xPara3); + uno::Reference<beans::XPropertySet> xFormula3Props(xPara3, uno::UNO_QUERY); CPPUNIT_ASSERT(xFormula3Props.is()); sal_Int16 nHOri3; - xFormula3Props->getPropertyValue("HoriOrient") >>= nHOri3; - CPPUNIT_ASSERT_EQUAL_MESSAGE("The alignment of the equation is not right!", sal_Int16(1), nHOri3); + xFormula3Props->getPropertyValue("ParaAdjust") >>= nHOri3; + CPPUNIT_ASSERT_EQUAL_MESSAGE("The alignment of the equation is not right!", + sal_Int16(style::ParagraphAdjust::ParagraphAdjust_RIGHT), nHOri3); } DECLARE_OOXMLEXPORT_EXPORTONLY_TEST(testTdf78749, "tdf78749.docx") |