diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-08-13 08:33:37 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-08-13 08:34:26 +0100 |
commit | 348cc2ce1e932f0fcaf90f9cf4d6dc9594f3f8a2 (patch) | |
tree | aa83c98e7de6953091cca60d9e4ad9ceb9289050 /sw | |
parent | 05d355ca19487dd3d1a86980f51a56db695e4bcc (diff) |
wrong row/col count limits
thanks to ccsheller for noticing
Change-Id: Idb0f39c48173445b750e0b85ac20b3f6b43691a7
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/vba/vbatablehelper.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sw/source/ui/vba/vbatablehelper.cxx b/sw/source/ui/vba/vbatablehelper.cxx index 755ecd899b87..65f02fdb9710 100644 --- a/sw/source/ui/vba/vbatablehelper.cxx +++ b/sw/source/ui/vba/vbatablehelper.cxx @@ -61,7 +61,6 @@ sal_Int32 SwVbaTableHelper::getTabColumnsCount( sal_Int32 nRowIndex ) throw (uno sal_Int32 SwVbaTableHelper::getTabColumnsMaxCount( ) throw (uno::RuntimeException) { sal_Int32 nRet = 0; - //sal_Int32 nRowCount = mxTextTable->getRows()->getCount(); sal_Int32 nRowCount = pTable->GetTabLines().size(); for( sal_Int32 index = 0; index < nRowCount; index++ ) { @@ -141,15 +140,15 @@ SwTableBox* SwVbaTableHelper::GetTabBox( sal_Int32 nCol, sal_Int32 nRow ) throw { SwTableLines& rLines = pTable->GetTabLines(); sal_Int32 nRowCount = rLines.size(); - if( nRowCount < nRow ) + if (nRow >= nRowCount) throw uno::RuntimeException(); - SwTableBox* pStart = NULL; SwTableLine* pLine = rLines[ nRow ]; - if( (sal_Int32)pLine->GetTabBoxes().size() < nCol ) + sal_Int32 nColCount = pLine->GetTabBoxes().size(); + if (nCol >= nColCount) throw uno::RuntimeException(); - pStart = pLine->GetTabBoxes()[ nCol ]; + SwTableBox* pStart = pLine->GetTabBoxes()[ nCol ]; if( !pStart ) throw uno::RuntimeException(); |