diff options
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 6 | ||||
-rw-r--r-- | writerfilter/source/dmapper/GraphicImport.cxx | 7 |
2 files changed, 9 insertions, 4 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index 2463534dd8ba..0ea69e698807 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -174,10 +174,8 @@ after they are loaded. CPPUNIT_ASSERT_EQUAL( OUString( "Red" ), descr2 ); CPPUNIT_ASSERT_EQUAL( OUString( "Green" ), descr3 ); - //FIXME: MS Word shows the image below the line of text, not above it. - // tdf#139915 This was 826, but it should be -826 - if (isExported()) - CPPUNIT_ASSERT_EQUAL(sal_Int32(-826), getProperty<sal_Int32>(image1, "VertOrientPosition")); + // tdf#139915/tdf#159157 This was 826, but it should be -826 + CPPUNIT_ASSERT_EQUAL(sal_Int32(-826), getProperty<sal_Int32>(image1, "VertOrientPosition")); sal_Int16 nExpected = text::RelOrientation::TEXT_LINE; CPPUNIT_ASSERT_EQUAL(nExpected, getProperty<sal_Int16>(image1, "VertOrientRelation")); diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index 63330c477cbd..eebd1b822897 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -1850,6 +1850,13 @@ uno::Reference<text::XTextContent> GraphicImport::createGraphicObject(uno::Refer m_pImpl->m_nLeftPosition = 0; } + if (m_pImpl->m_nVertRelation == text::RelOrientation::TEXT_LINE) + { + // Word's "line" is "below the bottom of the line", our TEXT_LINE is + // "towards top, from the bottom of the line", so invert the vertical position. + m_pImpl->m_nTopPosition *= -1; + } + m_pImpl->applyPosition(xGraphicObjectProperties); m_pImpl->applyRelativePosition(xGraphicObjectProperties); if( !m_pImpl->m_bOpaque ) |