diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2013-03-25 10:12:20 +0100 |
---|---|---|
committer | Fridrich Strba <fridrich@documentfoundation.org> | 2013-03-25 09:54:31 +0000 |
commit | 1f2dac0d945b8f1636ee203ec55cf7f21390e32e (patch) | |
tree | cc0f6aad9ca013c9bd7b8e9c301526a251459755 | |
parent | 5451b7bd30fba75f216f38ba1a1c7c144fd3fa7e (diff) |
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@documentfoundation.org>
Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/fdo60922.docx | bin | 0 -> 4503 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 8 | ||||
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper.cxx | 4 |
3 files changed, 11 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/fdo60922.docx b/sw/qa/extras/ooxmlimport/data/fdo60922.docx Binary files differnew file mode 100644 index 000000000000..0d1ff2613ecd --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/fdo60922.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 3f5a07064a75..51ce2410060b 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 8e74201c19ed..d552e144f1a3 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 |