[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - sw/qa sw/source
Mike Kaganski
mike.kaganski at collabora.com
Tue Jan 30 09:47:10 UTC 2018
sw/qa/extras/uiwriter/data/tdf115065.odt |binary
sw/qa/extras/uiwriter/uiwriter.cxx | 27 +++++++++++++++++++++++++++
sw/source/core/crsr/swcrsr.cxx | 4 ++--
3 files changed, 29 insertions(+), 2 deletions(-)
New commits:
commit 34064c116f196073259fc0a83c3d92611c263d19
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date: Thu Jan 18 14:21:58 2018 +0300
tdf#115065: nullptr dereference
Change-Id: Iafaaafdabf9fb7947fa0b03cd38d3b4a567a41b9
Reviewed-on: https://gerrit.libreoffice.org/48110
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Tested-by: Jenkins <ci at libreoffice.org>
(cherry picked from commit 13e55cedd2944c41f3f4fe7032cfea1ef9e6015d)
Reviewed-on: https://gerrit.libreoffice.org/48194
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/qa/extras/uiwriter/data/tdf115065.odt b/sw/qa/extras/uiwriter/data/tdf115065.odt
new file mode 100644
index 000000000000..86fc28aaf686
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf115065.odt differ
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 8f48295abe0c..07f153dac973 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -290,6 +290,7 @@ public:
void testTdf114306();
void testTdf114306_2();
void testTdf114536();
+ void testTdf115065();
CPPUNIT_TEST_SUITE(SwUiWriterTest);
CPPUNIT_TEST(testReplaceForward);
@@ -461,6 +462,7 @@ public:
CPPUNIT_TEST(testTdf114306);
CPPUNIT_TEST(testTdf114306_2);
CPPUNIT_TEST(testTdf114536);
+ CPPUNIT_TEST(testTdf115065);
CPPUNIT_TEST_SUITE_END();
private:
@@ -5619,6 +5621,31 @@ void SwUiWriterTest::testTdf113790()
CPPUNIT_ASSERT(dynamic_cast<SwXTextDocument *>(mxComponent.get()));
}
+void SwUiWriterTest::testTdf115065()
+{
+ // In the document, the tables have table style assigned
+ // Source table (first one) has two rows;
+ // destination (second one) has only one row
+ SwDoc* pDoc = createDoc("tdf115065.odt");
+ CPPUNIT_ASSERT(pDoc);
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ CPPUNIT_ASSERT(pWrtShell);
+
+ pWrtShell->GotoTable("Table2");
+ SwRect aRect = pWrtShell->GetCurrFrame()->getFrameArea();
+ // Destination point is the middle of the first cell of second table
+ Point ptTo = Point(aRect.Left() + aRect.Width() / 2, aRect.Top() + aRect.Height() / 2);
+
+ pWrtShell->GotoTable("Table1");
+ aRect = pWrtShell->GetCurrFrame()->getFrameArea();
+ // Source point is the middle of the first cell of first table
+ Point ptFrom = Point(aRect.Left() + aRect.Width() / 2, aRect.Top() + aRect.Height() / 2);
+
+ pWrtShell->SelTableCol();
+ // The copy operation (or closing document after that) segfaulted
+ pWrtShell->Copy(pWrtShell, ptFrom, ptTo);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwUiWriterTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/core/crsr/swcrsr.cxx b/sw/source/core/crsr/swcrsr.cxx
index 973880821359..4705f5c625ac 100644
--- a/sw/source/core/crsr/swcrsr.cxx
+++ b/sw/source/core/crsr/swcrsr.cxx
@@ -2265,8 +2265,8 @@ void SwTableCursor::DeleteBox(size_t const nPos)
bool SwTableCursor::NewTableSelection()
{
bool bRet = false;
- const SwNode *pStart = GetContentNode()->FindTableBoxStartNode();
- const SwNode *pEnd = GetContentNode(false)->FindTableBoxStartNode();
+ const SwNode *pStart = GetNode().FindTableBoxStartNode();
+ const SwNode *pEnd = GetNode(false).FindTableBoxStartNode();
if( pStart && pEnd )
{
const SwTableNode *pTableNode = pStart->FindTableNode();
More information about the Libreoffice-commits
mailing list