diff options
author | Patrick Jaap <patrick.jaap@tu-dresden.de> | 2020-02-06 18:33:19 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-02-10 09:35:13 +0100 |
commit | 8cbd7f59bb99282c4bcb60639da1263c8eb3a5e3 (patch) | |
tree | e747268934c6c172362feb5e82683f9ef2693c8e | |
parent | 157abc56d634e72e0654dc0cf88d0092744ac19c (diff) |
tdf#130262 ignore negative wrap distance values in doc prop import
Change-Id: I2c06b12c958dfde09adcc2ae4c59532ffde6b6fe
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88127
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | filter/source/msfilter/dffpropset.cxx | 11 | ||||
-rw-r--r-- | sw/qa/extras/ww8import/data/tdf130262.doc | bin | 0 -> 36864 bytes | |||
-rw-r--r-- | sw/qa/extras/ww8import/ww8import.cxx | 5 |
3 files changed, 16 insertions, 0 deletions
diff --git a/filter/source/msfilter/dffpropset.cxx b/filter/source/msfilter/dffpropset.cxx index 5b0b1194ae06..e5803046b4e4 100644 --- a/filter/source/msfilter/dffpropset.cxx +++ b/filter/source/msfilter/dffpropset.cxx @@ -1217,6 +1217,17 @@ void DffPropSet::ReadPropSet( SvStream& rIn, bool bSetUninitializedOnly ) } if ( bSetProperty ) { + // tdf#130262: ignore negative values for distances (maybe this list needs to be extended) + // LO does not allow negative values but [MS-ODRAW] does not forbid them + if ( nRecType == DFF_Prop_dxWrapDistLeft || nRecType == DFF_Prop_dxWrapDistRight + || nRecType == DFF_Prop_dyWrapDistTop || nRecType == DFF_Prop_dyWrapDistBottom ) + { + if ( static_cast<sal_Int32>(nContent) < 0 ) + { + break; + } + } + mpPropSetEntries[ nRecType ].nContent = nContent; mpPropSetEntries[ nRecType ].aFlags = aPropFlag; } diff --git a/sw/qa/extras/ww8import/data/tdf130262.doc b/sw/qa/extras/ww8import/data/tdf130262.doc Binary files differnew file mode 100644 index 000000000000..fb60beacd79d --- /dev/null +++ b/sw/qa/extras/ww8import/data/tdf130262.doc diff --git a/sw/qa/extras/ww8import/ww8import.cxx b/sw/qa/extras/ww8import/ww8import.cxx index c67f2c9385b0..468cacfd0967 100644 --- a/sw/qa/extras/ww8import/ww8import.cxx +++ b/sw/qa/extras/ww8import/ww8import.cxx @@ -365,6 +365,11 @@ DECLARE_WW8IMPORT_TEST(testTdf110987, "tdf110987") CPPUNIT_ASSERT(sFilterName != "MS Word 97 Vorlage"); } +DECLARE_WW8IMPORT_TEST(testTdf130262, "tdf130262.doc") +{ + // We had an infinite layout loop +} + // tests should only be added to ww8IMPORT *if* they fail round-tripping in ww8EXPORT CPPUNIT_PLUGIN_IMPLEMENT(); |