diff options
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; |