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 | |
parent | ebb4150463ef97571d8f4ffc0b8189ff94d5cf1a (diff) |
API CHANGE: Added XStyle::isHidden() and XStyle::setHidden()
Change-Id: I44770c05d51104b45d94145db8263187205daa84
-rw-r--r-- | offapi/com/sun/star/style/XStyle.idl | 8 | ||||
-rw-r--r-- | offapi/type_reference/types.rdb | bin | 7453696 -> 7453696 bytes | |||
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 3 | ||||
-rw-r--r-- | sc/inc/styleuno.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/styleuno.cxx | 17 | ||||
-rw-r--r-- | sd/inc/stlsheet.hxx | 2 | ||||
-rw-r--r-- | sd/source/core/stlsheet.cxx | 16 | ||||
-rw-r--r-- | svx/source/table/tabledesign.cxx | 2 | ||||
-rw-r--r-- | sw/inc/unostyle.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unostyle.cxx | 35 |
10 files changed, 87 insertions, 0 deletions
diff --git a/offapi/com/sun/star/style/XStyle.idl b/offapi/com/sun/star/style/XStyle.idl index 29932e4f7564..4367c5c57303 100644 --- a/offapi/com/sun/star/style/XStyle.idl +++ b/offapi/com/sun/star/style/XStyle.idl @@ -55,6 +55,14 @@ published interface XStyle: com::sun::star::container::XNamed void setParentStyle( [in] string aParentStyle ) raises( com::sun::star::container::NoSuchElementException ); + + /** tells whether the style is hidden in the UI. + */ + boolean isHidden(); + + /** sets whether a style should be hidden in the UI. + */ + void setHidden( [in] boolean hidden ); }; diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb Binary files differindex ab70f6772650..68c5ee86dfc0 100644 --- a/offapi/type_reference/types.rdb +++ b/offapi/type_reference/types.rdb diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 2588fbc026a5..ea90e23e5e3a 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -269,6 +269,9 @@ public: ::sal_Bool SAL_CALL isInUse( ) throw (uno::RuntimeException); ::rtl::OUString SAL_CALL getParentStyle( ) throw (uno::RuntimeException); void SAL_CALL setParentStyle( const ::rtl::OUString& aParentStyle ) throw (container::NoSuchElementException, uno::RuntimeException); + ::sal_Bool SAL_CALL isHidden( ) throw (uno::RuntimeException) { return false; } + void SAL_CALL setHidden( ::sal_Bool ) throw (uno::RuntimeException) { }; + // XNamed ::rtl::OUString SAL_CALL getName( ) throw (uno::RuntimeException); void SAL_CALL setName( const ::rtl::OUString& aName ) throw (uno::RuntimeException); diff --git a/sc/inc/styleuno.hxx b/sc/inc/styleuno.hxx index 166405299bd4..00b90f189c6e 100644 --- a/sc/inc/styleuno.hxx +++ b/sc/inc/styleuno.hxx @@ -256,6 +256,8 @@ 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/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 360cb68b0c93..42bc2de6e187 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -1246,6 +1246,23 @@ 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) diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx index 191bcf97b471..11942bb87f20 100644 --- a/sd/inc/stlsheet.hxx +++ b/sd/inc/stlsheet.hxx @@ -92,6 +92,8 @@ public: virtual sal_Bool SAL_CALL isInUse( ) throw(::com::sun::star::uno::RuntimeException); virtual ::rtl::OUString SAL_CALL getParentStyle( ) 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/sd/source/core/stlsheet.cxx b/sd/source/core/stlsheet.cxx index ef25721d52aa..13d1a5e2738d 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -1024,6 +1024,22 @@ void SAL_CALL SdStyleSheet::setParentStyle( const OUString& rParentName ) throw } } +sal_Bool SAL_CALL SdStyleSheet::isHidden() throw(RuntimeException) +{ + SolarMutexGuard aGuard; + throwIfDisposed(); + + return IsHidden(); +} + +void SAL_CALL SdStyleSheet::setHidden( sal_Bool bHidden ) throw(RuntimeException) +{ + SolarMutexGuard aGuard; + throwIfDisposed(); + + return SetHidden( bHidden ); +} + // -------------------------------------------------------------------- // XPropertySet // -------------------------------------------------------------------- diff --git a/svx/source/table/tabledesign.cxx b/svx/source/table/tabledesign.cxx index f719d363b25e..171b5e536b40 100644 --- a/svx/source/table/tabledesign.cxx +++ b/svx/source/table/tabledesign.cxx @@ -84,6 +84,8 @@ public: virtual ::sal_Bool SAL_CALL isInUse() throw (RuntimeException); virtual OUString SAL_CALL getParentStyle() throw (RuntimeException); virtual void SAL_CALL setParentStyle( const OUString& aParentStyle ) throw (NoSuchElementException, RuntimeException); + virtual ::sal_Bool SAL_CALL isHidden() throw (RuntimeException) { return false; }; + virtual void SAL_CALL setHidden( ::sal_Bool ) throw (RuntimeException) { }; // XNamed virtual OUString SAL_CALL getName() throw (RuntimeException); 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; |