[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sc/qa sc/source
Michael Meeks
michael.meeks at collabora.com
Wed Jan 1 04:04:25 PST 2014
sc/qa/unit/ucalc.cxx | 13 +++++++++++++
sc/qa/unit/ucalc.hxx | 2 ++
sc/source/core/data/column.cxx | 3 ++-
3 files changed, 17 insertions(+), 1 deletion(-)
New commits:
commit 74fcb90dc73e235934fc19d39b7d7b0bf07cc8a5
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Wed Jan 1 11:07:46 2014 +0000
fdo#73021 - avoid call crash on spell-check + unit test.
Change-Id: I3588ef45617bda440f970e54274cc0985b7baed5
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 2b04ea4..abf872c 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1638,6 +1638,19 @@ void Test::testEnterMixedMatrix()
m_pDoc->DeleteTab(0);
}
+void Test::testCellCopy()
+{
+ m_pDoc->InsertTab(0, "TestTab");
+ ScAddress aSrc(0,0,0);
+ ScAddress aDest(0,1,0);
+ OUString aStr("please copy me");
+ m_pDoc->SetString(aSrc, aStr);
+ CPPUNIT_ASSERT_EQUAL(m_pDoc->GetString(aSrc), aStr);
+ // copy to self - why not ?
+ m_pDoc->CopyCellToDocument(aSrc,aDest,*m_pDoc);
+ CPPUNIT_ASSERT_EQUAL(m_pDoc->GetString(aDest), aStr);
+}
+
void Test::testSheetCopy()
{
m_pDoc->InsertTab(0, "TestTab");
diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index b877e02..efefad2 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -213,6 +213,7 @@ public:
*/
void testPivotTableDocFunc();
+ void testCellCopy();
void testSheetCopy();
void testSheetMove();
void testExternalRef();
@@ -350,6 +351,7 @@ public:
CPPUNIT_TEST(testPivotTableNumStability);
CPPUNIT_TEST(testPivotTableFieldReference);
CPPUNIT_TEST(testPivotTableDocFunc);
+ CPPUNIT_TEST(testCellCopy);
CPPUNIT_TEST(testSheetCopy);
CPPUNIT_TEST(testSheetMove);
CPPUNIT_TEST(testExternalRef);
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 921ff25..e852e1f 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1564,7 +1564,8 @@ void ScColumn::CopyCellToDocument( SCROW nSrcRow, SCROW nDestRow, ScColumn& rDes
rDestCol.maCellTextAttrs.set(nDestRow, maCellTextAttrs.get<sc::CellTextAttr>(nSrcRow));
ScPostIt* pNote = maCellNotes.get<ScPostIt*>(nSrcRow);
rDestCol.maCellNotes.set(nDestRow, pNote);
- pNote->UpdateCaptionPos(ScAddress(rDestCol.nCol, nDestRow, rDestCol.nTab));
+ if (pNote)
+ pNote->UpdateCaptionPos(ScAddress(rDestCol.nCol, nDestRow, rDestCol.nTab));
}
else
{
More information about the Libreoffice-commits
mailing list