diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-05-15 12:44:48 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-05-15 13:02:12 +0100 |
commit | 4ee3eabd0f058b26544c84b2b5aaf5478d921817 (patch) | |
tree | ee75adf3ce0dca9b28acab7e6d6c1a86f224375f /sw/source/core/unocore/unotext.cxx | |
parent | f2cbe51f86954cc01e3f066e3896a2c84b866766 (diff) |
avoid crashing on load of fdo54724-1.rtf
Change-Id: I3df326eadc2f137c75e87835caf12266dbd011b5
Diffstat (limited to 'sw/source/core/unocore/unotext.cxx')
-rw-r--r-- | sw/source/core/unocore/unotext.cxx | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 59d586a6338e..8af3174f30bf 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -2238,12 +2238,17 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception) for (sal_Int32 nCell = 0; nCell < nCells; ++nCell) { - SwNodeRange *const pLastCell( - (nCell == 0) - ? ((nRow == 0) ? nullptr : &*aTableNodes.rbegin()->rbegin()) - : &*aRowNodes.rbegin()); - m_pImpl->ConvertCell(pRow[nCell], - aRowNodes, pLastCell, bExcept); + SwNodeRange *pLastCell; + if (nCell == 0 && nRow == 0) + { + pLastCell = nullptr; + } + else + { + std::vector<SwNodeRange>& rRowOfPrevCell = nCell ? aRowNodes : *aTableNodes.rbegin(); + pLastCell = !rRowOfPrevCell.empty() ? &*rRowOfPrevCell.rbegin() : nullptr; + } + m_pImpl->ConvertCell(pRow[nCell], aRowNodes, pLastCell, bExcept); } aTableNodes.push_back(aRowNodes); } |