Commits

ka  committed a170762 Merge

impressbi01: merged heads

  • Participants
  • Parent commits 6920ddd, 5969903

Comments (0)

Files changed (8)

File filter/inc/filter/msfilter/escherex.hxx

 
 		void		Commit( SvStream& rSt, sal_uInt16 nVersion = 3, sal_uInt16 nRecType = ESCHER_OPT );
 
+		sal_Bool	CreateShapeProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape );
         sal_Bool    CreateOLEGraphicProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXOleObject );
 
         /** Creates a complex ESCHER_Prop_fillBlip containing the BLIP directly (for Excel charts). */

File filter/source/msfilter/escherex.cxx

 	}
 }
 
+sal_Bool EscherPropertyContainer::CreateShapeProperties( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape )
+{
+	uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY );
+	if ( aXPropSet.is() )
+	{
+		sal_Bool bVal;
+		::com::sun::star::uno::Any aAny;
+		sal_uInt32 nShapeAttr = 0;
+		EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ), sal_True );
+		if ( aAny >>= bVal )
+		{
+			if ( !bVal )
+				nShapeAttr |= 0x20002;	// set fHidden = true
+		}
+		EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Printable" ) ), sal_True );
+		if ( aAny >>= bVal )
+		{
+			if ( !bVal )
+				nShapeAttr |= 0x10000;	// set fPrint = false;
+		}
+		if ( nShapeAttr )
+		    AddOpt( ESCHER_Prop_fPrint, nShapeAttr );
+	}
+	return sal_True;
+}
+
 sal_Bool EscherPropertyContainer::CreateOLEGraphicProperties(
 	const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > & rXShape )
 {

File filter/source/msfilter/eschesdo.cxx

 		if( rObj.GetAngle() )
 			ImplFlipBoundingBox( rObj, aPropOpt );
 
+		aPropOpt.CreateShapeProperties( rObj.GetShapeRef() );
 		mpEscherEx->Commit( aPropOpt, rObj.GetRect() );
 		if( mpEscherEx->GetGroupLevel() > 1 )
             mpEscherEx->AddChildAnchor( rObj.GetRect() );
 											rObj.GetRect() );
 		}
 		rObj.SetAngle( nAngle );
+		aPropOpt.CreateShapeProperties( rObj.GetShapeRef() );
 		mpEscherEx->Commit( aPropOpt, rObj.GetRect() );
 
 		// write the childanchor

File filter/source/msfilter/msdffimp.cxx

 	pRet =
 		ProcessObj( rSt, aObjData, pClientData, aTextRect, pRet);
 
+	if ( pRet )
+	{
+		sal_Int32 nGroupProperties( GetPropertyValue( DFF_Prop_fPrint ) );
+		pRet->SetVisible( ( nGroupProperties & 2 ) == 0 );
+		pRet->SetPrintable( ( nGroupProperties & 1 ) != 0 );
+	}
+
 	if ( mbTracing )
 		mpTracer->RemoveAttribute( aObjData.nSpFlags & SP_FGROUP
 									? rtl::OUString::createFromAscii( "GroupShape" )

File 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 );

File 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 )
 		{

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

File sd/source/filter/eppt/epptso.cxx

         ImplWriteTextStyleAtom( aClientTextBox, nStyleInstance, 0, NULL, aExtBu, &aPropOpt );
 
 		aPropOpt.CreateTextProperties( mXPropSet, mnTxId += 0x60, sal_False, sal_True );
+		aPropOpt.CreateShapeProperties( mXShape );
 		aPropOpt.Commit( *mpStrm );
 		mpPptEscherEx->AddAtom( 8, ESCHER_ClientAnchor );
 		*mpStrm << (sal_Int16)maRect.Top() << (sal_Int16)maRect.Left() << (sal_Int16)maRect.Right() << (sal_Int16)maRect.Bottom();      // oben, links, rechts, unten ????
             maRect.Justify();
             if ( mnAngle )
                 ImplFlipBoundingBox( aPropOpt );
-            aPropOpt.Commit( *mpStrm );
+            aPropOpt.CreateShapeProperties( mXShape );
+			aPropOpt.Commit( *mpStrm );
             mpPptEscherEx->AddClientAnchor( maRect );
 
 			if ( pClientData )
             SvMemoryStream  aExtBu( 0x200, 0x200 );
             ImplWriteTextStyleAtom( *pClientTextBox, EPP_TEXTTYPE_Other, 0, NULL, aExtBu, &aPropOpt );
 
+            aPropOpt.CreateShapeProperties( mXShape );
             aPropOpt.Commit( *mpStrm );
             mpPptEscherEx->AddClientAnchor( maRect );
 
 				aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x1000100 );
 				aPropOpt2.AddOpt( ESCHER_Prop_tableProperties, 1 );
 				aPropOpt2.AddOpt( ESCHER_Prop_tableRowProperties, sal_True, aMemStrm.Tell(), static_cast< sal_uInt8* >( const_cast< void* >( aMemStrm.GetData() ) ), aMemStrm.Tell() );
+				aPropOpt.CreateShapeProperties( rXShape );
 				aPropOpt.Commit( *mpStrm );
 				aPropOpt2.Commit( *mpStrm, 3, ESCHER_UDefProp );
 				mpPptEscherEx->AddAtom( 8, ESCHER_ClientAnchor );