diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-11-30 17:39:51 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-11-30 22:15:38 +0100 |
commit | 316656755caabf4797391c46338c58945908837d (patch) | |
tree | 722d376aaf838cacd372e1f4a0f993274508df70 /sw | |
parent | ebb4150463ef97571d8f4ffc0b8189ff94d5cf1a (diff) |
API CHANGE: Added XStyle::isHidden() and XStyle::setHidden()
Change-Id: I44770c05d51104b45d94145db8263187205daa84
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/unostyle.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 35 |
2 files changed, 37 insertions, 0 deletions
diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx index 76bbd5009776..95835b8ac22f 100644 --- a/sw/inc/unostyle.hxx +++ b/sw/inc/unostyle.hxx @@ -213,6 +213,8 @@ public: virtual sal_Bool SAL_CALL isInUse(void) throw( ::com::sun::star::uno::RuntimeException ); virtual rtl::OUString SAL_CALL getParentStyle(void) throw( ::com::sun::star::uno::RuntimeException ); 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 ); //XPropertySet virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index 5e6f87fa81cf..f0ab26e715f3 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1505,6 +1505,41 @@ void SwXStyle::setParentStyle(const OUString& rParentStyle) throw uno::RuntimeException(); } +sal_Bool SAL_CALL SwXStyle::isHidden( ) throw( uno::RuntimeException ) +{ + sal_Bool bHidden = sal_False; + SolarMutexGuard aGuard; + if( pBasePool ) + { + pBasePool->SetSearchMask( eFamily ); + SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName); + if(pBase) + { + rtl::Reference< SwDocStyleSheet > xBase( new SwDocStyleSheet(*(SwDocStyleSheet*)pBase) ); + bHidden = xBase->IsHidden(); + } + } + return bHidden; +} + +void SAL_CALL SwXStyle::setHidden( sal_Bool bHidden ) + throw( uno::RuntimeException ) +{ + SolarMutexGuard aGuard; + if( pBasePool ) + { + pBasePool->SetSearchMask( eFamily ); + SfxStyleSheetBase* pBase = pBasePool->Find(sStyleName); + if(pBase) + { + rtl::Reference< SwDocStyleSheet > xBase( new SwDocStyleSheet(*(SwDocStyleSheet*)pBase) ); + //make it a 'real' style - necessary for pooled styles + xBase->GetItemSet(); + xBase->SetHidden( bHidden ); + } + } +} + static uno::Reference< beans::XPropertySetInfo > lcl_getPropertySetInfo( SfxStyleFamily eFamily, sal_Bool bIsConditional ) { uno::Reference< beans::XPropertySetInfo > xRet; |