include/svx/sdr/properties/defaultproperties.hxx    |    2 +-
 include/svx/sdr/properties/properties.hxx           |    4 +++-
 include/svx/svdoashp.hxx                            |    2 +-
 include/svx/svdobj.hxx                              |    9 +++++++--
 sc/source/core/data/postit.cxx                      |    4 ++--
 svx/inc/sdr/properties/attributeproperties.hxx      |    2 +-
 svx/inc/sdr/properties/captionproperties.hxx        |    2 +-
 svx/inc/sdr/properties/circleproperties.hxx         |    2 +-
 svx/inc/sdr/properties/connectorproperties.hxx      |    2 +-
 svx/inc/sdr/properties/customshapeproperties.hxx    |    2 +-
 svx/inc/sdr/properties/e3dsceneproperties.hxx       |    2 +-
 svx/inc/sdr/properties/emptyproperties.hxx          |    2 +-
 svx/inc/sdr/properties/graphicproperties.hxx        |    2 +-
 svx/inc/sdr/properties/groupproperties.hxx          |    2 +-
 svx/inc/sdr/properties/measureproperties.hxx        |    2 +-
 svx/inc/sdr/properties/pageproperties.hxx           |    2 +-
 svx/inc/sdr/properties/rectangleproperties.hxx      |    2 +-
 svx/inc/sdr/properties/textproperties.hxx           |    2 +-
 svx/source/sdr/properties/attributeproperties.cxx   |    2 +-
 svx/source/sdr/properties/captionproperties.cxx     |    4 ++--
 svx/source/sdr/properties/circleproperties.cxx      |    4 ++--
 svx/source/sdr/properties/connectorproperties.cxx   |    4 ++--
 svx/source/sdr/properties/customshapeproperties.cxx |    4 ++--
 svx/source/sdr/properties/defaultproperties.cxx     |    2 +-
 svx/source/sdr/properties/e3dsceneproperties.cxx    |    4 ++--
 svx/source/sdr/properties/emptyproperties.cxx       |    2 +-
 svx/source/sdr/properties/graphicproperties.cxx     |    4 ++--
 svx/source/sdr/properties/groupproperties.cxx       |    4 ++--
 svx/source/sdr/properties/measureproperties.cxx     |    4 ++--
 svx/source/sdr/properties/pageproperties.cxx        |    2 +-
 svx/source/sdr/properties/rectangleproperties.cxx   |    4 ++--
 svx/source/sdr/properties/textproperties.cxx        |    8 ++++----
 svx/source/svdraw/svdoashp.cxx                      |    4 ++--
 svx/source/svdraw/svdobj.cxx                        |    8 ++++----
 34 files changed, 59 insertions(+), 52 deletions(-)

New commits:
commit 426adcbadc66fd79859e50ddc0064e899fc019e3
Author:     Noel Grandin <[email protected]>
AuthorDate: Mon Jul 29 14:36:22 2024 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Tue Jul 30 07:14:05 2024 +0200

    tdf#161846 remove one layout operations (iv)
    
    Change-Id: I0c09c7b4636a7ac4c3dc87a8a17efd278109c3c6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171213
    Reviewed-by: Noel Grandin <[email protected]>
    Tested-by: Jenkins

diff --git a/include/svx/sdr/properties/defaultproperties.hxx 
b/include/svx/sdr/properties/defaultproperties.hxx
index 21236c261fa8..54ca6c591561 100644
--- a/include/svx/sdr/properties/defaultproperties.hxx
+++ b/include/svx/sdr/properties/defaultproperties.hxx
@@ -98,7 +98,7 @@ namespace sdr::properties
 
             // set a new StyleSheet and broadcast
             SAL_DLLPRIVATE virtual void SetStyleSheet(SfxStyleSheet* 
pNewStyleSheet, bool bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
 
             // get the installed StyleSheet
             SAL_DLLPRIVATE virtual SfxStyleSheet* GetStyleSheet() const 
override;
diff --git a/include/svx/sdr/properties/properties.hxx 
b/include/svx/sdr/properties/properties.hxx
index 629ef99aae96..d15dda838009 100644
--- a/include/svx/sdr/properties/properties.hxx
+++ b/include/svx/sdr/properties/properties.hxx
@@ -143,8 +143,10 @@ namespace sdr::properties
 
             // Set a new StyleSheet. Registers as listener at the StyleSheet 
to get knowledge
             // of StyleSheet changes.
+            // @param bAdjustTextFrameWidthAndHeight pass false if you know it 
it safe to avoid the cost of doing
+            //              text layout right now.
             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) = 0;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) = 
0;
 
             // Get the installed StyleSheet.
             virtual SfxStyleSheet* GetStyleSheet() const = 0;
diff --git a/include/svx/svdoashp.hxx b/include/svx/svdoashp.hxx
index e36cb28d4948..0db44415c6f3 100644
--- a/include/svx/svdoashp.hxx
+++ b/include/svx/svdoashp.hxx
@@ -128,7 +128,7 @@ protected:
 
     Size m_aSuggestedTextFrameSize;
 
-    virtual void InternalSetStyleSheet( SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr, bool bBroadcast ) override;
+    virtual void InternalSetStyleSheet( SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr, bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = 
true ) override;
 
 public:
     bool UseNoFillStyle() const;
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 4692c2d36d59..127bf5c051e5 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -619,7 +619,9 @@ public:
     // if bDontRemoveHardAttr is false, set all attributes, which were set in 
the style sheet, to their default value
     // if true, all hard attributes keep their values
     void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr);
-    void NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr);
+    // @param bAdjustTextFrameWidthAndHeight pass false if you know it it safe 
to avoid the cost of doing
+    //              text layout right now.
+    void NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr, bool bAdjustTextFrameWidthAndHeight = true);
     SfxStyleSheet* GetStyleSheet() const;
 
     virtual bool HasTextEdit() const;
@@ -944,7 +946,10 @@ protected:
 
     const SfxItemSet* getBackgroundFillSet() const;
 
-    virtual void InternalSetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr, bool bBroadcast);
+    // @param bAdjustTextFrameWidthAndHeight pass false if you know it it safe 
to avoid the cost of doing
+    //              text layout right now.
+    virtual void InternalSetStyleSheet(SfxStyleSheet* pNewStyleSheet,
+                    bool bDontRemoveHardAttr, bool bBroadcast, bool 
bAdjustTextFrameWidthAndHeight = true);
 
 private:
     struct Impl;
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 99e34c268317..9beb09c433d6 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -659,7 +659,7 @@ void ScPostIt::CreateCaptionFromInitData( const ScAddress& 
rPos ) const
     if (!xInitData->maStyleName.isEmpty())
     {
         if (auto pStyleSheet = 
mrDoc.GetStyleSheetPool()->Find(xInitData->maStyleName, SfxStyleFamily::Frame))
-            
maNoteData.mxCaption->SetStyleSheet(static_cast<SfxStyleSheet*>(pStyleSheet), 
true);
+            
maNoteData.mxCaption->NbcSetStyleSheet(static_cast<SfxStyleSheet*>(pStyleSheet),
 true, /*bAdjustTextFrameWidthAndHeight*/false);
 
         if (xInitData->moItemSet)
             maNoteData.mxCaption->SetMergedItemSet(*xInitData->moItemSet);
@@ -667,7 +667,7 @@ void ScPostIt::CreateCaptionFromInitData( const ScAddress& 
rPos ) const
     else
     {
         if (auto pStyleSheet = 
mrDoc.GetStyleSheetPool()->Find(ScResId(STR_STYLENAME_NOTE), 
SfxStyleFamily::Frame))
-            
maNoteData.mxCaption->SetStyleSheet(static_cast<SfxStyleSheet*>(pStyleSheet), 
true);
+            
maNoteData.mxCaption->NbcSetStyleSheet(static_cast<SfxStyleSheet*>(pStyleSheet),
 true, /*bAdjustTextFrameWidthAndHeight*/false);
 
         // copy all items and reset shadow items
         if (xInitData->moItemSet)
diff --git a/svx/inc/sdr/properties/attributeproperties.hxx 
b/svx/inc/sdr/properties/attributeproperties.hxx
index bdaf48822b0b..d536d8c200dd 100644
--- a/svx/inc/sdr/properties/attributeproperties.hxx
+++ b/svx/inc/sdr/properties/attributeproperties.hxx
@@ -70,7 +70,7 @@ namespace sdr::properties
 
             // set a new StyleSheet and broadcast
             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
 
             // get the installed StyleSheet
             virtual SfxStyleSheet* GetStyleSheet() const override;
diff --git a/svx/inc/sdr/properties/captionproperties.hxx 
b/svx/inc/sdr/properties/captionproperties.hxx
index 625830c5e8db..c22032f0d146 100644
--- a/svx/inc/sdr/properties/captionproperties.hxx
+++ b/svx/inc/sdr/properties/captionproperties.hxx
@@ -48,7 +48,7 @@ namespace sdr::properties
 
             // set a new StyleSheet and broadcast
             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
 
             // force default attributes for a specific object type, called from
             // DefaultProperties::GetObjectItemSet() if a new ItemSet is 
created
diff --git a/svx/inc/sdr/properties/circleproperties.hxx 
b/svx/inc/sdr/properties/circleproperties.hxx
index 3283aa65793d..27ceabdea511 100644
--- a/svx/inc/sdr/properties/circleproperties.hxx
+++ b/svx/inc/sdr/properties/circleproperties.hxx
@@ -48,7 +48,7 @@ namespace sdr::properties
 
             // set a new StyleSheet and broadcast
             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
 
             // force default attributes for a specific object type, called from
             // DefaultProperties::GetObjectItemSet() if a new ItemSet is 
created
diff --git a/svx/inc/sdr/properties/connectorproperties.hxx 
b/svx/inc/sdr/properties/connectorproperties.hxx
index 238b6f2364a2..41ec492fa40b 100644
--- a/svx/inc/sdr/properties/connectorproperties.hxx
+++ b/svx/inc/sdr/properties/connectorproperties.hxx
@@ -48,7 +48,7 @@ namespace sdr::properties
 
             // set a new StyleSheet and broadcast
             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
         };
 } // end of namespace sdr::properties
 
diff --git a/svx/inc/sdr/properties/customshapeproperties.hxx 
b/svx/inc/sdr/properties/customshapeproperties.hxx
index 964c956e3d20..01c0ca3f0963 100644
--- a/svx/inc/sdr/properties/customshapeproperties.hxx
+++ b/svx/inc/sdr/properties/customshapeproperties.hxx
@@ -57,7 +57,7 @@ namespace sdr::properties
 
             // set a new StyleSheet and broadcast
             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
 
             // force default attributes for a specific object type, called from
             // DefaultProperties::GetObjectItemSet() if a new ItemSet is 
created
diff --git a/svx/inc/sdr/properties/e3dsceneproperties.hxx 
b/svx/inc/sdr/properties/e3dsceneproperties.hxx
index 4ffa1a4f4815..71b8b5972699 100644
--- a/svx/inc/sdr/properties/e3dsceneproperties.hxx
+++ b/svx/inc/sdr/properties/e3dsceneproperties.hxx
@@ -61,7 +61,7 @@ namespace sdr::properties
 
             // set a new StyleSheet and broadcast
             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
 
             // get the installed StyleSheet
             virtual SfxStyleSheet* GetStyleSheet() const override;
diff --git a/svx/inc/sdr/properties/emptyproperties.hxx 
b/svx/inc/sdr/properties/emptyproperties.hxx
index 9cab719e7307..e01d59bfcee8 100644
--- a/svx/inc/sdr/properties/emptyproperties.hxx
+++ b/svx/inc/sdr/properties/emptyproperties.hxx
@@ -61,7 +61,7 @@ namespace sdr::properties
 
             // set a new StyleSheet and broadcast
             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
 
             // get the installed StyleSheet
             virtual SfxStyleSheet* GetStyleSheet() const override;
diff --git a/svx/inc/sdr/properties/graphicproperties.hxx 
b/svx/inc/sdr/properties/graphicproperties.hxx
index 415d3681c5cd..d434ec08c4cf 100644
--- a/svx/inc/sdr/properties/graphicproperties.hxx
+++ b/svx/inc/sdr/properties/graphicproperties.hxx
@@ -51,7 +51,7 @@ namespace sdr::properties
 
             // set a new StyleSheet and broadcast
             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
 
             // force default attributes for a specific object type, called from
             // DefaultProperties::GetObjectItemSet() if a new ItemSet is 
created
diff --git a/svx/inc/sdr/properties/groupproperties.hxx 
b/svx/inc/sdr/properties/groupproperties.hxx
index 49e6107a25dd..8ceb2ee348ae 100644
--- a/svx/inc/sdr/properties/groupproperties.hxx
+++ b/svx/inc/sdr/properties/groupproperties.hxx
@@ -80,7 +80,7 @@ namespace sdr::properties
 
             // set a new StyleSheet
             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
 
             // get the local StyleSheet
             virtual SfxStyleSheet* GetStyleSheet() const override;
diff --git a/svx/inc/sdr/properties/measureproperties.hxx 
b/svx/inc/sdr/properties/measureproperties.hxx
index 323cfaa6de92..64277239bfd2 100644
--- a/svx/inc/sdr/properties/measureproperties.hxx
+++ b/svx/inc/sdr/properties/measureproperties.hxx
@@ -48,7 +48,7 @@ namespace sdr::properties
 
             // set a new StyleSheet and broadcast
             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
 
             // force default attributes for a specific object type, called from
             // DefaultProperties::GetObjectItemSet() if a new ItemSet is 
created
diff --git a/svx/inc/sdr/properties/pageproperties.hxx 
b/svx/inc/sdr/properties/pageproperties.hxx
index acd1d919f24e..6045aa038f84 100644
--- a/svx/inc/sdr/properties/pageproperties.hxx
+++ b/svx/inc/sdr/properties/pageproperties.hxx
@@ -54,7 +54,7 @@ namespace sdr::properties
 
             // set the installed StyleSheet
             virtual void SetStyleSheet(SfxStyleSheet* pStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
 
             // clear single item
             virtual void ClearObjectItem(const sal_uInt16 nWhich = 0) override;
diff --git a/svx/inc/sdr/properties/rectangleproperties.hxx 
b/svx/inc/sdr/properties/rectangleproperties.hxx
index b0d6845f78f7..32ca7c230a97 100644
--- a/svx/inc/sdr/properties/rectangleproperties.hxx
+++ b/svx/inc/sdr/properties/rectangleproperties.hxx
@@ -46,7 +46,7 @@ namespace sdr::properties
 
             // set a new StyleSheet and broadcast
             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
         };
 } // end of namespace sdr::properties
 
diff --git a/svx/inc/sdr/properties/textproperties.hxx 
b/svx/inc/sdr/properties/textproperties.hxx
index bc46ef1b8bba..24b711592ccd 100644
--- a/svx/inc/sdr/properties/textproperties.hxx
+++ b/svx/inc/sdr/properties/textproperties.hxx
@@ -60,7 +60,7 @@ namespace sdr::properties
 
             // set a new StyleSheet and broadcast
             virtual void SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast) override;
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight = true) 
override;
 
             // force default attributes for a specific object type, called from
             // DefaultProperties::GetObjectItemSet() if a new ItemSet is 
created
diff --git a/svx/source/sdr/properties/attributeproperties.cxx 
b/svx/source/sdr/properties/attributeproperties.cxx
index 177dd09aee1e..f1c57313a5ab 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -351,7 +351,7 @@ namespace sdr::properties
         }
 
         void AttributeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, 
bool bDontRemoveHardAttr,
-                bool /*bBroadcast*/)
+                bool /*bBroadcast*/, bool /*bAdjustTextFrameWidthAndHeight*/)
         {
             // guarantee SfxItemSet existence
             GetObjectItemSet();
diff --git a/svx/source/sdr/properties/captionproperties.cxx 
b/svx/source/sdr/properties/captionproperties.cxx
index 3de1da6d65b9..17302effb5a1 100644
--- a/svx/source/sdr/properties/captionproperties.cxx
+++ b/svx/source/sdr/properties/captionproperties.cxx
@@ -74,10 +74,10 @@ namespace sdr::properties
         }
 
         void CaptionProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, 
bool bDontRemoveHardAttr,
-                bool bBroadcast)
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight)
         {
             // call parent (always first thing to do, may create the 
SfxItemSet)
-            RectangleProperties::SetStyleSheet(pNewStyleSheet, 
bDontRemoveHardAttr, bBroadcast);
+            RectangleProperties::SetStyleSheet(pNewStyleSheet, 
bDontRemoveHardAttr, bBroadcast, bAdjustTextFrameWidthAndHeight);
 
             // local changes
             SdrCaptionObj& rObj = static_cast<SdrCaptionObj&>(GetSdrObject());
diff --git a/svx/source/sdr/properties/circleproperties.cxx 
b/svx/source/sdr/properties/circleproperties.cxx
index 643c297eb043..48b38620d29e 100644
--- a/svx/source/sdr/properties/circleproperties.cxx
+++ b/svx/source/sdr/properties/circleproperties.cxx
@@ -78,10 +78,10 @@ namespace sdr::properties
         }
 
         void CircleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, 
bool bDontRemoveHardAttr,
-                bool bBroadcast)
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight)
         {
             // call parent (always first thing to do, may create the 
SfxItemSet)
-            RectangleProperties::SetStyleSheet(pNewStyleSheet, 
bDontRemoveHardAttr, bBroadcast);
+            RectangleProperties::SetStyleSheet(pNewStyleSheet, 
bDontRemoveHardAttr, bBroadcast, bAdjustTextFrameWidthAndHeight);
 
             // local changes
             SdrCircObj& rObj = static_cast<SdrCircObj&>(GetSdrObject());
diff --git a/svx/source/sdr/properties/connectorproperties.cxx 
b/svx/source/sdr/properties/connectorproperties.cxx
index 4d3542d67894..667082fb4586 100644
--- a/svx/source/sdr/properties/connectorproperties.cxx
+++ b/svx/source/sdr/properties/connectorproperties.cxx
@@ -76,10 +76,10 @@ namespace sdr::properties
         }
 
         void ConnectorProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, 
bool bDontRemoveHardAttr,
-                bool bBroadcast)
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight)
         {
             // call parent (always first thing to do, may create the 
SfxItemSet)
-            TextProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, 
bBroadcast);
+            TextProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, 
bBroadcast, bAdjustTextFrameWidthAndHeight);
 
             // local changes
             SdrEdgeObj& rObj = static_cast<SdrEdgeObj&>(GetSdrObject());
diff --git a/svx/source/sdr/properties/customshapeproperties.cxx 
b/svx/source/sdr/properties/customshapeproperties.cxx
index ddf530e8d9ad..7fb9bb21e33b 100644
--- a/svx/source/sdr/properties/customshapeproperties.cxx
+++ b/svx/source/sdr/properties/customshapeproperties.cxx
@@ -163,10 +163,10 @@ namespace sdr::properties
         }
 
         void CustomShapeProperties::SetStyleSheet(SfxStyleSheet* 
pNewStyleSheet, bool bDontRemoveHardAttr,
-                bool bBroadcast)
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight)
         {
             // call parent (always first thing to do, may create the 
SfxItemSet)
-            TextProperties::SetStyleSheet( pNewStyleSheet, 
bDontRemoveHardAttr, bBroadcast );
+            TextProperties::SetStyleSheet( pNewStyleSheet, 
bDontRemoveHardAttr, bBroadcast, bAdjustTextFrameWidthAndHeight );
 
             // update bTextFrame and RenderGeometry
             UpdateTextFrameStatus(true);
diff --git a/svx/source/sdr/properties/defaultproperties.cxx 
b/svx/source/sdr/properties/defaultproperties.cxx
index f2051aa32f47..40631fe7b70c 100644
--- a/svx/source/sdr/properties/defaultproperties.cxx
+++ b/svx/source/sdr/properties/defaultproperties.cxx
@@ -219,7 +219,7 @@ namespace sdr::properties
         }
 
         void DefaultProperties::SetStyleSheet(SfxStyleSheet* 
/*pNewStyleSheet*/, bool /*bDontRemoveHardAttr*/,
-                bool /*bBroadcast*/)
+                bool /*bBroadcast*/, bool /*bAdjustTextFrameWidthAndHeight*/)
         {
             // no StyleSheet in DefaultProperties
         }
diff --git a/svx/source/sdr/properties/e3dsceneproperties.cxx 
b/svx/source/sdr/properties/e3dsceneproperties.cxx
index 62f535df3026..02ef68bb36a3 100644
--- a/svx/source/sdr/properties/e3dsceneproperties.cxx
+++ b/svx/source/sdr/properties/e3dsceneproperties.cxx
@@ -220,7 +220,7 @@ namespace sdr::properties
         }
 
         void E3dSceneProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, 
bool bDontRemoveHardAttr,
-                bool bBroadcast)
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight)
         {
             const SdrObjList* pSub(static_cast<const 
E3dScene&>(GetSdrObject()).GetSubList());
             OSL_ENSURE(nullptr != pSub, "Children of SdrObject expected (!)");
@@ -231,7 +231,7 @@ namespace sdr::properties
                 if(bBroadcast)
                     pObj->SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
                 else
-                    pObj->NbcSetStyleSheet(pNewStyleSheet, 
bDontRemoveHardAttr);
+                    pObj->NbcSetStyleSheet(pNewStyleSheet, 
bDontRemoveHardAttr, bAdjustTextFrameWidthAndHeight);
             }
         }
 
diff --git a/svx/source/sdr/properties/emptyproperties.cxx 
b/svx/source/sdr/properties/emptyproperties.cxx
index 1cad150b22a7..79b1d240937a 100644
--- a/svx/source/sdr/properties/emptyproperties.cxx
+++ b/svx/source/sdr/properties/emptyproperties.cxx
@@ -74,7 +74,7 @@ namespace sdr::properties
         }
 
         void EmptyProperties::SetStyleSheet(SfxStyleSheet* /*pNewStyleSheet*/, 
bool /*bDontRemoveHardAttr*/,
-                bool /*bBroadcast*/)
+                bool /*bBroadcast*/, bool /*bAdjustTextFrameWidthAndHeight*/)
         {
             assert(!"EmptyProperties::SetStyleSheet() should never be called");
         }
diff --git a/svx/source/sdr/properties/graphicproperties.cxx 
b/svx/source/sdr/properties/graphicproperties.cxx
index a43ee5bd9fbb..7f2988650d23 100644
--- a/svx/source/sdr/properties/graphicproperties.cxx
+++ b/svx/source/sdr/properties/graphicproperties.cxx
@@ -114,10 +114,10 @@ namespace sdr::properties
         }
 
         void GraphicProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, 
bool bDontRemoveHardAttr,
-                bool bBroadcast)
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight)
         {
             // call parent (always first thing to do, may create the 
SfxItemSet)
-            RectangleProperties::SetStyleSheet(pNewStyleSheet, 
bDontRemoveHardAttr, bBroadcast);
+            RectangleProperties::SetStyleSheet(pNewStyleSheet, 
bDontRemoveHardAttr, bBroadcast, bAdjustTextFrameWidthAndHeight);
 
             // local changes
             SdrGrafObj& rObj = static_cast<SdrGrafObj&>(GetSdrObject());
diff --git a/svx/source/sdr/properties/groupproperties.cxx 
b/svx/source/sdr/properties/groupproperties.cxx
index d81414fce3ab..db66d2061d0f 100644
--- a/svx/source/sdr/properties/groupproperties.cxx
+++ b/svx/source/sdr/properties/groupproperties.cxx
@@ -192,7 +192,7 @@ namespace sdr::properties
         }
 
         void GroupProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, 
bool bDontRemoveHardAttr,
-                bool bBroadcast)
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight)
         {
             const SdrObjList* pSub(static_cast<const 
SdrObjGroup&>(GetSdrObject()).GetSubList());
             OSL_ENSURE(nullptr != pSub, "Children of SdrObject expected (!)");
@@ -204,7 +204,7 @@ namespace sdr::properties
                 if(bBroadcast)
                     pObj->SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
                 else
-                    pObj->NbcSetStyleSheet(pNewStyleSheet, 
bDontRemoveHardAttr);
+                    pObj->NbcSetStyleSheet(pNewStyleSheet, 
bDontRemoveHardAttr, bAdjustTextFrameWidthAndHeight);
             }
         }
 
diff --git a/svx/source/sdr/properties/measureproperties.cxx 
b/svx/source/sdr/properties/measureproperties.cxx
index a6f4b7fd7c81..0fc8d7c1d278 100644
--- a/svx/source/sdr/properties/measureproperties.cxx
+++ b/svx/source/sdr/properties/measureproperties.cxx
@@ -84,10 +84,10 @@ namespace sdr::properties
         }
 
         void MeasureProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, 
bool bDontRemoveHardAttr,
-                bool bBroadcast)
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight)
         {
             // call parent (always first thing to do, may create the 
SfxItemSet)
-            TextProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, 
bBroadcast);
+            TextProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, 
bBroadcast, bAdjustTextFrameWidthAndHeight);
 
             // local changes
             // get access to dimension line object
diff --git a/svx/source/sdr/properties/pageproperties.cxx 
b/svx/source/sdr/properties/pageproperties.cxx
index 79129497efdd..030d0afc4768 100644
--- a/svx/source/sdr/properties/pageproperties.cxx
+++ b/svx/source/sdr/properties/pageproperties.cxx
@@ -72,7 +72,7 @@ namespace sdr::properties
         }
 
         void PageProperties::SetStyleSheet(SfxStyleSheet* /*pStyleSheet*/, 
bool /*bDontRemoveHardAttr*/,
-                bool /*bBroadcast*/)
+                bool /*bBroadcast*/, bool /*bAdjustTextFrameWidthAndHeight*/)
         {
             // override to legally ignore the StyleSheet here
         }
diff --git a/svx/source/sdr/properties/rectangleproperties.cxx 
b/svx/source/sdr/properties/rectangleproperties.cxx
index 71680e012b33..978ab8bbf415 100644
--- a/svx/source/sdr/properties/rectangleproperties.cxx
+++ b/svx/source/sdr/properties/rectangleproperties.cxx
@@ -55,10 +55,10 @@ namespace sdr::properties
 
         // set a new StyleSheet and broadcast
         void RectangleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, 
bool bDontRemoveHardAttr,
-                bool bBroadcast)
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight)
         {
             // call parent (always first thing to do, may create the 
SfxItemSet)
-            TextProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, 
bBroadcast);
+            TextProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, 
bBroadcast, bAdjustTextFrameWidthAndHeight);
 
             // local changes
             SdrRectObj& rObj = static_cast<SdrRectObj&>(GetSdrObject());
diff --git a/svx/source/sdr/properties/textproperties.cxx 
b/svx/source/sdr/properties/textproperties.cxx
index c1e7a2f6e0c6..7eb9603d739e 100644
--- a/svx/source/sdr/properties/textproperties.cxx
+++ b/svx/source/sdr/properties/textproperties.cxx
@@ -243,10 +243,10 @@ namespace sdr::properties
         }
 
         void TextProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr,
-                bool bBroadcast)
+                bool bBroadcast, bool bAdjustTextFrameWidthAndHeight)
         {
             // call parent (always first thing to do, may create the 
SfxItemSet)
-            AttributeProperties::SetStyleSheet(pNewStyleSheet, 
bDontRemoveHardAttr, bBroadcast);
+            AttributeProperties::SetStyleSheet(pNewStyleSheet, 
bDontRemoveHardAttr, bBroadcast, bAdjustTextFrameWidthAndHeight);
 
             // #i101556# StyleSheet has changed -> new version
             SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject());
@@ -349,12 +349,12 @@ namespace sdr::properties
 
                         std::optional<OutlinerParaObject> pTemp = 
rOutliner.CreateParaObject(0, nParaCount);
                         rOutliner.Clear();
-                        rObj.NbcSetOutlinerParaObjectForText(std::move(pTemp), 
pText);
+                        rObj.NbcSetOutlinerParaObjectForText(std::move(pTemp), 
pText, bAdjustTextFrameWidthAndHeight);
                     }
                 }
             }
 
-            if(rObj.IsTextFrame() && 
!rObj.getSdrModelFromSdrObject().isLocked())
+            if(rObj.IsTextFrame() && 
!rObj.getSdrModelFromSdrObject().isLocked() && bAdjustTextFrameWidthAndHeight)
                 rObj.NbcAdjustTextFrameWidthAndHeight();
         }
 
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index a3bb40589849..bca05cb58597 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -2882,11 +2882,11 @@ rtl::Reference<SdrObject> 
SdrObjCustomShape::DoConvertToPolyObj(bool bBezier, bo
     return pRetval;
 }
 
-void SdrObjCustomShape::InternalSetStyleSheet( SfxStyleSheet* pNewStyleSheet, 
bool bDontRemoveHardAttr, bool bBroadcast )
+void SdrObjCustomShape::InternalSetStyleSheet( SfxStyleSheet* pNewStyleSheet, 
bool bDontRemoveHardAttr, bool bBroadcast, bool bAdjustTextFrameWidthAndHeight )
 {
     // #i40944#
     InvalidateRenderGeometry();
-    SdrObject::InternalSetStyleSheet( pNewStyleSheet, bDontRemoveHardAttr, 
bBroadcast );
+    SdrObject::InternalSetStyleSheet( pNewStyleSheet, bDontRemoveHardAttr, 
bBroadcast, bAdjustTextFrameWidthAndHeight );
 }
 
 void SdrObjCustomShape::handlePageChange(SdrPage* pOldPage, SdrPage* pNewPage)
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 1db55afe2be6..685cda435b5d 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -2282,14 +2282,14 @@ void SdrObject::SetStyleSheet(SfxStyleSheet* 
pNewStyleSheet, bool bDontRemoveHar
     SendUserCall(SdrUserCallType::ChangeAttr, aBoundRect0);
 }
 
-void SdrObject::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr)
+void SdrObject::NbcSetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr, bool bAdjustTextFrameWidthAndHeight)
 {
-    InternalSetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, false);
+    InternalSetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, false, 
bAdjustTextFrameWidthAndHeight);
 }
 
-void SdrObject::InternalSetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr, bool bBroadcast)
+void SdrObject::InternalSetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool 
bDontRemoveHardAttr, bool bBroadcast, bool bAdjustTextFrameWidthAndHeight)
 {
-    GetProperties().SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, 
bBroadcast);
+    GetProperties().SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, 
bBroadcast, bAdjustTextFrameWidthAndHeight);
 }
 
 // Broadcasting while setting attributes is managed by the AttrObj.

Reply via email to