From d8d0914be7b5fee3e21ec088f518b09281ed34ee Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 11 Oct 2017 00:31:44 +0200 Subject: 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 Tested-by: Jenkins --- connectivity/source/drivers/writer/WTable.cxx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'connectivity/source') 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 #include #include +#include #include #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 xCellRange(xTable, uno::UNO_QUERY); - const uno::Reference xCell = xCellRange->getCellByPosition(nDocColumn, nDocRow); + uno::Reference 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 xText(xCell, uno::UNO_QUERY); -- cgit