diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2015-10-30 22:02:50 +1000 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2015-11-10 07:39:58 +0000 |
commit | 061d98ccc7fc95234514d5dee3d9e80e49b10dc7 (patch) | |
tree | 5b55f682de31a163fce704c971cc6c19e1d44c53 /sw | |
parent | d671a70f18c815427747f315179fa51533f47907 (diff) |
tdf#95071: fix spacing calculations for border with page offset
With commit ebf767eeb2a169ba533e1b2ffccf16f41d95df35, some previously
hidden bugs manifested themselves, this is one of them.
The margin size calculated incorrectly when border offset was from
page. The border is drawn from the margin inwards, so the margin
should be equal to OOXML w:space attribute, and border distance
should be OOXML page margin - border distance - border width.
Incorrect calculation gave negative margin, with IllegalArgumentException
thrown in SfxItemPropertySet::setPropertyValue.
Change-Id: Ifcf4a348e975df53410933aab3684d17f68b688c
Reviewed-on: https://gerrit.libreoffice.org/19586
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/plausable-border.docx | bin | 15737 -> 15719 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 2 |
2 files changed, 1 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/plausable-border.docx b/sw/qa/extras/ooxmlexport/data/plausable-border.docx Binary files differindex a1a95470a057..c6f049fe2d18 100644 --- a/sw/qa/extras/ooxmlexport/data/plausable-border.docx +++ b/sw/qa/extras/ooxmlexport/data/plausable-border.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 6f1ea3ec1010..003872ca6016 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -568,7 +568,7 @@ DECLARE_OOXMLIMPORT_TEST(testN758883, "n758883.docx") uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY); sal_Int32 nValue = 0; xPropertySet->getPropertyValue("LeftMargin") >>= nValue; - CPPUNIT_ASSERT_EQUAL(sal_Int32(794), nValue); + CPPUNIT_ASSERT_EQUAL(sal_Int32(847), nValue); // No assert for the 3rd problem: see the comment in the test doc. |