summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-04-30 10:12:13 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-04-30 13:18:00 +0100
commitc76b4dd2c323291ccf546d371cf524e08af9436d (patch)
tree8a12fcbc57a875457641eaf4c8072604d34b3d96 /chart2
parentc675a2d669c191f3b18ae006c78ef83efba14c30 (diff)
coverity#1296216 Uncaught exception
Change-Id: Id34a655c554e78476e3bd83c87de3cbe1b557980
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx79
1 files changed, 53 insertions, 26 deletions
diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
index 94ba53659e34..f9ded24eb6a4 100644
--- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx
@@ -55,6 +55,8 @@
#include <com/sun/star/drawing/FillStyle.hpp>
#include <com/sun/star/drawing/LineJoint.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 ::chart::wrapper;
@@ -640,38 +642,63 @@ beans::PropertyState SAL_CALL DataSeriesPointWrapper::getPropertyState( const OU
throw (beans::UnknownPropertyException, uno::RuntimeException, std::exception)
{
beans::PropertyState aState( beans::PropertyState_DIRECT_VALUE );
- if (rPropertyName == "SymbolBitmapURL")
+ try
{
- uno::Any aAny = WrappedPropertySet::getPropertyValue("SymbolType");
- sal_Int32 nVal = com::sun::star::chart::ChartSymbolType::NONE;
- if (aAny >>= nVal)
+ if (rPropertyName == "SymbolBitmapURL")
{
- if (nVal != com::sun::star::chart::ChartSymbolType::BITMAPURL)
- return beans::PropertyState::PropertyState_DEFAULT_VALUE;
+ uno::Any aAny = WrappedPropertySet::getPropertyValue("SymbolType");
+ 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")
+ if( m_eType == DATA_SERIES )
+ aState = WrappedPropertySet::getPropertyState( rPropertyName );
+ else
{
- Reference< beans::XPropertySet > xSeriesProp( getDataSeries(), uno::UNO_QUERY );
- bool bVaryColorsByPoint = false;
- if( xSeriesProp.is() && (xSeriesProp->getPropertyValue("VaryColorsByPoint") >>= bVaryColorsByPoint)
- && bVaryColorsByPoint )
- return beans::PropertyState_DIRECT_VALUE;
+ 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;
}
- 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& )
+ {
+ throw;
+ }
+ catch( const uno::RuntimeException& )
+ {
+ throw;
+ }
+ catch( const lang::WrappedTargetException& e )
+ {
+ css::uno::Any a(e.TargetException);
+ throw css::lang::WrappedTargetRuntimeException(
+ "wrapped Exception " + e.Message,
+ css::uno::Reference<css::uno::XInterface>(), a);
+ }
+ catch( const uno::Exception& e )
+ {
+ css::uno::Any a(cppu::getCaughtException());
+ throw css::lang::WrappedTargetRuntimeException(
+ "wrapped Exception " + e.Message,
+ css::uno::Reference<css::uno::XInterface>(), a);
}
return aState;
}