summaryrefslogtreecommitdiffstats
path: root/chart2/source/model/main/ChartModel.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/model/main/ChartModel.cxx')
-rw-r--r--chart2/source/model/main/ChartModel.cxx30
1 files changed, 13 insertions, 17 deletions
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index c0289c3af548..37b1f4967588 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -1071,28 +1071,24 @@ embed::VisualRepresentation SAL_CALL ChartModel::getPreferredVisualRepresentatio
uno::Any SAL_CALL ChartModel::getTransferData( const datatransfer::DataFlavor& aFlavor )
{
uno::Any aResult;
- if( isDataFlavorSupported( aFlavor ))
+ if( !isDataFlavorSupported( aFlavor ) )
+ throw datatransfer::UnsupportedFlavorException(
+ aFlavor.MimeType, static_cast< ::cppu::OWeakObject* >( this ));
+
+ try
{
- try
- {
- //get view from old api wrapper
- Reference< datatransfer::XTransferable > xTransferable(
- createInstance( CHART_VIEW_SERVICE_NAME ), uno::UNO_QUERY );
- if( xTransferable.is() &&
- xTransferable->isDataFlavorSupported( aFlavor ))
- {
- aResult = xTransferable->getTransferData( aFlavor );
- }
- }
- catch (const uno::Exception& ex)
+ //get view from old api wrapper
+ Reference< datatransfer::XTransferable > xTransferable(
+ createInstance( CHART_VIEW_SERVICE_NAME ), uno::UNO_QUERY );
+ if( xTransferable.is() &&
+ xTransferable->isDataFlavorSupported( aFlavor ))
{
- ASSERT_EXCEPTION( ex );
+ aResult = xTransferable->getTransferData( aFlavor );
}
}
- else
+ catch (const uno::Exception& ex)
{
- throw datatransfer::UnsupportedFlavorException(
- aFlavor.MimeType, static_cast< ::cppu::OWeakObject* >( this ));
+ ASSERT_EXCEPTION( ex );
}
return aResult;