summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;