diff options
Diffstat (limited to 'oox/source')
25 files changed, 1287 insertions, 425 deletions
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 9c06caffe0c2..ded047f2436b 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -190,6 +190,7 @@ bool XmlFilterBase::importFragment( const ::rtl::Reference< FragmentHandler >& r xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/main" ), NMSP_DRAWINGML ); xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/diagram" ), NMSP_DIAGRAM ); xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chart" ), NMSP_CHART ); + xParser->registerNamespace( CREATE_OUSTRING( "http://schemas.openxmlformats.org/drawingml/2006/chartDrawing" ), NMSP_CDR ); xParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:vml" ), NMSP_VML ); xParser->registerNamespace( CREATE_OUSTRING( "urn:schemas-microsoft-com:office:office" ), NMSP_OFFICE ); diff --git a/oox/source/drawingml/chart/chartconverter.cxx b/oox/source/drawingml/chart/chartconverter.cxx index f1b592631f2d..efd8e6d021e1 100644 --- a/oox/source/drawingml/chart/chartconverter.cxx +++ b/oox/source/drawingml/chart/chartconverter.cxx @@ -33,6 +33,9 @@ using ::rtl::OUString; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Exception; +using ::com::sun::star::awt::Point; +using ::com::sun::star::awt::Size; +using ::com::sun::star::drawing::XShapes; using ::com::sun::star::chart2::XChartDocument; using ::com::sun::star::chart2::data::XDataProvider; using ::com::sun::star::chart2::data::XDataSequence; @@ -53,14 +56,15 @@ ChartConverter::~ChartConverter() } void ChartConverter::convertFromModel( XmlFilterBase& rFilter, - ChartSpaceModel& rModel, const Reference< XChartDocument >& rxChartDoc ) + ChartSpaceModel& rChartModel, const Reference< XChartDocument >& rxChartDoc, + const Reference< XShapes >& rxExternalPage, const Point& rChartPos, const Size& rChartSize ) { OSL_ENSURE( rxChartDoc.is(), "ChartConverter::convertFromModel - missing chart document" ); if( rxChartDoc.is() ) { - ConverterRoot aConvBase( rFilter, *this, rxChartDoc, rModel ); - ChartSpaceConverter aSpaceConv( aConvBase, rModel ); - aSpaceConv.convertFromModel(); + ConverterRoot aConvBase( rFilter, *this, rChartModel, rxChartDoc, rChartSize ); + ChartSpaceConverter aSpaceConv( aConvBase, rChartModel ); + aSpaceConv.convertFromModel( rxExternalPage, rChartPos ); } } diff --git a/oox/source/drawingml/chart/chartdrawingfragment.cxx b/oox/source/drawingml/chart/chartdrawingfragment.cxx new file mode 100644 index 000000000000..9df064125457 --- /dev/null +++ b/oox/source/drawingml/chart/chartdrawingfragment.cxx @@ -0,0 +1,239 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2008 by Sun Microsystems, Inc. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: chartdrawingfragment.cxx,v $ + * + * $Revision: 1.1 $ + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "oox/drawingml/chart/chartdrawingfragment.hxx" +#include "oox/core/xmlfilterbase.hxx" +#include "oox/drawingml/connectorshapecontext.hxx" +#include "oox/drawingml/graphicshapecontext.hxx" +#include "oox/drawingml/shapecontext.hxx" +#include "oox/drawingml/shapegroupcontext.hxx" + +using ::rtl::OUString; +using ::com::sun::star::uno::Reference; +using ::com::sun::star::awt::Point; +using ::com::sun::star::awt::Rectangle; +using ::com::sun::star::awt::Size; +using ::com::sun::star::drawing::XShapes; +using ::oox::core::ContextHandlerRef; +using ::oox::core::FragmentHandler2; +using ::oox::core::XmlFilterBase; + +namespace oox { +namespace drawingml { +namespace chart { + +// ============================================================================ + +ShapeAnchor::ShapeAnchor( bool bRelSize ) : + mbRelSize( bRelSize ) +{ +} + +void ShapeAnchor::importExt( const AttributeList& rAttribs ) +{ + OSL_ENSURE( !mbRelSize, "ShapeAnchor::importExt - unexpected 'cdr:ext' element" ); + maSize.Width = rAttribs.getHyper( XML_cx, 0 ); + maSize.Height = rAttribs.getHyper( XML_cy, 0 ); +} + +void ShapeAnchor::setPos( sal_Int32 nElement, sal_Int32 nParentContext, const OUString& rValue ) +{ + AnchorPosModel* pAnchorPos = 0; + switch( nParentContext ) + { + case CDR_TOKEN( from ): + pAnchorPos = &maFrom; + break; + case CDR_TOKEN( to ): + OSL_ENSURE( mbRelSize, "ShapeAnchor::setPos - unexpected 'cdr:to' element" ); + pAnchorPos = &maTo; + break; + default: + OSL_ENSURE( false, "ShapeAnchor::setPos - unexpected parent element" ); + } + if( pAnchorPos ) switch( nElement ) + { + case CDR_TOKEN( x ): pAnchorPos->mfX = rValue.toDouble(); break; + case CDR_TOKEN( y ): pAnchorPos->mfY = rValue.toDouble(); break; + default: OSL_ENSURE( false, "ShapeAnchor::setPos - unexpected element" ); + } +} + +Rectangle ShapeAnchor::calcEmuLocation( const EmuRectangle& rEmuChartRect ) const +{ + Rectangle aLoc( -1, -1, -1, -1 ); + + OSL_ENSURE( maFrom.isValid(), "ShapeAnchor::calcEmuLocation - invalid from position" ); + OSL_ENSURE( mbRelSize ? maTo.isValid() : maSize.isValid(), "ShapeAnchor::calcEmuLocation - invalid to/size" ); + if( maFrom.isValid() && (mbRelSize ? maTo.isValid() : maSize.isValid()) ) + { + // calculate shape position + aLoc.X = getLimitedValue< sal_Int32, double >( maFrom.mfX * rEmuChartRect.Width, 0, SAL_MAX_INT32 ); + aLoc.Y = getLimitedValue< sal_Int32, double >( maFrom.mfY * rEmuChartRect.Height, 0, SAL_MAX_INT32 ); + + // calculate shape size + if( mbRelSize ) + { + aLoc.Width = getLimitedValue< sal_Int32, double >( maTo.mfX * rEmuChartRect.Width, 0, SAL_MAX_INT32 ) - aLoc.X; + if( aLoc.Width < 0 ) + { + aLoc.X += aLoc.Width; + aLoc.Width *= -1; + } + aLoc.Height = getLimitedValue< sal_Int32, double >( maTo.mfY * rEmuChartRect.Height, 0, SAL_MAX_INT32 ) - aLoc.Y; + if( aLoc.Height < 0 ) + { + aLoc.Y += aLoc.Height; + aLoc.Height *= -1; + } + } + else + { + aLoc.Width = getLimitedValue< sal_Int32, sal_Int64 >( maSize.Width, 0, SAL_MAX_INT32 ); + aLoc.Height = getLimitedValue< sal_Int32, sal_Int64 >( maSize.Height, 0, SAL_MAX_INT32 ); + } + } + + return aLoc; +} +// ============================================================================ + +ChartDrawingFragment::ChartDrawingFragment( XmlFilterBase& rFilter, + const OUString& rFragmentPath, const Reference< XShapes >& rxDrawPage, + const Size& rChartSize, const Point& rShapesOffset, bool bOleSupport ) : + FragmentHandler2( rFilter, rFragmentPath ), + mxDrawPage( rxDrawPage ), + mbOleSupport( bOleSupport ) +{ + maEmuChartRect.X = static_cast< sal_Int64 >( rShapesOffset.X ) * 360; + maEmuChartRect.Y = static_cast< sal_Int64 >( rShapesOffset.Y ) * 360; + maEmuChartRect.Width = static_cast< sal_Int64 >( rChartSize.Width ) * 360; + maEmuChartRect.Height = static_cast< sal_Int64 >( rChartSize.Height ) * 360; +} + +ChartDrawingFragment::~ChartDrawingFragment() +{ +} + +ContextHandlerRef ChartDrawingFragment::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) +{ + switch( getCurrentElement() ) + { + case XML_ROOT_CONTEXT: + if( nElement == C_TOKEN( userShapes ) ) return this; + break; + + case C_TOKEN( userShapes ): + switch( nElement ) + { + case CDR_TOKEN( absSizeAnchor ): + mxAnchor.reset( new ShapeAnchor( false ) ); + return this; + case CDR_TOKEN( relSizeAnchor ): + mxAnchor.reset( new ShapeAnchor( true ) ); + return this; + } + break; + + case CDR_TOKEN( absSizeAnchor ): + case CDR_TOKEN( relSizeAnchor ): + switch( nElement ) + { + case CDR_TOKEN( sp ): + mxShape.reset( new Shape( "com.sun.star.drawing.CustomShape" ) ); + return new ShapeContext( *this, ShapePtr(), mxShape ); + case CDR_TOKEN( cxnSp ): + mxShape.reset( new Shape( "com.sun.star.drawing.ConnectorShape" ) ); + return new ConnectorShapeContext( *this, ShapePtr(), mxShape ); + case CDR_TOKEN( pic ): + mxShape.reset( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ); + return new GraphicShapeContext( *this, ShapePtr(), mxShape ); + case CDR_TOKEN( graphicFrame ): + if( !mbOleSupport ) + return 0; + mxShape.reset( new Shape( "com.sun.star.drawing.OLE2Shape" ) ); + return new GraphicalObjectFrameContext( *this, ShapePtr(), mxShape, true ); + case CDR_TOKEN( grpSp ): + mxShape.reset( new Shape( "com.sun.star.drawing.GroupShape" ) ); + return new ShapeGroupContext( *this, ShapePtr(), mxShape ); + + case CDR_TOKEN( from ): + case CDR_TOKEN( to ): + return this; + + case CDR_TOKEN( ext ): + if( mxAnchor.get() ) mxAnchor->importExt( rAttribs ); + return 0; + } + break; + + case CDR_TOKEN( from ): + case CDR_TOKEN( to ): + switch( nElement ) + { + case CDR_TOKEN( x ): + case CDR_TOKEN( y ): + return this; // collect value in onEndElement() + } + break; + } + return 0; +} + +void ChartDrawingFragment::onEndElement( const OUString& rChars ) +{ + switch( getCurrentElement() ) + { + case CDR_TOKEN( x ): + case CDR_TOKEN( y ): + if( mxAnchor.get() ) mxAnchor->setPos( getCurrentElement(), getPreviousElement(), rChars ); + break; + + case CDR_TOKEN( absSizeAnchor ): + case CDR_TOKEN( relSizeAnchor ): + if( mxDrawPage.is() && mxShape.get() && mxAnchor.get() ) + { + Rectangle aLoc = mxAnchor->calcEmuLocation( maEmuChartRect ); + if( (aLoc.X >= 0) && (aLoc.Y >= 0) && (aLoc.Width >= 0) && (aLoc.Height >= 0) ) + mxShape->addShape( getFilter(), getFilter().getCurrentTheme(), mxDrawPage, &aLoc ); + } + mxShape.reset(); + mxAnchor.reset(); + break; + } +} + +// ============================================================================ + +} // namespace chart +} // namespace drawingml +} // namespace oox + diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx index 390f7ccfe7b9..6460e94a4f3b 100644 --- a/oox/source/drawingml/chart/chartspaceconverter.cxx +++ b/oox/source/drawingml/chart/chartspaceconverter.cxx @@ -26,24 +26,29 @@ ************************************************************************/ #include "oox/drawingml/chart/chartspaceconverter.hxx" +#include <com/sun/star/drawing/XDrawPageSupplier.hpp> +#include <com/sun/star/chart/MissingValueTreatment.hpp> #include <com/sun/star/chart/XChartDocument.hpp> #include <com/sun/star/chart2/XChartDocument.hpp> #include <com/sun/star/chart2/XTitled.hpp> #include <com/sun/star/chart2/data/XDataReceiver.hpp> -#include <com/sun/star/chart/MissingValueTreatment.hpp> #include "oox/core/xmlfilterbase.hxx" #include "oox/drawingml/chart/chartconverter.hxx" +#include "oox/drawingml/chart/chartdrawingfragment.hxx" #include "oox/drawingml/chart/chartspacemodel.hxx" #include "oox/drawingml/chart/plotareaconverter.hxx" #include "oox/drawingml/chart/titleconverter.hxx" #include "properties.hxx" using ::rtl::OUString; +using ::com::sun::star::awt::Point; using ::com::sun::star::uno::Reference; using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::UNO_QUERY; using ::com::sun::star::uno::UNO_QUERY_THROW; using ::com::sun::star::util::XNumberFormatsSupplier; +using ::com::sun::star::drawing::XDrawPageSupplier; +using ::com::sun::star::drawing::XShapes; using ::com::sun::star::chart2::XDiagram; using ::com::sun::star::chart2::XTitled; using ::com::sun::star::chart2::data::XDataReceiver; @@ -63,7 +68,7 @@ ChartSpaceConverter::~ChartSpaceConverter() { } -void ChartSpaceConverter::convertFromModel() +void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExternalPage, const Point& rChartPos ) { /* create data provider (virtual function in the ChartConverter class, derived converters may create an external data provider) */ @@ -81,8 +86,8 @@ void ChartSpaceConverter::convertFromModel() } // formatting of the chart background - PropertySet aPropSet( getChartDocument()->getPageBackground() ); - getFormatter().convertFrameFormatting( aPropSet, mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE ); + PropertySet aBackPropSet( getChartDocument()->getPageBackground() ); + getFormatter().convertFrameFormatting( aBackPropSet, mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE ); // convert plot area (container of all chart type groups) PlotAreaConverter aPlotAreaConv( *this, mrModel.mxPlotArea.getOrCreate() ); @@ -121,10 +126,10 @@ void ChartSpaceConverter::convertFromModel() } // legend - if( mrModel.mxLegend.is() ) + if( xDiagram.is() && mrModel.mxLegend.is() ) { LegendConverter aLegendConv( *this, *mrModel.mxLegend ); - aLegendConv.convertFromModel( getChartDocument()->getFirstDiagram() ); + aLegendConv.convertFromModel( xDiagram ); } // treatment of missing values @@ -142,12 +147,48 @@ void ChartSpaceConverter::convertFromModel() aDiaProp.setProperty( PROP_MissingValueTreatment, nMissingValues ); } - // set the IncludeHiddenCells property via the old API as only this ensures that the data provider and al created sequences get this flag correctly - Reference< com::sun::star::chart::XChartDocument > xStandardApiChartDoc( getChartDocument(), UNO_QUERY ); - if( xStandardApiChartDoc.is() ) + Reference< com::sun::star::chart::XChartDocument > xOldChartDoc( getChartDocument(), UNO_QUERY ); + if( xOldChartDoc.is() ) + { + /* Set the IncludeHiddenCells property via the old API as only this + ensures that the data provider and all created sequences get this + flag correctly. */ + PropertySet aOldDiaProp( xOldChartDoc->getDiagram() ); + aOldDiaProp.setProperty( PROP_IncludeHiddenCells, !mrModel.mbPlotVisOnly ); + } + + // embedded drawing shapes + if( mrModel.maDrawingPath.getLength() > 0 ) try + { + /* Get the internal draw page of the chart document, if no external + drawing page has been passed. */ + Reference< XShapes > xShapes; + Point aShapesOffset( 0, 0 ); + if( rxExternalPage.is() ) + { + xShapes = rxExternalPage; + // offset for embedded shapes to move them inside the chart area + aShapesOffset = rChartPos; + } + else + { + Reference< XDrawPageSupplier > xDrawPageSupp( getChartDocument(), UNO_QUERY_THROW ); + xShapes.set( xDrawPageSupp->getDrawPage(), UNO_QUERY_THROW ); + } + + /* If an external drawing page is passed, all embedded shapes will be + inserted there (used e.g. with 'chart sheets' in spreadsheet + documents). In this case, all types of shapes including OLE objects + are supported. If the shapes are inserted into the internal chart + drawing page instead, it is not possible to embed OLE objects. */ + bool bOleSupport = rxExternalPage.is(); + + // now, xShapes is not null anymore + getFilter().importFragment( new ChartDrawingFragment( + getFilter(), mrModel.maDrawingPath, xShapes, getChartSize(), aShapesOffset, bOleSupport ) ); + } + catch( Exception& ) { - PropertySet aStandardApiDiagramProp( xStandardApiChartDoc->getDiagram() ); - aStandardApiDiagramProp.setProperty( PROP_IncludeHiddenCells, !mrModel.mbPlotVisOnly ); } } diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index d041997636a9..75df94e95de7 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -75,6 +75,9 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const return 0; case C_TOKEN( txPr ): return new TextBodyContext( *this, mrModel.mxTextProp.create() ); + case C_TOKEN( userShapes ): + mrModel.maDrawingPath = getFragmentPathFromRelId( rAttribs.getString( R_TOKEN( id ), OUString() ) ); + return 0; } break; diff --git a/oox/source/drawingml/chart/converterbase.cxx b/oox/source/drawingml/chart/converterbase.cxx index 596efcf8b30f..534ce48e0278 100644 --- a/oox/source/drawingml/chart/converterbase.cxx +++ b/oox/source/drawingml/chart/converterbase.cxx @@ -40,6 +40,7 @@ using ::com::sun::star::uno::Exception; using ::com::sun::star::uno::UNO_QUERY_THROW; using ::com::sun::star::lang::XMultiServiceFactory; using ::com::sun::star::frame::XModel; +using ::com::sun::star::awt::Size; using ::com::sun::star::chart2::XChartDocument; using ::oox::core::XmlFilterBase; @@ -51,16 +52,18 @@ namespace chart { struct ConverterData { + ObjectFormatter maFormatter; XmlFilterBase& mrFilter; ChartConverter& mrConverter; Reference< XChartDocument > mxDoc; - ObjectFormatter maFormatter; + Size maSize; explicit ConverterData( XmlFilterBase& rFilter, ChartConverter& rChartConverter, + const ChartSpaceModel& rChartModel, const Reference< XChartDocument >& rxChartDoc, - const ChartSpaceModel& rChartSpace ); + const Size& rChartSize ); ~ConverterData(); }; @@ -69,12 +72,14 @@ struct ConverterData ConverterData::ConverterData( XmlFilterBase& rFilter, ChartConverter& rChartConverter, + const ChartSpaceModel& rChartModel, const Reference< XChartDocument >& rxChartDoc, - const ChartSpaceModel& rChartSpace ) : + const Size& rChartSize ) : + maFormatter( rFilter, rxChartDoc, rChartModel ), mrFilter( rFilter ), mrConverter( rChartConverter ), mxDoc( rxChartDoc ), - maFormatter( rFilter, rxChartDoc, rChartSpace ) + maSize( rChartSize ) { OSL_ENSURE( mxDoc.is(), "ConverterData::ConverterData - missing chart document" ); // lock the model to suppress internal updates during conversion @@ -106,9 +111,10 @@ ConverterData::~ConverterData() ConverterRoot::ConverterRoot( XmlFilterBase& rFilter, ChartConverter& rChartConverter, + const ChartSpaceModel& rChartModel, const Reference< XChartDocument >& rxChartDoc, - const ChartSpaceModel& rChartSpace ) : - mxData( new ConverterData( rFilter, rChartConverter, rxChartDoc, rChartSpace ) ) + const Size& rChartSize ) : + mxData( new ConverterData( rFilter, rChartConverter, rChartModel, rxChartDoc, rChartSize ) ) { } @@ -151,6 +157,11 @@ Reference< XChartDocument > ConverterRoot::getChartDocument() const return mxData->mxDoc; } +const Size& ConverterRoot::getChartSize() const +{ + return mxData->maSize; +} + ObjectFormatter& ConverterRoot::getFormatter() const { return mxData->maFormatter; diff --git a/oox/source/drawingml/chart/makefile.mk b/oox/source/drawingml/chart/makefile.mk index 3ba22a30f9e6..84762e6a2540 100644 --- a/oox/source/drawingml/chart/makefile.mk +++ b/oox/source/drawingml/chart/makefile.mk @@ -46,6 +46,7 @@ SLOFILES = \ $(SLO)$/axismodel.obj \ $(SLO)$/chartcontextbase.obj \ $(SLO)$/chartconverter.obj \ + $(SLO)$/chartdrawingfragment.obj \ $(SLO)$/chartspaceconverter.obj \ $(SLO)$/chartspacefragment.obj \ $(SLO)$/chartspacemodel.obj \ diff --git a/oox/source/drawingml/graphicshapecontext.cxx b/oox/source/drawingml/graphicshapecontext.cxx index bcb562c0118f..a0335fe68ee2 100644 --- a/oox/source/drawingml/graphicshapecontext.cxx +++ b/oox/source/drawingml/graphicshapecontext.cxx @@ -106,8 +106,9 @@ Reference< XFastContextHandler > GraphicShapeContext::createFastChildContext( sa // ============================================================================ // CT_GraphicalObjectFrameContext -GraphicalObjectFrameContext::GraphicalObjectFrameContext( ContextHandler& rParent, ShapePtr pMasterShapePtr, ShapePtr pShapePtr ) -: ShapeContext( rParent, pMasterShapePtr, pShapePtr ) +GraphicalObjectFrameContext::GraphicalObjectFrameContext( ContextHandler& rParent, ShapePtr pMasterShapePtr, ShapePtr pShapePtr, bool bEmbedShapesInChart ) : + ShapeContext( rParent, pMasterShapePtr, pShapePtr ), + mbEmbedShapesInChart( bEmbedShapesInChart ) { } @@ -135,7 +136,7 @@ Reference< XFastContextHandler > GraphicalObjectFrameContext::createFastChildCon else if ( sUri.equalsAscii( "http://schemas.openxmlformats.org/drawingml/2006/diagram" ) ) xRet.set( new DiagramGraphicDataContext( *this, mpShapePtr ) ); else if ( sUri.equalsAscii( "http://schemas.openxmlformats.org/drawingml/2006/chart" ) ) - xRet.set( new ChartGraphicDataContext( *this, mpShapePtr ) ); + xRet.set( new ChartGraphicDataContext( *this, mpShapePtr, mbEmbedShapesInChart ) ); else if ( sUri.compareToAscii( "http://schemas.openxmlformats.org/drawingml/2006/table" ) == 0 ) xRet.set( new table::TableContext( *this, mpShapePtr ) ); else @@ -349,22 +350,24 @@ Reference< XFastContextHandler > DiagramGraphicDataContext::createFastChildConte class CreateChartCallback : public CreateShapeCallback { public: - explicit CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath ); - virtual void onXShapeCreated( const Reference< drawing::XShape >& rxShape ) const; + explicit CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEmbedShapes ); + virtual void onXShapeCreated( const Reference< drawing::XShape >& rxShape, const Reference< drawing::XShapes >& rxShapes ) const; private: OUString maFragmentPath; + bool mbEmbedShapes; }; // ---------------------------------------------------------------------------- -CreateChartCallback::CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath ) : +CreateChartCallback::CreateChartCallback( XmlFilterBase& rFilter, const OUString& rFragmentPath, bool bEmbedShapes ) : CreateShapeCallback( rFilter ), - maFragmentPath( rFragmentPath ) + maFragmentPath( rFragmentPath ), + mbEmbedShapes( bEmbedShapes ) { } -void CreateChartCallback::onXShapeCreated( const Reference< drawing::XShape >& rxShape ) const +void CreateChartCallback::onXShapeCreated( const Reference< drawing::XShape >& rxShape, const Reference< drawing::XShapes >& rxShapes ) const { OSL_ENSURE( maFragmentPath.getLength() > 0, "CreateChartCallback::onXShapeCreated - missing chart fragment" ); if( maFragmentPath.getLength() > 0 ) try @@ -376,14 +379,17 @@ void CreateChartCallback::onXShapeCreated( const Reference< drawing::XShape >& r // get the XModel interface of the embedded object from the OLE shape Reference< frame::XModel > xDocModel; aShapeProp.getProperty( xDocModel, PROP_Model ); + Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW ); // load the chart data from the XML fragment chart::ChartSpaceModel aModel; mrFilter.importFragment( new chart::ChartSpaceFragment( mrFilter, maFragmentPath, aModel ) ); // convert imported chart model to chart document - Reference< chart2::XChartDocument > xChartDoc( xDocModel, UNO_QUERY_THROW ); - mrFilter.getChartConverter().convertFromModel( mrFilter, aModel, xChartDoc ); + Reference< drawing::XShapes > xExternalPage; + if( !mbEmbedShapes ) + xExternalPage = rxShapes; + mrFilter.getChartConverter().convertFromModel( mrFilter, aModel, xChartDoc, xExternalPage, rxShape->getPosition(), rxShape->getSize() ); } catch( Exception& ) { @@ -392,8 +398,9 @@ void CreateChartCallback::onXShapeCreated( const Reference< drawing::XShape >& r // ============================================================================ -ChartGraphicDataContext::ChartGraphicDataContext( ContextHandler& rParent, const ShapePtr& rxShape ) : - ShapeContext( rParent, ShapePtr(), rxShape ) +ChartGraphicDataContext::ChartGraphicDataContext( ContextHandler& rParent, const ShapePtr& rxShape, bool bEmbedShapes ) : + ShapeContext( rParent, ShapePtr(), rxShape ), + mbEmbedShapes( bEmbedShapes ) { rxShape->setServiceName( "com.sun.star.drawing.OLE2Shape" ); } @@ -405,7 +412,7 @@ Reference< XFastContextHandler > ChartGraphicDataContext::createFastChildContext { AttributeList aAttribs( rxAttribs ); OUString aFragmentPath = getFragmentPathFromRelId( aAttribs.getString( R_TOKEN( id ), OUString() ) ); - CreateShapeCallbackRef xCallback( new CreateChartCallback( getFilter(), aFragmentPath ) ); + CreateShapeCallbackRef xCallback( new CreateChartCallback( getFilter(), aFragmentPath, mbEmbedShapes ) ); mpShapePtr->setCreateShapeCallback( xCallback ); } return 0; diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 8bbfc820fca1..cab64f11c166 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -76,7 +76,7 @@ OUString CreateShapeCallback::onCreateXShape( const OUString& rServiceName, cons return rServiceName; } -void CreateShapeCallback::onXShapeCreated( const Reference< XShape >& ) const +void CreateShapeCallback::onXShapeCreated( const Reference< XShape >&, const Reference< XShapes >& ) const { } @@ -135,7 +135,7 @@ const ShapeStyleRef* Shape::getShapeStyleRef( sal_Int32 nRefType ) const void Shape::addShape( const ::oox::core::XmlFilterBase& rFilterBase, - const ThemePtr& rxTheme, + const Theme* pTheme, const Reference< XShapes >& rxShapes, const awt::Rectangle* pShapeRect, ShapeIdMap* pShapeMap ) @@ -145,7 +145,7 @@ void Shape::addShape( rtl::OUString sServiceName( msServiceName ); if( sServiceName.getLength() ) { - Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, rxTheme, rxShapes, pShapeRect, sal_False ) ); + Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, sal_False ) ); if( pShapeMap && msId.getLength() ) { @@ -155,7 +155,7 @@ void Shape::addShape( // if this is a group shape, we have to add also each child shape Reference< XShapes > xShapes( xShape, UNO_QUERY ); if ( xShapes.is() ) - addChildren( rFilterBase, *this, rxTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap ); + addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap ); } } catch( const Exception& ) @@ -184,7 +184,7 @@ void Shape::applyShapeReference( const Shape& rReferencedShape ) void Shape::addChildren( const ::oox::core::XmlFilterBase& rFilterBase, Shape& rMaster, - const ThemePtr& rxTheme, + const Theme* pTheme, const Reference< XShapes >& rxShapes, const awt::Rectangle& rClientRect, ShapeIdMap* pShapeMap ) @@ -235,14 +235,14 @@ void Shape::addChildren( pShapeRect = &aShapeRect; } } - (*aIter++)->addShape( rFilterBase, rxTheme, rxShapes, pShapeRect, pShapeMap ); + (*aIter++)->addShape( rFilterBase, pTheme, rxShapes, pShapeRect, pShapeMap ); } } Reference< XShape > Shape::createAndInsert( const ::oox::core::XmlFilterBase& rFilterBase, const rtl::OUString& rServiceName, - const ThemePtr& rxTheme, + const Theme* pTheme, const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes, const awt::Rectangle* pShapeRect, sal_Bool bClearText ) @@ -383,23 +383,23 @@ Reference< XShape > Shape::createAndInsert( aFillProperties.moFillType = XML_noFill; sal_Int32 nFillPhClr = -1; - if( rxTheme.get() ) + if( pTheme ) { if( const ShapeStyleRef* pLineRef = getShapeStyleRef( XML_lnRef ) ) { - if( const LineProperties* pLineProps = rxTheme->getLineStyle( pLineRef->mnThemedIdx ) ) + if( const LineProperties* pLineProps = pTheme->getLineStyle( pLineRef->mnThemedIdx ) ) aLineProperties.assignUsed( *pLineProps ); nLinePhClr = pLineRef->maPhClr.getColor( rFilterBase ); } if( const ShapeStyleRef* pFillRef = getShapeStyleRef( XML_fillRef ) ) { - if( const FillProperties* pFillProps = rxTheme->getFillStyle( pFillRef->mnThemedIdx ) ) + if( const FillProperties* pFillProps = pTheme->getFillStyle( pFillRef->mnThemedIdx ) ) aFillProperties.assignUsed( *pFillProps ); nFillPhClr = pFillRef->maPhClr.getColor( rFilterBase ); } // if( const ShapeStyleRef* pEffectRef = getShapeStyleRef( XML_fillRef ) ) // { -// if( const EffectProperties* pEffectProps = rxTheme->getEffectStyle( pEffectRef->mnThemedIdx ) ) +// if( const EffectProperties* pEffectProps = pTheme->getEffectStyle( pEffectRef->mnThemedIdx ) ) // aEffectProperties.assignUsed( *pEffectProps ); // nEffectPhClr = pEffectRef->maPhClr.getColor( rFilterBase ); // } @@ -451,8 +451,8 @@ Reference< XShape > Shape::createAndInsert( TextCharacterProperties aCharStyleProperties; if( const ShapeStyleRef* pFontRef = getShapeStyleRef( XML_fontRef ) ) { - if( rxTheme.get() ) - if( const TextCharacterProperties* pCharProps = rxTheme->getFontStyle( pFontRef->mnThemedIdx ) ) + if( pTheme ) + if( const TextCharacterProperties* pCharProps = pTheme->getFontStyle( pFontRef->mnThemedIdx ) ) aCharStyleProperties.assignUsed( *pCharProps ); aCharStyleProperties.maCharColor.assignIfUsed( pFontRef->maPhClr ); } @@ -465,7 +465,7 @@ Reference< XShape > Shape::createAndInsert( // use a callback for further processing on the XShape (e.g. charts) if( mxShape.is() && mxCreateCallback.get() ) - mxCreateCallback->onXShapeCreated( mxShape ); + mxCreateCallback->onXShapeCreated( mxShape, rxShapes ); return mxShape; } diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx index 3d93d5866886..1b90be3952ab 100644 --- a/oox/source/drawingml/shapegroupcontext.cxx +++ b/oox/source/drawingml/shapegroupcontext.cxx @@ -103,7 +103,7 @@ Reference< XFastContextHandler > ShapeGroupContext::createFastChildContext( sal_ xRet.set( new GraphicShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ) ) ); break; case XML_graphicFrame: // CT_GraphicalObjectFrame - xRet.set( new GraphicalObjectFrameContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.OLE2Shape" ) ) ) ); + xRet.set( new GraphicalObjectFrameContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.OLE2Shape" ) ), true ) ); break; } if( !xRet.is() ) diff --git a/oox/source/dump/biffdumper.ini b/oox/source/dump/biffdumper.ini index 645bb2bb7825..618e89c996e0 100644 --- a/oox/source/dump/biffdumper.ini +++ b/oox/source/dump/biffdumper.ini @@ -358,7 +358,7 @@ multilist=RECORD-NAMES-BIFF5 # chart records exclude=0x1004,0x102D,0x102F,0x1036,0x1037,0x1038,0x103B 0x1040=CHRADARAREA,CHAXESSET,,CHLEGENDENTRY,CHPROPERTIES,CHSERGROUP,CHUSEDAXESSETS, - 0x1048=CHPIVOTREF,,CHSERPARENT,CHSERTRENDLINE,,,CHFORMAT,CHPOS + 0x1048=CHPIVOTREF,,CHSERPARENT,CHSERTRENDLINE,,,CHFORMAT,CHFRAMEPOS 0x1050=CHFORMATRUNS,CHSOURCELINK,,,,,, 0x1058=,,,CHSERERRORBAR,,CHSERIESFORMAT,, end @@ -976,10 +976,11 @@ end shortlist=CHPROPERTIES-EMPTYCELLS,0,do-not-plot,as-zero,interpolated flagslist=CHPROPERTIES-FLAGS - 0x0001=manual-format + 0x0001=manual-series 0x0002=plot-visible-only 0x0004=fixed-size 0x0008=manual-plotarea + 0x0010=apply-plotarea-pos end # CHSCATTER ------------------------------------------------------------------ @@ -1039,7 +1040,7 @@ shortlist=CHTEXT-HORALIGN,1,left,center,right,block,distribute shortlist=CHTEXT-VERALIGN,1,top,center,bottom,block,distribute shortlist=CHTEXT-FILLMODE,1,transparent,opaque -combilist=CHTEXT-FLAGS-BIFF2 +flagslist=CHTEXT-FLAGS-BIFF2 0x0001=auto-color 0x0002=show-symbol 0x0004=show-value diff --git a/oox/source/dump/dffdumper.cxx b/oox/source/dump/dffdumper.cxx index bbd8c78d1a10..599687f5bd50 100644 --- a/oox/source/dump/dffdumper.cxx +++ b/oox/source/dump/dffdumper.cxx @@ -36,6 +36,30 @@ namespace dump { // ============================================================================ +namespace { + +const sal_uInt16 DFF_ID_BSE = 0xF007; /// BLIP store entry. +const sal_uInt16 DFF_ID_BSTORECONTAINER = 0xF001; /// BLIP store container. +const sal_uInt16 DFF_ID_CHILDANCHOR = 0xF00F; /// Child anchor (in groups). +const sal_uInt16 DFF_ID_CLIENTANCHOR = 0xF010; /// Client anchor. +const sal_uInt16 DFF_ID_DG = 0xF008; /// Drawing. +const sal_uInt16 DFF_ID_DGG = 0xF006; /// Drawing group. +const sal_uInt16 DFF_ID_OPT = 0xF00B; /// Property set. +const sal_uInt16 DFF_ID_OPT2 = 0xF121; /// Secondary property set. +const sal_uInt16 DFF_ID_OPT3 = 0xF122; /// Ternary property set. +const sal_uInt16 DFF_ID_SP = 0xF00A; /// Shape. +const sal_uInt16 DFF_ID_SPGR = 0xF009; /// Shape group. +const sal_uInt16 DFF_ID_SPLITMENUCOLORS = 0xF11E; /// Current toolbar colors. + +const sal_uInt16 DFF_OPT_IDMASK = 0x3FFF; +const sal_uInt16 DFF_OPT_PICTURE = 0x4000; +const sal_uInt16 DFF_OPT_COMPLEX = 0x8000; +const sal_uInt16 DFF_OPT_FLAGSMASK = 0x003F; + +} // namespace + +// ============================================================================ + void DffStreamObject::construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const OUString& rSysFileName ) { SequenceRecordObjectBase::construct( rParent, rxStrm, rSysFileName, "DFF-RECORD-NAMES" ); @@ -62,10 +86,12 @@ void DffStreamObject::implWriteExtHeader() const sal_Char* pcListName = "DFF-RECORD-INST"; switch( getRecId() ) { - case 0xF001: pcListName = "DFFBSTORECONT-RECORD-INST"; break; // DFFBSTORECONTAINER contains BLIP count - case 0xF007: pcListName = "DFFBSE-RECORD-INST"; break; // DFFBSE contains BLIP type - case 0xF00A: pcListName = "DFFSP-RECORD-INST"; break; // DFFSP contains shape type - case 0xF00B: pcListName = "DFFOPT-RECORD-INST"; break; // DFFOPT contains property count + case DFF_ID_BSE: pcListName = "DFFBSE-RECORD-INST"; break; // BLIP type + case DFF_ID_BSTORECONTAINER: pcListName = "DFFBSTORECONT-RECORD-INST"; break; // BLIP count + case DFF_ID_DG: pcListName = "DFFDG-RECORD-INST"; break; // drawing ID + case DFF_ID_OPT: pcListName = "DFFOPT-RECORD-INST"; break; // property count + case DFF_ID_SP: pcListName = "DFFSP-RECORD-INST"; break; // shape type + case DFF_ID_SPLITMENUCOLORS: pcListName = "DFFSPLITMENUC-RECORD-INST"; break; // number of colors } MultiItemsGuard aMultiGuard( out() ); writeHexItem( "instance", mnInstVer, pcListName ); @@ -76,7 +102,7 @@ void DffStreamObject::implDumpRecordBody() { switch( getRecId() ) { - case 0xF007: // DFFBSE + case DFF_ID_BSE: dumpDec< sal_uInt8 >( "win-type", "DFFBSE-TYPE" ); dumpDec< sal_uInt8 >( "mac-type", "DFFBSE-TYPE" ); dumpGuid( "guid" ); @@ -89,26 +115,63 @@ void DffStreamObject::implDumpRecordBody() dumpUnused( 2 ); break; - case 0xF00A: // DFFSP - dumpHex< sal_uInt32 >( "shape-id", "CONV-DEC" ); - dumpHex< sal_uInt32 >( "shape-flags", "DFFSP-FLAGS" ); + case DFF_ID_CHILDANCHOR: + dumpDec< sal_uInt32 >( "left" ); + dumpDec< sal_uInt32 >( "top" ); + dumpDec< sal_uInt32 >( "right" ); + dumpDec< sal_uInt32 >( "bottom" ); break; - case 0xF00B: // DFFOPT + case DFF_ID_CLIENTANCHOR: + implDumpClientAnchor(); + break; + + case DFF_ID_DG: + dumpDec< sal_uInt32 >( "shape-count" ); + dumpHex< sal_uInt32 >( "max-shape-id", "CONV-DEC" ); + break; + + case DFF_ID_DGG: { - sal_uInt16 nPropCount = getInst(); - out().resetItemIndex(); - for( sal_uInt16 nPropIdx = 0; !in().isEof() && (nPropIdx < nPropCount); ++nPropIdx ) + dumpHex< sal_uInt32 >( "max-shape-id", "CONV-DEC" ); + sal_uInt32 nClusters = dumpDec< sal_uInt32 >( "id-cluster-count" ); + dumpDec< sal_uInt32 >( "shape-count" ); + dumpDec< sal_uInt32 >( "drawing-count" ); + out().resetItemIndex( 1 ); + TableGuard aTabGuard( out(), 15, 16 ); + for( sal_uInt32 nCluster = 1; !in().isEof() && (nCluster < nClusters); ++nCluster ) { - sal_uInt16 nPropId = dumpDffOptPropHeader(); - IndentGuard aIndent( out() ); - dumpDffOptPropValue( nPropId, in().readuInt32() ); + MultiItemsGuard aMultiGuard( out() ); + writeEmptyItem( "#cluster" ); + dumpDec< sal_uInt32 >( "drawing-id" ); + dumpHex< sal_uInt32 >( "next-free-id", "CONV-DEC" ); } } break; - case 0xF010: // DFFCLIENTANCHOR - implDumpClientAnchor(); + case DFF_ID_OPT: + case DFF_ID_OPT2: + case DFF_ID_OPT3: + dumpDffOpt(); + break; + + case DFF_ID_SP: + dumpHex< sal_uInt32 >( "shape-id", "CONV-DEC" ); + dumpHex< sal_uInt32 >( "shape-flags", "DFFSP-FLAGS" ); + break; + + case DFF_ID_SPGR: + dumpDec< sal_uInt32 >( "left" ); + dumpDec< sal_uInt32 >( "top" ); + dumpDec< sal_uInt32 >( "right" ); + dumpDec< sal_uInt32 >( "bottom" ); + break; + + case DFF_ID_SPLITMENUCOLORS: + dumpDffSimpleColor( "fill-color" ); + dumpDffSimpleColor( "line-color" ); + dumpDffSimpleColor( "shadow-color" ); + dumpDffSimpleColor( "3d-color" ); break; } } @@ -121,38 +184,136 @@ void DffStreamObject::constructDffObj() { mnInstVer = 0; mnRealSize = 0; + if( SequenceRecordObjectBase::implIsValid() ) + { + maSimpleProps.insertFormats( cfg().getNameList( "DFFOPT-SIMPLE-PROPERTIES" ) ); + maComplexProps.insertFormats( cfg().getNameList( "DFFOPT-COMPLEX-PROPERTIES" ) ); + } } -sal_uInt16 DffStreamObject::dumpDffOptPropHeader() +sal_uInt32 DffStreamObject::dumpDffSimpleColor( const String& rName ) { - MultiItemsGuard aMultiGuard( out() ); - TableGuard aTabGuard( out(), 11 ); - writeEmptyItem( "#prop" ); - return dumpHex< sal_uInt16 >( "id", "DFFOPT-PROPERTY-ID" ); + return dumpHex< sal_uInt32 >( rName, "DFF-SIMPLE-COLOR" ); +} + +sal_uInt32 DffStreamObject::dumpDffColor( const String& rName ) +{ + return dumpHex< sal_uInt32 >( rName, "DFF-COLOR" ); } -void DffStreamObject::dumpDffOptPropValue( sal_uInt16 nPropId, sal_uInt32 nValue ) +namespace { + +enum PropType { PROPTYPE_BINARY, PROPTYPE_STRING, PROPTYPE_BLIP, PROPTYPE_COLORARRAY }; + +struct PropInfo +{ + OUString maName; + PropType meType; + sal_uInt16 mnId; + sal_uInt32 mnSize; + inline explicit PropInfo( const OUString& rName, PropType eType, sal_uInt16 nId, sal_uInt32 nSize ) : + maName( rName ), meType( eType ), mnId( nId ), mnSize( nSize ) {} +}; + +typedef ::std::vector< PropInfo > PropInfoVector; + +} // namespace + +void DffStreamObject::dumpDffOpt() { - switch( nPropId & 0x3FFF ) + sal_uInt16 nPropCount = getInst(); + PropInfoVector aPropInfos; + out().resetItemIndex(); + for( sal_uInt16 nPropIdx = 0; !in().isEof() && (nPropIdx < nPropCount); ++nPropIdx ) + { + sal_uInt16 nPropId = dumpDffOptPropHeader(); + sal_uInt16 nBaseId = nPropId & DFF_OPT_IDMASK; + sal_uInt32 nValue = in().readuInt32(); + + IndentGuard aIndent( out() ); + if( getFlag( nPropId, DFF_OPT_COMPLEX ) ) + { + writeHexItem( "complex-size", nValue, "CONV-DEC" ); + String aName; + PropType eType = PROPTYPE_BINARY; + ItemFormatMap::const_iterator aIt = maComplexProps.find( nBaseId ); + if( aIt != maComplexProps.end() ) + { + const ItemFormat& rItemFmt = aIt->second; + aName = rItemFmt.maItemName; + if( rItemFmt.maListName.equalsAscii( "binary" ) ) + eType = PROPTYPE_BINARY; + else if( rItemFmt.maListName.equalsAscii( "string" ) ) + eType = PROPTYPE_STRING; + else if( rItemFmt.maListName.equalsAscii( "blip" ) ) + eType = PROPTYPE_BLIP; + else if( rItemFmt.maListName.equalsAscii( "colorarray" ) ) + eType = PROPTYPE_COLORARRAY; + } + aPropInfos.push_back( PropInfo( aName( "property-data" ), eType, nBaseId, nValue ) ); + } + else + { + ItemFormatMap::const_iterator aIt = maSimpleProps.find( nBaseId ); + if( aIt != maSimpleProps.end() ) + { + const ItemFormat& rItemFmt = aIt->second; + // flags always at end of block of 64 properties + if( (nBaseId & DFF_OPT_FLAGSMASK) == DFF_OPT_FLAGSMASK ) + { + FlagsList* pFlagsList = dynamic_cast< FlagsList* >( cfg().getNameList( rItemFmt.maListName ).get() ); + sal_Int64 nOldIgnoreFlags = 0; + if( pFlagsList ) + { + nOldIgnoreFlags = pFlagsList->getIgnoreFlags(); + pFlagsList->setIgnoreFlags( nOldIgnoreFlags | 0xFFFF0000 | ~(nValue >> 16) ); + } + writeValueItem( rItemFmt, nValue ); + if( pFlagsList ) + pFlagsList->setIgnoreFlags( nOldIgnoreFlags ); + } + else + writeValueItem( rItemFmt, nValue ); + } + else + writeHexItem( "value", nValue ); + } + } + + out().resetItemIndex(); + for( PropInfoVector::iterator aIt = aPropInfos.begin(), aEnd = aPropInfos.end(); !in().isEof() && (aIt != aEnd); ++aIt ) { - case 127: writeHexItem( "flags", nValue, "DFFOPT-LOCK-FLAGS" ); break; - case 191: writeHexItem( "flags", nValue, "DFFOPT-TEXT-FLAGS" ); break; - case 255: writeHexItem( "flags", nValue, "DFFOPT-TEXTGEO-FLAGS" ); break; - case 319: writeHexItem( "flags", nValue, "DFFOPT-PICTURE-FLAGS" ); break; - case 383: writeHexItem( "flags", nValue, "DFFOPT-GEO-FLAGS" ); break; - case 447: writeHexItem( "flags", nValue, "DFFOPT-FILL-FLAGS" ); break; - case 511: writeHexItem( "flags", nValue, "DFFOPT-LINE-FLAGS" ); break; - case 575: writeHexItem( "flags", nValue, "DFFOPT-SHADOW-FLAGS" ); break; - case 639: writeHexItem( "flags", nValue, "DFFOPT-PERSP-FLAGS" ); break; - case 703: writeHexItem( "flags", nValue, "DFFOPT-3DOBJ-FLAGS" ); break; - case 767: writeHexItem( "flags", nValue, "DFFOPT-3DSTYLE-FLAGS" ); break; - case 831: writeHexItem( "flags", nValue, "DFFOPT-SHAPE1-FLAGS" ); break; - case 895: writeHexItem( "flags", nValue, "DFFOPT-CALLOUT-FLAGS" ); break; - case 959: writeHexItem( "flags", nValue, "DFFOPT-SHAPE2-FLAGS" ); break; - default: writeHexItem( "value", nValue ); + out().startMultiItems(); + writeEmptyItem( "#complex-data" ); + writeHexItem( "id", aIt->mnId, "DFFOPT-PROPERTY-NAMES" ); + out().endMultiItems(); + IndentGuard aIndent( out() ); + switch( aIt->meType ) + { + case PROPTYPE_BINARY: + dumpBinary( aIt->maName, aIt->mnSize ); + break; + case PROPTYPE_STRING: + dumpUnicodeArray( aIt->maName, aIt->mnSize / 2, true ); + break; + case PROPTYPE_BLIP: + dumpBinary( aIt->maName, aIt->mnSize ); + break; + case PROPTYPE_COLORARRAY: + dumpBinary( aIt->maName, aIt->mnSize ); + break; + } } } +sal_uInt16 DffStreamObject::dumpDffOptPropHeader() +{ + MultiItemsGuard aMultiGuard( out() ); + TableGuard aTabGuard( out(), 11 ); + writeEmptyItem( "#prop" ); + return dumpHex< sal_uInt16 >( "id", "DFFOPT-PROPERTY-ID" ); +} + // ============================================================================ } // namespace dump diff --git a/oox/source/dump/dffdumper.ini b/oox/source/dump/dffdumper.ini index 9c3184b275e5..c33d733c6bd8 100644 --- a/oox/source/dump/dffdumper.ini +++ b/oox/source/dump/dffdumper.ini @@ -12,7 +12,7 @@ multilist=DFF-RECORD-NAMES 0xF010=DFFCLIENTANCHOR,DFFCLIENTDATA,DFFCONNECTORRULE,DFFALIGNRULE,DFFARCRULE,DFFCLIENTRULE,DFFCLASSID,DFFCALLOUTRULE # 0xF018-0xF117 reserved for pictures 0xF118=DFFREGROUPITEM,DFFSELECTION,DFFCOLORMRU,,,DFFDELETEDPSPL,DFFSPLITMENUCOLORS,DFFOLEOBJECT - 0xF120=DFFCOLORSCHEME,,DFFUSERDEFPROP + 0xF120=DFFCOLORSCHEME,DFFOPT2,DFFOPT3 end combilist=DFF-RECORD-INST @@ -25,13 +25,60 @@ constlist=DFF-RECORD-VERSION 15=container end -# DFFBSTORECONTAINER --------------------------------------------------------- +combilist=DFF-SIMPLE-COLOR + 0x000000FF=uint8,dec,red,,filter=0x10000000~0x00000000 + 0x0000FF00=uint8,dec,green,,filter=0x10000000~0x00000000 + 0x00FF0000=uint8,dec,blue,,filter=0x10000000~0x00000000 + 0x000000FF=uint8,dec,scheme-idx,,filter=0x10000000~0x10000000 + 0x10000000=!rgb!scheme + ignore=0x08000000 +end -combilist=DFFBSTORECONT-RECORD-INST - include=DFF-RECORD-INST - 0xFFF0=uint16,dec,blip-count +combilist=DFF-COLOR + 0x0000FFFF=uint16,dec,palette-idx,,filter=0xFF000000~0x01000000 + 0x000000FF=uint8,dec,red,,filter=0xF9000000~0x00000000 + 0x0000FF00=uint8,dec,green,,filter=0xF9000000~0x00000000 + 0x00FF0000=uint8,dec,blue,,filter=0xF9000000~0x00000000 + 0x000000FF=uint8,dec,scheme-idx,,filter=0xFF000000~0x08000000 + 0x0000FFFF=uint16,dec,system-idx,DFF-SYSTEMCOLOR,filter=0xFF000000~0x10000000 + 0x00FF0000=uint16,dec,mod-by,,filter=0xFF000000~0x10000000 + 0x01000000=palette-idx + 0x02000000=palette-rgb + 0x04000000=system-rgb + 0x08000000=scheme-idx + 0x10000000=system-idx +end + +combilist=DFF-SYSTEMCOLOR + 0x00FF=uint8,dec,color-id,DFF-SYSTEMCOLOR-ID + 0x0F00=uint8,dec,mod,DFF-SYSTEMCOLOR-MOD + 0x2000=invert-after + 0x4000=half-invert-after + 0x8000=grey-before +end + +constlist=DFF-SYSTEMCOLOR-ID + include=SYSTEMCOLOR + 0xF0=shape-fill + 0xF1=shape-line-or-fill + 0xF2=shape-line + 0xF3=shape-shadow + 0xF4=current-or-last-used + 0xF5=shape-fill-back + 0xF6=shape-line-back + 0xF7=shape-fill-or-line +end + +shortlist=DFF-SYSTEMCOLOR-MOD,0,none,darken-by,lighten-by,add-grey-by,sub-grey-by,reverse-sub-grey-by,monochrome-by + +combilist=DFF-COLORMOD + 0x00000300=uint8,dec,type,DFF-COLORMOD-TYPE + 0x00FF0000=uint8,dec,level + ignore=0x200000FF end +shortlist=DFF-COLORMOD-TYPE,0,none,shade,tint + # DFFBSE --------------------------------------------------------------------- combilist=DFFBSE-RECORD-INST @@ -46,50 +93,18 @@ end shortlist=DFFBSE-USAGE,0,default,texture -# DFFSP ---------------------------------------------------------------------- +# DFFBSTORECONTAINER --------------------------------------------------------- -combilist=DFFSP-RECORD-INST +combilist=DFFBSTORECONT-RECORD-INST include=DFF-RECORD-INST - 0xFFF0=uint16,dec,shape-type,DFFSP-TYPE + 0xFFF0=uint16,dec,blip-count end -multilist=DFFSP-TYPE - 0=not-primitive,rectangle,round-rectangle,ellipse,diamond,isoceles-triangle,right-triangle,parallelogram,trapezoid,hexagon - 10=octagon,plus,star,arrow,thick-arrow,home-plate,cube,balloon,seal,arc - 20=line,plaque,can,donut,text-simple,text-octagon,text-hexagon,text-curve,text-wave,text-ring - 30=text-on-curve,text-on-ring,straight-connector-1,bent-connector-2,bent-connector-3,bent-connector-4,bent-connector-5,curved-connector-2,curved-connector-3,curved-connector-4 - 40=curved-connector-5,callout-1,callout-2,callout-3,accent-callout-1,accent-callout-2,accent-callout-3,border-callout-1,border-callout-2,border-callout-3 - 50=accent-border-callout-1,accent-border-callout-2,accent-border-callout-3,ribbon,ribbon-2,chevron,pentagon,no-smoking,seal-8,seal-16 - 60=seal-32,wedge-rect-callout,wedge-rrect-callout,wedge-ellipse-callout,wave,folded-corner,left-arrow,down-arrow,up-arrow,left-right-arrow - 70=up-down-arrow,irregular-seal-1,irregular-seal-2,lightning-bolt,heart,picture-frame,quad-arrow,left-arrow-callout,right-arrow-callout,up-arrow-callout - 80=down-arrow-callout,left-right-arrow-callout,up-down-arrow-callout,quad-arrow-callout,bevel,left-bracket,right-bracket,left-brace,right-brace,left-up-arrow - 90=bent-up-arrow,bent-arrow,seal-24,striped-right-arrow,notched-right-arrow,block-arc,smiley-face,vertical-scroll,horizontal-scroll,circular-arrow - 100=notched-circular-arrow,uturn-arrow,curved-right-arrow,curved-left-arrow,curved-up-arrow,curved-down-arrow,cloud-callout,ellipse-ribbon,ellipse-ribbon-2,flow-chart-process - 110=flow-chart-decision,flow-chart-input-output,flow-chart-predefined-process,flow-chart-internal-storage,flow-chart-document,flow-chart-multidocument,flow-chart-terminator,flow-chart-preparation,flow-chart-manual-input,flow-chart-manual-operation - 120=flow-chart-connector,flow-chart-punched-card,flow-chart-punched-tape,flow-chart-summing-junction,flow-chart-or,flow-chart-collate,flow-chart-sort,flow-chart-extract,flow-chart-merge,flow-chart-offline-storage - 130=flow-chart-online-storage,flow-chart-magnetic-tape,flow-chart-magnetic-disk,flow-chart-magnetic-drum,flow-chart-display,flow-chart-delay,text-plain-text,text-stop,text-triangle,text-triangle-inverted - 140=text-chevron,text-chevron-inverted,text-ring-inside,text-ring-outside,text-arch-up-curve,text-arch-down-curve,text-circle-curve,text-button-curve,text-arch-up-pour,text-arch-down-pour - 150=text-circle-pour,text-button-pour,text-curve-up,text-curve-down,text-cascade-up,text-cascade-down,text-wave-1,text-wave-2,text-wave-3,text-wave-4 - 160=text-inflate,text-deflate,text-inflate-bottom,text-deflate-bottom,text-inflate-top,text-deflate-top,text-deflate-inflate,text-deflate-inflate-deflate,text-fade-right,text-fade-left - 170=text-fade-up,text-fade-down,text-slant-up,text-slant-down,text-can-up,text-can-down,flow-chart-alternate-process,flow-chart-offpage-connector,callout-90,accent-callout-90 - 180=border-callout-90,accent-border-callout-90,left-right-up-arrow,sun,moon,bracket-pair,brace-pair,seal-4,double-wave,action-button-blank - 190=action-button-home,action-button-help,action-button-information,action-button-forward-next,action-button-back-previous,action-button-end,action-button-beginning,action-button-return,action-button-document,action-button-sound - 200=action-button-movie,host-control,text-box -end +# DFFDG ---------------------------------------------------------------------- -flagslist=DFFSP-FLAGS - 0x00000001=group - 0x00000002=child - 0x00000004=patriarch - 0x00000008=deleted - 0x00000010=ole - 0x00000020=has-master - 0x00000040=flip-horizontal - 0x00000080=flip-vertical - 0x00000100=connector - 0x00000200=has-anchor - 0x00000400=background - 0x00000800=has-shape-type +combilist=DFFDG-RECORD-INST + include=DFF-RECORD-INST + 0xFFF0=uint16,dec,drawing-id end # DFFOPT --------------------------------------------------------------------- @@ -106,205 +121,530 @@ combilist=DFFOPT-PROPERTY-ID end multilist=DFFOPT-PROPERTY-NAMES - # transform - 0x0004=rotation - # protection - 0x007F=lock-flags - # text + # 0x0000-0x003F: transformation + 0x0000=transf-left,transf-top,transf-right,transf-bottom,transf-rotation,transf-page + 0x003F=transf-flags + # 0x0040-0x007F: protection + 0x007F=prot-flags + # 0x0080-0x00BF: text 0x0080=text-id,text-left,text-top,text-right,text-bottom,text-wrap-mode,text-scale,text-anchor-mode - 0x0088=text-flow,text-font-rotation,text-next-shape,text-bidi + 0x0088=text-flow,text-font-orient,text-next-shape,text-bidi 0x00BF=text-flags - # text geometry - 0x00C0=text-unicode-string,text-rtf-string,text-curve-align,text-def-size,text-spacing,text-font-family - 0x00FF=text-geometry-flags - # picture - 0x0100=pic-crop-top,pic-crop-bottom,pic-crop-left,pic-crop-right,pic-data,pic-file-name,pic-flags,pic-transparency-color - 0x0108=pic-contrast,pic-brightness,pic-gamma,pic-id,pic-double-cr-mod,pic-fill-cr-mod,pic-line-cr-mod,pic-data-print - 0x0110=pic-name-print,pic-flags-print - 0x013F=pic-flags - # geometry + # 0x00C0-0x00FF: text geometry + 0x00C0=textgeo-unicode-string,textgeo-rtf-string,textgeo-curve-align,textgeo-def-size,textgeo-spacing,textgeo-font,textgeo-css-font + 0x00FF=textgeo-flags + # 0x0100-0x013F: picture (BLIP) + 0x0100=blip-crop-top,blip-crop-bottom,blip-crop-left,blip-crop-right,blip-id,blip-name,blip-opt,blip-transparency-color + 0x0108=blip-contrast,blip-brightness,blip-gamma,blip-ole-id,blip-double-cr-mod,blip-fill-cr-mod,blip-line-cr-mod,blip-print-id + 0x0110=blip-print-name,blip-print-opt,blip-movie,,,blip-transparency-color-ext,,blip-transparency-color-ext-mod + 0x0118,,blip-recolor,blip-recolor,blip-recolor-ext,,blip-recolor-ext-mod + 0x013F=blip-flags + # 0x0140-0x017F: shape geometry 0x0140=geo-left,geo-top,geo-right,geo-bottom,geo-shape-path,geo-vertices,geo-segment-info,geo-adjust-1 - 0x0148=geo-adjust-2,geo-adjust-3,geo-adjust-4,geo-adjust-5,geo-adjust-6,geo-adjust-7,geo-adjust-8,geo-adjust-9 - 0x0150=geo-adjust-10,geo-connect-points,geo-stretch-x,geo-stretch-y,geo-handles,geo-formulas,geo-text-recs - 0x0158=geo-connector-type + 0x0148=geo-adjust-2,geo-adjust-3,geo-adjust-4,geo-adjust-5,geo-adjust-6,geo-adjust-7,geo-adjust-8, + 0x0150=,geo-connect-sites,geo-connect-sites-dir,geo-stretch-x,geo-stretch-y,geo-handles,geo-guides,geo-inscribe + 0x0158=geo-connect-points 0x017F=geo-flags - # fill style + # 0x0180-0x01BF: fill style 0x0180=fill-type,fill-color,fill-opacity,fill-back-color,fill-back-opacity,fill-cr-mod,fill-blip,fill-blip-name - 0x0188=fill-blip-flags,fill-width,fill-height,fill-angle,fill-focus,fill-to-left,fill-to-top,fill-to-right + 0x0188=fill-blip-opt,fill-width,fill-height,fill-angle,fill-focus,fill-to-left,fill-to-top,fill-to-right 0x0190=fill-to-bottom,fill-rect-left,fill-rect-top,fill-rect-right,fill-rect-bottom,fill-dz-type,fill-shade-preset,fill-shade-colors - 0x0198=fill-origin-x,fill-origin-y,fill-shape-origin-x,fill-shape-origin-y,fill-shade-type + 0x0198=fill-origin-x,fill-origin-y,fill-shape-origin-x,fill-shape-origin-y,fill-shade-type,,fill-color-ext, + 0x01A0=fill-color-ext-mod,,fill-back-color-ext,,fill-back-color-ext-mod 0x01BF=fill-flags - # line style - 0x01C0=line-color,line-opacity,line-back-color,line-cr-mod,line-type,line-fill-blip,line-fill-blip-name,line-fill-blip-flags + # 0x01C0-0x01FF: line style + 0x01C0=line-color,line-opacity,line-back-color,line-cr-mod,line-type,line-fill-blip,line-fill-blip-name,line-fill-blip-opt 0x01C8=line-fill-width,line-fill-height,line-fill-dz-type,line-width,line-miter-limit,line-style,line-dash,line-dash-style 0x01D0=line-start-arrow-head,line-end-arrow-head,line-start-arrow-width,line-start-arrow-length,line-end-arrow-width,line-end-arrow-length,line-join-style,line-end-cap-style + 0x01D8=,line-color-ext,,line-color-ext-mod,,line-back-color-ext,,line-back-color-ext-mod 0x01FF=line-flags - # shadow style + # 0x0200-0x023F: shadow style 0x0200=shadow-type,shadow-color,shadow-highlight,shadow-cr-mod,shadow-opacity,shadow-offset-x,shadow-offset-y,shadow-2nd-offset-x - 0x0208=shadow-2nd-offset-y,shadow-scale-x-to-x,shadow-scale-y-to-x,shadow-scale-x-to-y,shadow-scale-y-to-y,shadow-persp-x,shadow-persp-y,shadow-weight - 0x0210=shadow-origin-x,shadow-origin-y + 0x0208=shadow-2nd-offset-y,,,,,,, + 0x0210=shadow-origin-x,shadow-origin-y,shadow-color-ext,,shadow-color-ext-mod,,shadow-highlight-ext, + 0x0218=shadow-highlight-ext-mod 0x023F=shadow-flags - # perspective + # 0x0240-0x027F: perspective 0x0240=persp-type,persp-offset-x,persp-offsety,persp-scale-x-to-x,persp-scale-y-to-x,persp-scale-x-to-y,persp-scale-y-to-y,persp-persp-x 0x0248=persp-persp-y,persp-weight,persp-origin-x,persp-origin-y 0x027F=persp-flags - # 3d object + # 0x0280-0x02BF: 3d object 0x0280=3dobj-specular-amt,3dobj-diffuse-amt,3dobj-shininess,3dobj-edge-thickness,3dobj-extrude-forward,3dobj-extrude-backward,3dobj-extrude-plane,3dobj-extrusion-color - 0x0288=3dobj-cr-mod + 0x0288=3dobj-cr-mod,3dobj-extrusion-color-ext,,3dobj-extrusion-color-ext-mod 0x02BF=3dobj-flags - # 3d style + # 0x02C0-0x02FF: 3d style 0x02C0=3dstyle-y-rotation,3dstyle-x-rotation,3dstyle-rotation-axis-x,3dstyle-rotation-axis-y,3dstyle-rotation-axis-z,3dstyle-rotation,3dstyle-rotation-center-x,3dstyle-rotation-center-y 0x02C8=3dstyle-rotation-center-z,3dstyle-render-mode,3dstyle-tolerance,3dstyle-view-point-x,3dstyle-view-point-y,3dstyle-view-point-z,3dstyle-origin-x,3dstyle-origin-y 0x02D0=3dstyle-skew-angle,3dstyle-skew-amount,3dstyle-ambient-intensity,3dstyle-key-light-x,3dstyle-key-light-y,3dstyle-key-light-z,3dstyle-key-light-intensity,3dstyle-fill-light-x 0x02D8=3dstyle-fill-light-y,3dstyle-fill-light-z,3dstyle-fill-light-intensity 0x02FF=3dstyle-flags - # shape 1 - 0x0301=,shape-master,,shape-connect-style,shape-bw-mod,shape-bw-mode-pure-bw,shape-bw-mode-bw - 0x033F=shape1-flags - # callout - 0x0340=callout-type,callout-box-distance,callout-angle,callout-drop-type,callout-drop-distance,callout-length + # 0x0300-0x033F: shape + 0x0300=,shape-master,,shape-connect-style,shape-bw-mod,shape-bw-mode-pure-bw,shape-bw-mode-bw,shape-discuss-anchor-id + 0x0308=,shape-dia-layout,shape-dia-node-kind,shape-dia-layout-mru,shape-equation-xml + 0x033F=shape-flags + # 0x0340-0x037F: callout + 0x0340=callout-type,callout-box-distance,callout-angle,callout-drop-type,callout-drop-pos,callout-length 0x037F=callout-flags - # shape 2 - 0x0380=shape-name,shape-description,shape-hyperlink,shape-wrap-polygon-vertices,shape-wrap-left,shape-wrap-top,shape-wrap-right,shape-wrap-bottom - 0x0388=shape-regroup-id - 0x03BF=shape2-flags + # 0x0380-0x03BF: group or shape + 0x0380=group-name,group-description,group-hyperlink,group-wrap-polygon-vertices,group-wrap-left,group-wrap-top,group-wrap-right,group-wrap-bottom + 0x0388=group-regroup-id,,,,,group-tooltip,group-script,group-pos-h + 0x0390=group-pos-rel-h,group-pos-v,group-pos-rel-v,group-rel-width-hr,group-align-hr,group-height-hr,group-width-hr,group-script-ext-attr + 0x0398=group-script-lang,,group-script-lang-attr,group-border-top-color,group-border-left-color,group-border-bottom-color,group-border-right-color,group-table-props + 0x03A0=group-table-row-props,,,,,group-web-bot,, + 0x03A8=,group-metro-blob,group-rel-z-order, + 0x03BF=group-flags + # 0x03C0-0x03FF: relative transformation + 0x03C0=reltransf-left,reltransf-top,reltransf-right,reltransf-bottom,reltransf-rotation,reltransf-page + 0x03FF=reltransf-flags + # 0x0400-0x043F: unknown HTML + 0x0400=,,uhtml-line-id,uhtml-fill-id,uhtml-pic-id,uhtml-path-id,uhtml-shadow-id,uhtml-persp-id + 0x0408=uhtml-text-path-id,uhtml-formulae-id,uhtml-handles-id,uhtml-callout-id,uhtml-lock-id,uhtml-text-id,uhtml-3d-id + 0x043F=uhtml-flags + # 0x0500-0x053F: diagram + 0x0500=dia-type,dia-style,,,dia-rel-table,dia-scale-x,dia-scale-y,dia-def-fontsize + 0x0508=dia-constrain-bounds,dia-base-text-scale + 0x053F=dia-flags + # 0x0540-0x057F: left line style + 0x0540=lline-color,lline-opacity,lline-back-color,lline-cr-mod,lline-type,lline-fill-blip,lline-fill-blip-name,lline-fill-blip-opt + 0x0548=lline-fill-width,lline-fill-height,lline-fill-dz-type,lline-width,lline-miter-limit,lline-style,lline-dash,lline-dash-style + 0x0550=lline-start-arrow-head,lline-end-arrow-head,lline-start-arrow-width,lline-start-arrow-length,lline-end-arrow-width,lline-end-arrow-length,lline-join-style,lline-end-cap-style + 0x0558=,lline-color-ext,,lline-color-ext-mod,,lline-back-color-ext,,lline-back-color-ext-mod + 0x057F=lline-flags + # 0x0580-0x05BF: top line style + 0x0580=tline-color,tline-opacity,tline-back-color,tline-cr-mod,tline-type,tline-fill-blip,tline-fill-blip-name,tline-fill-blip-opt + 0x0588=tline-fill-width,tline-fill-height,tline-fill-dz-type,tline-width,tline-miter-limit,tline-style,tline-dash,tline-dash-style + 0x0590=tline-start-arrow-head,tline-end-arrow-head,tline-start-arrow-width,tline-start-arrow-length,tline-end-arrow-width,tline-end-arrow-length,tline-join-style,tline-end-cap-style + 0x0598=,tline-color-ext,,tline-color-ext-mod,,tline-back-color-ext,,tline-back-color-ext-mod + 0x05BF=tline-flags + # 0x05C0-0x05FF: right line style + 0x05C0=rline-color,rline-opacity,rline-back-color,rline-cr-mod,rline-type,rline-fill-blip,rline-fill-blip-name,rline-fill-blip-opt + 0x05C8=rline-fill-width,rline-fill-height,rline-fill-dz-type,rline-width,rline-miter-limit,rline-style,rline-dash,rline-dash-style + 0x05D0=rline-start-arrow-head,rline-end-arrow-head,rline-start-arrow-width,rline-start-arrow-length,rline-end-arrow-width,rline-end-arrow-length,rline-join-style,rline-end-cap-style + 0x05D8=,rline-color-ext,,rline-color-ext-mod,,rline-back-color-ext,,rline-back-color-ext-mod + 0x05FF=rline-flags + # 0x0600-0x063F: bottom line style + 0x0600=bline-color,bline-opacity,bline-back-color,bline-cr-mod,bline-type,bline-fill-blip,bline-fill-blip-name,bline-fill-blip-opt + 0x0608=bline-fill-width,bline-fill-height,bline-fill-dz-type,bline-width,bline-miter-limit,bline-style,bline-dash,bline-dash-style + 0x0610=bline-start-arrow-head,bline-end-arrow-head,bline-start-arrow-width,bline-start-arrow-length,bline-end-arrow-width,bline-end-arrow-length,bline-join-style,bline-end-cap-style + 0x0618=,bline-color-ext,,bline-color-ext-mod,,bline-back-color-ext,,bline-back-color-ext-mod + 0x063F=bline-flags + # 0x0680-0x06BF: web component + 0x0680=webcomp-html,webcomp-name,webcomp-url + 0x06BF=webcomp-flags + # 0x0700-0x073F: ink data + 0x0700=ink-data + 0x073F=ink-flags + # 0x0780-0x07BF: signature line + 0x0780=,sigline-guid,sigline-provider-guid,sigline-suggested-signer,sigline-suggested-signer-info,sigline-suggested-signer-email,sigline-sign-instruction,sigline-add-xml + 0x0788=sigline-provider-url + 0x07BF=sigline-flags + # 0x07C0-0x07FF: group or shape #2 + 0x07C0=group2-rel-width,group2-rel-height,group2-rel-pos-x,group2-rel-pos-y,group2-size-rel-h,group2-size-rel-v +end + +constlist=DFFOPT-SIMPLE-PROPERTIES + # transformation + 0x003F=uint32,hex,flags,DFFOPT-TRANSFORM-FLAGS + # protection + 0x007F=uint32,hex,flags,DFFOPT-PROTECTION-FLAGS + # text + 0x00BF=uint32,hex,flags,DFFOPT-TEXT-FLAGS + # text geometry + 0x00FF=uint32,hex,flags,DFFOPT-TEXTGEO-FLAGS + # picture (BLIP) + 0x013F=uint32,hex,flags,DFFOPT-BLIP-FLAGS + # shape geometry + 0x017F=uint32,hex,flags,DFFOPT-GEO-FLAGS + # fill style + 0x0180=uint32,dec,type,DFFOPT-FILL-TYPE + 0x0181=uint32,hex,color,DFF-COLOR + 0x0182=int32,fix,opacity,CONV-FLOAT-TO-PERC + 0x0183=uint32,hex,color,DFF-COLOR + 0x0184=int32,fix,opacity,DFF-OPACITY + 0x0185=uint32,hex,color,DFF-COLOR + 0x0186=uint32,dec,blip-id + 0x0188=uint32,dec,blip-opt,DFFOPT-BLIPOPT + 0x0189=int32,dec,width + 0x018A=int32,dec,height + 0x018B=int32,fix,angle,CONV-DEG + 0x018C=int32,dec,focus,CONV-PERCENT + 0x018D=int32,fix,size,CONV-FLOAT-TO-PERC + 0x018E=int32,fix,size,CONV-FLOAT-TO-PERC + 0x018F=int32,fix,size,CONV-FLOAT-TO-PERC + 0x0190=int32,fix,size,CONV-FLOAT-TO-PERC + 0x0191=int32,fix,size,CONV-EMU-TO-CM + 0x0192=int32,fix,size,CONV-EMU-TO-CM + 0x0193=int32,fix,size,CONV-EMU-TO-CM + 0x0194=int32,fix,size,CONV-EMU-TO-CM + 0x0195=uint32,dec,type,DFFOPT-FILL-DZTYPE + 0x0196=int32,dec,preset + 0x0198=int32,fix,pos,CONV-FLOAT-TO-PERC + 0x0199=int32,fix,pos,CONV-FLOAT-TO-PERC + 0x019A=int32,fix,pos,CONV-FLOAT-TO-PERC + 0x019B=int32,fix,pos,CONV-FLOAT-TO-PERC + 0x019C=uint32,hex,type,DFFOPT-FILL-SHADETYPE + 0x019E=uint32,hex,color,DFF-COLOR + 0x01A0=uint32,hex,color-mod,DFF-COLORMOD + 0x01A2=uint32,hex,color,DFF-COLOR + 0x01A4=uint32,hex,color-mod,DFF-COLORMOD + 0x01BF=uint32,hex,flags,DFFOPT-FILL-FLAGS + # line style + 0x01C0=uint32,hex,color,DFF-COLOR + 0x01C2=uint32,hex,color,DFF-COLOR + 0x01FF=uint32,hex,flags,DFFOPT-LINE-FLAGS + # shadow style + 0x0201=uint32,hex,color,DFF-COLOR + 0x023F=uint32,hex,flags,DFFOPT-SHADOW-FLAGS + # perspective + 0x027F=uint32,hex,flags,DFFOPT-PERSP-FLAGS + # 3d object + 0x02BF=uint32,hex,flags,DFFOPT-3DOBJ-FLAGS + # 3d style + 0x02FF=uint32,hex,flags,DFFOPT-3DSTYLE-FLAGS + # shape + 0x033F=uint32,hex,flags,DFFOPT-SHAPE-FLAGS + # callout + 0x037F=uint32,hex,flags,DFFOPT-CALLOUT-FLAGS + # group or shape + 0x03BF=uint32,hex,flags,DFFOPT-GROUP-FLAGS + # relative transformation + 0x03FF=uint32,hex,flags,DFFOPT-TRANSFORM-FLAGS + # unknown HTML + 0x043F=uint32,hex,flags,DFFOPT-UHTML-FLAGS + # diagram + 0x053F=uint32,hex,flags,DFFOPT-DIAGRAM-FLAGS + # left line style + 0x0540=uint32,hex,color,DFF-COLOR + 0x0542=uint32,hex,color,DFF-COLOR + 0x057F=uint32,hex,flags,DFFOPT-LINE-FLAGS + # top line style + 0x0580=uint32,hex,color,DFF-COLOR + 0x0582=uint32,hex,color,DFF-COLOR + 0x05BF=uint32,hex,flags,DFFOPT-LINE-FLAGS + # right line style + 0x05C0=uint32,hex,color,DFF-COLOR + 0x05C2=uint32,hex,color,DFF-COLOR + 0x05FF=uint32,hex,flags,DFFOPT-LINE-FLAGS + # bottom line style + 0x0600=uint32,hex,color,DFF-COLOR + 0x0602=uint32,hex,color,DFF-COLOR + 0x063F=uint32,hex,flags,DFFOPT-LINE-FLAGS + # web component + 0x06BF=uint32,hex,flags,DFFOPT-WEBCOMP-FLAGS + # ink data + 0x073F=uint32,hex,flags,DFFOPT-INK-FLAGS + # signature line + 0x07BF=uint32,hex,flags,DFFOPT-SIGLINE-FLAGS + # group or shape #2 +end + +constlist=DFFOPT-COMPLEX-PROPERTIES + 0x0186=uint32,hex,blip,blip + 0x0187=uint32,hex,blip-name,string + 0x0197=uint32,hex,shade-colors,colorarray + 0x0380=uint32,hex,shape-name,string +end + +# common + +combilist=DFFOPT-BLIPOPT + 0x00000003=uint8,dec,type,DFFOPT-BLIPOPT-TYPE + 0x00000004=do-not-save + 0x00000008=linked +end + +shortlist=DFFOPT-BLIPOPT-TYPE,0,comment,file,url + +# transformation + +flagslist=DFFOPT-TRANSFORM-FLAGS + 0x0001=:flip-h + 0x0002=:flip-v end -flagslist=DFFOPT-LOCK-FLAGS - 0x00000001=lock-against-grouping - 0x00000002=lock-adjust-handles - 0x00000004=lock-text - 0x00000008=lock-vertices - 0x00000010=lock-cropping - 0x00000020=lock-against-select - 0x00000040=lock-position - 0x00000080=lock-aspect-ratio - 0x00000100=lock-rotation - ignore=0xFFFF0000 +# protection + +flagslist=DFFOPT-PROTECTION-FLAGS + 0x0001=:lock-against-grouping + 0x0002=:lock-adjust-handles + 0x0004=:lock-text + 0x0008=:lock-vertices + 0x0010=:lock-cropping + 0x0020=:lock-against-select + 0x0040=:lock-position + 0x0080=:lock-aspect-ratio + 0x0100=:lock-rotation + 0x0200=:lock-against-ungrouping end +# text + flagslist=DFFOPT-TEXT-FLAGS - 0x00000001=fit-text-to-shape - 0x00000002=fit-shape-to-text - 0x00000004=rotate-text - 0x00000008=auto-text-margin - 0x00000010=select-text - ignore=0xFFFF0000 + 0x0002=:fit-shape-to-text + 0x0008=:auto-text-margin + 0x0010=:select-text + ignore=0x0005 end +# text geometry + flagslist=DFFOPT-TEXTGEO-FLAGS - 0x00000001=strike-through - 0x00000002=small-caps - 0x00000004=shadow - 0x00000008=underline - 0x00000010=italic - 0x00000020=bold - 0x00000040=no-measure-along-path - 0x00000080=stretch-height - 0x00000100=scale-on-path - 0x00000200=shrink-to-fit - 0x00000400=stretch-to-fit - 0x00000800=tightening - 0x00001000=kerning - 0x00002000=vertical - 0x00004000=has-effect - 0x00008000=reverse-rows - ignore=0xFFFF0000 -end - -flagslist=DFFOPT-PICTURE-FLAGS - 0x00000001=ole-alive - 0x00000002=bi-level-display - 0x00000004=grayscale - 0x00000008=no-hit-test - ignore=0xFFFF0000 + 0x0001=:strike-through + 0x0002=:small-caps + 0x0004=:shadow + 0x0008=:underline + 0x0010=:italic + 0x0020=:bold + 0x0040=:no-measure-along-path + 0x0080=:normalize + 0x0100=:best-fit + 0x0200=:shrink-to-fit + 0x0400=:stretch-to-fit + 0x0800=:tightening + 0x1000=:kerning + 0x2000=:vertical + 0x4000=:has-effect + 0x8000=:reverse-rows +end + +# picture (BLIP) + +flagslist=DFFOPT-BLIP-FLAGS + 0x0001=:ole-alive + 0x0002=:bi-level-display + 0x0004=:grayscale + 0x0008=:no-hit-test + 0x0010=:loop-anim + 0x0020=:rewind-anim + 0x0040=:preserve-gray end +# shape geometry + flagslist=DFFOPT-GEO-FLAGS - 0x00000001=fill-support - 0x00000002=fill-shade-shape-support - 0x00000004=fontwork-support - 0x00000008=line-support - 0x00000010=3d-support - 0x00000020=shadow-support - ignore=0xFFFF0000 + 0x0001=:fill-support + 0x0002=:fill-shade-shape-support + 0x0004=:fontwork-support + 0x0008=:line-support + 0x0010=:3d-support + 0x0020=:shadow-support +end + +# fill style + +shortlist=DFFOPT-FILL-TYPE,0,solid,pattern,texture,picture,edge-shade,linear-shade,shape-shade,point-shade,title-shade,background + +combilist=DFFOPT-FILL-DZTYPE + 0x00000003=uint8,dec,unit,DFFOPT-FILL-DZTYPE-UNIT + 0x0000000C=uint8,dec,aspect,DFFOPT-FILL-DZTYPE-ASPECT +end + +shortlist=DFFOPT-FILL-DZTYPE-UNIT,0,unused,emu,pixel,shape-size-rel +shortlist=DFFOPT-FILL-DZTYPE-ASPECT,0,none,fixed,prefer-largest + +flagslist=DFFOPT-FILL-SHADETYPE + 0x00000001=none + 0x00000002=gamma + 0x00000004=sigma-transfer + 0x00000008=flat-band + 0x00000010=one-color end flagslist=DFFOPT-FILL-FLAGS - 0x00000001=no-fill-hit-test - 0x00000002=use-large-rect - 0x00000004=register-pattern - 0x00000008=hit-test-fill - 0x00000010=has-fill - ignore=0xFFFF0000 + 0x0001=:no-fill-hit-test + 0x0002=:fill-to-rect + 0x0004=:fill-rel-to-shape + 0x0008=:hit-test-fill + 0x0010=:has-fill + 0x0020=:shape-anchor + 0x0040=:recolor-as-pic end +# line style + flagslist=DFFOPT-LINE-FLAGS - 0x00000001=draw-dash-for-invisible - 0x00000002=register-pattern - 0x00000004=hit-test-line - 0x00000008=has-line - 0x00000010=arrowhead-support - ignore=0xFFFF0000 + 0x0001=:draw-dash-for-invisible + 0x0002=:fill-rel-to-shape + 0x0004=:hit-test-line + 0x0008=:has-line + 0x0010=:arrowhead-support + 0x0020=:inset-pen-support + 0x0040=:inset-pen + 0x0200=:opaque-back-line end +# shadow style + flagslist=DFFOPT-SHADOW-FLAGS - 0x00000001=excel5-style - 0x00000002=has-shadow - ignore=0xFFFF0000 + 0x0001=:obscured-shadow + 0x0002=:has-shadow end +# perspective + flagslist=DFFOPT-PERSP-FLAGS - 0x00000001=has-perspective - ignore=0xFFFF0000 + 0x0001=:has-perspective end +# 3d object + flagslist=DFFOPT-3DOBJ-FLAGS - 0x00000001=light-face - 0x00000002=extrusion-color - 0x00000004=metallic - 0x00000008=has-3d - ignore=0xFFFF0000 + 0x0001=:light-face + 0x0002=:extrusion-color + 0x0004=:metallic + 0x0008=:has-3d end +# 3d style + flagslist=DFFOPT-3DSTYLE-FLAGS - 0x00000001=fill-color-harsh - 0x00000002=key-color-harsh - 0x00000004=parallel - 0x00000008=rotation-center-auto - 0x00000010=constrain-rotation - ignore=0xFFFF0000 + 0x0001=:fill-color-harsh + 0x0002=:key-color-harsh + 0x0004=:parallel + 0x0008=:rotation-center-auto + 0x0010=:constrain-rotation end -flagslist=DFFOPT-SHAPE1-FLAGS - 0x00000001=background - 0x00000002=delete-attached-object - 0x00000008=lock-shape-type - 0x00000010=prefer-rel-resize - 0x00000020=ole-iconified - ignore=0xFFFF0000 +# shape + +flagslist=DFFOPT-SHAPE-FLAGS + 0x0001=:background + 0x0004=:initiator + 0x0008=:lock-shape-type + 0x0010=:prefer-rel-resize + 0x0020=:ole-iconified + 0x0040=:flip-v-override + 0x0080=:flip-h-override + 0x0100=:policy-barcode + 0x0200=:policy-label end +# callout + flagslist=DFFOPT-CALLOUT-FLAGS - 0x00000001=length-specified - 0x00000002=drop-auto - 0x00000004=minus-y - 0x00000008=minus-x - 0x00000010=has-text-border - 0x00000020=has-accent-bar - 0x00000040=is-callout - ignore=0xFFFF0000 -end - -flagslist=DFFOPT-SHAPE2-FLAGS - 0x00000001=print - 0x00000002=hidden - 0x00000004=1d-adjustment - 0x00000008=action-attached - 0x00000010=notify-double-click - 0x00000020=behind-text - 0x00000040=wrap-edited - ignore=0xFFFF0000 + 0x0001=:length-specified + 0x0002=:drop-auto + 0x0004=:minus-y + 0x0008=:minus-x + 0x0010=:has-text-border + 0x0020=:has-accent-bar + 0x0040=:is-callout +end + +# group or shape + +flagslist=DFFOPT-GROUP-FLAGS + 0x0001=:print + 0x0002=:hidden + 0x0004=:1d-adjustment + 0x0008=:is-button + 0x0010=:notify-double-click + 0x0020=:behind-doc + 0x0040=:wrap-edited + 0x0080=:script-anchor + 0x0100=:really-hidden + 0x0200=:allow-overlap + 0x0400=:user-drawn + 0x0800=:is-hr + 0x1000=:no-shade-hr + 0x2000=:standard-hr + 0x4000=:is-bullet + 0x8000=:layout-in-cell +end + +# unknown HTML + +flagslist=DFFOPT-UHTML-FLAGS + 0x0002=:fake-master + 0x0004=:ole-from-html +end + +# diagram + +flagslist=DFFOPT-DIAGRAM-FLAGS + 0x0001=:pseudo-inline + 0x0002=:do-layout + 0x0004=:reverse + 0x0008=:do-format +end + +# web component + +flagslist=DFFOPT-WEBCOMP-FLAGS + 0x0001=:is-web-component +end + +# ink data + +flagslist=DFFOPT-INK-FLAGS + 0x0001=:render-ink + 0x0002=:render-shape + 0x0004=:hit-test-ink + 0x0008=:ink-annotation +end + +# signature line + +flagslist=DFFOPT-SIGLINE-FLAGS + 0x0001=:is-signature-line + 0x0002=:show-sign-instruction + 0x0004=:show-sign-comment + 0x0008=:show-sign-date +end + +# group or shape #2 + +# DFFSP ---------------------------------------------------------------------- + +combilist=DFFSP-RECORD-INST + include=DFF-RECORD-INST + 0xFFF0=uint16,dec,shape-type,DFFSP-TYPE +end + +multilist=DFFSP-TYPE + 0=not-primitive,rectangle,round-rectangle,ellipse,diamond,isoceles-triangle,right-triangle,parallelogram,trapezoid,hexagon + 10=octagon,plus,star,arrow,thick-arrow,home-plate,cube,balloon,seal,arc + 20=line,plaque,can,donut,text-simple,text-octagon,text-hexagon,text-curve,text-wave,text-ring + 30=text-on-curve,text-on-ring,straight-connector-1,bent-connector-2,bent-connector-3,bent-connector-4,bent-connector-5,curved-connector-2,curved-connector-3,curved-connector-4 + 40=curved-connector-5,callout-1,callout-2,callout-3,accent-callout-1,accent-callout-2,accent-callout-3,border-callout-1,border-callout-2,border-callout-3 + 50=accent-border-callout-1,accent-border-callout-2,accent-border-callout-3,ribbon,ribbon-2,chevron,pentagon,no-smoking,seal-8,seal-16 + 60=seal-32,wedge-rect-callout,wedge-rrect-callout,wedge-ellipse-callout,wave,folded-corner,left-arrow,down-arrow,up-arrow,left-right-arrow + 70=up-down-arrow,irregular-seal-1,irregular-seal-2,lightning-bolt,heart,picture-frame,quad-arrow,left-arrow-callout,right-arrow-callout,up-arrow-callout + 80=down-arrow-callout,left-right-arrow-callout,up-down-arrow-callout,quad-arrow-callout,bevel,left-bracket,right-bracket,left-brace,right-brace,left-up-arrow + 90=bent-up-arrow,bent-arrow,seal-24,striped-right-arrow,notched-right-arrow,block-arc,smiley-face,vertical-scroll,horizontal-scroll,circular-arrow + 100=notched-circular-arrow,uturn-arrow,curved-right-arrow,curved-left-arrow,curved-up-arrow,curved-down-arrow,cloud-callout,ellipse-ribbon,ellipse-ribbon-2,flow-chart-process + 110=flow-chart-decision,flow-chart-input-output,flow-chart-predefined-process,flow-chart-internal-storage,flow-chart-document,flow-chart-multidocument,flow-chart-terminator,flow-chart-preparation,flow-chart-manual-input,flow-chart-manual-operation + 120=flow-chart-connector,flow-chart-punched-card,flow-chart-punched-tape,flow-chart-summing-junction,flow-chart-or,flow-chart-collate,flow-chart-sort,flow-chart-extract,flow-chart-merge,flow-chart-offline-storage + 130=flow-chart-online-storage,flow-chart-magnetic-tape,flow-chart-magnetic-disk,flow-chart-magnetic-drum,flow-chart-display,flow-chart-delay,text-plain-text,text-stop,text-triangle,text-triangle-inverted + 140=text-chevron,text-chevron-inverted,text-ring-inside,text-ring-outside,text-arch-up-curve,text-arch-down-curve,text-circle-curve,text-button-curve,text-arch-up-pour,text-arch-down-pour + 150=text-circle-pour,text-button-pour,text-curve-up,text-curve-down,text-cascade-up,text-cascade-down,text-wave-1,text-wave-2,text-wave-3,text-wave-4 + 160=text-inflate,text-deflate,text-inflate-bottom,text-deflate-bottom,text-inflate-top,text-deflate-top,text-deflate-inflate,text-deflate-inflate-deflate,text-fade-right,text-fade-left + 170=text-fade-up,text-fade-down,text-slant-up,text-slant-down,text-can-up,text-can-down,flow-chart-alternate-process,flow-chart-offpage-connector,callout-90,accent-callout-90 + 180=border-callout-90,accent-border-callout-90,left-right-up-arrow,sun,moon,bracket-pair,brace-pair,seal-4,double-wave,action-button-blank + 190=action-button-home,action-button-help,action-button-information,action-button-forward-next,action-button-back-previous,action-button-end,action-button-beginning,action-button-return,action-button-document,action-button-sound + 200=action-button-movie,host-control,text-box +end + +flagslist=DFFSP-FLAGS + 0x00000001=group + 0x00000002=child + 0x00000004=patriarch + 0x00000008=deleted + 0x00000010=ole + 0x00000020=has-master + 0x00000040=flip-horizontal + 0x00000080=flip-vertical + 0x00000100=connector + 0x00000200=has-anchor + 0x00000400=background + 0x00000800=has-shape-type +end + +# DFFSPLITMENUCOLORS --------------------------------------------------------- + +combilist=DFFSPLITMENUC-RECORD-INST + include=DFF-RECORD-INST + 0xFFF0=uint16,dec,color-count end # ============================================================================ diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index 6d834e04c487..8e0e9a4e1225 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -772,6 +772,14 @@ OUString StringHelper::trimSpaces( const OUString& rStr ) return rStr.copy( nBeg, nEnd - nBeg ); } +OUString StringHelper::trimTrailingNul( const OUString& rStr ) +{ + sal_Int32 nLastPos = rStr.getLength() - 1; + if( (nLastPos >= 0) && (rStr[ nLastPos ] == 0) ) + return rStr.copy( 0, nLastPos ); + return rStr; +} + OString StringHelper::convertToUtf8( const OUString& rStr ) { return OUStringToOString( rStr, RTL_TEXTENCODING_UTF8 ); @@ -888,6 +896,25 @@ bool StringHelper::convertStringToBool( const OUString& rData ) return convertStringToInt( nData, rData ) && (nData != 0); } +OUStringPair StringHelper::convertStringToPair( const OUString& rString, sal_Unicode cSep ) +{ + OUStringPair aPair; + if( rString.getLength() > 0 ) + { + sal_Int32 nEqPos = rString.indexOf( cSep ); + if( nEqPos < 0 ) + { + aPair.first = rString; + } + else + { + aPair.first = StringHelper::trimSpaces( rString.copy( 0, nEqPos ) ); + aPair.second = StringHelper::trimSpaces( rString.copy( nEqPos + 1 ) ); + } + } + return aPair; +} + void StringHelper::convertStringToStringList( OUStringVector& orVec, const OUString& rData, bool bIgnoreEmpty ) { orVec.clear(); @@ -1067,25 +1094,11 @@ ConfigItemBase::LineType ConfigItemBase::readConfigLine( } } - LineType eResult = LINETYPE_END; - if( aLine.getLength() > 0 ) - { - sal_Int32 nEqPos = aLine.indexOf( '=' ); - if( nEqPos < 0 ) - { - orKey = aLine; - } - else - { - orKey = StringHelper::trimSpaces( aLine.copy( 0, nEqPos ) ); - orData = StringHelper::trimSpaces( aLine.copy( nEqPos + 1 ) ); - } - - if( (orKey.getLength() > 0) && ((orData.getLength() > 0) || !orKey.equalsAscii( "end" )) ) - eResult = LINETYPE_DATA; - } - - return eResult; + OUStringPair aPair = StringHelper::convertStringToPair( aLine ); + orKey = aPair.first; + orData = aPair.second; + return ((orKey.getLength() > 0) && ((orData.getLength() > 0) || !orKey.equalsAscii( "end" ))) ? + LINETYPE_DATA : LINETYPE_END; } ConfigItemBase::LineType ConfigItemBase::readConfigLine( const ConfigInputStreamRef& rxStrm ) const @@ -1176,6 +1189,15 @@ void NameListBase::exclude( const OUString& rKeys ) // ============================================================================ +void ItemFormatMap::insertFormats( const NameListRef& rxNameList ) +{ + if( Base::isValid( rxNameList ) ) + for( NameListBase::const_iterator aIt = rxNameList->begin(), aEnd = rxNameList->end(); aIt != aEnd; ++aIt ) + (*this)[ aIt->first ].parse( aIt->second ); +} + +// ============================================================================ + ConstList::ConstList( const SharedConfigData& rCfgData ) : NameListBase( rCfgData ), maDefName( OOX_DUMP_ERR_NONAME ), @@ -1283,46 +1305,57 @@ void FlagsList::implProcessConfigItemStr( void FlagsList::implSetName( sal_Int64 nKey, const OUString& rName ) { - insertRawName( nKey, rName ); + if( (nKey != 0) && ((nKey & (nKey - 1)) == 0) ) // only a single bit set? + insertRawName( nKey, rName ); } OUString FlagsList::implGetName( const Config& /*rCfg*/, sal_Int64 nKey ) const { - sal_Int64 nFlags = nKey; - setFlag( nFlags, mnIgnore, false ); - sal_Int64 nFound = 0; + sal_Int64 nFound = mnIgnore; OUStringBuffer aName; // add known flags for( const_iterator aIt = begin(), aEnd = end(); aIt != aEnd; ++aIt ) { sal_Int64 nMask = aIt->first; - const OUString& rFlagName = aIt->second; - bool bNegated = (rFlagName.getLength() > 0) && (rFlagName[ 0 ] == '!'); - sal_Int32 nBothSep = bNegated ? rFlagName.indexOf( '!', 1 ) : -1; - bool bFlag = getFlag( nFlags, nMask ); - if( bFlag ) - { - if( !bNegated ) - StringHelper::appendToken( aName, rFlagName ); - else if( nBothSep > 0 ) - StringHelper::appendToken( aName, rFlagName.copy( nBothSep + 1 ) ); - } - else if( bNegated ) + setFlag( nFound, nMask ); + if( !getFlag( mnIgnore, nMask ) ) { - if( nBothSep > 0 ) - StringHelper::appendToken( aName, rFlagName.copy( 1, nBothSep - 1 ) ); - else + const OUString& rFlagName = aIt->second; + bool bOnOff = (rFlagName.getLength() > 0) && (rFlagName[ 0 ] == ':'); + bool bFlag = getFlag( nKey, nMask ); + if( bOnOff ) + { StringHelper::appendToken( aName, rFlagName.copy( 1 ) ); + aName.appendAscii( bFlag ? ":on" : ":off" ); + } + else + { + bool bNegated = (rFlagName.getLength() > 0) && (rFlagName[ 0 ] == '!'); + sal_Int32 nBothSep = bNegated ? rFlagName.indexOf( '!', 1 ) : -1; + if( bFlag ) + { + if( !bNegated ) + StringHelper::appendToken( aName, rFlagName ); + else if( nBothSep > 0 ) + StringHelper::appendToken( aName, rFlagName.copy( nBothSep + 1 ) ); + } + else if( bNegated ) + { + if( nBothSep > 0 ) + StringHelper::appendToken( aName, rFlagName.copy( 1, nBothSep - 1 ) ); + else + StringHelper::appendToken( aName, rFlagName.copy( 1 ) ); + } + } } - setFlag( nFound, nMask ); } // add unknown flags - setFlag( nFlags, nFound, false ); - if( nFlags != 0 ) + setFlag( nKey, nFound, false ); + if( nKey != 0 ) { OUStringBuffer aUnknown( CREATE_OUSTRING( OOX_DUMP_UNKNOWN ) ); aUnknown.append( OOX_DUMP_ITEMSEP ); - StringHelper::appendShortHex( aUnknown, nFlags, true ); + StringHelper::appendShortHex( aUnknown, nKey, true ); StringHelper::enclose( aUnknown, '(', ')' ); StringHelper::appendToken( aName, aUnknown.makeStringAndClear() ); } @@ -1342,6 +1375,11 @@ void FlagsList::implIncludeList( const NameListBase& rList ) // ============================================================================ +bool CombiList::ExtItemFormatKey::operator<( const ExtItemFormatKey& rRight ) const +{ + return (mnKey < rRight.mnKey) || ((mnKey == rRight.mnKey) && (maFilter < rRight.maFilter)); +} + CombiList::CombiList( const SharedConfigData& rCfgData ) : FlagsList( rCfgData ) { @@ -1351,9 +1389,34 @@ void CombiList::implSetName( sal_Int64 nKey, const OUString& rName ) { if( (nKey & (nKey - 1)) != 0 ) // more than a single bit set? { - ExtItemFormat& rItemFmt = maFmtMap[ nKey ]; - OUStringVector aRemain = rItemFmt.parse( rName ); - rItemFmt.mbShiftValue = aRemain.empty() || !aRemain.front().equalsAscii( "noshift" ); + typedef ::std::set< ExtItemFormatKey > ExtItemFormatKeySet; + ::std::set< ExtItemFormatKey > aItemKeys; + ExtItemFormat aItemFmt; + OUStringVector aRemain = aItemFmt.parse( rName ); + for( OUStringVector::iterator aIt = aRemain.begin(), aEnd = aRemain.end(); aIt != aEnd; ++aIt ) + { + OUStringPair aPair = StringHelper::convertStringToPair( *aIt ); + if( aPair.first.equalsAscii( "noshift" ) ) + { + aItemFmt.mbShiftValue = StringHelper::convertStringToBool( aPair.second ); + } + else if( aPair.first.equalsAscii( "filter" ) ) + { + OUStringPair aFilter = StringHelper::convertStringToPair( aPair.second, '~' ); + ExtItemFormatKey aKey( nKey ); + if( (aFilter.first.getLength() > 0) && StringHelper::convertStringToInt( aKey.maFilter.first, aFilter.first ) && + (aFilter.second.getLength() > 0) && StringHelper::convertStringToInt( aKey.maFilter.second, aFilter.second ) ) + { + if( aKey.maFilter.first == 0 ) + aKey.maFilter.second = 0; + aItemKeys.insert( aKey ); + } + } + } + if( aItemKeys.empty() ) + aItemKeys.insert( ExtItemFormatKey( nKey ) ); + for( ExtItemFormatKeySet::iterator aIt = aItemKeys.begin(), aEnd = aItemKeys.end(); aIt != aEnd; ++aIt ) + maFmtMap[ *aIt ] = aItemFmt; } else { @@ -1363,18 +1426,18 @@ void CombiList::implSetName( sal_Int64 nKey, const OUString& rName ) OUString CombiList::implGetName( const Config& rCfg, sal_Int64 nKey ) const { - sal_Int64 nFlags = nKey; sal_Int64 nFound = 0; OUStringBuffer aName; // add known flag fields for( ExtItemFormatMap::const_iterator aIt = maFmtMap.begin(), aEnd = maFmtMap.end(); aIt != aEnd; ++aIt ) { - sal_Int64 nMask = aIt->first; - if( nMask != 0 ) + const ExtItemFormatKey& rMapKey = aIt->first; + sal_Int64 nMask = rMapKey.mnKey; + if( (nMask != 0) && ((nKey & rMapKey.maFilter.first) == rMapKey.maFilter.second) ) { const ExtItemFormat& rItemFmt = aIt->second; - sal_uInt64 nUFlags = static_cast< sal_uInt64 >( nFlags ); + sal_uInt64 nUFlags = static_cast< sal_uInt64 >( nKey ); sal_uInt64 nUMask = static_cast< sal_uInt64 >( nMask ); if( rItemFmt.mbShiftValue ) while( (nUMask & 1) == 0 ) { nUFlags >>= 1; nUMask >>= 1; } @@ -1411,8 +1474,8 @@ OUString CombiList::implGetName( const Config& rCfg, sal_Int64 nKey ) const setFlag( nFound, nMask ); } } - setFlag( nFlags, nFound, false ); - StringHelper::appendToken( aName, FlagsList::implGetName( rCfg, nFlags ) ); + setFlag( nKey, nFound, false ); + StringHelper::appendToken( aName, FlagsList::implGetName( rCfg, nKey ) ); return aName.makeStringAndClear(); } @@ -2627,7 +2690,7 @@ sal_Unicode InputObjectBase::dumpUnicode( const String& rName ) return cChar; } -OUString InputObjectBase::dumpCharArray( const String& rName, sal_Int32 nLen, rtl_TextEncoding eTextEnc ) +OUString InputObjectBase::dumpCharArray( const String& rName, sal_Int32 nLen, rtl_TextEncoding eTextEnc, bool bHideTrailingNul ) { sal_Int32 nDumpSize = getLimitedValue< sal_Int32, sal_Int64 >( mxStrm->getLength() - mxStrm->tell(), 0, nLen ); OUString aString; @@ -2638,16 +2701,20 @@ OUString InputObjectBase::dumpCharArray( const String& rName, sal_Int32 nLen, rt aBuffer[ nCharsRead ] = 0; aString = OStringToOUString( OString( &aBuffer.front() ), eTextEnc ); } + if( bHideTrailingNul ) + aString = StringHelper::trimTrailingNul( aString ); writeStringItem( rName( "text" ), aString ); return aString; } -OUString InputObjectBase::dumpUnicodeArray( const String& rName, sal_Int32 nLen ) +OUString InputObjectBase::dumpUnicodeArray( const String& rName, sal_Int32 nLen, bool bHideTrailingNul ) { OUStringBuffer aBuffer; for( sal_Int32 nIndex = 0; !mxStrm->isEof() && (nIndex < nLen); ++nIndex ) aBuffer.append( static_cast< sal_Unicode >( mxStrm->readuInt16() ) ); OUString aString = aBuffer.makeStringAndClear(); + if( bHideTrailingNul ) + aString = StringHelper::trimTrailingNul( aString ); writeStringItem( rName( "text" ), aString ); return aString; } @@ -3059,12 +3126,7 @@ bool RecordObjectBase::implIsValid() const void RecordObjectBase::implDump() { NameListRef xRecNames = getRecNames(); - - typedef ::std::map< sal_Int64, ItemFormat > ItemFormatMap; - ItemFormatMap aSimpleRecs; - if( NameListBase* pSimpleRecs = maSimpleRecs.getNameList( cfg() ).get() ) - for( NameListBase::const_iterator aIt = pSimpleRecs->begin(), aEnd = pSimpleRecs->end(); aIt != aEnd; ++aIt ) - aSimpleRecs[ aIt->first ].parse( aIt->second ); + ItemFormatMap aSimpleRecs( maSimpleRecs.getNameList( cfg() ) ); while( implStartRecord( *mxBaseStrm, mnRecPos, mnRecId, mnRecSize ) ) { diff --git a/oox/source/dump/dumperbase.ini b/oox/source/dump/dumperbase.ini index 99603e12e560..84d742c2b35f 100644 --- a/oox/source/dump/dumperbase.ini +++ b/oox/source/dump/dumperbase.ini @@ -164,7 +164,7 @@ show-record-position=0 # include = <LISTNAME>[,<LISTNAME>...] # exclude = <bitfield>[,<bitfield>...] # ignore = <bitfield> -# <bitmask> = <constname> | !<constname> | !<constname0>!<constname1> +# <bitmask> = <cname> | !<cname> | :<cname> | !<cname0>!<cname1> # end # # - include (optional): See constlist above. @@ -173,10 +173,14 @@ show-record-position=0 # name and not set in this declaration will be shown as unknown. Default is # to not ignore a bit. # - <bitmask>: The bit to be named. Must be a value with a single bit set. -# - <constname>: sets a name for the bit that will be shown if it is set. -# - !<constname>: sets a name for the bit that will be shown if it is cleared. -# - !<constname0>!<constname1>: sets a name for the cleared bit (constname0), -# and for the set bit (constname1). +# - <cname> - Sets a name for the bit that will be shown if the bit is set. +# Does not show anything if the bit is cleared. +# - !<cname> - Sets a name for the bit that will be shown if the bit is +# cleared. Does not show anything if the bit is set. +# - :<cname> - Sets a name for the bit that will always be shown together +# with the actual state of the bit, appended as ':on' or ':off'. +# - !<cname0>!<cname1> - Sets a name for both the cleared bit (cname0), and +# for the set bit (cname1). # # ---------------------------------------------------------------------------- # @@ -191,8 +195,8 @@ show-record-position=0 # include = <LISTNAME>[,<LISTNAME>...] # exclude = <bitmask>[,<bitmask>...] # ignore = <bitfield> -# <bitmask> = <constname> | !<constname> | !<constname0>!<constname1> -# <bitfield> = <datatype>,<dataformat>,<bitfieldname>[,<LISTNAME>[,noshift]] +# <bitmask> = <cname> | !<cname> | :<cname> | !<cname0>!<cname1> +# <bitfield> = <datatype>,<dataformat>,<bitfieldname>[,<LISTNAME>[,options...]] # end # # - include (optional): See constlist above. @@ -206,7 +210,17 @@ show-record-position=0 # - <bitfieldname>: The name of the embedded bitfield. # - <LISTAME>: Optional name list with names for the values of the embedded # bitfield. -# - noshift: If set, the extracted value is not shifted to the right. +# - options: Additional options for this bitfield: +# - filter = <filterbitfield>~<filtervalue>: If set, the entire bitfield +# will only be written, if the complete data item currently dumped +# contains exactly the value specified in <filtervalue> in the bitfield +# specified in <filterbitfield>. Otherwise, nothing is written. It is +# possible to specify multiple filter rules for this bitfield. In that +# case, the bitfield will be written, if at least one filter rule +# applies for the current data item. +# - noshift = <bool>: If set to 'true', the extracted value will be +# shifted to the right (normalized). If set to 'false', the value will +# be written unshifted. Default is 'true'. # # ---------------------------------------------------------------------------- # @@ -230,6 +244,7 @@ unitconverter=CONV-PT-TO-CM,/28.346457,cm unitconverter=CONV-PT1616-TO-CM,/1857713.4,cm unitconverter=CONV-TWIP-TO-CM,/566.92913,cm unitconverter=CONV-TWIP-TO-PT,/20,pt +unitconverter=CONV-EMU-TO-CM,/36000,cm constlist=BOOLEAN 0=FALSE @@ -239,7 +254,7 @@ end combilist=RK-FLAGS 0x00000001=div-100 0x00000002=integer - 0xFFFFFFFC=int32,dec,value + 0xFFFFFFFC=int32,dec,value,,filter=0x2~0x2 end constlist=CHARSET @@ -370,5 +385,12 @@ multilist=COUNTRY 980=,iran end +multilist=SYSTEMCOLOR + 0x00=scrollbar,desktop,active-title,inactive-title,menu,window-back,window-frame,menu-text + 0x08=window-text,active-title-text,active-border,inactive-border,app-workspace,highlight,highlight-text,button-face + 0x10=button-shadow,disabled-text,button-text,inactive-title-text,button-highlight,button-dark-shadow,button-light-shadow,tooltip-text + 0x18=tooltip-back,,hot-light,active-title-2,inactive-title-2,menu-highlight,menubar +end + # ============================================================================ diff --git a/oox/source/dump/oledumper.cxx b/oox/source/dump/oledumper.cxx index 30b4fb67436b..b7750d4113b8 100644 --- a/oox/source/dump/oledumper.cxx +++ b/oox/source/dump/oledumper.cxx @@ -671,15 +671,7 @@ sal_uInt32 OcxPropertyObjectBase::dumpColorProperty( sal_uInt32 nDefault ) { MultiItemsGuard aMultiGuard( out() ); alignInput< sal_uInt32 >(); - sal_uInt32 nColor = dumpHex< sal_uInt32 >( getPropertyName(), "OCX-COLOR" ); - switch( extractValue< sal_uInt8 >( nColor, 24, 8 ) ) - { - case 0x00: writeColorABGRItem( "rgb", extractValue< sal_Int32 >( nColor, 0, 24 ) ); break; - case 0x01: writeDecItem( "palette-index", extractValue< sal_uInt16 >( nColor, 0, 16 ) ); break; - case 0x02: writeColorABGRItem( "rgb", extractValue< sal_Int32 >( nColor, 0, 24 ) ); break; - case 0x80: writeDecItem( "sys-color", extractValue< sal_uInt16 >( nColor, 0, 16 ), "OCX-SYSTEMCOLOR" ); break; - } - return nColor; + return dumpHex< sal_uInt32 >( getPropertyName(), "OCX-COLOR" ); } return nDefault; } diff --git a/oox/source/dump/oledumper.ini b/oox/source/dump/oledumper.ini index 96433d63c7fa..c398b0c01e51 100644 --- a/oox/source/dump/oledumper.ini +++ b/oox/source/dump/oledumper.ini @@ -115,8 +115,12 @@ end {0713E8D2-850A-101B-AFC0-4210102A8DA7}=COMCTL.ProgCtrl.1 combilist=OCX-COLOR + 0x0000FFFF=uint32,dec,palette-index,,filter=0xFF000000~0x01000000 + 0x000000FF=uint32,dec,red,,filter=0xFF000000~0x00000000,filter=0xFF000000~0x02000000 + 0x0000FF00=uint32,dec,green,,filter=0xFF000000~0x00000000,filter=0xFF000000~0x02000000 + 0x00FF0000=uint32,dec,blue,,filter=0xFF000000~0x00000000,filter=0xFF000000~0x02000000 + 0x0000FFFF=uint32,dec,system-color,SYSTEMCOLOR,filter=0xFF000000~0x80000000 0xFF000000=uint8,dec,type,OCX-COLORTYPE - 0x00FFFFFF=uint32,hex,value end constlist=OCX-COLORTYPE @@ -126,13 +130,6 @@ constlist=OCX-COLORTYPE 0x80=system-color end -multilist=OCX-SYSTEMCOLOR - 0x00=scrollbar,desktop,active-title,inactive-title,menubar,window-back,window-frame,menu-text - 0x08=window-text,active-title-text,active-border,inactive-border,app-workspace,highlight,highlight-text,button-face - 0x10=button-shadow,disabled-text,button-text,inactive-title-text,button-highlight,button-dark-shadow,button-light-shadow,tooltip-text - 0x18=tooltip-back -end - combilist=OCX-STRINGLEN 0x80000000=!unicode!compressed 0x7FFFFFFF=int32,dec,buffer-size @@ -543,16 +540,6 @@ flagslist=OCX-FORMSITE-FLAGS 0x00040000=container end -combilist=OCX-FORMSITE-CLASSIDCACHE - 0x7FFF=uint16,dec,cache-idx,OCX-FORMSITE-CLASSIDCACHEINDEX - 0x8000=!predefined-class-id!class-table-index -end - -constlist=OCX-FORMSITE-CLASSIDCACHEINDEX - default= - 0x7FFF=invalid -end - constlist=OCX-FORMSITE-CLASSNAMES 7=Forms.Form.1 12=Forms.Image.1 @@ -572,6 +559,17 @@ constlist=OCX-FORMSITE-CLASSNAMES 57=Forms.MultiPage.1 end +constlist=OCX-FORMSITE-CLASSIDCACHEINDEX + include=OCX-FORMSITE-CLASSNAMES + 0x7FFF=invalid +end + +combilist=OCX-FORMSITE-CLASSIDCACHE + 0x7FFF=uint16,dec,cache-idx,OCX-FORMSITE-CLASSIDCACHEINDEX,filter=0x8000~0x0000 + 0x7FFF=uint16,dec,class-table-idx,,filter=0x8000~0x8000 + 0x8000=!predefined-class-id!class-table-index +end + # form design extender ------------------------------------------------------ flagslist=OCX-FORMDESIGNEXT-PROPERTIES diff --git a/oox/source/ppt/pptshape.cxx b/oox/source/ppt/pptshape.cxx index 534a207a6e58..016857161696 100644 --- a/oox/source/ppt/pptshape.cxx +++ b/oox/source/ppt/pptshape.cxx @@ -64,7 +64,7 @@ PPTShape::~PPTShape() void PPTShape::addShape( const oox::core::XmlFilterBase& rFilterBase, const SlidePersist& rSlidePersist, - const oox::drawingml::ThemePtr& rxTheme, + const oox::drawingml::Theme* pTheme, const Reference< XShapes >& rxShapes, const awt::Rectangle* pShapeRect, ::oox::drawingml::ShapeIdMap* pShapeMap ) @@ -159,7 +159,7 @@ void PPTShape::addShape( aMasterTextListStyle = rSlidePersist.getMasterPersist().get() ? rSlidePersist.getMasterPersist()->getOtherTextStyle() : rSlidePersist.getOtherTextStyle(); setMasterTextListStyle( aMasterTextListStyle ); - Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, rxTheme, rxShapes, pShapeRect, bClearText ) ); + Reference< XShape > xShape( createAndInsert( rFilterBase, sServiceName, pTheme, rxShapes, pShapeRect, bClearText ) ); if ( !rSlidePersist.isMasterPage() && rSlidePersist.getPage().is() && ( (sal_Int32)mnSubType == XML_title ) ) { try @@ -185,7 +185,7 @@ void PPTShape::addShape( // if this is a group shape, we have to add also each child shape Reference< XShapes > xShapes( xShape, UNO_QUERY ); if ( xShapes.is() ) - addChildren( rFilterBase, *this, rxTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap ); + addChildren( rFilterBase, *this, pTheme, xShapes, pShapeRect ? *pShapeRect : awt::Rectangle( maPosition.X, maPosition.Y, maSize.Width, maSize.Height ), pShapeMap ); } } catch( const Exception& ) diff --git a/oox/source/ppt/pptshapegroupcontext.cxx b/oox/source/ppt/pptshapegroupcontext.cxx index bd9fd5d549b1..4113b399e6eb 100644 --- a/oox/source/ppt/pptshapegroupcontext.cxx +++ b/oox/source/ppt/pptshapegroupcontext.cxx @@ -104,7 +104,7 @@ Reference< XFastContextHandler > PPTShapeGroupContext::createFastChildContext( s xRet.set( new oox::drawingml::GraphicShapeContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.GraphicObjectShape" ) ) ) ); break; case NMSP_PPT|XML_graphicFrame: // CT_GraphicalObjectFrame - xRet.set( new oox::drawingml::GraphicalObjectFrameContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.OLE2Shape" ) ) ) ); + xRet.set( new oox::drawingml::GraphicalObjectFrameContext( *this, mpGroupShapePtr, oox::drawingml::ShapePtr( new PPTShape( meShapeLocation, "com.sun.star.drawing.OLE2Shape" ) ), true ) ); break; } diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index 227f0b7ce799..c91a1bd1fd79 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -143,9 +143,9 @@ void SlidePersist::createXShapes( const XmlFilterBase& rFilterBase ) { PPTShape* pPPTShape = dynamic_cast< PPTShape* >( (*aChildIter).get() ); if ( pPPTShape ) - pPPTShape->addShape( rFilterBase, *this, getTheme(), xShapes, 0, &getShapeMap() ); + pPPTShape->addShape( rFilterBase, *this, getTheme().get(), xShapes, 0, &getShapeMap() ); else - (*aChildIter)->addShape( rFilterBase, getTheme(), xShapes, 0, &getShapeMap() ); + (*aChildIter)->addShape( rFilterBase, getTheme().get(), xShapes, 0, &getShapeMap() ); aChildIter++; } diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index ef8831b06db3..42efee474d90 100644 --- a/oox/source/shape/ShapeContextHandler.cxx +++ b/oox/source/shape/ShapeContextHandler.cxx @@ -74,7 +74,7 @@ ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element ) case XML_graphic: mpShape.reset(new Shape("com.sun.star.drawing.OLE2Shape" )); mxGraphicShapeContext.set - (new GraphicalObjectFrameContext(*rFragmentHandler, pMasterShape, mpShape)); + (new GraphicalObjectFrameContext(*rFragmentHandler, pMasterShape, mpShape, true)); break; case XML_pic: mpShape.reset(new Shape("com.sun.star.drawing.GraphicObjectShape" )); @@ -240,7 +240,7 @@ ShapeContextHandler::getShape() throw (uno::RuntimeException) } else if (mpShape.get() != NULL) { - mpShape->addShape(*mxFilterBase, mpThemePtr, xShapes); + mpShape->addShape(*mxFilterBase, mpThemePtr.get(), xShapes); xResult.set(mpShape->getXShape()); } } diff --git a/oox/source/token/gennamespaces.pl b/oox/source/token/gennamespaces.pl index b3d277b85c2f..2a7f2e2423bb 100644 --- a/oox/source/token/gennamespaces.pl +++ b/oox/source/token/gennamespaces.pl @@ -50,6 +50,7 @@ print ( HXX "// defines for tokens with specific namespaces, can be used in swit print ( HXX "#define A_TOKEN( token ) (::oox::NMSP_DRAWINGML | XML_##token)\n" ); print ( HXX "#define AX_TOKEN( token ) (::oox::NMSP_AX | XML_##token)\n" ); print ( HXX "#define C_TOKEN( token ) (::oox::NMSP_CHART | XML_##token)\n" ); +print ( HXX "#define CDR_TOKEN( token ) (::oox::NMSP_CDR | XML_##token)\n" ); print ( HXX "#define O_TOKEN( token ) (::oox::NMSP_OFFICE | XML_##token)\n" ); print ( HXX "#define PPT_TOKEN( token ) (::oox::NMSP_PPT | XML_##token)\n" ); print ( HXX "#define R_TOKEN( token ) (::oox::NMSP_RELATIONSHIPS | XML_##token)\n" ); diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt index 63ca76e95f54..45bb59541b1b 100644 --- a/oox/source/token/namespaces.txt +++ b/oox/source/token/namespaces.txt @@ -14,6 +14,7 @@ DRAWINGML PICTURE DIAGRAM CHART +CDR DOC_DRAWINGML # VML diff --git a/oox/source/xls/drawingfragment.cxx b/oox/source/xls/drawingfragment.cxx index 56e1c888d0a2..28687ba92da7 100644 --- a/oox/source/xls/drawingfragment.cxx +++ b/oox/source/xls/drawingfragment.cxx @@ -92,22 +92,6 @@ sal_Int64 lclCalcEmu( const UnitConverter& rUnitConv, sal_Int64 nValue, Unit eFr // ============================================================================ -AnchorPosModel::AnchorPosModel() : - mnX( -1 ), - mnY( -1 ) -{ -} - -// ---------------------------------------------------------------------------- - -AnchorSizeModel::AnchorSizeModel() : - mnWidth( -1 ), - mnHeight( -1 ) -{ -} - -// ---------------------------------------------------------------------------- - AnchorCellModel::AnchorCellModel() : mnCol( -1 ), mnRow( -1 ), @@ -155,15 +139,15 @@ void ShapeAnchor::importAnchor( sal_Int32 nElement, const AttributeList& rAttrib void ShapeAnchor::importPos( const AttributeList& rAttribs ) { OSL_ENSURE( meType == ANCHOR_ABSOLUTE, "ShapeAnchor::importPos - unexpected 'xdr:pos' element" ); - maPos.mnX = rAttribs.getHyper( XML_x, 0 ); - maPos.mnY = rAttribs.getHyper( XML_y, 0 ); + maPos.X = rAttribs.getHyper( XML_x, 0 ); + maPos.Y = rAttribs.getHyper( XML_y, 0 ); } void ShapeAnchor::importExt( const AttributeList& rAttribs ) { OSL_ENSURE( (meType == ANCHOR_ABSOLUTE) || (meType == ANCHOR_ONECELL), "ShapeAnchor::importExt - unexpected 'xdr:ext' element" ); - maSize.mnWidth = rAttribs.getHyper( XML_cx, 0 ); - maSize.mnHeight = rAttribs.getHyper( XML_cy, 0 ); + maSize.Width = rAttribs.getHyper( XML_cx, 0 ); + maSize.Height = rAttribs.getHyper( XML_cy, 0 ); } void ShapeAnchor::importClientData( const AttributeList& rAttribs ) @@ -229,12 +213,12 @@ bool ShapeAnchor::isValidAnchor() const case ANCHOR_ABSOLUTE: OSL_ENSURE( maPos.isValid(), "ShapeAnchor::isValidAnchor - invalid position" ); OSL_ENSURE( maSize.isValid(), "ShapeAnchor::isValidAnchor - invalid size" ); - bValid = maPos.isValid() && maSize.isValid() && (maSize.mnWidth > 0) && (maSize.mnHeight > 0); + bValid = maPos.isValid() && maSize.isValid() && (maSize.Width > 0) && (maSize.Height > 0); break; case ANCHOR_ONECELL: OSL_ENSURE( maFrom.isValid(), "ShapeAnchor::isValidAnchor - invalid from position" ); OSL_ENSURE( maSize.isValid(), "ShapeAnchor::isValidAnchor - invalid size" ); - bValid = maFrom.isValid() && maSize.isValid() && (maSize.mnWidth > 0) && (maSize.mnHeight > 0); + bValid = maFrom.isValid() && maSize.isValid() && (maSize.Width > 0) && (maSize.Height > 0); break; case ANCHOR_TWOCELL: case ANCHOR_VML: @@ -264,10 +248,10 @@ Rectangle ShapeAnchor::calcApiLocation( const Size& rApiSheetSize, const AnchorS { case ANCHOR_ABSOLUTE: OSL_ENSURE( maPos.isValid(), "ShapeAnchor::calcApiLocation - invalid position" ); - if( maPos.isValid() && (maPos.mnX < rEmuSheetSize.mnWidth) && (maPos.mnY < rEmuSheetSize.mnHeight) ) + if( maPos.isValid() && (maPos.X < rEmuSheetSize.Width) && (maPos.Y < rEmuSheetSize.Height) ) { - aApiLoc.X = rUnitConv.scaleToMm100( static_cast< double >( maPos.mnX ), UNIT_EMU ); - aApiLoc.Y = rUnitConv.scaleToMm100( static_cast< double >( maPos.mnY ), UNIT_EMU ); + aApiLoc.X = rUnitConv.scaleToMm100( static_cast< double >( maPos.X ), UNIT_EMU ); + aApiLoc.Y = rUnitConv.scaleToMm100( static_cast< double >( maPos.Y ), UNIT_EMU ); } break; case ANCHOR_ONECELL: @@ -295,10 +279,10 @@ Rectangle ShapeAnchor::calcApiLocation( const Size& rApiSheetSize, const AnchorS if( maSize.isValid() ) { aApiLoc.Width = ::std::min< sal_Int32 >( - rUnitConv.scaleToMm100( static_cast< double >( maSize.mnWidth ), UNIT_EMU ), + rUnitConv.scaleToMm100( static_cast< double >( maSize.Width ), UNIT_EMU ), rApiSheetSize.Width - aApiLoc.X ); aApiLoc.Height = ::std::min< sal_Int32 >( - rUnitConv.scaleToMm100( static_cast< double >( maSize.mnHeight ), UNIT_EMU ), + rUnitConv.scaleToMm100( static_cast< double >( maSize.Height ), UNIT_EMU ), rApiSheetSize.Height - aApiLoc.Y ); } break; @@ -340,8 +324,8 @@ Rectangle ShapeAnchor::calcEmuLocation( const AnchorSizeModel& rEmuSheetSize ) c UnitConverter& rUnitConv = getUnitConverter(); Size aSheetSize( - getLimitedValue< sal_Int32, sal_Int64 >( rEmuSheetSize.mnWidth, 0, SAL_MAX_INT32 ), - getLimitedValue< sal_Int32, sal_Int64 >( rEmuSheetSize.mnHeight, 0, SAL_MAX_INT32 ) ); + getLimitedValue< sal_Int32, sal_Int64 >( rEmuSheetSize.Width, 0, SAL_MAX_INT32 ), + getLimitedValue< sal_Int32, sal_Int64 >( rEmuSheetSize.Height, 0, SAL_MAX_INT32 ) ); Rectangle aLoc( -1, -1, -1, -1 ); Unit eUnitX = (meType == ANCHOR_VML) ? UNIT_SCREENX : UNIT_EMU; Unit eUnitY = (meType == ANCHOR_VML) ? UNIT_SCREENY : UNIT_EMU; @@ -351,10 +335,10 @@ Rectangle ShapeAnchor::calcEmuLocation( const AnchorSizeModel& rEmuSheetSize ) c { case ANCHOR_ABSOLUTE: OSL_ENSURE( maPos.isValid(), "ShapeAnchor::calcEmuLocation - invalid position" ); - if( maPos.isValid() && (maPos.mnX < aSheetSize.Width) && (maPos.mnY < aSheetSize.Height) ) + if( maPos.isValid() && (maPos.X < aSheetSize.Width) && (maPos.Y < aSheetSize.Height) ) { - aLoc.X = static_cast< sal_Int32 >( maPos.mnX ); - aLoc.Y = static_cast< sal_Int32 >( maPos.mnY ); + aLoc.X = static_cast< sal_Int32 >( maPos.X ); + aLoc.Y = static_cast< sal_Int32 >( maPos.Y ); } break; case ANCHOR_ONECELL: @@ -386,8 +370,8 @@ Rectangle ShapeAnchor::calcEmuLocation( const AnchorSizeModel& rEmuSheetSize ) c OSL_ENSURE( maSize.isValid(), "ShapeAnchor::calcEmuLocation - invalid size" ); if( maSize.isValid() ) { - aLoc.Width = static_cast< sal_Int32 >( ::std::min< sal_Int64 >( maSize.mnWidth, aSheetSize.Width - aLoc.X ) ); - aLoc.Height = static_cast< sal_Int32 >( ::std::min< sal_Int64 >( maSize.mnHeight, aSheetSize.Height - aLoc.Y ) ); + aLoc.Width = static_cast< sal_Int32 >( ::std::min< sal_Int64 >( maSize.Width, aSheetSize.Width - aLoc.X ) ); + aLoc.Height = static_cast< sal_Int32 >( ::std::min< sal_Int64 >( maSize.Height, aSheetSize.Height - aLoc.Y ) ); } break; case ANCHOR_TWOCELL: @@ -439,8 +423,8 @@ OoxDrawingFragment::OoxDrawingFragment( const WorksheetHelper& rHelper, const OU { OSL_ENSURE( mxDrawPage.is(), "OoxDrawingFragment::OoxDrawingFragment - missing drawing page" ); maApiSheetSize = getDrawPageSize(); - maEmuSheetSize.mnWidth = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Width, UNIT_EMU ) ); - maEmuSheetSize.mnHeight = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Height, UNIT_EMU ) ); + maEmuSheetSize.Width = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Width, UNIT_EMU ) ); + maEmuSheetSize.Height = static_cast< sal_Int64 >( getUnitConverter().scaleFromMm100( maApiSheetSize.Height, UNIT_EMU ) ); } // oox.core.ContextHandler2Helper interface ----------------------------------- @@ -481,7 +465,7 @@ ContextHandlerRef OoxDrawingFragment::onCreateContext( sal_Int32 nElement, const return new GraphicShapeContext( *this, ShapePtr(), mxShape ); case XDR_TOKEN( graphicFrame ): mxShape.reset( new Shape( "com.sun.star.drawing.OLE2Shape" ) ); - return new GraphicalObjectFrameContext( *this, ShapePtr(), mxShape ); + return new GraphicalObjectFrameContext( *this, ShapePtr(), mxShape, getSheetType() != SHEETTYPE_CHARTSHEET ); case XDR_TOKEN( grpSp ): mxShape.reset( new Shape( "com.sun.star.drawing.GroupShape" ) ); return new ShapeGroupContext( *this, ShapePtr(), mxShape ); @@ -526,7 +510,7 @@ void OoxDrawingFragment::onEndElement( const OUString& rChars ) { Rectangle aLoc = mxAnchor->calcEmuLocation( maEmuSheetSize ); if( (aLoc.X >= 0) && (aLoc.Y >= 0) && (aLoc.Width >= 0) && (aLoc.Height >= 0) ) - mxShape->addShape( getOoxFilter(), getThemeRef(), mxDrawPage, &aLoc ); + mxShape->addShape( getOoxFilter(), &getTheme(), mxDrawPage, &aLoc ); } mxShape.reset(); mxAnchor.reset(); diff --git a/oox/source/xls/workbookhelper.cxx b/oox/source/xls/workbookhelper.cxx index 8f6fb872e71e..93ad0a65422f 100644 --- a/oox/source/xls/workbookhelper.cxx +++ b/oox/source/xls/workbookhelper.cxx @@ -317,8 +317,6 @@ public: inline WorksheetBuffer& getWorksheets() const { return *mxWorksheets; } /** Returns the office theme object read from the theme substorage. */ inline ThemeBuffer& getTheme() const { return *mxTheme; } - /** Returns the office theme object reference read from the theme substorage. */ - inline ::boost::shared_ptr< Theme > getThemeRef() const { return mxTheme; } /** Returns all cell formatting objects read from the styles substream. */ inline StylesBuffer& getStyles() const { return *mxStyles; } /** Returns the shared strings read from the shared strings substream. */ @@ -961,11 +959,6 @@ ThemeBuffer& WorkbookHelper::getTheme() const return mrBookData.getTheme(); } -::boost::shared_ptr< Theme > WorkbookHelper::getThemeRef() const -{ - return mrBookData.getThemeRef(); -} - StylesBuffer& WorkbookHelper::getStyles() const { return mrBookData.getStyles(); |