diff options
author | Vasily Melenchuk <Vasily.Melenchuk@cib.de> | 2017-06-20 14:20:31 +0300 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-06-27 15:39:12 +0200 |
commit | d5b19100ca4d3670d1b5367e8000739af60a6892 (patch) | |
tree | 96bb0dd67ccfbe6cc7611255e3d6afb4eb543d8b /writerfilter | |
parent | 16e625c92f73eae7b95c788e2545d01dc9b05680 (diff) |
tdf#100075 DOCX frame height rule updated
According to "[MS-OE376]: Office Implementation Information for
ECMA-376 Standards Support" Word treats default value for
hRule attribute in a different way: if frame height is missing it
is "auto" (as in specification), but if frame height exist, then
default value for hRule is "atLeast".
Change-Id: I0ce30b61d1a6b85febbbd8a6bf5af3eb1bb2767f
Reviewed-on: https://gerrit.libreoffice.org/39065
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index ef3d0ade41e5..7e4da2b359a5 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -874,10 +874,25 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) rAppendContext.pLastParagraphProperties->Geth() : pStyleProperties->Geth() > 0 ? pStyleProperties->Geth() : DEFAULT_FRAME_MIN_HEIGHT)); - aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_SIZE_TYPE), sal_Int16( + sal_Int16 nhRule = sal_Int16( rAppendContext.pLastParagraphProperties->GethRule() >= 0 ? rAppendContext.pLastParagraphProperties->GethRule() : - pStyleProperties->GethRule() >=0 ? pStyleProperties->GethRule() : text::SizeType::VARIABLE))); + pStyleProperties->GethRule()); + if ( nhRule < 0 ) + { + if ( rAppendContext.pLastParagraphProperties->Geth() >= 0 || + pStyleProperties->GethRule() >= 0 ) + { + // [MS-OE376] Word uses a default value of "atLeast" for + // this attribute when the value of the h attribute is not 0. + nhRule = text::SizeType::MIN; + } + else + { + nhRule = text::SizeType::VARIABLE; + } + } + aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_SIZE_TYPE), nhRule)); aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_WIDTH_TYPE), bAutoWidth ? text::SizeType::MIN : text::SizeType::FIX)); @@ -967,10 +982,21 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) nWidth = DEFAULT_FRAME_MIN_WIDTH; aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_WIDTH), nWidth)); - aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_SIZE_TYPE), sal_Int16( - rAppendContext.pLastParagraphProperties->GethRule() >= 0 ? - rAppendContext.pLastParagraphProperties->GethRule() : - text::SizeType::VARIABLE))); + sal_Int16 nhRule = sal_Int16(rAppendContext.pLastParagraphProperties->GethRule()); + if ( nhRule < 0 ) + { + if ( rAppendContext.pLastParagraphProperties->Geth() >= 0 ) + { + // [MS-OE376] Word uses a default value of atLeast for + // this attribute when the value of the h attribute is not 0. + nhRule = text::SizeType::MIN; + } + else + { + nhRule = text::SizeType::VARIABLE; + } + } + aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_SIZE_TYPE), nhRule)); aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_WIDTH_TYPE), bAutoWidth ? text::SizeType::MIN : text::SizeType::FIX)); |