diff options
author | Noel Power <noel.power@novell.com> | 2012-06-06 16:45:54 +0100 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2012-06-06 18:01:21 +0100 |
commit | 80a31e00c5276602f27aa410b2fe6dece1f3fcce (patch) | |
tree | e6c017612177d66cb8604303961d6aad90afc3e8 /oox/source | |
parent | dfc4832049c140b7442c085062599aef1953e8fd (diff) |
import vmlshape 'hidden' style attribute and apply to controls bnc#757609
ensure 'hidden' controls are imported as such.
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 11 | ||||
-rw-r--r-- | oox/source/vml/vmlshapecontext.cxx | 2 |
2 files changed, 11 insertions, 2 deletions
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx index 4e5e4ac1a74e..aa39fcc97491 100644 --- a/oox/source/vml/vmlshape.cxx +++ b/oox/source/vml/vmlshape.cxx @@ -34,6 +34,7 @@ #include <com/sun/star/drawing/PointSequenceSequence.hpp> #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp> #include <com/sun/star/drawing/XShapes.hpp> +#include <com/sun/star/drawing/XControlShape.hpp> #include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/RelOrientation.hpp> @@ -115,7 +116,8 @@ Rectangle lclGetAbsRect( const Rectangle& rRelRect, const Rectangle& rShapeRect, // ============================================================================ ShapeTypeModel::ShapeTypeModel(): - mbAutoHeight( sal_False ) + mbAutoHeight( sal_False ), + mbVisible( sal_True ) { } @@ -305,7 +307,12 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS PropertySet aShapeProp( xShape ); if( aShapeProp.hasProperty( PROP_Name ) ) aShapeProp.setProperty( PROP_Name, getShapeName() ); - + Reference< XControlShape > xControlShape( xShape, uno::UNO_QUERY ); + if ( xControlShape.is() && !getTypeModel().mbVisible ) + { + PropertySet aControlShapeProp( xControlShape->getControl() ); + aControlShapeProp.setProperty( PROP_EnableVisible, uno::makeAny( sal_False ) ); + } /* Notify the drawing that a new shape has been inserted. For convenience, pass the rectangle that contains position and size of the shape. */ diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index 3134282c06d4..68793c947aef 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -361,6 +361,8 @@ void ShapeTypeContext::setStyle( const OUString& rStyle ) else if( aName == "mso-fit-shape-to-text" ) mrTypeModel.mbAutoHeight = sal_True; else if( aName == "rotation" ) mrTypeModel.maRotation = aValue; else if( aName == "flip" ) mrTypeModel.maFlip = aValue; + else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "visibility" ) ) ) + mrTypeModel.mbVisible = !aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("hidden") ); } } } |