From 4ecad8ef6c7643e2c076373535cfa0f1d8d7a5c1 Mon Sep 17 00:00:00 2001 From: sj Date: Mon, 15 Mar 2010 17:55:35 +0100 Subject: impressbi01: #161701# now importing hidden/printable shapes --- filter/source/msfilter/msdffimp.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 28e8696a89dd..9542ff1dfb5f 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -5415,6 +5415,13 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r 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" ) -- cgit v1.2.3 From 981fef044e2ac483f0ba689913caf5f782da7b27 Mon Sep 17 00:00:00 2001 From: sj Date: Tue, 16 Mar 2010 10:20:44 +0100 Subject: impressbi01: #161701# PPT Export, now also exporting hidden/non printable shapes --- filter/inc/filter/msfilter/escherex.hxx | 1 + filter/source/msfilter/escherex.cxx | 26 ++++++++++++++++++++++++++ filter/source/msfilter/eschesdo.cxx | 2 ++ 3 files changed, 29 insertions(+) diff --git a/filter/inc/filter/msfilter/escherex.hxx b/filter/inc/filter/msfilter/escherex.hxx index 4f1381749a55..d75c9c6245eb 100644 --- a/filter/inc/filter/msfilter/escherex.hxx +++ b/filter/inc/filter/msfilter/escherex.hxx @@ -1196,6 +1196,7 @@ class MSFILTER_DLLPUBLIC EscherPropertyContainer 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). */ diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 10e1051eba2a..70d4271517e7 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -1101,6 +1101,32 @@ void EscherPropertyContainer::ImplCreateGraphicAttributes( const ::com::sun::sta } } +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 ) { diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx index b72427d78571..e8e4b036f283 100644 --- a/filter/source/msfilter/eschesdo.cxx +++ b/filter/source/msfilter/eschesdo.cxx @@ -729,6 +729,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj, if( rObj.GetAngle() ) ImplFlipBoundingBox( rObj, aPropOpt ); + aPropOpt.CreateShapeProperties( rObj.GetShapeRef() ); mpEscherEx->Commit( aPropOpt, rObj.GetRect() ); if( mpEscherEx->GetGroupLevel() > 1 ) mpEscherEx->AddChildAnchor( rObj.GetRect() ); @@ -826,6 +827,7 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj, rObj.GetRect() ); } rObj.SetAngle( nAngle ); + aPropOpt.CreateShapeProperties( rObj.GetShapeRef() ); mpEscherEx->Commit( aPropOpt, rObj.GetRect() ); // write the childanchor -- cgit v1.2.3 From e64a54ecd1fded745db18758bbe7e9934a89f8b2 Mon Sep 17 00:00:00 2001 From: sj Date: Tue, 16 Mar 2010 15:59:04 +0100 Subject: impressbi01: #161701# oox import of hidden shapes --- oox/inc/oox/drawingml/shape.hxx | 2 ++ oox/source/drawingml/shape.cxx | 8 ++++++++ oox/source/drawingml/shapecontext.cxx | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx index b6c015f73938..821b2f04c44c 100644 --- a/oox/inc/oox/drawingml/shape.hxx +++ b/oox/inc/oox/drawingml/shape.hxx @@ -122,6 +122,7 @@ public: 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; } @@ -201,6 +202,7 @@ private: sal_Int32 mnRotation; sal_Bool mbFlipH; sal_Bool mbFlipV; + sal_Bool mbHidden; }; ::rtl::OUString GetShapeType( sal_Int32 nType ); diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 8bbfc820fca1..9673d2e4e139 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -93,6 +93,7 @@ Shape::Shape( const sal_Char* pServiceName ) , mnRotation( 0 ) , mbFlipH( false ) , mbFlipV( false ) +, mbHidden( false ) { if ( pServiceName ) msServiceName = OUString::createFromAscii( pServiceName ); @@ -178,6 +179,7 @@ void Shape::applyShapeReference( const Shape& rReferencedShape ) mnRotation = rReferencedShape.mnRotation; mbFlipH = rReferencedShape.mbFlipH; mbFlipV = rReferencedShape.mbFlipV; + mbHidden = rReferencedShape.mbHidden; } // for group shapes, the following method is also adding each child @@ -365,6 +367,12 @@ Reference< XShape > Shape::createAndInsert( } 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 ) { diff --git a/oox/source/drawingml/shapecontext.cxx b/oox/source/drawingml/shapecontext.cxx index 4ee664b1c66c..00332d1be0e3 100644 --- a/oox/source/drawingml/shapecontext.cxx +++ b/oox/source/drawingml/shapecontext.cxx @@ -31,6 +31,7 @@ #include #include +#include "oox/helper/attributelist.hxx" #include "oox/drawingml/shapecontext.hxx" #include "oox/drawingml/shapestylecontext.hxx" #include "oox/core/namespaces.hxx" @@ -85,9 +86,13 @@ Reference< XFastContextHandler > ShapeContext::createFastChildContext( sal_Int32 // 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() ); -- cgit v1.2.3 From bc30330c6c67ce22d9b95ac617b4982c2d4cbd6d Mon Sep 17 00:00:00 2001 From: ka Date: Thu, 10 Jun 2010 10:50:30 +0200 Subject: impressbi01: warnings --- filter/source/msfilter/escherex.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 741700727dc1..2ad33b1e6195 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -1106,7 +1106,7 @@ sal_Bool EscherPropertyContainer::CreateShapeProperties( const ::com::sun::star: uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY ); if ( aXPropSet.is() ) { - sal_Bool bVal; + sal_Bool bVal = false; ::com::sun::star::uno::Any aAny; sal_uInt32 nShapeAttr = 0; EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ), sal_True ); @@ -4225,7 +4225,7 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( sal_Bool bFirst ) nRule = GetClosestPoint( aPoly, aRefPoint ); if ( aType == "drawing.Ellipse" ) - nRule <<= 1; // In PPT hat eine Ellipse 8 Möglichkeiten sich zu connecten + nRule <<= 1; // In PPT hat eine Ellipse 8 M?glichkeiten sich zu connecten } } return nRule; -- cgit v1.2.3