diff options
author | Justin Luth <justin.luth@collabora.com> | 2023-03-13 07:45:54 -0400 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2023-03-15 09:45:16 +0000 |
commit | 1a12246fc1deaaf1e2c723c0c541de85cf88101e (patch) | |
tree | 2bf8b5784e213e81cd4f5e1e50329bd4177f406c | |
parent | fb8522e457b098b5ade98a4a4babbc8704d3fad4 (diff) |
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 <jluth@mail.com>
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 40 |
1 files changed, 17 insertions, 23 deletions
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; |