diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2018-06-14 23:49:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-06-18 14:32:21 +0200 |
commit | 00d244e984589697e9f4d5743ec08e963327e3b9 (patch) | |
tree | 11c05a5351f0e7ae614eb883ecd2fcf7f8a0b739 | |
parent | 0c75367ae5ac257310541ca3c1972b5c9977f452 (diff) |
tdf#118022: fix crash when searching record in form by handling SQLException
See https://bugs.documentfoundation.org/attachment.cgi?id=142760
Found thanks on gdb with command
catch throw com::sun::star::sdbc::SQLException
First SQLException was dealt but not the second one
Change-Id: I7d5d3ad612db132a3bda97cff14367912ae885f9
Reviewed-on: https://gerrit.libreoffice.org/55836
(cherry picked from commit f94292e8c4d469bd3123e1649b0f2a94d4b357b3)
Reviewed-on: https://gerrit.libreoffice.org/55852
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | svx/source/fmcomp/gridcell.cxx | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx index 8767b3efb0b5..222267f4b85e 100644 --- a/svx/source/fmcomp/gridcell.cxx +++ b/svx/source/fmcomp/gridcell.cxx @@ -1150,10 +1150,22 @@ void DbTextField::PaintFieldToCell( OutputDevice& _rDev, const tools::Rectangle& OUString DbTextField::GetFormatText(const Reference< XColumn >& _rxField, const Reference< XNumberFormatter >& xFormatter, Color** /*ppColor*/) { + if (!_rxField.is()) + return OUString(); + const css::uno::Reference<css::beans::XPropertySet> xPS(_rxField, UNO_QUERY); FormattedColumnValue fmter( xFormatter, xPS ); - return fmter.getFormattedValue(); + try + { + return fmter.getFormattedValue(); + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION("svx"); + } + return OUString(); + } |