Kaydet (Commit) 1be1d904 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) David Tardon

wrong row/col count limits

thanks to ccsheller for noticing

Change-Id: Idb0f39c48173445b750e0b85ac20b3f6b43691a7
(cherry picked from commit 348cc2ce)
Reviewed-on: https://gerrit.libreoffice.org/17692Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst c23e12eb
...@@ -61,7 +61,6 @@ sal_Int32 SwVbaTableHelper::getTabColumnsCount( sal_Int32 nRowIndex ) throw (uno ...@@ -61,7 +61,6 @@ sal_Int32 SwVbaTableHelper::getTabColumnsCount( sal_Int32 nRowIndex ) throw (uno
sal_Int32 SwVbaTableHelper::getTabColumnsMaxCount( ) throw (uno::RuntimeException) sal_Int32 SwVbaTableHelper::getTabColumnsMaxCount( ) throw (uno::RuntimeException)
{ {
sal_Int32 nRet = 0; sal_Int32 nRet = 0;
//sal_Int32 nRowCount = mxTextTable->getRows()->getCount();
sal_Int32 nRowCount = pTable->GetTabLines().size(); sal_Int32 nRowCount = pTable->GetTabLines().size();
for( sal_Int32 index = 0; index < nRowCount; index++ ) for( sal_Int32 index = 0; index < nRowCount; index++ )
{ {
...@@ -141,15 +140,15 @@ SwTableBox* SwVbaTableHelper::GetTabBox( sal_Int32 nCol, sal_Int32 nRow ) throw ...@@ -141,15 +140,15 @@ SwTableBox* SwVbaTableHelper::GetTabBox( sal_Int32 nCol, sal_Int32 nRow ) throw
{ {
SwTableLines& rLines = pTable->GetTabLines(); SwTableLines& rLines = pTable->GetTabLines();
sal_Int32 nRowCount = rLines.size(); sal_Int32 nRowCount = rLines.size();
if( nRowCount < nRow ) if (nRow < 0 || nRow >= nRowCount)
throw uno::RuntimeException(); throw uno::RuntimeException();
SwTableBox* pStart = NULL;
SwTableLine* pLine = rLines[ nRow ]; SwTableLine* pLine = rLines[ nRow ];
if( (sal_Int32)pLine->GetTabBoxes().size() < nCol ) sal_Int32 nColCount = pLine->GetTabBoxes().size();
if (nCol < 0 || nCol >= nColCount)
throw uno::RuntimeException(); throw uno::RuntimeException();
pStart = pLine->GetTabBoxes()[ nCol ]; SwTableBox* pStart = pLine->GetTabBoxes()[ nCol ];
if( !pStart ) if( !pStart )
throw uno::RuntimeException(); throw uno::RuntimeException();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment