From 80a31e00c5276602f27aa410b2fe6dece1f3fcce Mon Sep 17 00:00:00 2001 From: Noel Power Date: Wed, 6 Jun 2012 16:45:54 +0100 Subject: import vmlshape 'hidden' style attribute and apply to controls bnc#757609 ensure 'hidden' controls are imported as such. --- oox/inc/oox/vml/vmlshape.hxx | 1 + oox/source/vml/vmlshape.cxx | 11 +++++++++-- oox/source/vml/vmlshapecontext.cxx | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'oox') 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 #include #include +#include #include #include #include @@ -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") ); } } } -- cgit