summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2012-06-12 19:50:23 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-06-13 09:50:03 +0200
commit54ffca05745da60db73d331bbad4af175aaf1788 (patch)
treed66627ead0ef1ac5361275fa018558d7c80fd7c1
parentdfa7f7cd91f1860ed0e469b121a5ec0604aea125 (diff)
Resolves: fdo#49178 CRASH when FILEOPEN particular RTF
Change-Id: Idd938980b91ec8b822a92dfd7013a20fe5b6f498 (cherry picked from commit 104badf31c8a39994cadc460561bfa01e428b67b) Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
-rw-r--r--writerfilter/source/dmapper/DomainMapperTableManager.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/writerfilter/source/dmapper/DomainMapperTableManager.cxx b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
index 89a71f1d2ede..2b5935835f6b 100644
--- a/writerfilter/source/dmapper/DomainMapperTableManager.cxx
+++ b/writerfilter/source/dmapper/DomainMapperTableManager.cxx
@@ -486,8 +486,9 @@ void DomainMapperTableManager::endOfRowAction()
sal_Int16 nSum = 0;
sal_uInt32 nPos = 0;
+ sal_uInt32 nSizeTableGrid = pTableGrid->size();
// Ignoring the i=0 case means we assume that the width of the last cell matches the table width
- for (int i = m_nCell; i > 1; i--)
+ for (sal_uInt32 i = m_nCell; i > 1 && nSizeTableGrid >= i; i--)
{
nSum += (*pTableGrid.get())[pTableGrid->size() - i]; // Size of the current cell
pSeparators[nPos].Position = nSum * nFullWidthRelative / nFullWidth; // Relative position