writerfilter/source/dmapper/DomainMapper_Impl.cxx | 40 +++++++++------------- 1 file changed, 17 insertions(+), 23 deletions(-)
New commits: commit 1a12246fc1deaaf1e2c723c0c541de85cf88101e Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Mon Mar 13 07:45:54 2023 -0400 Commit: Justin Luth <jl...@mail.com> CommitDate: Wed Mar 15 09:45:16 2023 +0000 NFC tdf#154129 writerfilter framePr: deduplicate w:w This should be a No Functional Change. I had a unit test error deduplicating the combined patch (in combination with Hori/VertOrient) but not now. And I don't see any differences (even after a git reflog/git cherry-pick) and yet the unit test failure was consistent over three tries... Change-Id: I00f5290590fe51c68d1e3e65df1f172252655feb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148804 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 430726a464d3..eee409798ce1 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1630,6 +1630,23 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) std::vector<beans::PropertyValue> aFrameProperties; + sal_Int32 nWidth = -1; + for (const auto pProp : vProps) + { + if (pProp->Getw() < 0) + continue; + nWidth = pProp->Getw(); + break; + } + bool bAutoWidth = nWidth < 1; + if (bAutoWidth) + nWidth = DEFAULT_FRAME_MIN_WIDTH; + aFrameProperties.push_back( + comphelper::makePropertyValue(getPropertyName(PROP_WIDTH), nWidth)); + aFrameProperties.push_back( + comphelper::makePropertyValue(getPropertyName(PROP_WIDTH_TYPE), + bAutoWidth ? text::SizeType::MIN : text::SizeType::FIX)); + sal_Int16 nHoriOrient = text::HoriOrientation::NONE; for (const auto pProp : vProps) { @@ -1654,19 +1671,6 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) if (vProps.size() > 1) { - sal_Int32 nWidth = -1; - for (const auto pProp : vProps) - { - if (pProp->Getw() < 0) - continue; - nWidth = pProp->Getw(); - break; - } - bool bAutoWidth = nWidth < 1; - if( bAutoWidth ) - nWidth = DEFAULT_FRAME_MIN_WIDTH; - aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_WIDTH), nWidth)); - bool bValidH = false; sal_Int32 nHeight = DEFAULT_FRAME_MIN_HEIGHT; for (const auto pProp : vProps) @@ -1703,8 +1707,6 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) } 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)); - if (const std::optional<sal_Int16> nDirection = PopFrameDirection()) { aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_FRM_DIRECTION), *nDirection)); @@ -1824,12 +1826,6 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) } else { - sal_Int32 nWidth = rAppendContext.pLastParagraphProperties->Getw(); - bool bAutoWidth = nWidth < 1; - if( bAutoWidth ) - nWidth = DEFAULT_FRAME_MIN_WIDTH; - aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_WIDTH), nWidth)); - sal_Int16 nhRule = sal_Int16(rAppendContext.pLastParagraphProperties->GethRule()); if ( nhRule < 0 ) { @@ -1846,8 +1842,6 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) } 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)); - sal_Int32 nVertDist = rAppendContext.pLastParagraphProperties->GethSpace(); if( nVertDist < 0 ) nVertDist = 0;