writerfilter/source/dmapper/DomainMapper_Impl.cxx | 54 ++++++++-------------- 1 file changed, 22 insertions(+), 32 deletions(-)
New commits: commit fb8522e457b098b5ade98a4a4babbc8704d3fad4 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Sat Mar 11 21:09:13 2023 -0500 Commit: Justin Luth <jl...@mail.com> CommitDate: Wed Mar 15 09:44:34 2023 +0000 NFC tdf#154129 writerfilter framePr: deduplicate Hori/VertOrient This patch should be a No Functional Change I had a unit test error in an earlier combined patch so it seemed better to split deduplication up into smaller chuncks and make the change incrementally. Change-Id: Ie6eeaca07fd5d4fd5bc312f131851ceda5cc3647 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148803 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 db61d2fda2d1..430726a464d3 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1630,6 +1630,28 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) std::vector<beans::PropertyValue> aFrameProperties; + sal_Int16 nHoriOrient = text::HoriOrientation::NONE; + for (const auto pProp : vProps) + { + if (pProp->GetxAlign() < 0) + continue; + nHoriOrient = pProp->GetxAlign(); + break; + } + aFrameProperties.push_back( + comphelper::makePropertyValue(getPropertyName(PROP_HORI_ORIENT), nHoriOrient)); + + sal_Int16 nVertOrient = text::VertOrientation::NONE; + for (const auto pProp : vProps) + { + if (pProp->GetyAlign() < 0) + continue; + nVertOrient = pProp->GetyAlign(); + break; + } + aFrameProperties.push_back( + comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT), nVertOrient)); + if (vProps.size() > 1) { sal_Int32 nWidth = -1; @@ -1688,16 +1710,6 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_FRM_DIRECTION), *nDirection)); } - sal_Int16 nHoriOrient = text::HoriOrientation::NONE; - for (const auto pProp : vProps) - { - if (pProp->GetxAlign() < 0) - continue; - nHoriOrient = pProp->GetxAlign(); - break; - } - aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_HORI_ORIENT), nHoriOrient)); - //set a non negative default value bool bValidX = false; sal_Int32 nX = DEFAULT_VALUE; @@ -1724,16 +1736,6 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) aFrameProperties.push_back(comphelper::makePropertyValue( getPropertyName(PROP_HORI_ORIENT_RELATION), nHAnchor)); - sal_Int16 nVertOrient = text::VertOrientation::NONE; - for (const auto pProp : vProps) - { - if (pProp->GetyAlign() < 0) - continue; - nVertOrient = pProp->GetyAlign(); - break; - } - aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT), nVertOrient)); - //set a non negative default value bool bValidY = false; sal_Int32 nY = DEFAULT_VALUE; @@ -1846,18 +1848,6 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_WIDTH_TYPE), bAutoWidth ? text::SizeType::MIN : text::SizeType::FIX)); - sal_Int16 nHoriOrient = sal_Int16( - rAppendContext.pLastParagraphProperties->GetxAlign() >= 0 ? - rAppendContext.pLastParagraphProperties->GetxAlign() : - text::HoriOrientation::NONE ); - aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_HORI_ORIENT), nHoriOrient)); - - sal_Int16 nVertOrient = sal_Int16( - rAppendContext.pLastParagraphProperties->GetyAlign() >= 0 ? - rAppendContext.pLastParagraphProperties->GetyAlign() : - text::VertOrientation::NONE ); - aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT), nVertOrient)); - sal_Int32 nVertDist = rAppendContext.pLastParagraphProperties->GethSpace(); if( nVertDist < 0 ) nVertDist = 0;