coverity#1296216 Uncaught exception

Change-Id: Id34a655c554e78476e3bd83c87de3cbe1b557980
This commit is contained in:
Caolán McNamara
2015-04-30 10:12:13 +01:00
parent c675a2d669
commit c76b4dd2c3

View File

@@ -55,6 +55,8 @@
#include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/LineJoint.hpp> #include <com/sun/star/drawing/LineJoint.hpp>
#include <com/sun/star/drawing/LineStyle.hpp> #include <com/sun/star/drawing/LineStyle.hpp>
#include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
#include <cppuhelper/exc_hlp.hxx>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::chart::wrapper; using namespace ::chart::wrapper;
@@ -640,38 +642,63 @@ beans::PropertyState SAL_CALL DataSeriesPointWrapper::getPropertyState( const OU
throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception) throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
{ {
beans::PropertyState aState( beans::PropertyState_DIRECT_VALUE ); beans::PropertyState aState( beans::PropertyState_DIRECT_VALUE );
if (rPropertyName == "SymbolBitmapURL") try
{ {
uno::Any aAny = WrappedPropertySet::getPropertyValue("SymbolType"); if (rPropertyName == "SymbolBitmapURL")
sal_Int32 nVal = com::sun::star::chart::ChartSymbolType::NONE;
if (aAny >>= nVal)
{ {
if (nVal != com::sun::star::chart::ChartSymbolType::BITMAPURL) uno::Any aAny = WrappedPropertySet::getPropertyValue("SymbolType");
return beans::PropertyState::PropertyState_DEFAULT_VALUE; sal_Int32 nVal = com::sun::star::chart::ChartSymbolType::NONE;
if (aAny >>= nVal)
{
if (nVal != com::sun::star::chart::ChartSymbolType::BITMAPURL)
return beans::PropertyState::PropertyState_DEFAULT_VALUE;
}
}
if( m_eType == DATA_SERIES )
aState = WrappedPropertySet::getPropertyState( rPropertyName );
else
{
if( rPropertyName == "FillColor")
{
Reference< beans::XPropertySet > xSeriesProp( getDataSeries(), uno::UNO_QUERY );
bool bVaryColorsByPoint = false;
if( xSeriesProp.is() && (xSeriesProp->getPropertyValue("VaryColorsByPoint") >>= bVaryColorsByPoint)
&& bVaryColorsByPoint )
return beans::PropertyState_DIRECT_VALUE;
}
else if( rPropertyName == "Lines"
|| rPropertyName == "SymbolType"
|| rPropertyName == "SymbolSize" )
return WrappedPropertySet::getPropertyState( rPropertyName );
uno::Any aDefault( getPropertyDefault( rPropertyName ) );
uno::Any aValue( getPropertyValue( rPropertyName ) );
if( aDefault==aValue )
aState = beans::PropertyState_DEFAULT_VALUE;
} }
} }
catch( const beans::UnknownPropertyException& )
if( m_eType == DATA_SERIES )
aState = WrappedPropertySet::getPropertyState( rPropertyName );
else
{ {
if( rPropertyName == "FillColor") throw;
{ }
Reference< beans::XPropertySet > xSeriesProp( getDataSeries(), uno::UNO_QUERY ); catch( const uno::RuntimeException& )
bool bVaryColorsByPoint = false; {
if( xSeriesProp.is() && (xSeriesProp->getPropertyValue("VaryColorsByPoint") >>= bVaryColorsByPoint) throw;
&& bVaryColorsByPoint ) }
return beans::PropertyState_DIRECT_VALUE; catch( const lang::WrappedTargetException& e )
} {
else if( rPropertyName == "Lines" css::uno::Any a(e.TargetException);
|| rPropertyName == "SymbolType" throw css::lang::WrappedTargetRuntimeException(
|| rPropertyName == "SymbolSize" ) "wrapped Exception " + e.Message,
return WrappedPropertySet::getPropertyState( rPropertyName ); css::uno::Reference<css::uno::XInterface>(), a);
}
uno::Any aDefault( getPropertyDefault( rPropertyName ) ); catch( const uno::Exception& e )
uno::Any aValue( getPropertyValue( rPropertyName ) ); {
if( aDefault==aValue ) css::uno::Any a(cppu::getCaughtException());
aState = beans::PropertyState_DEFAULT_VALUE; throw css::lang::WrappedTargetRuntimeException(
"wrapped Exception " + e.Message,
css::uno::Reference<css::uno::XInterface>(), a);
} }
return aState; return aState;
} }