diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-27 10:31:06 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-27 16:06:38 +0000 |
commit | b3020a00e8542fa54c055206eaf8a0f5bb8c709e (patch) | |
tree | 72bcb05c168e766492db6f76338dd5014818ea70 /svx | |
parent | 2ba9d58d5978c94352c4c6cf9c47aa3de79d05fe (diff) |
ofz#946 NbcAdjustTextFrameWidthAndHeight calling itself
Change-Id: Ibebe76332d25af87841c3b7761a5583347dfbf34
Reviewed-on: https://gerrit.libreoffice.org/35756
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 22 |
1 files changed, 15 insertions, 7 deletions
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; } |