From 1192b227544c87f25a367ebff478cbdc190dad02 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 27 Mar 2012 13:03:21 +0100 Subject: Resolves: rhbz#802173 crash in ScRowStyles::GetStyleNameIndex --- sc/source/filter/xml/XMLStylesExportHelper.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sc') diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index a04c75bb10cb..48d95020f58d 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -1290,6 +1290,9 @@ void ScRowStyles::AddNewTable(const sal_Int32 nTable, const sal_Int32 nFields) sal_Int32 ScRowStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32 nField) { OSL_ENSURE(static_cast(nTable) < aTables.size(), "wrong table"); + if (!(static_cast(nTable) < aTables.size())) + return -1; + if (maCache.hasCache(nTable, nField)) // Cache hit ! return maCache.mnStyle; -- cgit