[Libreoffice-commits] .: oox/inc oox/source

Noel Power noelp at kemper.freedesktop.org
Wed Jun 6 10:01:25 PDT 2012


 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(-)

New commits:
commit 80a31e00c5276602f27aa410b2fe6dece1f3fcce
Author: Noel Power <noel.power at novell.com>
Date:   Wed Jun 6 16:45:54 2012 +0100

    import vmlshape 'hidden' style attribute and apply to controls bnc#757609
    
    ensure 'hidden' controls are imported as such.

diff --git a/oox/inc/oox/vml/vmlshape.hxx b/oox/inc/oox/vml/vmlshape.hxx
index b60e251..d8e7209 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 4e5e4ac..aa39fcc 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 3134282..68793c9 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") );
         }
     }
 }


More information about the Libreoffice-commits mailing list