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/inc/scitems.hxx | 4 +++- sc/inc/styleuno.hxx | 2 -- sc/inc/unonames.hxx | 1 + sc/source/core/data/docpool.cxx | 1 + sc/source/ui/unoobj/styleuno.cxx | 35 ++++++++++++++++++----------------- 5 files changed, 23 insertions(+), 20 deletions(-) (limited to 'sc') diff --git a/sc/inc/scitems.hxx b/sc/inc/scitems.hxx index e644854373f0..ea03478da05c 100644 --- a/sc/inc/scitems.hxx +++ b/sc/inc/scitems.hxx @@ -164,7 +164,9 @@ #define ATTR_PAGE_SCALETO 190 // #i8868# scale printout to width/height -#define ATTR_ENDINDEX ATTR_PAGE_SCALETO // end of pool-range +#define ATTR_HIDDEN 191 + +#define ATTR_ENDINDEX ATTR_HIDDEN // end of pool-range //-------------------------------- // Dummy Slot-IDs for dialogs diff --git a/sc/inc/styleuno.hxx b/sc/inc/styleuno.hxx index 00b90f189c6e..166405299bd4 100644 --- a/sc/inc/styleuno.hxx +++ b/sc/inc/styleuno.hxx @@ -256,8 +256,6 @@ public: virtual void SAL_CALL setParentStyle( const ::rtl::OUString& aParentStyle ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException); - virtual sal_Bool SAL_CALL isHidden() throw(::com::sun::star::uno::RuntimeException); - virtual void SAL_CALL setHidden( sal_Bool bHidden ) throw(::com::sun::star::uno::RuntimeException); // XNamed virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException); diff --git a/sc/inc/unonames.hxx b/sc/inc/unonames.hxx index 167c10cfac35..5d95c21ae2ad 100644 --- a/sc/inc/unonames.hxx +++ b/sc/inc/unonames.hxx @@ -125,6 +125,7 @@ #define SC_UNONAME_ROTREF "RotateReference" #define SC_UNONAME_ASIANVERT "AsianVerticalMode" #define SC_UNONAME_WRITING "WritingMode" +#define SC_UNONAME_HIDDEN "Hidden" #define SC_UNONAME_BOTTBORDER "BottomBorder" #define SC_UNONAME_LEFTBORDER "LeftBorder" diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx index 3fe7aecd3581..c1cacfb25fe1 100644 --- a/sc/source/core/data/docpool.cxx +++ b/sc/source/core/data/docpool.cxx @@ -333,6 +333,7 @@ ScDocumentPool::ScDocumentPool( SfxItemPool* pSecPool, sal_Bool bLoadRefCounts ) ppPoolDefaults[ ATTR_PAGE_FORMULAS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_FORMULAS, false ); ppPoolDefaults[ ATTR_PAGE_NULLVALS - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_PAGE_NULLVALS, sal_True ); ppPoolDefaults[ ATTR_PAGE_SCALETO - ATTR_STARTINDEX ] = new ScPageScaleToItem( 1, 1 ); + ppPoolDefaults[ ATTR_HIDDEN - ATTR_STARTINDEX ] = new SfxBoolItem( ATTR_HIDDEN, sal_False ); SetDefaults( ppPoolDefaults ); 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