summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlimport/data/fdo63685.docxbin0 -> 10964 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx10
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx8
3 files changed, 14 insertions, 4 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/fdo63685.docx b/sw/qa/extras/ooxmlimport/data/fdo63685.docx
new file mode 100644
index 000000000000..a1348fcff3b6
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/fdo63685.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index b8addaccac92..db545c36af33 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -125,6 +125,7 @@ public:
void testFdo59273();
void testTableWidth();
void testConditionalstylesTbllook();
+ void testFdo63685();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -201,6 +202,7 @@ void Test::run()
{"fdo59273.docx", &Test::testFdo59273},
{"table_width.docx", &Test::testTableWidth},
{"conditionalstyles-tbllook.docx", &Test::testConditionalstylesTbllook},
+ {"fdo63685.docx", &Test::testFdo63685},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1324,6 +1326,14 @@ void Test::testConditionalstylesTbllook()
CPPUNIT_ASSERT_EQUAL(sal_Int32(0x7F7F7F), getProperty<sal_Int32>(xTable->getCellByName("A1"), "BackColor"));
}
+void Test::testFdo63685()
+{
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ // Was 85697, i.e. original 114120 was converted to mm100 from twips, not from EMUs.
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(318), getProperty<sal_Int32>(xDraws->getByIndex(0), "TopMargin"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 895e814b84fb..b44056417581 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -991,16 +991,16 @@ void GraphicImport::lcl_attribute(Id nName, Value & val)
}
break;
case NS_ooxml::LN_CT_Inline_distT:
- m_pImpl->nTopMargin = ConversionHelper::convertTwipToMM100(nIntValue);
+ m_pImpl->nTopMargin = ConversionHelper::convertEMUToMM100(nIntValue);
break;
case NS_ooxml::LN_CT_Inline_distB:
- m_pImpl->nBottomMargin = ConversionHelper::convertTwipToMM100(nIntValue);
+ m_pImpl->nBottomMargin = ConversionHelper::convertEMUToMM100(nIntValue);
break;
case NS_ooxml::LN_CT_Inline_distL:
- m_pImpl->nLeftMargin = ConversionHelper::convertTwipToMM100(nIntValue);
+ m_pImpl->nLeftMargin = ConversionHelper::convertEMUToMM100(nIntValue);
break;
case NS_ooxml::LN_CT_Inline_distR:
- m_pImpl->nRightMargin = ConversionHelper::convertTwipToMM100(nIntValue);
+ m_pImpl->nRightMargin = ConversionHelper::convertEMUToMM100(nIntValue);
break;
case NS_ooxml::LN_CT_GraphicalObjectData_uri:
val.getString();