writerfilter/source/dmapper/DomainMapper_Impl.cxx |   24 ++++++++++------------
 1 file changed, 11 insertions(+), 13 deletions(-)

New commits:
commit 33ce22f080bbedfde78fdc907b0d4d5bd0f68f14
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Sat Mar 11 19:04:06 2023 -0500
Commit:     Justin Luth <jl...@mail.com>
CommitDate: Wed Mar 15 12:38:02 2023 +0000

    tdf#154129 writerfilter framePr: deduplicate w:wrap
    
    This is not quite a No Functional Change commit.
    
    Likely it was a mistake that this was different for no-parent style.
    Ahh, yes. commit 3eda8234acf09cd5a31cdcde76f04631a51fcc37
    Author: Caolán McNcNamara on Thu Apr 27 15:25:20 2017 +0100
        Resolves: tdf#107411 LibreOffice hangs at RTF import time
    made the change to only one half.
    
    Basically only RTF format ever has no "parent style",
    so this should be a rather safe change to make.
    
    MAKE_FIXED_SIZE is ENUM_MAX which would be
    define SAL_MAX_ENUM 0x7fffffff.
    
    Change-Id: I72ebfbdfbf656450068339326ad2a182d56b291f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148811
    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 822746e5f02e..c10703ba2bee 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1762,6 +1762,17 @@ void 
DomainMapper_Impl::CheckUnregisteredFrameConversion( )
         aFrameProperties.push_back(
             
comphelper::makePropertyValue(getPropertyName(PROP_VERT_ORIENT_RELATION), 
nVAnchor));
 
+        text::WrapTextMode nWrap = text::WrapTextMode_NONE;
+        for (const auto pProp : vProps)
+        {
+            if (pProp->GetWrap() == 
text::WrapTextMode::WrapTextMode_MAKE_FIXED_SIZE)
+                continue;
+            nWrap = pProp->GetWrap();
+            break;
+        }
+        aFrameProperties.push_back(
+            comphelper::makePropertyValue(getPropertyName(PROP_SURROUND), 
nWrap));
+
         if (vProps.size() > 1)
         {
             if (const std::optional<sal_Int16> nDirection = 
PopFrameDirection())
@@ -1769,16 +1780,6 @@ void 
DomainMapper_Impl::CheckUnregisteredFrameConversion( )
                 
aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_FRM_DIRECTION),
 *nDirection));
             }
 
-            text::WrapTextMode nWrap = text::WrapTextMode_NONE;
-            for (const auto pProp : vProps)
-            {
-                if (pProp->GetWrap() == 
text::WrapTextMode::WrapTextMode_MAKE_FIXED_SIZE)
-                    continue;
-                nWrap = pProp->GetWrap();
-                break;
-            }
-            aFrameProperties.push_back(
-                comphelper::makePropertyValue(getPropertyName(PROP_SURROUND), 
nWrap));
 
             /** FDO#73546 : distL & distR should be unsigned integers <Ecma 
20.4.3.6>
                 Swapped the array elements 11,12 & 13,14 since 11 & 12 are
@@ -1837,9 +1838,6 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( 
)
             
aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_TOP_MARGIN),
 nHoriOrient == text::HoriOrientation::LEFT ? 0 : nHoriDist));
             
aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_BOTTOM_MARGIN),
 nHoriOrient == text::HoriOrientation::RIGHT ? 0 : nHoriDist));
 
-            if( rAppendContext.pLastParagraphProperties->GetWrap() >= 
text::WrapTextMode_NONE )
-                
aFrameProperties.push_back(comphelper::makePropertyValue("Surround", 
rAppendContext.pLastParagraphProperties->GetWrap()));
-
             lcl_MoveBorderPropertiesToFrame(aFrameProperties,
                 rAppendContext.pLastParagraphProperties->GetStartingRange(),
                 rAppendContext.pLastParagraphProperties->GetEndingRange());

Reply via email to