[Libreoffice-commits] .: 3 commits - sc/qa
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Sep 25 03:30:48 PDT 2012
sc/qa/unit/data/xlsx/formats.xlsx |binary
sc/qa/unit/data/xlsx/named-ranges-global.xlsx |binary
sc/qa/unit/subsequent_filters-test.cxx | 31 ++++++++++++++++++++++++--
3 files changed, 29 insertions(+), 2 deletions(-)
New commits:
commit 4caa1baf0eecf422bb4f3b6101ecd2bc6fc3ebfa
Author: Noel Power <noel.power at suse.com>
Date: Tue Sep 25 11:29:16 2012 +0100
add new test ( disabled ) to show still unresolved problem :-(
Change-Id: I1469d95ae8492fd24094b52033e23f0318bc0190
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 38bc44a..3428582 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -644,7 +644,7 @@ void testFormats_Impl(ScFiltersTest* pFiltersTest, ScDocument* pDoc, sal_Int32 n
rtl::OUString sExpected("Excel Built-in Date");
rtl::OUString sResult = pStyleSheet->GetName();
CPPUNIT_ASSERT_EQUAL_MESSAGE("parent style for Sheet4.B2 is 'Excel Built-in Date'", sExpected, sResult);
- // check align
+ // check align of style
SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
eHorJustify = static_cast<SvxCellHorJustify>(static_cast< const SvxHorJustifyItem& >(rItemSet.Get( ATTR_HOR_JUSTIFY ) ).GetValue() );
CPPUNIT_ASSERT_EQUAL_MESSAGE("'Excel Built-in Date' style should be aligned centre horizontally", SVX_HOR_JUSTIFY_CENTER, eHorJustify);
@@ -653,6 +653,12 @@ void testFormats_Impl(ScFiltersTest* pFiltersTest, ScDocument* pDoc, sal_Int32 n
sExpected = rtl::OUString("29");
CPPUNIT_ASSERT_EQUAL_MESSAGE("'Excel Built-in Date' style should just display month", sExpected, sResult );
+ // check actual align applied to cell, should be the same as
+ // the style
+ eHorJustify = static_cast<SvxCellHorJustify>(static_cast< const SvxHorJustifyItem& >(pPattern->GetItem( ATTR_HOR_JUSTIFY ) ).GetValue() );
+#if ENABLE_WHEN_FIXED
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("cell with 'Excel Built-in Date' style should be aligned centre horizontally", SVX_HOR_JUSTIFY_CENTER, eHorJustify);
+#endif
}
}
commit 3f79d49058c41a92a2dfe0a284c4adbd1c1f96c3
Author: Noel Power <noel.power at suse.com>
Date: Mon Sep 24 20:18:01 2012 +0100
unit test for fdo#55198
Change-Id: I15b745366d1f4c3180f44290e72e245f98bbd755
diff --git a/sc/qa/unit/data/xlsx/formats.xlsx b/sc/qa/unit/data/xlsx/formats.xlsx
index ddc828a..1c451be 100644
Binary files a/sc/qa/unit/data/xlsx/formats.xlsx and b/sc/qa/unit/data/xlsx/formats.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 678d1ec..38bc44a 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -50,6 +50,7 @@
#include "userdat.hxx"
#include "dpobject.hxx"
#include "dpsave.hxx"
+#include "stlsheet.hxx"
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XControlShape.hpp>
@@ -634,6 +635,25 @@ void testFormats_Impl(ScFiltersTest* pFiltersTest, ScDocument* pDoc, sal_Int32 n
rtl::OUString aCondString = getConditionalFormatString(pDoc, 3,0,2);
pFiltersTest->createCSVPath(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("conditionalFormatting.")), aCSVFileName);
testCondFile(aCSVFileName, pDoc, 2);
+ // test parent cell style import ( fdo#55198 )
+ if ( nFormat == XLSX )
+ {
+ pPattern = pDoc->GetPattern(1,1,3);
+ ScStyleSheet* pStyleSheet = (ScStyleSheet*)pPattern->GetStyleSheet();
+ // check parent style name
+ rtl::OUString sExpected("Excel Built-in Date");
+ rtl::OUString sResult = pStyleSheet->GetName();
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("parent style for Sheet4.B2 is 'Excel Built-in Date'", sExpected, sResult);
+ // check align
+ SfxItemSet& rItemSet = pStyleSheet->GetItemSet();
+ eHorJustify = static_cast<SvxCellHorJustify>(static_cast< const SvxHorJustifyItem& >(rItemSet.Get( ATTR_HOR_JUSTIFY ) ).GetValue() );
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("'Excel Built-in Date' style should be aligned centre horizontally", SVX_HOR_JUSTIFY_CENTER, eHorJustify);
+ // check date format ( should be just month e.g. 29 )
+ sResult =pDoc->GetString( 1,1,3 );
+ sExpected = rtl::OUString("29");
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("'Excel Built-in Date' style should just display month", sExpected, sResult );
+
+ }
}
ScConditionalFormat* pCondFormat = pDoc->GetCondFormat(0,0,2);
commit fde638b3ac35997aa3e38a37fed56d6eb661806b
Author: Noel Power <noel.power at suse.com>
Date: Mon Sep 24 18:10:32 2012 +0100
unit test for bnc#780296 fix
Change-Id: Ib75437bb52c8094821fc9d18429f4ce01bb7ec2f
diff --git a/sc/qa/unit/data/xlsx/named-ranges-global.xlsx b/sc/qa/unit/data/xlsx/named-ranges-global.xlsx
index 3bb0cbc..fe90d6d 100644
Binary files a/sc/qa/unit/data/xlsx/named-ranges-global.xlsx and b/sc/qa/unit/data/xlsx/named-ranges-global.xlsx differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index e9f6b66..678d1ec 100644
--- a/sc/qa/unit/subsequent_filters-test.cxx
+++ b/sc/qa/unit/subsequent_filters-test.cxx
@@ -321,6 +321,9 @@ void testRangeNameImpl(ScDocument* pDoc)
CPPUNIT_ASSERT_EQUAL_MESSAGE("=SUM(global3) should be 10", 10.0, aValue);
pDoc->GetValue(1,0,1,aValue);
CPPUNIT_ASSERT_EQUAL_MESSAGE("range name Sheet2.local1 should reference Sheet1.A5", 5.0, aValue);
+ // Test if Global5 ( which depends on Global6 ) is evaluated
+ pDoc->GetValue(0,5,1, aValue);
+ CPPUNIT_ASSERT_EQUAL_MESSAGE("formula Global5 should reference Global6 ( which is evaluated as local1 )", 5.0, aValue);
}
}
@@ -351,8 +354,6 @@ void ScFiltersTest::testRangeNameXLSX()
ScDocument* pDoc = xDocSh->GetDocument();
testRangeNameImpl(pDoc);
-
- xDocSh->DoClose();
}
void ScFiltersTest::testHardRecalcODS()
More information about the Libreoffice-commits
mailing list