#83765# solved gpf when exporting lines, catching uno base exception instead of catch ( ... )

This commit is contained in:
Sven Jacobi
2001-03-09 12:53:13 +00:00
parent 586b49b2fa
commit 68e3c99207
2 changed files with 113 additions and 121 deletions

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: escherex.cxx,v $
*
* $Revision: 1.15 $
* $Revision: 1.16 $
*
* last change: $Author: sj $ $Date: 2001-01-26 13:57:57 $
* last change: $Author: sj $ $Date: 2001-03-09 13:52:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -997,7 +997,7 @@ sal_Bool EscherPropertyContainer::CreatePolygonProperties(
static String sPolyPolygon ( RTL_CONSTASCII_USTRINGPARAM( "PolyPolygon" ) );
sal_Bool bRetValue = sal_True;
sal_Bool bNoLine = ( nFlags & ESCHER_CREATEPOLYGON_LINE ) == 0;
sal_Bool bLine = ( nFlags & ESCHER_CREATEPOLYGON_LINE ) != 0;
PolyPolygon aPolyPolygon;
Polygon aPolygon;
@@ -1074,25 +1074,6 @@ sal_Bool EscherPropertyContainer::CreatePolygonProperties(
bRetValue = pOuterSequence != NULL;
if ( bRetValue )
{
// ist dies ein Polygon oder gar ein PolyPolygon ?
// sogar eine einfache Line wird als Polygon verpackt !!! ????
if ( !bNoLine )
{
::com::sun::star::drawing::PointSequence* pInnerSequence = pOuterSequence++;
bRetValue = pInnerSequence != NULL;
if ( bRetValue )
{
::com::sun::star::awt::Point* pArray = pInnerSequence->getArray();
if ( pArray )
{
::com::sun::star::awt::Point aTopLeft( pArray[ 0 ] );
::com::sun::star::awt::Point aBottomRight( pArray[ 1 ] );
rGeoRect = ::com::sun::star::awt::Rectangle(
aTopLeft.X, aTopLeft.Y, aBottomRight.X - aTopLeft.X, aBottomRight.Y - aTopLeft.Y );
}
}
}
sal_uInt16 a, b, nInnerSequenceCount;
::com::sun::star::awt::Point* pArray;
@@ -1121,7 +1102,22 @@ sal_Bool EscherPropertyContainer::CreatePolygonProperties(
}
}
}
if ( bRetValue && bNoLine )
if ( bRetValue )
{
if ( bLine )
{
if ( aPolygon.GetSize() == 2 )
{
rGeoRect = ::com::sun::star::awt::Rectangle(
aPolygon[ 0 ].X(),
aPolygon[ 0 ].Y(),
aPolygon[ 1 ].X() - aPolygon[ 0 ].X(),
aPolygon[ 1 ].Y() - aPolygon[ 0 ].Y() );
}
else
bRetValue = sal_False;
}
else
{
sal_uInt16 i, j, k, nPoints, nBezPoints, nPolyCount = aPolyPolygon.Count();
Rectangle aRect( aPolyPolygon.GetBoundRect() );
@@ -1220,6 +1216,7 @@ sal_Bool EscherPropertyContainer::CreatePolygonProperties(
AddOpt( ESCHER_Prop_pVertices, TRUE, nVerticesBufSize - 6, (sal_uInt8*)pVerticesBuf, nVerticesBufSize );
AddOpt( ESCHER_Prop_pSegmentInfo, TRUE, nSegmentBufSize, (sal_uInt8*)pSegmentBuf, nSegmentBufSize );
}
}
return bRetValue;
}
@@ -1483,10 +1480,6 @@ sal_Bool EscherPropertyValueHelper::GetPropertyValue(
sal_Bool bTestPropertyAvailability )
{
sal_Bool bRetValue = sal_True;
#ifdef UNX
bTestPropertyAvailability = sal_True;
#endif
if ( bTestPropertyAvailability )
{
bRetValue = sal_False;
@@ -1497,9 +1490,9 @@ sal_Bool EscherPropertyValueHelper::GetPropertyValue(
if ( aXPropSetInfo.is() )
bRetValue = aXPropSetInfo->hasPropertyByName( rString );
}
catch(...)
catch( ::com::sun::star::uno::Exception& )
{
//...
bRetValue = sal_False;
}
}
if ( bRetValue )
@@ -1510,7 +1503,7 @@ sal_Bool EscherPropertyValueHelper::GetPropertyValue(
if ( !rAny.hasValue() )
bRetValue = sal_False;
}
catch(...)
catch( ::com::sun::star::uno::Exception& )
{
bRetValue = sal_False;
}
@@ -1532,7 +1525,7 @@ sal_Bool EscherPropertyValueHelper::GetPropertyValue(
if ( aXPropState.is() )
eRetValue = aXPropState->getPropertyState( rPropertyName );
}
catch(...)
catch( ::com::sun::star::uno::Exception& )
{
//...
}

View File

@@ -2,9 +2,9 @@
*
* $RCSfile: eschesdo.cxx,v $
*
* $Revision: 1.9 $
* $Revision: 1.10 $
*
* last change: $Author: sj $ $Date: 2001-01-22 18:26:02 $
* last change: $Author: sj $ $Date: 2001-03-09 13:53:13 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -1317,7 +1317,7 @@ BOOL ImplEESdrObject::ImplGetPropertyValue( const sal_Unicode* rString )
if( mAny.hasValue() )
bRetValue = TRUE;
}
catch(...)
catch( ::com::sun::star::uno::Exception& )
{
bRetValue = FALSE;
}
@@ -1332,17 +1332,16 @@ BOOL ImplEESdrObject::ImplGetPropertyValue( const Reference< XPropertySet >& rXP
BOOL bRetValue = FALSE;
if( mbValid )
{
TRY
try
{
mAny = rXPropSet->getPropertyValue( rString );
if( 0 != mAny.get() )
bRetValue = TRUE;
}
CATCH_ALL()
catch( ::com::sun::star::uno::Exception& )
{
bRetValue = FALSE;
}
END_CATCH;
}
return bRetValue;
}
@@ -1371,6 +1370,6 @@ UINT32 ImplEESdrObject::ImplGetText()
BOOL ImplEESdrObject::ImplHasText() const
{
Reference< XText > xXText( mXShape, UNO_QUERY );
return xXText.is();
return xXText.is() && xXText->getString().getLength();
}