[Libreoffice-commits] core.git: sw/qa writerfilter/source

Miklos Vajna vmiklos at suse.cz
Fri Apr 19 08:32:40 PDT 2013


 sw/qa/extras/ooxmlimport/data/fdo63685.docx   |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx      |   10 ++++++++++
 writerfilter/source/dmapper/GraphicImport.cxx |    8 ++++----
 3 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit a88ac708403c03d0f950f09ec29c0d5a1e5a85b4
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Apr 19 17:14:05 2013 +0200

    fdo#63685 wp:inline's distT/B/L/R is in EMU's, not twips
    
    Regression from 3d7e168a2a43c2414b0633379102ddb29437e75b.
    
    Change-Id: I9ab3f9f41316a01d5a74f3e500bad7a83c8d2dca

diff --git a/sw/qa/extras/ooxmlimport/data/fdo63685.docx b/sw/qa/extras/ooxmlimport/data/fdo63685.docx
new file mode 100644
index 0000000..a1348fc
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo63685.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index b8addac..db545c3 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 895e814..b440564 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();


More information about the Libreoffice-commits mailing list