sw/source/core/text/itratr.cxx   |   34 +++++++++++++++++-----------------
 sw/source/filter/ww8/ww8par6.cxx |    7 +++++--
 2 files changed, 22 insertions(+), 19 deletions(-)

New commits:
commit a975a5f80fcb6bfa5d656e5647485832bb41d49e
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Oct 12 15:37:53 2021 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue Oct 12 17:55:42 2021 +0200

    ofz#39837 avoid timeout
    
    Change-Id: Icde966364e7d79c52b01abe4c7109fbc5db38b09
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123460
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index e6105c2ff5ad..2074983ee90c 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2730,8 +2730,11 @@ void SwWW8ImplReader::StopApo()
 
             aFlySet.ClearItem(RES_FRM_SIZE);
 
-            CalculateFlySize(aFlySet, m_xSFlyPara->xMainTextPos->nNode,
-                m_xSFlyPara->nWidth);
+            if (!m_bFuzzing)
+            {
+                CalculateFlySize(aFlySet, m_xSFlyPara->xMainTextPos->nNode,
+                    m_xSFlyPara->nWidth);
+            }
 
             nNewWidth = ItemGet<SwFormatFrameSize>(aFlySet, 
RES_FRM_SIZE).GetWidth();
 
commit bd5d16b5b3c6bdf139c04d6e8ca1310418512244
Author:     Caolán McNamara <[email protected]>
AuthorDate: Tue Oct 12 15:24:30 2021 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Tue Oct 12 17:55:27 2021 +0200

    pass 2nd arg of lcl_MinMaxNode by reference
    
    as a pointer it was never null
    
    Change-Id: If242b2dbc39ec3dd407709714741c87c4ef53e83
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123459
    Tested-by: Caolán McNamara <[email protected]>
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 9571324f8dbe..d62fc192ebf2 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -878,7 +878,7 @@ public:
 
 }
 
-static void lcl_MinMaxNode( SwFrameFormat* pNd, SwMinMaxNodeArgs* pIn )
+static void lcl_MinMaxNode(SwFrameFormat* pNd, SwMinMaxNodeArgs& rIn)
 {
     const SwFormatAnchor& rFormatA = pNd->GetAnchor();
 
@@ -889,8 +889,8 @@ static void lcl_MinMaxNode( SwFrameFormat* pNd, 
SwMinMaxNodeArgs* pIn )
     }
 
     const SwPosition *pPos = rFormatA.GetContentAnchor();
-    OSL_ENSURE(pPos && pIn, "Unexpected NULL arguments");
-    if (!pPos || !pIn || pIn->m_nIndex != pPos->nNode.GetIndex())
+    OSL_ENSURE(pPos, "Unexpected NULL arguments");
+    if (!pPos || rIn.m_nIndex != pPos->nNode.GetIndex())
         return;
 
     tools::Long nMin, nMax;
@@ -953,7 +953,7 @@ static void lcl_MinMaxNode( SwFrameFormat* pNd, 
SwMinMaxNodeArgs* pIn )
 
     if( css::text::WrapTextMode_THROUGH == pNd->GetSurround().GetSurround() )
     {
-        pIn->Minimum( nMin );
+        rIn.Minimum( nMin );
         return;
     }
 
@@ -966,33 +966,33 @@ static void lcl_MinMaxNode( SwFrameFormat* pNd, 
SwMinMaxNodeArgs* pIn )
         {
             if( nDiff )
             {
-                pIn->m_nRightRest -= pIn->m_nRightDiff;
-                pIn->m_nRightDiff = nDiff;
+                rIn.m_nRightRest -= rIn.m_nRightDiff;
+                rIn.m_nRightDiff = nDiff;
             }
             if( text::RelOrientation::FRAME != rOrient.GetRelationOrient() )
             {
-                if (pIn->m_nRightRest > 0)
-                    pIn->m_nRightRest = 0;
+                if (rIn.m_nRightRest > 0)
+                    rIn.m_nRightRest = 0;
             }
-            pIn->m_nRightRest -= nMin;
+            rIn.m_nRightRest -= nMin;
             break;
         }
         case text::HoriOrientation::LEFT:
         {
             if( nDiff )
             {
-                pIn->m_nLeftRest -= pIn->m_nLeftDiff;
-                pIn->m_nLeftDiff = nDiff;
+                rIn.m_nLeftRest -= rIn.m_nLeftDiff;
+                rIn.m_nLeftDiff = nDiff;
             }
-            if (text::RelOrientation::FRAME != rOrient.GetRelationOrient() && 
pIn->m_nLeftRest < 0)
-                pIn->m_nLeftRest = 0;
-            pIn->m_nLeftRest -= nMin;
+            if (text::RelOrientation::FRAME != rOrient.GetRelationOrient() && 
rIn.m_nLeftRest < 0)
+                rIn.m_nLeftRest = 0;
+            rIn.m_nLeftRest -= nMin;
             break;
         }
         default:
         {
-            pIn->m_nMaxWidth += nMax;
-            pIn->Minimum( nMin );
+            rIn.m_nMaxWidth += nMax;
+            rIn.Minimum(nMin);
         }
     }
 }
@@ -1041,7 +1041,7 @@ void SwTextNode::GetMinMaxSize( sal_uLong nIndex, 
sal_uLong& rMin, sal_uLong &rM
         {
             aNodeArgs.m_nIndex = nIndex;
             for( SwFrameFormat *pFormat : *pTmp )
-                lcl_MinMaxNode( pFormat, &aNodeArgs );
+                lcl_MinMaxNode(pFormat, aNodeArgs);
         }
     }
     if (aNodeArgs.m_nLeftRest < 0)

Reply via email to