diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-12-13 13:51:24 +0000 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-01-02 23:42:51 +0000 |
commit | 1d45caa9a3a326a1947265feb02d7d0a378c75f3 (patch) | |
tree | 1a9006021e85234818994775d17d390c184150be | |
parent | 03b6eff8ba1d7102608221e6bf94f581aba2ee9d (diff) |
crashtesting: assert on loading certain rtf
Change-Id: I17acf270f552571fec898e19fa2d000ec4c00df5
(cherry picked from commit 82f25d5de546225548725e4056fdf1148fe605eb)
Reviewed-on: https://gerrit.libreoffice.org/31979
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
-rw-r--r-- | sw/inc/ndarr.hxx | 2 | ||||
-rw-r--r-- | sw/qa/core/data/rtf/fail/table-3.rtf | bin | 0 -> 3355 bytes | |||
-rw-r--r-- | sw/source/core/docnode/ndtbl.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unotext.cxx | 2 |
4 files changed, 3 insertions, 3 deletions
diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx index 39078e7f627f..f4c00d49ef1a 100644 --- a/sw/inc/ndarr.hxx +++ b/sw/inc/ndarr.hxx @@ -258,7 +258,7 @@ public: SwTextFormatColl* pTextColl, SwUndoTextToTable* pUndo = nullptr ); - static SwNodeRange * ExpandRangeForTableBox(const SwNodeRange & rRange); + SwNodeRange * ExpandRangeForTableBox(const SwNodeRange & rRange); /// create a table from a vector of NodeRanges - API support SwTableNode* TextToTable( const TableRanges_t& rTableNodes, diff --git a/sw/qa/core/data/rtf/fail/table-3.rtf b/sw/qa/core/data/rtf/fail/table-3.rtf Binary files differnew file mode 100644 index 000000000000..ea07218bdcba --- /dev/null +++ b/sw/qa/core/data/rtf/fail/table-3.rtf diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx index 56a54575bbd3..889a5135b3d3 100644 --- a/sw/source/core/docnode/ndtbl.cxx +++ b/sw/source/core/docnode/ndtbl.cxx @@ -1315,7 +1315,7 @@ SwNodeRange * SwNodes::ExpandRangeForTableBox(const SwNodeRange & rRange) } SwNode * pNode = &aIndex.GetNode(); - while (pNode->IsEndNode()) + while (pNode->IsEndNode() && aIndex < Count() - 1) { SwNode * pStartNode = pNode->StartOfSectionNode(); SwNodeIndex aStartIndex(*pStartNode); diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index bad069f628d7..f87543c69114 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1839,7 +1839,7 @@ void SwXText::Impl::ConvertCell( SwNodeRange aTmpRange(aStartCellPam.Start()->nNode, aEndCellPam.End()->nNode); SwNodeRange * pCorrectedRange = - SwNodes::ExpandRangeForTableBox(aTmpRange); + m_pDoc->GetNodes().ExpandRangeForTableBox(aTmpRange); if (pCorrectedRange != nullptr) { |