summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/xml/xmlexprt.cxx16
1 files changed, 15 insertions, 1 deletions
diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx
index 00231fc4ae38..0590c95d0e8b 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -2733,6 +2733,20 @@ void ScXMLExport::CollectInternalShape( uno::Reference< drawing::XShape > const
}
}
+static uno::Reference<sheet::XSheetCellRange> lclGetSheetRange(const uno::Reference <sheet::XSpreadsheet>& xTable, sal_Int32 nCol, sal_Int32 nRow)
+{
+ try
+ {
+ return uno::Reference<sheet::XSheetCellRange>(xTable->getCellRangeByPosition(nCol, nRow, nCol, nRow), uno::UNO_QUERY);
+ }
+ catch (const uno::Exception&)
+ {
+ TOOLS_WARN_EXCEPTION("sc", "Exception in getCellRangeByPosition, col: " << nCol << ", row: " << nRow);
+ assert(false && "try and capture this in crashtesting");
+ }
+ return nullptr;
+}
+
bool ScXMLExport::GetMerged (const table::CellRangeAddress* pCellAddress,
const uno::Reference <sheet::XSpreadsheet>& xTable)
{
@@ -2744,7 +2758,7 @@ bool ScXMLExport::GetMerged (const table::CellRangeAddress* pCellAddress,
bool bRowInc(nEndRow > nRow);
while(!bReady && nRow <= nEndRow && nCol <= nEndCol)
{
- uno::Reference<sheet::XSheetCellRange> xSheetCellRange(xTable->getCellRangeByPosition(nCol, nRow, nCol, nRow), uno::UNO_QUERY);
+ uno::Reference<sheet::XSheetCellRange> xSheetCellRange(lclGetSheetRange(xTable, nCol, nRow));
if (xSheetCellRange.is())
{
uno::Reference<sheet::XSheetCellCursor> xCursor(xTable->createCursorByRange(xSheetCellRange));