[Libreoffice-commits] core.git: sw/inc sw/qa sw/source

Caolán McNamara caolanm at redhat.com
Tue Dec 13 13:52:21 UTC 2016


 sw/inc/ndarr.hxx                     |    2 +-
 sw/qa/core/data/rtf/fail/table-3.rtf |binary
 sw/source/core/docnode/ndtbl.cxx     |    2 +-
 sw/source/core/unocore/unotext.cxx   |    2 +-
 4 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 82f25d5de546225548725e4056fdf1148fe605eb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Dec 13 13:51:24 2016 +0000

    crashtesting: assert on loading certain rtf
    
    Change-Id: I17acf270f552571fec898e19fa2d000ec4c00df5

diff --git a/sw/inc/ndarr.hxx b/sw/inc/ndarr.hxx
index 620ffe1..978d814 100644
--- a/sw/inc/ndarr.hxx
+++ b/sw/inc/ndarr.hxx
@@ -259,7 +259,7 @@ public:
                                 SwTextFormatColl* pTextColl,
                                 SwUndoTextToTable* pUndo );
 
-    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
new file mode 100644
index 0000000..ea07218
Binary files /dev/null and b/sw/qa/core/data/rtf/fail/table-3.rtf differ
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 9c8eb82..f6540bb 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1302,7 +1302,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 49f2cbe..37ec468 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)
     {


More information about the Libreoffice-commits mailing list