diff options
Diffstat (limited to 'sc/source/ui/unoobj/TablePivotCharts.cxx')
-rw-r--r-- | sc/source/ui/unoobj/TablePivotCharts.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/ui/unoobj/TablePivotCharts.cxx b/sc/source/ui/unoobj/TablePivotCharts.cxx index 16d260fec458..6369729d772f 100644 --- a/sc/source/ui/unoobj/TablePivotCharts.cxx +++ b/sc/source/ui/unoobj/TablePivotCharts.cxx @@ -217,10 +217,10 @@ uno::Any SAL_CALL TablePivotCharts::getByIndex(sal_Int32 nIndex) throw lang::IndexOutOfBoundsException(); uno::Reference<table::XTablePivotChart> xChart(new TablePivotChart(m_pDocShell, m_nTab, aName)); - if (xChart.is()) - return uno::makeAny(xChart); - else + if (!xChart.is()) throw lang::IndexOutOfBoundsException(); + + return uno::makeAny(xChart); } uno::Type SAL_CALL TablePivotCharts::getElementType() @@ -243,10 +243,10 @@ uno::Any SAL_CALL TablePivotCharts::getByName(OUString const & rName) throw container::NoSuchElementException(); uno::Reference<table::XTablePivotChart> xChart(new TablePivotChart(m_pDocShell, m_nTab, rName)); - if (xChart.is()) - return uno::makeAny(xChart); - else + if (!xChart.is()) throw container::NoSuchElementException(); + + return uno::makeAny(xChart); } uno::Sequence<OUString> SAL_CALL TablePivotCharts::getElementNames() |