svx/source/svdraw/svdotext.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 70e6d969dcbece69bc9bd5e3a0bc5d878a33ca6a
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Dec 14 12:42:11 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Dec 14 14:42:18 2021 +0100

    ofz#42338 avoid timeout in autogrow frames during ppt import
    
    Change-Id: I4bcd8b5ee59609016451ddce5eaeb445f7c793c3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126827
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index 91a0870630e0..9788bfdeae7a 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -52,6 +52,7 @@
 #include <basegfx/matrix/b2dhommatrixtools.hxx>
 #include <sal/log.hxx>
 #include <o3tl/temporary.hxx>
+#include <unotools/configmgr.hxx>
 
 using namespace com::sun::star;
 
@@ -1340,6 +1341,15 @@ void 
SdrTextObj::NbcSetOutlinerParaObject(std::optional<OutlinerParaObject> pTex
     NbcSetOutlinerParaObjectForText( std::move(pTextObject), getActiveText() );
 }
 
+namespace
+{
+    bool IsAutoGrow(const SdrTextObj& rObj)
+    {
+        bool bAutoGrow = rObj.IsAutoGrowHeight() || rObj.IsAutoGrowWidth();
+        return bAutoGrow && !utl::ConfigManager::IsFuzzing();
+    }
+}
+
 void SdrTextObj::NbcSetOutlinerParaObjectForText( 
std::optional<OutlinerParaObject> pTextObject, SdrText* pText )
 {
     if( pText )
@@ -1355,7 +1365,7 @@ void SdrTextObj::NbcSetOutlinerParaObjectForText( 
std::optional<OutlinerParaObje
     }
 
     SetTextSizeDirty();
-    if (IsTextFrame() && (IsAutoGrowHeight() || IsAutoGrowWidth()))
+    if (IsTextFrame() && IsAutoGrow(*this))
     { // adapt text frame!
         NbcAdjustTextFrameWidthAndHeight();
     }

Reply via email to