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 | |
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')
-rw-r--r-- | oox/inc/oox/vml/vmlshape.hxx | 1 | ||||
-rw-r--r-- | oox/source/vml/vmlshape.cxx | 11 | ||||
-rw-r--r-- | oox/source/vml/vmlshapecontext.cxx | 2 |
3 files changed, 12 insertions, 2 deletions
diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx index b60e2515eddb..d8e72094c19c 100644 --- a/oox/inc/oox/vml/vmlshape.hxx +++ b/oox/inc/oox/vml/vmlshape.hxx @@ -84,6 +84,7 @@ struct ShapeTypeModel ::rtl::OUString maRotation; ///< Rotation of the shape, in degrees. ::rtl::OUString maFlip; ///< Flip type of the shape (can be "x" or "y"). sal_Bool mbAutoHeight; ///< If true, the height value is a minimum value (mostly used for textboxes) + sal_Bool mbVisible; /// Visible or Hidden StrokeModel maStrokeModel; ///< Border line formatting. FillModel maFillModel; ///< Shape fill formatting. 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") ); } } } |