writerfilter/source/dmapper/DomainMapper_Impl.cxx | 30 +++++++++------------- 1 file changed, 13 insertions(+), 17 deletions(-)
New commits: commit 611288b64548762e0731ed6323e1653e4fca2317 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Mon Mar 13 10:09:46 2023 -0400 Commit: Justin Luth <jl...@mail.com> CommitDate: Wed Mar 15 09:49:16 2023 +0000 tdf#154129 writerfilter framePr: deduplicate w:y This is not quite a No Functional Change commit. In the previous code, a zero value for Y was not added as a property if there was no parent style. Basically only RTF format ever has no "parent style", so this should be a rather safe change to make. I've done the same thing for others as well. Change-Id: I4a7ecb194ad8cbedf6d1b5c66cac7b10a1532b98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148808 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 624a2da20b30..48f92e1e6dbb 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1708,6 +1708,19 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) aFrameProperties.push_back( comphelper::makePropertyValue(getPropertyName(PROP_HORI_ORIENT), nHoriOrient)); + bool bValidY = false; + sal_Int32 nY = DEFAULT_VALUE; + for (const auto pProp : vProps) + { + bValidY = pProp->IsyValid(); + if (!bValidY) + continue; + nY = pProp->Gety(); + break; + } + aFrameProperties.push_back( + comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT_POSITION), nY)); + sal_Int16 nVertOrient = text::VertOrientation::NONE; for (const auto pProp : vProps) { @@ -1738,20 +1751,6 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) aFrameProperties.push_back(comphelper::makePropertyValue( getPropertyName(PROP_HORI_ORIENT_RELATION), nHAnchor)); - //set a non negative default value - bool bValidY = false; - sal_Int32 nY = DEFAULT_VALUE; - for (const auto pProp : vProps) - { - bValidY = pProp->IsyValid(); - if (!bValidY) - continue; - nY = pProp->Gety(); - break; - } - aFrameProperties.push_back( - comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT_POSITION), nY)); - //Default the anchor in case FramePr_vAnchor is missing ECMA 17.3.1.11 sal_Int16 nVAnchor = text::RelOrientation::FRAME; // 'text' // vAlign is ignored if vAnchor is set to 'text'. So, if w:y is not defined, @@ -1841,9 +1840,6 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) if( rAppendContext.pLastParagraphProperties->GethAnchor() >= 0 ) aFrameProperties.push_back(comphelper::makePropertyValue("HoriOrientRelation", sal_Int16(rAppendContext.pLastParagraphProperties->GethAnchor()))); - if( rAppendContext.pLastParagraphProperties->IsyValid() ) - aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT_POSITION), rAppendContext.pLastParagraphProperties->Gety())); - if( rAppendContext.pLastParagraphProperties->GetvAnchor() >= 0 ) aFrameProperties.push_back(comphelper::makePropertyValue("VertOrientRelation", sal_Int16(rAppendContext.pLastParagraphProperties->GetvAnchor())));