From d9ef61fb546af443736057557552e3a95c569c11 Mon Sep 17 00:00:00 2001 From: Cédric Bosdonnat Date: Mon, 3 Dec 2012 17:48:40 +0100 Subject: API CHANGE: roll back the XStyle changes to add a new Hidden property on Style Change-Id: If6d23925567fb184cd8fc4e00fc72fe4d216e756 --- sc/source/ui/unoobj/styleuno.cxx | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) (limited to 'sc/source/ui/unoobj') diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 42bc2de6e187..77bc8cebcee9 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -167,6 +167,7 @@ static const SfxItemPropertySet* lcl_GetCellStyleSet() {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS), ATTR_VER_JUSTIFY, &::getCppuType((const sal_Int32*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_CELLVJUS_METHOD), ATTR_VER_JUSTIFY_METHOD, &::getCppuType((const sal_Int32*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNONAME_HIDDEN), ATTR_HIDDEN, &getCppuType((sal_Bool*)0), 0, 0 }, {0,0,0,0,0,0} }; static SfxItemPropertySet aCellStyleSet_Impl( aCellStyleMap_Impl ); @@ -287,6 +288,7 @@ static const SfxItemPropertySet * lcl_GetPageStyleSet() {MAP_CHAR_LEN(SC_UNONAME_USERDEF), ATTR_USERDEF, &getCppuType((uno::Reference*)0), 0, 0 }, {MAP_CHAR_LEN(SC_UNO_PAGE_WIDTH), ATTR_PAGE_SIZE, &::getCppuType((const sal_Int32*)0), 0, MID_SIZE_WIDTH | CONVERT_TWIPS }, {MAP_CHAR_LEN(SC_UNONAME_WRITING), ATTR_WRITINGDIR, &getCppuType((sal_Int16*)0), 0, 0 }, + {MAP_CHAR_LEN(SC_UNONAME_HIDDEN), ATTR_HIDDEN, &getCppuType((sal_Bool*)0), 0, 0 }, {0,0,0,0,0,0} }; static SfxItemPropertySet aPageStyleSet_Impl( aPageStyleMap_Impl ); @@ -1246,23 +1248,6 @@ void SAL_CALL ScStyleObj::setParentStyle( const rtl::OUString& rParentStyle ) } } -sal_Bool SAL_CALL ScStyleObj::isHidden( ) throw (uno::RuntimeException) -{ - SolarMutexGuard aGuard; - SfxStyleSheetBase* pStyle = GetStyle_Impl(); - if (pStyle) - return pStyle->IsHidden(); - return false; -} - -void SAL_CALL ScStyleObj::setHidden( sal_Bool bHidden ) throw (uno::RuntimeException) -{ - SolarMutexGuard aGuard; - SfxStyleSheetBase* pStyle = GetStyle_Impl(); - if (pStyle) - pStyle->SetHidden( bHidden ); -} - // container::XNamed rtl::OUString SAL_CALL ScStyleObj::getName() throw(uno::RuntimeException) @@ -1897,6 +1882,13 @@ void ScStyleObj::SetOnePropertyValue( const ::rtl::OUString& rPropertyName, cons } } break; + case ATTR_HIDDEN: + { + sal_Bool bHidden = sal_False; + if ( *pValue >>= bHidden ) + pStyle->SetHidden( bHidden ); + } + break; default: // Default-Items mit falscher Slot-ID // funktionieren im SfxItemPropertySet3 nicht @@ -2081,6 +2073,15 @@ uno::Any SAL_CALL ScStyleObj::getPropertyValue( const rtl::OUString& aPropertyNa aAny = uno::makeAny(static_cast(aItem.GetHeight())); } break; + case ATTR_HIDDEN: + { + sal_Bool bHidden = sal_False; + SfxStyleSheetBase* pStyle = GetStyle_Impl(); + if ( pStyle ) + bHidden = pStyle->IsHidden(); + aAny = uno::makeAny( bHidden ); + } + break; default: // Default-Items mit falscher Slot-ID // funktionieren im SfxItemPropertySet3 nicht -- cgit v1.2.3