summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-10-11 00:31:44 +0200
committerAndras Timar <andras.timar@collabora.com>2017-10-15 23:03:46 +0200
commit4900f7ebd803e9e1478d1a17d298f20e153188fa (patch)
treea66304bbecd7df9a096d36c0dccf971019c716bf /connectivity
parent77cc0de89ddc097adce6d6ef2f4397c2f160461a (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> (cherry picked from commit d8d0914be7b5fee3e21ec088f518b09281ed34ee) Signed-off-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/drivers/writer/WTable.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/connectivity/source/drivers/writer/WTable.cxx b/connectivity/source/drivers/writer/WTable.cxx
index b8facb1d14cf..e86bb2b056c3 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);