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

Miklos Vajna vmiklos at suse.cz
Mon Mar 25 02:25:35 PDT 2013


 sw/qa/extras/ooxmlimport/data/fdo60922.docx  |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx     |    8 ++++++++
 writerfilter/source/dmapper/DomainMapper.cxx |    4 +++-
 3 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit cadb3433b395b53a9eda584ed5fee79ca74e7483
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Mon Mar 25 10:12:20 2013 +0100

    fdo#60922 ignore DOCX import of w:position w:val="0"
    
    Change-Id: I10e9c0f1078e36710335a9a48f7f02292c764795

diff --git a/sw/qa/extras/ooxmlimport/data/fdo60922.docx b/sw/qa/extras/ooxmlimport/data/fdo60922.docx
new file mode 100644
index 0000000..0d1ff26
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/fdo60922.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 94c934d..a5b41e3 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -121,6 +121,7 @@ public:
     void testFdo59638();
     void testFdo61343();
     void testToolsLineNumbering();
+    void testFdo60922();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -193,6 +194,7 @@ void Test::run()
         {"fdo59638.docx", &Test::testFdo59638},
         {"fdo61343.docx", &Test::testFdo61343},
         {"tools-line-numbering.docx", &Test::testToolsLineNumbering},
+        {"fdo60922.docx", &Test::testFdo60922},
     };
     header();
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1280,6 +1282,12 @@ void Test::testToolsLineNumbering()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(3), nValue);
 }
 
+void Test::testFdo60922()
+{
+    // This was 0, not 100, due to wrong import of w:position w:val="0"
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(getRun(getParagraph(1), 1), "CharEscapementHeight"));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index a4d1e03..276aaa5 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2154,7 +2154,9 @@ void DomainMapper::sprmWithProps( Sprm& rSprm, PropertyMapPtr rContext, SprmType
     case NS_sprm::LN_CHpsInc:
         break;  // sprmCHpsInc
     case NS_sprm::LN_CHpsPos:
-        m_pImpl->deferCharacterProperty( nSprmId, uno::makeAny( nIntValue ));
+        // The spec says 0 is the same as the lack of the value, so don't parse that.
+        if (nIntValue)
+            m_pImpl->deferCharacterProperty( nSprmId, uno::makeAny( nIntValue ));
         break;  // sprmCHpsPos
     case NS_sprm::LN_CHpsPosAdj:
         break;  // sprmCHpsPosAdj


More information about the Libreoffice-commits mailing list