summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2012-09-24 20:18:01 +0100
committerNoel Power <noel.power@suse.com>2012-09-25 11:30:13 +0100
commit3f79d49058c41a92a2dfe0a284c4adbd1c1f96c3 (patch)
treec03b338037481dbed0f0e5c16aa485328ca24d5f /sc
parentfde638b3ac35997aa3e38a37fed56d6eb661806b (diff)
unit test for fdo#55198
Change-Id: I15b745366d1f4c3180f44290e72e245f98bbd755
Diffstat (limited to 'sc')
-rw-r--r--sc/qa/unit/data/xlsx/formats.xlsxbin7928 -> 9169 bytes
-rw-r--r--sc/qa/unit/subsequent_filters-test.cxx20
2 files changed, 20 insertions, 0 deletions
diff --git a/sc/qa/unit/data/xlsx/formats.xlsx b/sc/qa/unit/data/xlsx/formats.xlsx
index ddc828af96ab..1c451be9a294 100644
--- a/sc/qa/unit/data/xlsx/formats.xlsx
+++ b/sc/qa/unit/data/xlsx/formats.xlsx
Binary files differ
diff --git a/sc/qa/unit/subsequent_filters-test.cxx b/sc/qa/unit/subsequent_filters-test.cxx
index 678d1ecfcb50..38bc44a02a90 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);