summaryrefslogtreecommitdiff
path: root/sc
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
parent6e26f941e162da811fcc449f2f6cce083d21100c (diff)
workaround problems with row import, fdo#58539
This fixes another crash with gnome#627150 Change-Id: Ibd259c77f8df04b52c9fee0699e0edd1ad30e94e
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/xml/xmlrowi.cxx7
-rw-r--r--sc/source/filter/xml/xmlrowi.hxx2
2 files changed, 9 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())
{
diff --git a/sc/source/filter/xml/xmlrowi.hxx b/sc/source/filter/xml/xmlrowi.hxx
index a900ff781d11..02c5255f883f 100644
--- a/sc/source/filter/xml/xmlrowi.hxx
+++ b/sc/source/filter/xml/xmlrowi.hxx
@@ -29,6 +29,8 @@ class ScXMLTableRowContext : public SvXMLImportContext
rtl::OUString sStyleName;
rtl::OUString sVisibility;
sal_Int32 nRepeatedRows;
+ sal_Int32 mnLastRow; // to workaround problems with the cell import, can be removed when the cell
+ // always adds enough rows
bool bHasCell;
const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }