summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml/xmlcelli.cxx
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2008-11-20 13:27:25 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2008-11-20 13:27:25 +0000
commitefae0f61f1e45db66b9e98eb72f6e0022ec8353f (patch)
tree680b3b367ae2a23ade4d1ab095124012c540d443 /sc/source/filter/xml/xmlcelli.cxx
parent77588e26942ad545eb1aa98455c2ecec15b1edd0 (diff)
CWS-TOOLING: integrate CWS calc46_DEV300
Diffstat (limited to 'sc/source/filter/xml/xmlcelli.cxx')
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx34
1 files changed, 22 insertions, 12 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 4ef62e589cd3..d6e88aaed484 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: xmlcelli.cxx,v $
- * $Revision: 1.96 $
+ * $Revision: 1.96.166.1 $
*
* This file is part of OpenOffice.org.
*
@@ -607,21 +607,31 @@ void ScXMLTableRowCellContext::DoMerge(const com::sun::star::table::CellAddress&
uno::Reference<table::XCellRange> xCellRange(rXMLImport.GetTables().GetCurrentXCellRange());
if ( xCellRange.is() )
{
- table::CellRangeAddress aCellAddress;
- if (IsMerged(xCellRange, aCellPos.Column, aCellPos.Row, aCellAddress))
+ // Stored merge range may actually be of a larger extend than what
+ // we support, in which case getCellRangeByPosition() throws
+ // IndexOutOfBoundsException. Do nothing then.
+ try
{
- //unmerge
+ table::CellRangeAddress aCellAddress;
+ if (IsMerged(xCellRange, aCellPos.Column, aCellPos.Row, aCellAddress))
+ {
+ //unmerge
+ uno::Reference <util::XMergeable> xMergeable (xCellRange->getCellRangeByPosition(aCellAddress.StartColumn, aCellAddress.StartRow,
+ aCellAddress.EndColumn, aCellAddress.EndRow), uno::UNO_QUERY);
+ if (xMergeable.is())
+ xMergeable->merge(sal_False);
+ }
+
+ //merge
uno::Reference <util::XMergeable> xMergeable (xCellRange->getCellRangeByPosition(aCellAddress.StartColumn, aCellAddress.StartRow,
- aCellAddress.EndColumn, aCellAddress.EndRow), uno::UNO_QUERY);
+ aCellAddress.EndColumn + nCols, aCellAddress.EndRow + nRows), uno::UNO_QUERY);
if (xMergeable.is())
- xMergeable->merge(sal_False);
+ xMergeable->merge(sal_True);
+ }
+ catch ( lang::IndexOutOfBoundsException & )
+ {
+ DBG_ERRORFILE("ScXMLTableRowCellContext::DoMerge: range to be merged larger than what we support");
}
-
- //merge
- uno::Reference <util::XMergeable> xMergeable (xCellRange->getCellRangeByPosition(aCellAddress.StartColumn, aCellAddress.StartRow,
- aCellAddress.EndColumn + nCols, aCellAddress.EndRow + nRows), uno::UNO_QUERY);
- if (xMergeable.is())
- xMergeable->merge(sal_True);
}
}
}