diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-09-03 13:50:48 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-09-03 17:28:35 +0200 |
commit | 74533c1f1d5e8e48a65d33bef236f1382d32aa06 (patch) | |
tree | 8987f5ce0a00bbe4d6cc189dcba40d19ddd2bb80 /sw/qa/extras/ooxmlexport | |
parent | a28cae7899a6fd0977919fd907396c70d92e41c2 (diff) |
tdf#162746: sanitize width in SwTextFormatter::FeedInf
Since commit 7e9c23894bd45e015accf26ae0a77035b7eed452 (tdf#161368:
use SwTwips for twip sizes, instead of sal_uInt16), the result of
rInf.Right() - GetLeftMargin() is not cast to an unsigned type,
so may happen to be a negative value. Make sure it's not negative;
this doesn't fix the layout of this document (it still opens with
table having wrong width, as before the mentioned commit), just
avoids the infinite layout loop.
Change-Id: I4930c8718d5fd09064ae0febd9b5adbdb0e2cd5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172789
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/qa/extras/ooxmlexport')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/tdf162746.docx | bin | 0 -> 14899 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport21.cxx | 6 |
2 files changed, 6 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/tdf162746.docx b/sw/qa/extras/ooxmlexport/data/tdf162746.docx Binary files differnew file mode 100644 index 000000000000..6143196a13cb --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/tdf162746.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx index ee67ec61fe5e..884ddc991585 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport21.cxx @@ -1177,6 +1177,12 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf61309) CPPUNIT_ASSERT_EQUAL(1, getPages()); } +CPPUNIT_TEST_FIXTURE(Test, testTdf162746) +{ + // Without the fix in place this hangs (and eventually OOMs) on opening + loadAndSave("tdf162746.docx"); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); |