[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sw/qa writerfilter/source

Miklos Vajna vmiklos at suse.cz
Mon Mar 25 02:54:52 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 1f2dac0d945b8f1636ee203ec55cf7f21390e32e
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"
    
    (cherry picked from commit cadb3433b395b53a9eda584ed5fee79ca74e7483)
    
    Conflicts:
    	sw/qa/extras/ooxmlimport/ooxmlimport.cxx
    
    Change-Id: I10e9c0f1078e36710335a9a48f7f02292c764795
    Reviewed-on: https://gerrit.libreoffice.org/2981
    Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
    Tested-by: Fridrich Strba <fridrich at documentfoundation.org>

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 3f5a070..51ce241 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -114,6 +114,7 @@ public:
     void testFdo53985();
     void testFdo59638();
     void testFdo61343();
+    void testFdo60922();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -180,6 +181,7 @@ void Test::run()
         {"fdo53985.docx", &Test::testFdo53985},
         {"fdo59638.docx", &Test::testFdo59638},
         {"fdo61343.docx", &Test::testFdo61343},
+        {"fdo60922.docx", &Test::testFdo60922},
     };
     for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
     {
@@ -1132,6 +1134,12 @@ void Test::testFdo61343()
     CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount());
 }
 
+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 8e74201..d552e14 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -2152,7 +2152,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