diff options
27 files changed, 110 insertions, 99 deletions
diff --git a/dictionaries b/dictionaries -Subproject 1595bf11e295d96123fcb327ba9919307aa5b12 +Subproject 84861864e2555282a23235225dd15dc1c6d3024 diff --git a/helpcontent2 b/helpcontent2 -Subproject 9a488450c8fec4ec520541d50683b07b9bd86b2 +Subproject cd65acbcb541da83c39c3f1eeb6672a7bcc123d diff --git a/offapi/com/sun/star/style/Style.idl b/offapi/com/sun/star/style/Style.idl index 31e7dd71365a..52089e17750b 100644 --- a/offapi/com/sun/star/style/Style.idl +++ b/offapi/com/sun/star/style/Style.idl @@ -135,6 +135,10 @@ published service Style */ [optional, property] sequence< com::sun::star::beans::NamedValue > ParaStyleConditions; + /** Flag indicating whether to hide the style in the UI. + @since LibreOffice 4.0 + */ + [optional, property] boolean Hidden; }; diff --git a/offapi/com/sun/star/style/XStyle.idl b/offapi/com/sun/star/style/XStyle.idl index 4367c5c57303..8ceb036bbc80 100644 --- a/offapi/com/sun/star/style/XStyle.idl +++ b/offapi/com/sun/star/style/XStyle.idl @@ -54,15 +54,6 @@ 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 a6ff8e497437..d70c98f3cdc6 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 ea90e23e5e3a..1ae1719956e4 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -269,8 +269,6 @@ 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); 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<container::XNameContainer>*)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<sal_Int16>(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 diff --git a/sd/inc/stlsheet.hxx b/sd/inc/stlsheet.hxx index 11942bb87f20..191bcf97b471 100644 --- a/sd/inc/stlsheet.hxx +++ b/sd/inc/stlsheet.hxx @@ -92,8 +92,6 @@ 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 570516412e43..ecd84d74b302 100644 --- a/sd/source/core/stlsheet.cxx +++ b/sd/source/core/stlsheet.cxx @@ -66,6 +66,7 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; using namespace ::com::sun::star::drawing; +#define WID_STYLE_HIDDEN 7997 #define WID_STYLE_DISPNAME 7998 #define WID_STYLE_FAMILY 7999 @@ -76,6 +77,7 @@ static SvxItemPropertySet& GetStylePropertySet() { RTL_CONSTASCII_STRINGPARAM("Family"), WID_STYLE_FAMILY, &::getCppuType((const OUString*)0), PropertyAttribute::READONLY, 0}, { RTL_CONSTASCII_STRINGPARAM("UserDefinedAttributes"), SDRATTR_XMLATTRIBUTES, &XNameContainer::static_type(), 0, 0}, { RTL_CONSTASCII_STRINGPARAM("DisplayName"), WID_STYLE_DISPNAME, &::getCppuType((const OUString*)0), PropertyAttribute::READONLY, 0}, + { RTL_CONSTASCII_STRINGPARAM("Hidden"), WID_STYLE_HIDDEN, &::getCppuType((bool*)0), 0, 0}, SVX_UNOEDIT_NUMBERING_PROPERTIE, SHADOW_PROPERTIES @@ -1024,22 +1026,6 @@ 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 rbHidden ) throw(RuntimeException) -{ - SolarMutexGuard aGuard; - throwIfDisposed(); - - return SetHidden( rbHidden ); -} - // -------------------------------------------------------------------- // XPropertySet // -------------------------------------------------------------------- @@ -1067,6 +1053,13 @@ void SAL_CALL SdStyleSheet::setPropertyValue( const OUString& aPropertyName, con } else { + if( pEntry->nWID == WID_STYLE_HIDDEN ) + { + sal_Bool bValue = sal_False; + if ( aValue >>= bValue ) + SetHidden( bValue ); + return; + } if( pEntry->nWID == SDRATTR_TEXTDIRECTION ) return; // not yet implemented for styles @@ -1188,6 +1181,10 @@ Any SAL_CALL SdStyleSheet::getPropertyValue( const OUString& PropertyName ) thro aAny <<= BitmapMode_NO_REPEAT; } } + else if( pEntry->nWID == WID_STYLE_HIDDEN ) + { + aAny <<= IsHidden( ); + } else { SfxItemSet aSet( GetPool().GetPool(), pEntry->nWID, pEntry->nWID); diff --git a/svx/source/table/tabledesign.cxx b/svx/source/table/tabledesign.cxx index 171b5e536b40..f719d363b25e 100644 --- a/svx/source/table/tabledesign.cxx +++ b/svx/source/table/tabledesign.cxx @@ -84,8 +84,6 @@ 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/cmdid.h b/sw/inc/cmdid.h index 524adcdc4ddd..e5052cfffa5c 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -659,6 +659,7 @@ included in c-context files, so c++ style stuff will cause problems. #define FN_UNO_TABLE_BORDER2 (FN_EXTRA2 + 120) #define FN_UNO_REPLACEMENT_GRAPHIC_U_R_L (FN_EXTRA2 + 121) +#define FN_UNO_HIDDEN (FN_EXTRA2 + 122) /*------------------------------------------------ -------------------- Area: Help diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 28c7ba4eeae5..b681c11ae3d6 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -815,8 +815,9 @@ enum SwPropNameIds /* 0754 */ UNO_NAME_TABLE_BORDER2, /* 0755 */ UNO_NAME_REPLACEMENT_GRAPHIC_URL, +/* 0756 */ UNO_NAME_HIDDEN, -/* 0756 */ SW_PROPNAME_END +/* 0757 */ SW_PROPNAME_END // new items in this array must match SwPropNameTab aPropNameTab }; diff --git a/sw/inc/unostyle.hxx b/sw/inc/unostyle.hxx index 95835b8ac22f..76bbd5009776 100644 --- a/sw/inc/unostyle.hxx +++ b/sw/inc/unostyle.hxx @@ -213,8 +213,6 @@ 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/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 8849dfd379ef..9c6fe6e28c9c 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -461,7 +461,8 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() { SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 },\ { SW_PROP_NMID(UNO_NAME_PARA_IS_CONNECT_BORDER), RES_PARATR_CONNECT_BORDER, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0},\ { SW_PROP_NMID(UNO_NAME_SNAP_TO_GRID), RES_PARATR_SNAPTOGRID, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::MAYBEVOID, 0 }, \ - { SW_PROP_NMID(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL,CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0}, + { SW_PROP_NMID(UNO_NAME_OUTLINE_LEVEL), RES_PARATR_OUTLINELEVEL,CPPU_E2T(CPPUTYPE_INT16), PropertyAttribute::MAYBEVOID, 0}, \ + { SW_PROP_NMID(UNO_NAME_HIDDEN), FN_UNO_HIDDEN, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, #define COMMON_FLDTYP_PROPERTIES \ @@ -558,6 +559,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { SW_PROP_NMID(UNO_NAME_CHAR_WORD_MODE), RES_CHRATR_WORDLINEMODE,CPPU_E2T(CPPUTYPE_BOOLEAN) , PROPERTY_NONE, 0}, { SW_PROP_NMID(UNO_NAME_USER_DEFINED_ATTRIBUTES), RES_UNKNOWNATR_CONTAINER, CPPU_E2T(CPPUTYPE_REFNAMECNT), PropertyAttribute::MAYBEVOID, 0 }, { SW_PROP_NMID(UNO_NAME_IS_PHYSICAL), FN_UNO_IS_PHYSICAL, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0}, + { SW_PROP_NMID(UNO_NAME_HIDDEN), FN_UNO_HIDDEN, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, { SW_PROP_NMID(UNO_NAME_DISPLAY_NAME), FN_UNO_DISPLAY_NAME, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0}, { SW_PROP_NMID(UNO_NAME_CHAR_COMBINE_IS_ON), RES_CHRATR_TWO_LINES, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_TWOLINES}, { SW_PROP_NMID(UNO_NAME_CHAR_COMBINE_PREFIX), RES_CHRATR_TWO_LINES, CPPU_E2T(CPPUTYPE_OUSTRING), PROPERTY_NONE, MID_START_BRACKET}, @@ -729,6 +731,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s // #i28701# { SW_PROP_NMID(UNO_NAME_WRAP_INFLUENCE_ON_POSITION), RES_WRAP_INFLUENCE_ON_OBJPOS, CPPU_E2T(CPPUTYPE_INT8), PROPERTY_NONE, MID_WRAP_INFLUENCE}, { SW_PROP_NMID(UNO_NAME_WRITING_MODE), RES_FRAMEDIR, CPPU_E2T(CPPUTYPE_INT16), PROPERTY_NONE, 0 }, + { SW_PROP_NMID(UNO_NAME_HIDDEN), FN_UNO_HIDDEN, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; aMapEntriesArr[nPropertyId] = aFrameStyleMap; @@ -855,6 +858,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { SW_PROP_NMID(UNO_NAME_GRID_BASE_WIDTH), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, MID_GRID_BASEWIDTH|CONVERT_TWIPS}, { SW_PROP_NMID(UNO_NAME_GRID_SNAP_TO_CHARS), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_GRID_SNAPTOCHARS}, { SW_PROP_NMID(UNO_NAME_GRID_STANDARD_PAGE_MODE), RES_TEXTGRID, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, MID_GRID_STANDARD_MODE}, + { SW_PROP_NMID(UNO_NAME_HIDDEN), FN_UNO_HIDDEN, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; aMapEntriesArr[nPropertyId] = aPageStyleMap; @@ -867,6 +871,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { SW_PROP_NMID(UNO_NAME_NUMBERING_RULES), FN_UNO_NUM_RULES, CPPU_E2T(CPPUTYPE_REFIDXREPL), PROPERTY_NONE, CONVERT_TWIPS}, { SW_PROP_NMID(UNO_NAME_IS_PHYSICAL), FN_UNO_IS_PHYSICAL, CPPU_E2T(CPPUTYPE_BOOLEAN), PropertyAttribute::READONLY, 0}, { SW_PROP_NMID(UNO_NAME_DISPLAY_NAME), FN_UNO_DISPLAY_NAME, CPPU_E2T(CPPUTYPE_OUSTRING), PropertyAttribute::READONLY, 0}, + { SW_PROP_NMID(UNO_NAME_HIDDEN), FN_UNO_HIDDEN, CPPU_E2T(CPPUTYPE_BOOLEAN), PROPERTY_NONE, 0}, {0,0,0,0,0,0} }; aMapEntriesArr[nPropertyId] = aNumStyleMap; diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx index d2d653fe0e11..88eb7eb013c4 100644 --- a/sw/source/core/unocore/unoprnms.cxx +++ b/sw/source/core/unocore/unoprnms.cxx @@ -785,6 +785,7 @@ const SwPropNameTab aPropNameTab = { /* 0753 UNO_NAME_INITIALS */ {MAP_CHAR_LEN("Initials")}, /* 0754 UNO_NAME_INITIALS */ {MAP_CHAR_LEN("TableBorder2")}, /* 0755 UNO_NAME_REPLACEMENT_GRAPHIC_URL */ {MAP_CHAR_LEN("ReplacementGraphicURL")}, +/* 0756 UNO_NAME_HIDDEN */ {MAP_CHAR_LEN("Hidden")}, // new items in this array must match enum SwPropNameIds }; diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx index f0ab26e715f3..c8e7fa347031 100644 --- a/sw/source/core/unocore/unostyle.cxx +++ b/sw/source/core/unocore/unostyle.cxx @@ -1505,41 +1505,6 @@ 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; @@ -1715,6 +1680,18 @@ static void lcl_SetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, { switch(rEntry.nWID) { + case FN_UNO_HIDDEN: + { + sal_Bool bHidden = sal_False; + if ( rValue >>= bHidden ) + { + //make it a 'real' style - necessary for pooled styles + rBase.mxNewBase->GetItemSet(); + rBase.mxNewBase->SetHidden( bHidden ); + } + } + break; + case RES_PAPER_BIN: { SfxPrinter *pPrinter = pDoc->getPrinter( true ); @@ -2210,6 +2187,16 @@ static uno::Any lcl_GetStyleProperty(const SfxItemPropertySimpleEntry& rEntry, } aRet.setValue(&bPhys, ::getBooleanCppuType()); } + else if (FN_UNO_HIDDEN == rEntry.nWID) + { + sal_Bool bHidden = sal_False; + if(pBase) + { + rtl::Reference< SwDocStyleSheet > xBase( new SwDocStyleSheet(*(SwDocStyleSheet*)pBase) ); + bHidden = xBase->IsHidden(); + } + aRet.setValue(&bHidden, ::getBooleanCppuType()); + } else if(pBase) { if(!rBase.mxNewBase.is()) diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index 2710bee2acf6..89fa46a84c02 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -117,8 +117,13 @@ sal_Bool XMLPageExport::exportStyle( GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_NAME, GetExport().EncodeStyleName( sName, &bEncoded ) ); - if ( rStyle->isHidden( ) && GetExport( ).getDefaultVersion( ) == SvtSaveOptions::ODFVER_LATEST ) - GetExport( ).AddAttribute( XML_NAMESPACE_STYLE, XML_HIDDEN, "true" ); + if ( xPropSetInfo->hasPropertyByName( "Hidden" ) ) + { + uno::Any aValue = xPropSet->getPropertyValue( "Hidden" ); + sal_Bool bHidden = sal_False; + if ( ( aValue >>= bHidden ) && bHidden && GetExport( ).getDefaultVersion( ) == SvtSaveOptions::ODFVER_LATEST ) + GetExport( ).AddAttribute( XML_NAMESPACE_STYLE, XML_HIDDEN, "true" ); + } if( bEncoded ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_DISPLAY_NAME, diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index 9dac4827a4ab..e68261e02719 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -267,6 +267,7 @@ void XMLPropStyleContext::CreateAndInsert( sal_Bool bOverwrite ) if( rName != GetName() ) GetImport().AddStyleDisplayName( GetFamily(), GetName(), rName ); + if( bOverwrite || bNew ) { Reference< XPropertyState > xPropState( xPropSet, uno::UNO_QUERY ); @@ -341,8 +342,6 @@ void XMLPropStyleContext::Finish( sal_Bool bOverwrite ) if( !xFamilies.is() ) return; - mxStyle->setHidden( IsHidden( ) ); - // connect parent OUString sParent( GetParentName() ); if( !sParent.isEmpty() ) @@ -402,6 +401,12 @@ void XMLPropStyleContext::Finish( sal_Bool bOverwrite ) xPropSet->setPropertyValue( msFollowStyle, aAny ); } } + + if ( xPropSetInfo->hasPropertyByName( "Hidden" ) ) + { + xPropSet->setPropertyValue( "Hidden", uno::makeAny( IsHidden( ) ) ); + } + } } diff --git a/xmloff/source/style/styleexp.cxx b/xmloff/source/style/styleexp.cxx index 0a9669eb1fdf..1cb096c22eff 100644 --- a/xmloff/source/style/styleexp.cxx +++ b/xmloff/source/style/styleexp.cxx @@ -121,8 +121,13 @@ sal_Bool XMLStyleExport::exportStyle( if( !rXMLFamily.isEmpty() ) GetExport().AddAttribute( XML_NAMESPACE_STYLE, XML_FAMILY, rXMLFamily); - if ( rStyle->isHidden( ) && GetExport( ).getDefaultVersion( ) == SvtSaveOptions::ODFVER_LATEST ) - GetExport( ).AddAttribute( XML_NAMESPACE_STYLE, XML_HIDDEN, "true" ); + if ( xPropSetInfo->hasPropertyByName( "Hidden" ) ) + { + aAny = xPropSet->getPropertyValue( "Hidden" ); + sal_Bool bHidden = sal_False; + if ( ( aAny >>= bHidden ) && bHidden && GetExport( ).getDefaultVersion( ) == SvtSaveOptions::ODFVER_LATEST ) + GetExport( ).AddAttribute( XML_NAMESPACE_STYLE, XML_HIDDEN, "true" ); + } // style:parent-style-name="..." OUString sParentString(rStyle->getParentStyle()); diff --git a/xmloff/source/style/xmlnume.cxx b/xmloff/source/style/xmlnume.cxx index cd697eccdd5b..6c94cbd222b5 100644 --- a/xmloff/source/style/xmlnume.cxx +++ b/xmloff/source/style/xmlnume.cxx @@ -751,7 +751,14 @@ sal_Bool SvxXMLNumRuleExport::exportStyle( const Reference< XStyle >& rStyle ) OUString sName = rStyle->getName(); - exportNumberingRule( sName, rStyle->isHidden(), xNumRule ); + sal_Bool bHidden = sal_False; + if ( xPropSetInfo->hasPropertyByName( "Hidden" ) ) + { + aAny = xPropSet->getPropertyValue( "Hidden" ); + aAny >>= bHidden; + } + + exportNumberingRule( sName, bHidden, xNumRule ); return sal_True; } diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx index 9d0dec5ffc91..8e89cbadd1e1 100644 --- a/xmloff/source/style/xmlnumi.cxx +++ b/xmloff/source/style/xmlnumi.cxx @@ -1257,6 +1257,10 @@ void SvxXMLListStyleContext::CreateAndInsertLate( sal_Bool bOverwrite ) Any aAny = xPropSet->getPropertyValue( sIsPhysical ); bNew = !*(sal_Bool *)aAny.getValue(); } + + if ( xPropSetInfo->hasPropertyByName( "Hidden" ) ) + xPropSet->setPropertyValue( "Hidden", uno::makeAny( IsHidden( ) ) ); + if( rName != GetName() ) GetImport().AddStyleDisplayName( XML_STYLE_FAMILY_TEXT_LIST, GetName(), rName ); diff --git a/xmloff/source/text/XMLTextMasterPageContext.cxx b/xmloff/source/text/XMLTextMasterPageContext.cxx index e707895ce5a0..0b1c2ff798c6 100644 --- a/xmloff/source/text/XMLTextMasterPageContext.cxx +++ b/xmloff/source/text/XMLTextMasterPageContext.cxx @@ -292,6 +292,11 @@ void XMLTextMasterPageContext::Finish( sal_Bool bOverwrite ) xPropSet->setPropertyValue( sFollowStyle, aAny ); } } + + if ( xPropSetInfo->hasPropertyByName( "Hidden" ) ) + { + xPropSet->setPropertyValue( "Hidden", uno::makeAny( IsHidden( ) ) ); + } } } diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index 81ce15cc042f..349712523e87 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -280,8 +280,6 @@ void XMLTextStyleContext::Finish( sal_Bool bOverwrite ) !( bOverwrite || IsNew() ) ) return; - xStyle->setHidden( IsHidden( ) ); - Reference < XPropertySet > xPropSet( xStyle, UNO_QUERY ); Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo(); |