Commits

Anonymous committed 5969903

impressbi01: #161701# oox import of hidden shapes

Comments (0)

Files changed (3)

oox/inc/oox/drawingml/shape.hxx

     void                            setName( const rtl::OUString& rName ) { msName = rName; }
     ::rtl::OUString                 getName( ) { return msName; }
     void                            setId( const rtl::OUString& rId ) { msId = rId; }
+	void							setHidden( sal_Bool bHidden ) { mbHidden = bHidden; }
     void                            setSubType( sal_uInt32 nSubType ) { mnSubType = nSubType; }
     sal_Int32                       getSubType() const { return mnSubType; }
     void                            setIndex( sal_uInt32 nIndex ) { mnIndex = nIndex; }
     sal_Int32                       mnRotation;
     sal_Bool                        mbFlipH;
     sal_Bool                        mbFlipV;
+	sal_Bool						mbHidden;
 };
 
 ::rtl::OUString GetShapeType( sal_Int32 nType );

oox/source/drawingml/shape.cxx

 , mnRotation( 0 )
 , mbFlipH( false )
 , mbFlipV( false )
+, mbHidden( false )
 {
     if ( pServiceName )
         msServiceName = OUString::createFromAscii( pServiceName );
     mnRotation = rReferencedShape.mnRotation;
     mbFlipH = rReferencedShape.mbFlipH;
     mbFlipV = rReferencedShape.mbFlipV;
+	mbHidden = rReferencedShape.mbHidden;
 }
 
 // for group shapes, the following method is also adding each child
         }
 	    rxShapes->add( mxShape );
 
+		if ( mbHidden )
+		{
+			const OUString sHidden( CREATE_OUSTRING( "NumberingLevel" ) );
+			xSet->setPropertyValue( sHidden, Any( mbHidden ) );
+		}
+
 		// sj: removing default text of placeholder objects such as SlideNumberShape or HeaderShape
 		if ( bClearText )
 		{

oox/source/drawingml/shapecontext.cxx

 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/container/XNamed.hpp>
 
+#include "oox/helper/attributelist.hxx"
 #include "oox/drawingml/shapecontext.hxx"
 #include "oox/drawingml/shapestylecontext.hxx"
 #include "oox/core/namespaces.hxx"
 //	case XML_drElemPr:
 //		break;
 	case XML_cNvPr:
+	{
+		AttributeList aAttribs( xAttribs );
+		mpShapePtr->setHidden( aAttribs.getBool( XML_hidden, false ) );
 		mpShapePtr->setId( xAttribs->getOptionalValue( XML_id ) );
 		mpShapePtr->setName( xAttribs->getOptionalValue( XML_name ) );
 		break;
+	}
 	case XML_ph:
 		mpShapePtr->setSubType( xAttribs->getOptionalValueToken( XML_type, XML_obj ) );
 		mpShapePtr->setIndex( xAttribs->getOptionalValue( XML_idx ).toInt32() );