writerfilter/source/dmapper/DomainMapper_Impl.cxx | 29 +++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-)
New commits: commit b1696d2a3e2015b60fc04a785e6a9f7925f4232e Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Sat Mar 11 14:47:18 2023 -0500 Commit: Justin Luth <jl...@mail.com> CommitDate: Tue Mar 14 11:17:41 2023 +0000 tdf#154129 writerfilter framePr: check whole style inheritance: Y/YAlign This patch depends on HAnchor, which created vProps. There were no existing unit tests where the old and new method produced different values. Change-Id: I1bf7dd6ee7a8c8d00f7c743657a32a86986e7a7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148690 Reviewed-by: Justin Luth <jl...@mail.com> Tested-by: Jenkins diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index e6f9f8f6a3ab..fad1efd9ead3 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1692,18 +1692,29 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) aFrameProperties.push_back(comphelper::makePropertyValue( getPropertyName(PROP_HORI_ORIENT_RELATION), nHAnchor)); - sal_Int16 nVertOrient = sal_Int16( - rAppendContext.pLastParagraphProperties->GetyAlign() >= 0 ? - rAppendContext.pLastParagraphProperties->GetyAlign() : - pStyleProperties->props().GetyAlign() >= 0 ? pStyleProperties->props().GetyAlign() : text::VertOrientation::NONE ); + 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 - aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT_POSITION), - rAppendContext.pLastParagraphProperties->IsyValid() ? - rAppendContext.pLastParagraphProperties->Gety() : - pStyleProperties->props().IsyValid() - ? pStyleProperties->props().Gety() : 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'