include/svx/svdoashp.hxx | 1 + svx/source/svdraw/svdoashp.cxx | 22 +++++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-)
New commits: commit b3020a00e8542fa54c055206eaf8a0f5bb8c709e Author: Caolán McNamara <[email protected]> Date: Mon Mar 27 10:31:06 2017 +0100 ofz#946 NbcAdjustTextFrameWidthAndHeight calling itself Change-Id: Ibebe76332d25af87841c3b7761a5583347dfbf34 Reviewed-on: https://gerrit.libreoffice.org/35756 Tested-by: Jenkins <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Caolán McNamara <[email protected]> diff --git a/include/svx/svdoashp.hxx b/include/svx/svdoashp.hxx index e978be4ede64..43c9c1bf4394 100644 --- a/include/svx/svdoashp.hxx +++ b/include/svx/svdoashp.hxx @@ -76,6 +76,7 @@ class SVX_DLLPUBLIC SdrObjCustomShape : public SdrTextObj private: // fObjectRotation is containing the object rotation in degrees. double fObjectRotation; + bool mbAdjustingTextFrameWidthAndHeight; protected: virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override; diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index 0f90e4dad7dc..f01c49107472 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -833,10 +833,11 @@ sdr::properties::BaseProperties* SdrObjCustomShape::CreateObjectSpecificProperti return new sdr::properties::CustomShapeProperties(*this); } -SdrObjCustomShape::SdrObjCustomShape() : - SdrTextObj(), - fObjectRotation( 0.0 ), - mpLastShadowGeometry(nullptr) +SdrObjCustomShape::SdrObjCustomShape() + : SdrTextObj() + , fObjectRotation(0.0) + , mbAdjustingTextFrameWidthAndHeight(false) + , mpLastShadowGeometry(nullptr) { bClosedObj = true; // custom shapes may be filled bTextFrame = true; @@ -2429,10 +2430,12 @@ Rectangle SdrObjCustomShape::ImpCalculateTextFrame( const bool bHgt, const bool bool SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt) { - Rectangle aNewTextRect = ImpCalculateTextFrame( bHgt, bWdt ); - bool bRet = !aNewTextRect.IsEmpty() && ( aNewTextRect != maRect ); - if ( bRet ) + Rectangle aNewTextRect = ImpCalculateTextFrame(bHgt, bWdt); + const bool bRet = !aNewTextRect.IsEmpty() && aNewTextRect != maRect; + if (bRet && !mbAdjustingTextFrameWidthAndHeight) { + mbAdjustingTextFrameWidthAndHeight = true; + // taking care of handles that should not been changed std::vector< SdrCustomShapeInteraction > aInteractionHandles( GetInteractionHandles() ); @@ -2453,9 +2456,12 @@ bool SdrObjCustomShape::NbcAdjustTextFrameWidthAndHeight(bool bHgt, bool bWdt) } } InvalidateRenderGeometry(); + + mbAdjustingTextFrameWidthAndHeight = false; } return bRet; } + bool SdrObjCustomShape::AdjustTextFrameWidthAndHeight() { Rectangle aNewTextRect = ImpCalculateTextFrame( true/*bHgt*/, true/*bWdt*/ ); @@ -2767,6 +2773,8 @@ SdrObjCustomShape& SdrObjCustomShape::operator=(const SdrObjCustomShape& rObj) return *this; SdrTextObj::operator=( rObj ); fObjectRotation = rObj.fObjectRotation; + mbAdjustingTextFrameWidthAndHeight = rObj.mbAdjustingTextFrameWidthAndHeight; + assert(!mbAdjustingTextFrameWidthAndHeight); InvalidateRenderGeometry(); return *this; }
_______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
