[Libreoffice-commits] core.git: 3 commits - sc/qa sc/source vcl/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Sat Dec 6 20:44:12 PST 2014


 sc/qa/unit/ucalc.hxx                |    2 +
 sc/qa/unit/ucalc_formula.cxx        |   37 ++++++++++++++++++++++++++++++++++++
 sc/source/core/data/documen2.cxx    |    3 --
 vcl/source/opengl/OpenGLContext.cxx |    3 ++
 4 files changed, 43 insertions(+), 2 deletions(-)

New commits:
commit c0533a4694e63959bc198dfb190511a223d521c0
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sun Dec 7 05:39:06 2014 +0100

    add test for fdo#85856
    
    Change-Id: I4b3f8a0a0ebd089862ccffc452a2852b5868a51d

diff --git a/sc/qa/unit/ucalc.hxx b/sc/qa/unit/ucalc.hxx
index d5fd983..ed35ca1 100644
--- a/sc/qa/unit/ucalc.hxx
+++ b/sc/qa/unit/ucalc.hxx
@@ -148,6 +148,7 @@ public:
     void testFormulaRefUpdateNameMove();
     void testFormulaRefUpdateNameExpandRef();
     void testFormulaRefUpdateNameDeleteRow();
+    void testFormulaRefUpdateNameCopySheet();
     void testFormulaRefUpdateValidity();
     void testMultipleOperations();
     void testFuncCOLUMN();
@@ -451,6 +452,7 @@ public:
     CPPUNIT_TEST(testFormulaRefUpdateNameMove);
     CPPUNIT_TEST(testFormulaRefUpdateNameExpandRef);
     CPPUNIT_TEST(testFormulaRefUpdateNameDeleteRow);
+    CPPUNIT_TEST(testFormulaRefUpdateNameCopySheet);
     CPPUNIT_TEST(testFormulaRefUpdateValidity);
     CPPUNIT_TEST(testMultipleOperations);
     CPPUNIT_TEST(testFuncCOLUMN);
diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx
index c66194c..44c78f32 100644
--- a/sc/qa/unit/ucalc_formula.cxx
+++ b/sc/qa/unit/ucalc_formula.cxx
@@ -2599,6 +2599,43 @@ void Test::testFormulaRefUpdateNameDeleteRow()
     m_pDoc->DeleteTab(0);
 }
 
+void Test::testFormulaRefUpdateNameCopySheet()
+{
+    m_pDoc->InsertTab(0, "Test");
+    m_pDoc->InsertTab(1, "Test2");
+
+    bool bInserted = m_pDoc->InsertNewRangeName("RED", ScAddress(0,0,0), "$Test.$B$2");
+    CPPUNIT_ASSERT(bInserted);
+    bInserted = m_pDoc->InsertNewRangeName("BLUE", ScAddress(0,0,0), "$Test.$B$3");
+    CPPUNIT_ASSERT(bInserted);
+    m_pDoc->SetValue(1, 1, 0, 1);
+    m_pDoc->SetValue(1, 2, 0, 2);
+
+    // insert formula into Test2 that is =RED+BLUE
+    m_pDoc->SetString(ScAddress(2,2,1), "=RED+BLUE");
+
+    double nVal = m_pDoc->GetValue(2, 2, 1);
+    CPPUNIT_ASSERT_EQUAL(3.0, nVal);
+    m_pDoc->CopyTab(1, 0);
+
+    nVal = m_pDoc->GetValue(2, 2, 2);
+    CPPUNIT_ASSERT_EQUAL(3.0, nVal);
+
+    nVal = m_pDoc->GetValue(2, 2, 0);
+    CPPUNIT_ASSERT_EQUAL(3.0, nVal);
+
+    m_pDoc->SetValue(1, 1, 1, 3);
+
+    nVal = m_pDoc->GetValue(2, 2, 2);
+    CPPUNIT_ASSERT_EQUAL(5.0, nVal);
+
+    nVal = m_pDoc->GetValue(2, 2, 0);
+    CPPUNIT_ASSERT_EQUAL(5.0, nVal);
+
+    m_pDoc->DeleteTab(1);
+    m_pDoc->DeleteTab(0);
+}
+
 void Test::testFormulaRefUpdateValidity()
 {
     struct {
commit 6c8ada4d81b5ff06c98b238e016b183fdca05c0b
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Sun Dec 7 05:14:10 2014 +0100

    we need the original context that contains the data, fdo#85856
    
    Change-Id: I107201ab736b548f010d813540e0a9cec7402e79

diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 404dd31..02e1992 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -882,9 +882,8 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM
         aRefCxt.mnTabDelta = nDz;
         maTabs[nNewPos]->UpdateReference(aRefCxt, NULL);
 
-        sc::RefUpdateInsertTabContext aInsTabCxt(nNewPos, 1);
         maTabs[nNewPos]->UpdateInsertTabAbs(nNewPos); // move all paragraphs up by one!!
-        maTabs[nOldPos]->UpdateInsertTab(aInsTabCxt);
+        maTabs[nOldPos]->UpdateInsertTab(aCxt);
 
         maTabs[nOldPos]->UpdateCompile();
         maTabs[nNewPos]->UpdateCompile( true ); //  maybe already compiled in Clone, but used names need recompilation
commit c634ef6d9613eb1847636876f701f66070c7ccb7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Dec 5 03:32:41 2014 +0100

    simple check to prevent crash with old drivers
    
    Change-Id: Ia5cfdcae1d762ed8ee4b182c141565f20c97ec7d

diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 56e565f..c068cd8 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -914,6 +914,9 @@ bool OpenGLContext::ImplInit()
     if (!g_vShareList.empty())
         hSharedCtx = g_vShareList.front();
 
+    if (!wglCreateContextAttribsARB)
+        return false;
+
     // now setup the shared context; this needs a temporary context already
     // set up in order to work
     m_aGLWin.hRC = wglCreateContextAttribsARB(m_aGLWin.hDC, hSharedCtx, NULL);


More information about the Libreoffice-commits mailing list