[Libreoffice-commits] .: 2 commits - sc/inc sc/qa

Markus Mohrhard mmohrhard at kemper.freedesktop.org
Sat Mar 31 18:37:24 PDT 2012


 sc/inc/document.hxx                    |    2 +-
 sc/qa/unit/data/ods/border.ods         |binary
 sc/qa/unit/subsequent_filters-test.cxx |   26 ++++++++++++++++++++++++++
 sc/qa/unit/ucalc.cxx                   |    4 +++-
 4 files changed, 30 insertions(+), 2 deletions(-)

New commits:
commit f19ebe978a329e5322fca89aaf568371c532e5fb
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Apr 1 03:32:40 2012 +0200

    first part of border import test

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 2fbd0eb..1c0477c 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -865,7 +865,7 @@ public:
                                  SCCOL nCol2, SCROW nRow2, SCTAB nTab2, sal_uInt16 nMask ) const;
     SC_DLLPUBLIC bool HasAttrib( const ScRange& rRange, sal_uInt16 nMask ) const;
 
-    void            GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab,
+    SC_DLLPUBLIC void GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab,
                                     const ::editeng::SvxBorderLine** ppLeft,
                                     const ::editeng::SvxBorderLine** ppTop,
                                     const ::editeng::SvxBorderLine** ppRight,
diff --git a/sc/qa/unit/data/ods/border.ods b/sc/qa/unit/data/ods/border.ods
new file mode 100644
index 0000000..e2ac68b
Binary files /dev/null and b/sc/qa/unit/data/ods/border.ods differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 7ff3ba0..3502d34 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -41,6 +41,7 @@
 
 #include <editeng/brshitem.hxx>
 #include <editeng/justifyitem.hxx>
+#include <editeng/borderline.hxx>
 #include <dbdata.hxx>
 
 #define CALC_DEBUG_OUTPUT 0
@@ -102,6 +103,7 @@ public:
     void testFormatsXLSX();
     void testMatrixODS();
     void testMatrixXLS();
+    void testBorderODS();
     void testBugFixesODS();
     void testBugFixesXLS();
     void testBugFixesXLSX();
@@ -121,6 +123,7 @@ public:
     CPPUNIT_TEST(testFormatsXLSX);
     CPPUNIT_TEST(testMatrixODS);
     CPPUNIT_TEST(testMatrixXLS);
+    CPPUNIT_TEST(testBorderODS);
     CPPUNIT_TEST(testBugFixesODS);
     CPPUNIT_TEST(testBugFixesXLS);
     CPPUNIT_TEST(testBugFixesXLSX);
@@ -470,6 +473,29 @@ void ScFiltersTest::testMatrixXLS()
     xDocSh->DoClose();
 }
 
+void ScFiltersTest::testBorderODS()
+{
+    const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("border."));
+    ScDocShellRef xDocSh = loadDoc( aFileNameBase, 0);
+
+    CPPUNIT_ASSERT_MESSAGE("Failed to load border.*", xDocSh.Is());
+    ScDocument* pDoc = xDocSh->GetDocument();
+
+    const editeng::SvxBorderLine* pLeft = NULL;
+    const editeng::SvxBorderLine* pTop = NULL;
+    const editeng::SvxBorderLine* pRight = NULL;
+    const editeng::SvxBorderLine* pBottom = NULL;
+
+    pDoc->GetBorderLines( 0, 1, 0, &pLeft, &pTop, &pRight, &pBottom );
+    CPPUNIT_ASSERT(!pLeft);
+    CPPUNIT_ASSERT(!pTop);
+    CPPUNIT_ASSERT(!pBottom);
+    CPPUNIT_ASSERT(pRight);
+    CPPUNIT_ASSERT_EQUAL(pRight->GetStyle(),editeng::SOLID);
+
+    xDocSh->DoClose();
+}
+
 void ScFiltersTest::testBugFixesODS()
 {
     const rtl::OUString aFileNameBase(RTL_CONSTASCII_USTRINGPARAM("bug-fixes."));
commit c41f72f5a9cdee8e048c29768ada9a9e2666b7d7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Apr 1 02:56:15 2012 +0200

    with the correct assumption this check actually makes sense

diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 838d3a1..1bdfe9d 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -3933,7 +3933,9 @@ void Test::testSetBackgroundColor()
     //now check for undo
     SfxUndoAction* pUndo = new ScUndoTabColor(m_xDocShRef,0, aOldTabBgColor, aColor);
     pUndo->Undo();
-    //CPPUNIT_ASSERT_MESSAGE("the correct color is not set after undo", m_pDoc->GetTabBgColor(0)!= aOldTabBgColor.GetColor());
+    CPPUNIT_ASSERT_MESSAGE("the correct color is not set after undo", m_pDoc->GetTabBgColor(0)== aOldTabBgColor.GetColor());
+    pUndo->Redo();
+    CPPUNIT_ASSERT_MESSAGE("the correct color is not set after undo", m_pDoc->GetTabBgColor(0)== aColor.GetColor());
     m_pDoc->DeleteTab(0);
 }
 


More information about the Libreoffice-commits mailing list