summaryrefslogtreecommitdiff
path: root/sfx2
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 /sfx2
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 'sfx2')
-rw-r--r--sfx2/source/doc/doctemplates.cxx2
-rw-r--r--sfx2/source/doc/objserv.cxx2
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx6
3 files changed, 5 insertions, 5 deletions
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index d0e5cb929620..7181a5db9fcb 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1653,7 +1653,7 @@ bool SfxDocTplService_Impl::renameGroup( const OUString& rOldName,
while ( xResultSet->next() )
{
if ( !::utl::UCBContentHelper::IsSubPath( aGroupTargetURL, xRow->getString( 1 ) ) )
- throw uno::Exception();
+ throw uno::Exception("not sub path", nullptr);
}
bCanBeRenamed = true;
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 6dc7fc317dc2..18ec45205a50 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -618,7 +618,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq)
bool bForceSaveAs = nId == SID_SAVEDOC && IsReadOnlyMedium();
const SfxSlot* pSlot = GetModule()->GetSlotPool()->GetSlot( bForceSaveAs ? SID_SAVEASDOC : nId );
if ( !pSlot )
- throw uno::Exception();
+ throw uno::Exception("no slot", nullptr);
SfxStoringHelper aHelper;
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index ce5f43c9bf9d..65427284b637 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3486,7 +3486,7 @@ void SAL_CALL SfxBaseModel::setVisualAreaSize( sal_Int64 nAspect, const awt::Siz
SfxModelGuard aGuard( *this );
if ( !m_pData->m_pObjectShell.is() )
- throw Exception(); // TODO: error handling
+ throw Exception("no object shell", nullptr); // TODO: error handling
SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell.get(), false );
if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED && !pViewFrm->GetFrame().IsInPlace() )
@@ -3513,7 +3513,7 @@ awt::Size SAL_CALL SfxBaseModel::getVisualAreaSize( sal_Int64 /*nAspect*/ )
SfxModelGuard aGuard( *this );
if ( !m_pData->m_pObjectShell.is() )
- throw Exception(); // TODO: error handling
+ throw Exception("no object shell", nullptr); // TODO: error handling
tools::Rectangle aTmpRect = m_pData->m_pObjectShell->GetVisArea( ASPECT_CONTENT );
@@ -3526,7 +3526,7 @@ sal_Int32 SAL_CALL SfxBaseModel::getMapUnit( sal_Int64 /*nAspect*/ )
SfxModelGuard aGuard( *this );
if ( !m_pData->m_pObjectShell.is() )
- throw Exception(); // TODO: error handling
+ throw Exception("no object shell", nullptr); // TODO: error handling
return VCLUnoHelper::VCL2UnoEmbedMapUnit( m_pData->m_pObjectShell->GetMapUnit() );
}