summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2012-06-07 15:25:06 +0100
committerFridrich Štrba <fridrich.strba@bluewin.ch>2012-06-11 12:12:52 +0200
commit21f43fb084c4c468c3f5722058325903a8e3daf9 (patch)
treecdfc4124d5812dc10e8e080d5a233a14edc0c3f3
parenteee0a07a8119bf097b680e4481302f3ab2e68eac (diff)
import vmlshape 'hidden' style attribute and apply to controls bnc#757609
ensure 'hidden' controls are imported as such. Change-Id: Ie79e61f06d65c86db9d1a734e85b27ee368bebe8 Signed-off-by: Fridrich Štrba <fridrich.strba@bluewin.ch>
-rw-r--r--oox/inc/oox/vml/vmlshape.hxx1
-rw-r--r--oox/source/vml/vmlshape.cxx11
-rw-r--r--oox/source/vml/vmlshapecontext.cxx2
3 files changed, 12 insertions, 2 deletions
diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index 1926a088726c..3817629bc5bb 100644
--- a/oox/inc/oox/vml/vmlshape.hxx
+++ b/oox/inc/oox/vml/vmlshape.hxx
@@ -79,6 +79,7 @@ struct ShapeTypeModel
::rtl::OUString maMarginLeft; /// X position of the shape bounding box to shape anchor (number with unit).
::rtl::OUString maMarginTop; /// Y position of the shape bounding box to shape anchor (number with unit).
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 4f1b40fe746e..0985dafe8512 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>
@@ -171,7 +172,8 @@ void lclSetXShapeRect( const Reference< XShape >& rxShape, const Rectangle& rSha
// ============================================================================
ShapeTypeModel::ShapeTypeModel():
- mbAutoHeight( sal_False )
+ mbAutoHeight( sal_False ),
+ mbVisible( sal_True )
{
}
@@ -361,7 +363,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_QUERY );
+ if ( xControlShape.is() && !getTypeModel().mbVisible )
+ {
+ PropertySet aControlShapeProp( xControlShape->getControl() );
+ aControlShapeProp.setProperty( PROP_EnableVisible, 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 cb64424b933f..a8dd809ed40f 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -347,6 +347,8 @@ void ShapeTypeContext::setStyle( const OUString& rStyle )
else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "margin-left" ) ) ) mrTypeModel.maMarginLeft = aValue;
else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "margin-top" ) ) ) mrTypeModel.maMarginTop = aValue;
else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "mso-fit-shape-to-text" ) ) ) mrTypeModel.mbAutoHeight = sal_True;
+ else if( aName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "visibility" ) ) )
+ mrTypeModel.mbVisible = !aValue.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("hidden") );
}
}
}