diff options
author | Muthu Subramanian <sumuthu@suse.com> | 2012-02-27 18:03:21 +0530 |
---|---|---|
committer | Muthu Subramanian <sumuthu@suse.com> | 2012-02-27 18:03:21 +0530 |
commit | 44b98b588c51c976c38b08844f7e09d236518e32 (patch) | |
tree | b9069acd40802486136cf94dd4d018509e074169 /svx | |
parent | 550cc3e9dbe7a86797fc946f40d9ae5529d6ce2c (diff) |
n742593: Adding checks before using textbox sizes.
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShape2d.cxx | 2 | ||||
-rw-r--r-- | svx/source/svdraw/svdoashp.cxx | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 3e5f340802df..3087526ea1f3 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -1193,6 +1193,8 @@ Rectangle EnhancedCustomShape2d::GetTextRect() const } Rectangle aRect( aTopLeft, aBottomRight ); OSL_TRACE("EnhancedCustomShape2d::GetTextRect: %d x %d", aRect.GetWidth(), aRect.GetHeight()); + if( aRect.GetWidth() <= 1 || aRect.GetHeight() <= 1 ) + return aLogicRect; aRect.Move( aLogicRect.Left(), aLogicRect.Top() ); aRect.Justify(); return aRect; diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx index aac2cf8ee53f..2cd4a042a2a5 100644 --- a/svx/source/svdraw/svdoashp.cxx +++ b/svx/source/svdraw/svdoashp.cxx @@ -556,7 +556,7 @@ sal_Bool SdrObjCustomShape::GetTextBounds( Rectangle& rTextBound ) const if ( xCustomShapeEngine.is() ) { awt::Rectangle aR( xCustomShapeEngine->getTextBounds() ); - if ( aR.Width || aR.Height ) + if ( aR.Width > 1 && aR.Height > 1 ) { rTextBound = Rectangle( Point( aR.X, aR.Y ), Size( aR.Width, aR.Height ) ); bRet = sal_True; |