[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - svx/source

Julien Nabet serval2412 at yahoo.fr
Tue Jul 10 18:00:14 UTC 2018


 svx/source/fmcomp/gridcell.cxx |   14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 44f72ca3747deb1c8824626f216d295815b5ceff
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Thu Jun 14 23:49:11 2018 +0200

    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
    
    Reviewed-on: https://gerrit.libreoffice.org/55836
    (cherry picked from commit f94292e8c4d469bd3123e1649b0f2a94d4b357b3)
    
    Change-Id: I7d5d3ad612db132a3bda97cff14367912ae885f9
    Reviewed-on: https://gerrit.libreoffice.org/55853
    Tested-by: Jenkins
    Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>

diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 7da52af19012..2da40fa9b03c 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();
+    }
+    return OUString();
+
 }
 
 


More information about the Libreoffice-commits mailing list