summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml/xmlrowi.cxx
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-01-04 02:59:23 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-01-04 03:34:24 +0100
commit3e85d9c62c69ee39dd4c6ae7cd556fdf53f5e01d (patch)
treeb8cbef305a4f7c5a4655ab3e97fa4fce571aa66f /sc/source/filter/xml/xmlrowi.cxx
parent6e26f941e162da811fcc449f2f6cce083d21100c (diff)
workaround problems with row import, fdo#58539
This fixes another crash with gnome#627150 Change-Id: Ibd259c77f8df04b52c9fee0699e0edd1ad30e94e
Diffstat (limited to 'sc/source/filter/xml/xmlrowi.cxx')
-rw-r--r--sc/source/filter/xml/xmlrowi.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sc/source/filter/xml/xmlrowi.cxx b/sc/source/filter/xml/xmlrowi.cxx
index ea5816516f9c..67d1f23ae43a 100644
--- a/sc/source/filter/xml/xmlrowi.cxx
+++ b/sc/source/filter/xml/xmlrowi.cxx
@@ -97,6 +97,7 @@ ScXMLTableRowContext::ScXMLTableRowContext( ScXMLImport& rImport,
break;*/
}
}
+ mnLastRow = GetScImport().GetTables().GetCurrentRow() + nRepeatedRows;
GetScImport().GetTables().AddRow();
GetScImport().GetTables().SetRowStyle(sCellStyleName);
}
@@ -154,6 +155,12 @@ void ScXMLTableRowContext::EndElement()
}
SCTAB nSheet = rXMLImport.GetTables().GetCurrentSheet();
sal_Int32 nCurrentRow(rXMLImport.GetTables().GetCurrentRow());
+ if(nCurrentRow != mnLastRow)
+ {
+ // this document is most likely invalid in some way
+ SAL_WARN("sc", "we did not generate enough rows in the cell import!!");
+ nCurrentRow = mnLastRow;
+ }
uno::Reference<sheet::XSpreadsheet> xSheet(rXMLImport.GetTables().GetCurrentXSheet());
if(xSheet.is())
{