From 3f79d49058c41a92a2dfe0a284c4adbd1c1f96c3 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Mon, 24 Sep 2012 20:18:01 +0100 Subject: unit test for fdo#55198 Change-Id: I15b745366d1f4c3180f44290e72e245f98bbd755 --- sc/qa/unit/data/xlsx/formats.xlsx | Bin 7928 -> 9169 bytes sc/qa/unit/subsequent_filters-test.cxx | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'sc/qa') diff --git a/sc/qa/unit/data/xlsx/formats.xlsx b/sc/qa/unit/data/xlsx/formats.xlsx index ddc828af96ab..1c451be9a294 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 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 #include @@ -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(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); -- cgit