summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-30 17:32:50 +0200
committerJulien Nabet <serval2412@yahoo.fr>2017-10-01 18:17:11 +0200
commit20bae560c05a3df6e7ce8d4b869ed00f951c1e59 (patch)
tree968607d7c4f33c26302bee6731858c1ed64aa622 /reportdesign
parentebeff35a0305683574373b75c7b0e5797749fe3e (diff)
throw more useful uno::Exception's
if we're going to throw the base class of the exception hierarchy, we can at least put a useful message in there to make the source a little bit easier to locate. Change-Id: I2f3106c99ba25125eacef8fa77e2f3a2c89f2566 Reviewed-on: https://gerrit.libreoffice.org/42968 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/core/sdr/RptModel.cxx12
-rw-r--r--reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx4
-rw-r--r--reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx2
3 files changed, 9 insertions, 9 deletions
diff --git a/reportdesign/source/core/sdr/RptModel.cxx b/reportdesign/source/core/sdr/RptModel.cxx
index 60cf31e4d2fe..6e9371015c5f 100644
--- a/reportdesign/source/core/sdr/RptModel.cxx
+++ b/reportdesign/source/core/sdr/RptModel.cxx
@@ -148,38 +148,38 @@ uno::Reference< uno::XInterface > OReportModel::createShape(const OUString& aSer
uno::Reference<report::XFormattedField> xProp = new OFormattedField(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape);
xRet = xProp;
if ( _rShape.is() )
- throw uno::Exception();
+ throw uno::Exception("no shape", nullptr);
xProp->setPropertyValue( PROPERTY_FORMATSSUPPLIER, uno::makeAny(uno::Reference< util::XNumberFormatsSupplier >(*m_pReportDefinition,uno::UNO_QUERY)) );
}
else if ( aServiceSpecifier == SERVICE_FIXEDTEXT)
{
xRet = static_cast<cppu::OWeakObject*>(new OFixedText(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape));
if ( _rShape.is() )
- throw uno::Exception();
+ throw uno::Exception("no shape", nullptr);
}
else if ( aServiceSpecifier == SERVICE_FIXEDLINE)
{
xRet = static_cast<cppu::OWeakObject*>(new OFixedLine(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape,nOrientation));
if ( _rShape.is() )
- throw uno::Exception();
+ throw uno::Exception("no shape", nullptr);
}
else if ( aServiceSpecifier == SERVICE_IMAGECONTROL )
{
xRet = static_cast<cppu::OWeakObject*>(new OImageControl(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape));
if ( _rShape.is() )
- throw uno::Exception();
+ throw uno::Exception("no shape", nullptr);
}
else if ( aServiceSpecifier == SERVICE_REPORTDEFINITION )
{
xRet = static_cast<cppu::OWeakObject*>(new OReportDefinition(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape));
if ( _rShape.is() )
- throw uno::Exception();
+ throw uno::Exception("no shape", nullptr);
}
else if ( _rShape.is() )
{
xRet = static_cast<cppu::OWeakObject*>(new OShape(m_pReportDefinition->getContext(),m_pReportDefinition,_rShape,aServiceSpecifier));
if ( _rShape.is() )
- throw uno::Exception();
+ throw uno::Exception("no shape", nullptr);
}
}
return xRet;
diff --git a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
index b359f8f987d6..f68dc4d9e554 100644
--- a/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlExportDocumentHandler.cxx
@@ -297,11 +297,11 @@ void SAL_CALL ExportDocumentHandler::initialize( const uno::Sequence< uno::Any >
OSL_ENSURE(m_xDelegatee.is(),"No document handler available!");
if ( !m_xDelegatee.is() || !m_xModel.is() )
- throw uno::Exception();
+ throw uno::Exception("no delegatee and no model", nullptr);
m_xDatabaseDataProvider.set(m_xModel->getDataProvider(),uno::UNO_QUERY_THROW);
if ( !m_xDatabaseDataProvider->getActiveConnection().is() )
- throw uno::Exception();
+ throw uno::Exception("no active connection", nullptr);
uno::Reference< reflection::XProxyFactory > xProxyFactory = reflection::ProxyFactory::create( m_xContext );
m_xProxy = xProxyFactory->createProxy(m_xDelegatee.get());
diff --git a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
index 3aedaaaa8272..315883a300a6 100644
--- a/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
+++ b/reportdesign/source/filter/xml/xmlImportDocumentHandler.cxx
@@ -347,7 +347,7 @@ void SAL_CALL ImportDocumentHandler::initialize( const uno::Sequence< uno::Any >
OSL_ENSURE(m_xDelegatee.is(),"No document handler available!");
if ( !m_xDelegatee.is() || !m_xModel.is() )
- throw uno::Exception();
+ throw uno::Exception("no delegatee and no model", nullptr);
m_xDatabaseDataProvider.set(m_xModel->getDataProvider(),uno::UNO_QUERY);
if ( !m_xDatabaseDataProvider.is() )