Kaydet (Commit) d9ef61fb authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

API CHANGE: roll back the XStyle changes to add a new Hidden property on Style

Change-Id: If6d23925567fb184cd8fc4e00fc72fe4d216e756
üst b49ea0c9
dictionaries @ 84861864
Subproject commit 1595bf11e295d96123fcb327ba9919307aa5b127
Subproject commit 84861864e2555282a23235225dd15dc1c6d30249
helpcontent2 @ cd65acbc
Subproject commit 9a488450c8fec4ec520541d50683b07b9bd86b22
Subproject commit cd65acbcb541da83c39c3f1eeb6672a7bcc123d6
......@@ -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;
};
......
......@@ -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 );
};
......
No preview for this file type
......@@ -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);
......
......@@ -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
......
......@@ -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);
......
......@@ -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"
......
......@@ -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 );
......
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
......@@ -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);
......
......@@ -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
......
......@@ -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
};
......
......@@ -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);
......
......@@ -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;
......
......@@ -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
};
......
......@@ -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())
......
......@@ -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,
......
......@@ -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( ) ) );
}
}
}
......
......@@ -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());
......
......@@ -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;
}
......
......@@ -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 );
......
......@@ -292,6 +292,11 @@ void XMLTextMasterPageContext::Finish( sal_Bool bOverwrite )
xPropSet->setPropertyValue( sFollowStyle, aAny );
}
}
if ( xPropSetInfo->hasPropertyByName( "Hidden" ) )
{
xPropSet->setPropertyValue( "Hidden", uno::makeAny( IsHidden( ) ) );
}
}
}
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment