[Libreoffice-commits] .: svx/source

Muthu Subramanian sumuthu at kemper.freedesktop.org
Mon Feb 27 04:10:37 PST 2012


 svx/source/customshapes/EnhancedCustomShape2d.cxx |    2 ++
 svx/source/svdraw/svdoashp.cxx                    |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 44b98b588c51c976c38b08844f7e09d236518e32
Author: Muthu Subramanian <sumuthu at suse.com>
Date:   Mon Feb 27 18:03:21 2012 +0530

    n742593: Adding checks before using textbox sizes.

diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 3e5f340..3087526 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 aac2cf8..2cd4a04 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;


More information about the Libreoffice-commits mailing list