diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-12-03 17:48:40 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-12-03 17:58:48 +0100 |
commit | d9ef61fb546af443736057557552e3a95c569c11 (patch) | |
tree | 40e42d1f7d3574150699cf9b3b254fbe58703e42 /xmloff/source | |
parent | b49ea0c9d24aa48d62590cb3443c3ad4143d2e2f (diff) |
API CHANGE: roll back the XStyle changes to add a new Hidden property on Style
Change-Id: If6d23925567fb184cd8fc4e00fc72fe4d216e756
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/style/XMLPageExport.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/style/prstylei.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/style/styleexp.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/style/xmlnume.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumi.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextMasterPageContext.cxx | 5 | ||||
-rw-r--r-- | xmloff/source/text/txtstyli.cxx | 2 |
7 files changed, 38 insertions, 9 deletions
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(); |