summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml/XMLStylesExportHelper.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-03-27 13:03:21 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-03-27 13:04:20 +0100
commit1192b227544c87f25a367ebff478cbdc190dad02 (patch)
treebfe6c2e40daef29b758574297ef2895d70ddd875 /sc/source/filter/xml/XMLStylesExportHelper.cxx
parent5ae64e4b0c23f209410fe84df041c9445234df74 (diff)
Resolves: rhbz#802173 crash in ScRowStyles::GetStyleNameIndex
Diffstat (limited to 'sc/source/filter/xml/XMLStylesExportHelper.cxx')
-rw-r--r--sc/source/filter/xml/XMLStylesExportHelper.cxx3
1 files changed, 3 insertions, 0 deletions
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<size_t>(nTable) < aTables.size(), "wrong table");
+ if (!(static_cast<size_t>(nTable) < aTables.size()))
+ return -1;
+
if (maCache.hasCache(nTable, nField))
// Cache hit !
return maCache.mnStyle;