diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-10-11 00:31:44 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-10-11 08:19:46 +0200 |
commit | d8d0914be7b5fee3e21ec088f518b09281ed34ee (patch) | |
tree | e0fe8c879b5aa97dbc4af0c2528bb28ff71252bc /connectivity | |
parent | 33f126b4262d1af9c3f0c2e850f5a13b3c6acfc2 (diff) |
connectivity writer driver: survive merged cells
Fow now just don't crash on them, instead give empty result for those
cells.
Change-Id: I9edd231b00fa00af95408a550484da74c98275da
Reviewed-on: https://gerrit.libreoffice.org/43319
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/writer/WTable.cxx | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/connectivity/source/drivers/writer/WTable.cxx b/connectivity/source/drivers/writer/WTable.cxx index fd759cc88ad9..9f08b05ca48a 100644 --- a/connectivity/source/drivers/writer/WTable.cxx +++ b/connectivity/source/drivers/writer/WTable.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/util/NumberFormat.hpp> #include <com/sun/star/util/XNumberFormatsSupplier.hpp> #include <com/sun/star/text/XText.hpp> +#include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <svl/converter.hxx> #include "writer/WConnection.hxx" #include "component/CColumns.hxx" @@ -87,7 +88,17 @@ static void lcl_SetValue(connectivity::ORowSetValue& rValue, const uno::Referenc ++nDocRow; uno::Reference<table::XCellRange> xCellRange(xTable, uno::UNO_QUERY); - const uno::Reference<table::XCell> xCell = xCellRange->getCellByPosition(nDocColumn, nDocRow); + uno::Reference<table::XCell> xCell; + try + { + xCell = xCellRange->getCellByPosition(nDocColumn, nDocRow); + } + catch (const lang::IndexOutOfBoundsException& /*rException*/) + { + SAL_WARN("connectivity.writer", "getCellByPosition(" << nDocColumn << ", " << nDocRow << ") failed"); + rValue = OUString(); + } + if (xCell.is()) { const uno::Reference<text::XText> xText(xCell, uno::UNO_QUERY); |