summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2010-03-03 14:30:52 +0100
committerIvo Hinkelmann <ihi@openoffice.org>2010-03-03 14:30:52 +0100
commit2f4c2aa9b9342ba2d32d55e45857e3373c2f926f (patch)
tree4c5525f2df3635a89fa5627e59d9c7d32806c388
parent293353a698e6eb741bde6762095549ba487a039d (diff)
parent28b3166238380cf69fd5293f7426698d89d43db9 (diff)
CWS-TOOLING: integrate CWS chartshapesooo/DEV300_m75ooo/DEV300_m74
-rw-r--r--filter/inc/filter/msfilter/escherex.hxx182
-rw-r--r--filter/source/msfilter/escherex.cxx304
-rw-r--r--filter/source/msfilter/eschesdo.cxx78
-rw-r--r--filter/source/msfilter/eschesdo.hxx5
-rw-r--r--oox/inc/oox/drawingml/chart/chartconverter.hxx34
-rw-r--r--oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx126
-rw-r--r--oox/inc/oox/drawingml/chart/chartspaceconverter.hxx10
-rw-r--r--oox/inc/oox/drawingml/chart/chartspacemodel.hxx1
-rw-r--r--oox/inc/oox/drawingml/chart/converterbase.hxx6
-rw-r--r--oox/inc/oox/drawingml/drawingmltypes.hxx31
-rw-r--r--oox/inc/oox/drawingml/graphicshapecontext.hxx9
-rw-r--r--oox/inc/oox/drawingml/shape.hxx9
-rw-r--r--oox/inc/oox/dump/dffdumper.hxx7
-rw-r--r--oox/inc/oox/dump/dumperbase.hxx37
-rw-r--r--oox/inc/oox/ppt/pptshape.hxx4
-rw-r--r--oox/inc/oox/xls/drawingfragment.hxx18
-rw-r--r--oox/inc/oox/xls/workbookhelper.hxx2
-rw-r--r--oox/source/core/xmlfilterbase.cxx1
-rw-r--r--oox/source/drawingml/chart/chartconverter.cxx12
-rw-r--r--oox/source/drawingml/chart/chartdrawingfragment.cxx239
-rw-r--r--oox/source/drawingml/chart/chartspaceconverter.cxx63
-rw-r--r--oox/source/drawingml/chart/chartspacefragment.cxx3
-rw-r--r--oox/source/drawingml/chart/converterbase.cxx23
-rw-r--r--oox/source/drawingml/chart/makefile.mk1
-rw-r--r--oox/source/drawingml/graphicshapecontext.cxx33
-rw-r--r--oox/source/drawingml/shape.cxx28
-rw-r--r--oox/source/drawingml/shapegroupcontext.cxx4
-rw-r--r--oox/source/dump/biffdumper.ini7
-rw-r--r--oox/source/dump/dffdumper.cxx239
-rw-r--r--oox/source/dump/dffdumper.ini712
-rw-r--r--oox/source/dump/dumperbase.cxx180
-rw-r--r--oox/source/dump/dumperbase.ini40
-rw-r--r--oox/source/dump/oledumper.cxx10
-rw-r--r--oox/source/dump/oledumper.ini34
-rw-r--r--oox/source/ppt/pptshape.cxx6
-rw-r--r--oox/source/ppt/pptshapegroupcontext.cxx4
-rw-r--r--oox/source/ppt/slidepersist.cxx4
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx16
-rw-r--r--oox/source/token/gennamespaces.pl1
-rw-r--r--oox/source/token/namespaces.txt1
-rw-r--r--oox/source/xls/drawingfragment.cxx60
-rw-r--r--oox/source/xls/workbookhelper.cxx7
42 files changed, 1932 insertions, 659 deletions
diff --git a/filter/inc/filter/msfilter/escherex.hxx b/filter/inc/filter/msfilter/escherex.hxx
index 08f0cf0b9..bd3d76179 100644
--- a/filter/inc/filter/msfilter/escherex.hxx
+++ b/filter/inc/filter/msfilter/escherex.hxx
@@ -28,7 +28,9 @@
#ifndef _SVX_ESCHEREX_HXX
#define _SVX_ESCHEREX_HXX
+#include <memory>
#include <vector>
+#include <boost/shared_ptr.hpp>
#include <tools/solar.h>
#include <tools/gen.hxx>
#include <tools/list.hxx>
@@ -945,13 +947,13 @@ enum ESCHER_LineCap
#define ESCHER_Persist_PrivateEntry 0x80000000
#define ESCHER_Persist_Dgg 0x00010000
-#define ESCHER_Persist_Dgg_FIDCL 0x00010001
#define ESCHER_Persist_Dg 0x00020000
-#define ESCHER_Persist_BlibStoreContainer 0x00030000
#define ESCHER_Persist_CurrentPosition 0x00040000
#define ESCHER_Persist_Grouping_Snap 0x00050000
#define ESCHER_Persist_Grouping_Logic 0x00060000
+const sal_uInt32 DFF_DGG_CLUSTER_SIZE = 0x00000400; /// Shape IDs per cluster in DGG atom.
+
// ---------------------------------------------------------------------------------------------
namespace com { namespace sun { namespace star {
@@ -961,6 +963,7 @@ namespace com { namespace sun { namespace star {
namespace drawing {
struct EnhancedCustomShapeAdjustmentValue;
class XShape;
+ class XShapes;
}
}}}
@@ -1030,13 +1033,11 @@ struct EscherPersistEntry
// ---------------------------------------------------------------------------------------------
-class SvMemoryStream;
class EscherBlibEntry
{
friend class EscherGraphicProvider;
friend class EscherEx;
- friend class _EscherEx;
protected:
@@ -1189,7 +1190,7 @@ class MSFILTER_DLLPUBLIC EscherPropertyContainer
sal_uInt8* pProp, sal_uInt32 nPropSize );
sal_Bool GetOpt( sal_uInt16 nPropertyID, sal_uInt32& rPropValue ) const;
-
+
sal_Bool GetOpt( sal_uInt16 nPropertyID, EscherPropSortStruct& rPropValue ) const;
EscherProperties GetOpts() const;
@@ -1344,52 +1345,137 @@ public:
};
+// ============================================================================
+
+/** Instance for global DFF data, shared through various instances of EscherEx. */
+class MSFILTER_DLLPUBLIC EscherExGlobal : public EscherGraphicProvider
+{
+public:
+ explicit EscherExGlobal( sal_uInt32 nGraphicProvFlags = _E_GRAPH_PROV_DO_NOT_ROTATE_METAFILES );
+ virtual ~EscherExGlobal();
+
+ /** Returns a new drawing ID for a new drawing container (DGCONTAINER). */
+ sal_uInt32 GenerateDrawingId();
+ /** Creates and returns a new shape identifier, updates the internal shape
+ counters and registers the identifier in the DGG cluster table.
+ @param nDrawingId Drawing identifier has to be passed to be able to
+ generate shape identifiers for multiple drawings simultaniously. */
+ sal_uInt32 GenerateShapeId( sal_uInt32 nDrawingId, bool bIsInSpgr );
+ /** Returns the number of shapes in the current drawing, based on number of
+ calls to the GenerateShapeId() function. */
+ sal_uInt32 GetDrawingShapeCount( sal_uInt32 nDrawingId ) const;
+ /** Returns the last shape identifier generated by the GenerateShapeId()
+ function. */
+ sal_uInt32 GetLastShapeId( sal_uInt32 nDrawingId ) const;
+
+ /** Sets the flag indicating that the DGGCONTAINER exists. */
+ inline void SetDggContainer() { mbHasDggCont = true; }
+ /** Sets the flag indicating that the DGGCONTAINER exists. */
+ inline bool HasDggContainer() const { return mbHasDggCont; }
+ /** Returns the total size of the DGG atom (including header). */
+ sal_uInt32 GetDggAtomSize() const;
+ /** Writes the complete DGG atom to the passed stream (overwrites existing data!). */
+ void WriteDggAtom( SvStream& rStrm ) const;
+
+ /** Called if a picture shall be written and no picture stream is set at
+ class ImplEscherExSdr.
+
+ On first invokation, this function calls the virtual member function
+ ImplQueryPictureStream(). The return value will be cached internally
+ for subsequent calls and for the GetPictureStream() function.
+ */
+ SvStream* QueryPictureStream();
+
+ /** Returns the picture stream if existing (queried), otherwise null. */
+ inline SvStream* GetPictureStream() { return mpPicStrm; }
+
+private:
+ /** Derived classes may implement to create a new stream used to store the
+ picture data.
+
+ The implementation has to take care about lifetime of the returned
+ stream (it will not be destructed automatically). This function is
+ called exactly once. The return value will be cached internally for
+ repeated calls of the public QueryPictureStream() function.
+ */
+ virtual SvStream* ImplQueryPictureStream();
+
+private:
+ struct ClusterEntry
+ {
+ sal_uInt32 mnDrawingId; /// Identifier of drawing this cluster belongs to (one-based index into maDrawingInfos).
+ sal_uInt32 mnNextShapeId; /// Next free shape identifier in this cluster.
+ inline explicit ClusterEntry( sal_uInt32 nDrawingId ) : mnDrawingId( nDrawingId ), mnNextShapeId( 0 ) {}
+ };
+ typedef ::std::vector< ClusterEntry > ClusterTable;
+
+ struct DrawingInfo
+ {
+ sal_uInt32 mnClusterId; /// Currently used cluster (one-based index into maClusterTable).
+ sal_uInt32 mnShapeCount; /// Current number of shapes in this drawing.
+ sal_uInt32 mnLastShapeId; /// Last shape identifier generated for this drawing.
+ inline explicit DrawingInfo( sal_uInt32 nClusterId ) : mnClusterId( nClusterId ), mnShapeCount( 0 ), mnLastShapeId( 0 ) {}
+ };
+ typedef ::std::vector< DrawingInfo > DrawingInfoVector;
+
+ ClusterTable maClusterTable; /// List with cluster IDs (used object IDs in drawings).
+ DrawingInfoVector maDrawingInfos; /// Data about all used drawings.
+ SvStream* mpPicStrm; /// Cached result of ImplQueryPictureStream().
+ bool mbHasDggCont; /// True = the DGGCONTAINER has been initialized.
+ bool mbPicStrmQueried; /// True = ImplQueryPictureStream() has been called.
+};
+
+typedef ::boost::shared_ptr< EscherExGlobal > EscherExGlobalRef;
+
// ---------------------------------------------------------------------------------------------
class SdrObject;
class SdrPage;
class ImplEscherExSdr;
-class Color;
-
-class Graphic;
-class SvMemoryStream;
-class SvStream;
-class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGraphicProvider
+class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable
{
- protected :
+ protected:
+ typedef ::std::auto_ptr< ImplEscherExSdr > ImplEscherExSdrPtr;
+ EscherExGlobalRef mxGlobal;
+ ImplEscherExSdrPtr mpImplEscherExSdr;
SvStream* mpOutStrm;
- ImplEscherExSdr* mpImplEscherExSdr;
UINT32 mnStrmStartOfs;
std::vector< sal_uInt32 > mOffsets;
std::vector< sal_uInt16 > mRecTypes;
- UINT32 mnDrawings;
- UINT32 mnFIDCLs; // anzahl der cluster ID's
-
UINT32 mnCurrentDg;
- UINT32 mnCurrentShapeID; // die naechste freie ID
- UINT32 mnCurrentShapeMaximumID; // die hoechste und auch benutzte ID
- UINT32 mnTotalShapesDg; // anzahl der shapes im Dg
- UINT32 mnTotalShapeIdUsedDg; // anzahl der benutzten shape Id's im Dg
- UINT32 mnTotalShapesDgg; // anzahl der shapes im Dgg
UINT32 mnCountOfs;
UINT32 mnGroupLevel;
UINT16 mnHellLayerId;
BOOL mbEscherSpgr;
- BOOL mbEscherDgg;
BOOL mbEscherDg;
BOOL mbOleEmf; // OLE is EMF instead of WMF
virtual BOOL DoSeek( UINT32 nKey );
- public:
+public:
+ explicit EscherEx( const EscherExGlobalRef& rxGlobal, SvStream& rOutStrm );
+ virtual ~EscherEx();
+
+ /** Creates and returns a new shape identifier, updates the internal shape
+ counters and registers the identifier in the DGG cluster table. */
+ inline sal_uInt32 GenerateShapeId() { return mxGlobal->GenerateShapeId( mnCurrentDg, mbEscherSpgr ); }
+
+ /** Returns the graphic provider from the global object that has been
+ passed to the constructor.
+ */
+ inline EscherGraphicProvider&
+ GetGraphicProvider() { return *mxGlobal; }
- EscherEx( SvStream& rOut, UINT32 nDrawings );
+ /** Called if a picture shall be written and no picture stream is set at
+ class ImplEscherExSdr.
+ */
+ inline SvStream* QueryPictureStream() { return mxGlobal->QueryPictureStream(); }
/// Fuegt in den EscherStream interne Daten ein, dieser Vorgang
/// darf und muss nur einmal ausgefuehrt werden.
@@ -1398,14 +1484,29 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGrap
/// gemerged, wie es fuer Excel (und Word?) benoetigt wird.
virtual void Flush( SvStream* pPicStreamMergeBSE = NULL );
- virtual ~EscherEx();
+ /** Inserts the passed number of bytes at the current position of the
+ output stream.
- // Application may overload this function to maintain an offset
- // table for specific regions but MUST call this function too.
- virtual void InsertAtCurrentPos( UINT32 nBytes, BOOL bCont = FALSE );// es werden nBytes an der aktuellen Stream Position eingefuegt,
- // die PersistantTable und interne Zeiger angepasst
+ Inserts dummy bytes and moves all following stream data, and updates
+ all internal stream offsets stored in the PersistTable and the affected
+ container sizes, which makes this operation very expensive. (!)
+
+ @param nBytes The number of bytes to be inserted into the stream.
+
+ @param bExpandEndOfAtom If set to true, an atom that currently ends
+ exactly at the current stream position will be expanded to include
+ the inserted data. If set to false, an atom that currently ends
+ exactly at the current stream position will not be expanded to
+ include the inserted data (used to insert e.g. a new atom after an
+ existing atom). Note that containers that end exactly at the
+ current stream position are always expanded to include the inserted
+ data.
+ */
+ void InsertAtCurrentPos( sal_uInt32 nBytes, bool bExpandEndOfAtom );
void InsertPersistOffset( UINT32 nKey, UINT32 nOffset ); // Es wird nicht geprueft, ob sich jener schluessel schon in der PersistantTable befindet
+ void ReplacePersistOffset( UINT32 nKey, UINT32 nOffset );
+ UINT32 GetPersistOffset( UINT32 nKey );
BOOL SeekToPersistOffset( UINT32 nKey );
virtual BOOL InsertAtPersistOffset( UINT32 nKey, UINT32 nValue );// nValue wird im Stream an entrsprechender Stelle eingefuegt(overwrite modus), ohne dass sich die
// aktuelle StreamPosition aendert
@@ -1440,21 +1541,16 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGrap
// ein ESCHER_Sp wird geschrieben ( Ein ESCHER_DgContainer muss dazu geoeffnet sein !!)
virtual void AddShape( UINT32 nShpInstance, UINT32 nFlagIds, UINT32 nShapeID = 0 );
- // reserviert eine ShapeId
- UINT32 GetShapeID();
virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
UINT32 GetColor( const UINT32 nColor, BOOL bSwap = TRUE );
UINT32 GetColor( const Color& rColor, BOOL bSwap = TRUE );
- // OLE is written as EMF instead of WMF (default WMF)
- void SetOleEmf( BOOL bVal ) { mbOleEmf = bVal; }
- BOOL IsOleEmf() const { return mbOleEmf; }
-
// ...Sdr... implemented in eschesdo.cxx
void AddSdrPage( const SdrPage& rPage );
+ void AddUnoShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
/// returns the ShapeID
UINT32 AddSdrObject( const SdrObject& rObj );
@@ -1467,7 +1563,9 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGrap
/// Called before a shape is written, application supplies
/// ClientRecords. May set AppData::bDontWriteShape so the
/// shape is ignored.
- virtual EscherExHostAppData* StartShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape );
+ virtual EscherExHostAppData* StartShape(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape,
+ const Rectangle* pChildAnchor );
/// Called after a shape is written to inform the application
/// of the resulted shape type and ID.
@@ -1491,10 +1589,6 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGrap
/// the same functionality as an ordinary recursive group.
virtual EscherExHostAppData* EnterAdditionalTextGroup();
- /// Called if a picture shall be written and no PicStream is
- /// set at ImplEscherExSdr
- virtual SvStream* QueryPicStream();
-
/// Called if an ESCHER_Prop_lTxid shall be written
virtual UINT32 QueryTextID( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >&, UINT32 nShapeId );
// add an dummy rectangle shape into the escher stream
@@ -1504,6 +1598,14 @@ class MSFILTER_DLLPUBLIC EscherEx : public EscherPersistTable, public EscherGrap
void SetHellLayerId( UINT16 nId ) { mnHellLayerId = nId; }
UINT16 GetHellLayerId() const { return mnHellLayerId; }
+
+private:
+ EscherEx( const EscherEx& );
+ EscherEx& operator=( const EscherEx& );
+
+ // prevent C-style cast to former base class EscherGraphicProvider
+ operator EscherGraphicProvider&();
+ operator EscherGraphicProvider const&();
};
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index c95abd779..a8ada752d 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -266,7 +266,7 @@ void EscherPropertyContainer::AddOpt( sal_uInt16 nPropID, sal_Bool bBlib, sal_uI
sal_Bool EscherPropertyContainer::GetOpt( sal_uInt16 nPropId, sal_uInt32& rPropValue ) const
{
EscherPropSortStruct aPropStruct;
-
+
if ( GetOpt( nPropId, aPropStruct ) )
{
rPropValue = aPropStruct.nPropValue;
@@ -3669,13 +3669,13 @@ void EscherGraphicProvider::WriteBlibStoreContainer( SvStream& rSt, SvStream* pM
// record type
*pMergePicStreamBSE >> n16;
rSt << UINT16( ESCHER_BlipFirst + nBlibType );
- DBG_ASSERT( n16 == ESCHER_BlipFirst + nBlibType , "EscherEx::Flush: BLIP record types differ" );
+ DBG_ASSERT( n16 == ESCHER_BlipFirst + nBlibType , "EscherGraphicProvider::WriteBlibStoreContainer: BLIP record types differ" );
UINT32 n32;
// record size
*pMergePicStreamBSE >> n32;
nBlipSize -= 8;
rSt << nBlipSize;
- DBG_ASSERT( nBlipSize == n32, "EscherEx::Flush: BLIP sizes differ" );
+ DBG_ASSERT( nBlipSize == n32, "EscherGraphicProvider::WriteBlibStoreContainer: BLIP sizes differ" );
// record
while ( nBlipSize )
{
@@ -4290,63 +4290,189 @@ void EscherSolverContainer::WriteSolver( SvStream& rStrm )
}
// ---------------------------------------------------------------------------------------------
+
+EscherExGlobal::EscherExGlobal( sal_uInt32 nGraphicProvFlags ) :
+ EscherGraphicProvider( nGraphicProvFlags ),
+ mpPicStrm( 0 ),
+ mbHasDggCont( false ),
+ mbPicStrmQueried( false )
+{
+}
+
+EscherExGlobal::~EscherExGlobal()
+{
+}
+
+sal_uInt32 EscherExGlobal::GenerateDrawingId()
+{
+ // new drawing starts a new cluster in the cluster table (cluster identifiers are one-based)
+ sal_uInt32 nClusterId = static_cast< sal_uInt32 >( maClusterTable.size() + 1 );
+ // drawing identifiers are one-based
+ sal_uInt32 nDrawingId = static_cast< sal_uInt32 >( maDrawingInfos.size() + 1 );
+ // prepare new entries in the tables
+ maClusterTable.push_back( ClusterEntry( nDrawingId ) );
+ maDrawingInfos.push_back( DrawingInfo( nClusterId ) );
+ // return the new drawing identifier
+ return nDrawingId;
+}
+
+sal_uInt32 EscherExGlobal::GenerateShapeId( sal_uInt32 nDrawingId, bool bIsInSpgr )
+{
+ // drawing identifier is one-based
+ size_t nDrawingIdx = nDrawingId - 1;
+ OSL_ENSURE( nDrawingIdx < maDrawingInfos.size(), "EscherExGlobal::GenerateShapeId - invalid drawing ID" );
+ if( nDrawingIdx >= maDrawingInfos.size() )
+ return 0;
+ DrawingInfo& rDrawingInfo = maDrawingInfos[ nDrawingIdx ];
+
+ // cluster identifier in drawing info struct is one-based
+ ClusterEntry* pClusterEntry = &maClusterTable[ rDrawingInfo.mnClusterId - 1 ];
+
+ // check cluster overflow, create new cluster entry
+ if( pClusterEntry->mnNextShapeId == DFF_DGG_CLUSTER_SIZE )
+ {
+ // start a new cluster in the cluster table
+ maClusterTable.push_back( ClusterEntry( nDrawingId ) );
+ pClusterEntry = &maClusterTable.back();
+ // new size of maClusterTable is equal to one-based identifier of the new cluster
+ rDrawingInfo.mnClusterId = static_cast< sal_uInt32 >( maClusterTable.size() );
+ }
+
+ // build shape identifier from cluster identifier and next free cluster shape identifier
+ rDrawingInfo.mnLastShapeId = static_cast< sal_uInt32 >( rDrawingInfo.mnClusterId * DFF_DGG_CLUSTER_SIZE + pClusterEntry->mnNextShapeId );
+ // update free shape identifier in cluster entry
+ ++pClusterEntry->mnNextShapeId;
+ /* Old code has counted the shapes only, if we are in a SPGRCONTAINER. Is
+ this really intended? Maybe it's always true... */
+ if( bIsInSpgr )
+ ++rDrawingInfo.mnShapeCount;
+
+ // return the new shape identifier
+ return rDrawingInfo.mnLastShapeId;
+}
+
+sal_uInt32 EscherExGlobal::GetDrawingShapeCount( sal_uInt32 nDrawingId ) const
+{
+ size_t nDrawingIdx = nDrawingId - 1;
+ OSL_ENSURE( nDrawingIdx < maDrawingInfos.size(), "EscherExGlobal::GetDrawingShapeCount - invalid drawing ID" );
+ return (nDrawingIdx < maDrawingInfos.size()) ? maDrawingInfos[ nDrawingIdx ].mnShapeCount : 0;
+}
+
+sal_uInt32 EscherExGlobal::GetLastShapeId( sal_uInt32 nDrawingId ) const
+{
+ size_t nDrawingIdx = nDrawingId - 1;
+ OSL_ENSURE( nDrawingIdx < maDrawingInfos.size(), "EscherExGlobal::GetLastShapeId - invalid drawing ID" );
+ return (nDrawingIdx < maDrawingInfos.size()) ? maDrawingInfos[ nDrawingIdx ].mnLastShapeId : 0;
+}
+
+sal_uInt32 EscherExGlobal::GetDggAtomSize() const
+{
+ // 8 bytes header, 16 bytes fixed DGG data, 8 bytes for each cluster
+ return static_cast< sal_uInt32 >( 24 + 8 * maClusterTable.size() );
+}
+
+void EscherExGlobal::WriteDggAtom( SvStream& rStrm ) const
+{
+ sal_uInt32 nDggSize = GetDggAtomSize();
+
+ // write the DGG record header (do not include the 8 bytes of the header in the data size)
+ rStrm << static_cast< sal_uInt32 >( ESCHER_Dgg << 16 ) << static_cast< sal_uInt32 >( nDggSize - 8 );
+
+ // claculate and write the fixed DGG data
+ sal_uInt32 nShapeCount = 0;
+ sal_uInt32 nLastShapeId = 0;
+ for( DrawingInfoVector::const_iterator aIt = maDrawingInfos.begin(), aEnd = maDrawingInfos.end(); aIt != aEnd; ++aIt )
+ {
+ nShapeCount += aIt->mnShapeCount;
+ nLastShapeId = ::std::max( nLastShapeId, aIt->mnLastShapeId );
+ }
+ // the non-existing cluster with index #0 is counted too
+ sal_uInt32 nClusterCount = static_cast< sal_uInt32 >( maClusterTable.size() + 1 );
+ sal_uInt32 nDrawingCount = static_cast< sal_uInt32 >( maDrawingInfos.size() );
+ rStrm << nLastShapeId << nClusterCount << nShapeCount << nDrawingCount;
+
+ // write the cluster table
+ for( ClusterTable::const_iterator aIt = maClusterTable.begin(), aEnd = maClusterTable.end(); aIt != aEnd; ++aIt )
+ rStrm << aIt->mnDrawingId << aIt->mnNextShapeId;
+}
+
+SvStream* EscherExGlobal::QueryPictureStream()
+{
+ if( !mbPicStrmQueried )
+ {
+ mpPicStrm = ImplQueryPictureStream();
+ mbPicStrmQueried = true;
+ }
+ return mpPicStrm;
+}
+
+SvStream* EscherExGlobal::ImplQueryPictureStream()
+{
+ return 0;
+}
+
+// ---------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------
-EscherEx::EscherEx( SvStream& rOutStrm, UINT32 nDrawings ) :
- EscherGraphicProvider ( 0 ),
+EscherEx::EscherEx( const EscherExGlobalRef& rxGlobal, SvStream& rOutStrm ) :
+ mxGlobal ( rxGlobal ),
mpOutStrm ( &rOutStrm ),
- mnDrawings ( nDrawings ),
mnGroupLevel ( 0 ),
mnHellLayerId ( USHRT_MAX ),
mbEscherSpgr ( FALSE ),
- mbEscherDgg ( FALSE ), // TRUE, wenn jemals ein ESCHER_Dgg angelegt wurde, dieser wird dann im Dest. aktualisiert
- mbEscherDg ( FALSE ),
- mbOleEmf ( FALSE )
+ mbEscherDg ( FALSE )
{
mnStrmStartOfs = mpOutStrm->Tell();
- mpImplEscherExSdr = new ImplEscherExSdr( *this );
+ mpImplEscherExSdr.reset( new ImplEscherExSdr( *this ) );
+}
+
+EscherEx::~EscherEx()
+{
}
// ---------------------------------------------------------------------------------------------
void EscherEx::Flush( SvStream* pPicStreamMergeBSE /* = NULL */ )
{
- if ( mbEscherDgg ) // ESCHER_Dgg anpassen
+ if ( mxGlobal->HasDggContainer() )
{
+ // store the current stream position at ESCHER_Persist_CurrentPosition key
PtReplaceOrInsert( ESCHER_Persist_CurrentPosition, mpOutStrm->Tell() );
if ( DoSeek( ESCHER_Persist_Dgg ) )
{
- *mpOutStrm << mnCurrentShapeID << (UINT32)( mnFIDCLs + 1 ) << mnTotalShapesDgg << mnDrawings;
- }
- if ( HasGraphics() )
- {
- if ( DoSeek( ESCHER_Persist_BlibStoreContainer ) ) // ESCHER_BlibStoreContainer schreiben
+ /* The DGG record is still not written. ESCHER_Persist_Dgg seeks
+ to the place where the complete record has to be inserted. */
+ InsertAtCurrentPos( mxGlobal->GetDggAtomSize(), false );
+ mxGlobal->WriteDggAtom( *mpOutStrm );
+
+ if ( mxGlobal->HasGraphics() )
{
- sal_uInt32 nAddBytes = GetBlibStoreContainerSize( pPicStreamMergeBSE );
- if ( nAddBytes )
+ /* Calculate the total size of the BSTORECONTAINER including
+ all BSE records containing the picture data contained in
+ the passed in pPicStreamMergeBSE. */
+ sal_uInt32 nBSCSize = mxGlobal->GetBlibStoreContainerSize( pPicStreamMergeBSE );
+ if ( nBSCSize > 0 )
{
- InsertAtCurrentPos( nAddBytes, TRUE ); // platz schaffen fuer Blib Container samt seinen Blib Atomen
- WriteBlibStoreContainer( *mpOutStrm, pPicStreamMergeBSE );
+ InsertAtCurrentPos( nBSCSize, false );
+ mxGlobal->WriteBlibStoreContainer( *mpOutStrm, pPicStreamMergeBSE );
}
}
+
+ /* Forget the stream position stored for the DGG which is invalid
+ after the call to InsertAtCurrentPos() anyway. */
+ PtDelete( ESCHER_Persist_Dgg );
}
+ // seek to initial position (may be different due to inserted DGG and BLIPs)
mpOutStrm->Seek( PtGetOffsetByID( ESCHER_Persist_CurrentPosition ) );
}
}
// ---------------------------------------------------------------------------------------------
-EscherEx::~EscherEx()
-{
- delete mpImplEscherExSdr;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-void EscherEx::InsertAtCurrentPos( UINT32 nBytes, BOOL bContainer )
+void EscherEx::InsertAtCurrentPos( UINT32 nBytes, bool bExpandEndOfAtom )
{
UINT32 nSize, nType, nSource, nBufSize, nToCopy, nCurPos = mpOutStrm->Tell();
BYTE* pBuf;
@@ -4364,11 +4490,16 @@ void EscherEx::InsertAtCurrentPos( UINT32 nBytes, BOOL bContainer )
while ( mpOutStrm->Tell() < nCurPos )
{
*mpOutStrm >> nType >> nSize;
- if ( ( mpOutStrm->Tell() + nSize ) >= ( ( bContainer ) ? nCurPos + 1 : nCurPos ) )
+ sal_uInt32 nEndOfRecord = mpOutStrm->Tell() + nSize;
+ bool bContainer = (nType & 0x0F) == 0x0F;
+ /* Expand the record, if the insertion position is inside, or if the
+ position is at the end of a container (expands always), or at the
+ end of an atom and bExpandEndOfAtom is set. */
+ if ( (nCurPos < nEndOfRecord) || ((nCurPos == nEndOfRecord) && (bContainer || bExpandEndOfAtom)) )
{
mpOutStrm->SeekRel( -4 );
*mpOutStrm << (UINT32)( nSize + nBytes );
- if ( ( nType & 0xf ) != 0xf )
+ if ( !bContainer )
mpOutStrm->SeekRel( nSize );
}
else
@@ -4428,6 +4559,16 @@ void EscherEx::InsertPersistOffset( UINT32 nKey, UINT32 nOffset )
PtInsert( ESCHER_Persist_PrivateEntry | nKey, nOffset );
}
+void EscherEx::ReplacePersistOffset( UINT32 nKey, UINT32 nOffset )
+{
+ PtReplace( ESCHER_Persist_PrivateEntry | nKey, nOffset );
+}
+
+UINT32 EscherEx::GetPersistOffset( UINT32 nKey )
+{
+ return PtGetOffsetByID( ESCHER_Persist_PrivateEntry | nKey );
+}
+
// ---------------------------------------------------------------------------------------------
BOOL EscherEx::DoSeek( UINT32 nKey )
@@ -4476,39 +4617,25 @@ void EscherEx::OpenContainer( UINT16 nEscherContainer, int nRecInstance )
{
case ESCHER_DggContainer :
{
- mbEscherDgg = TRUE;
- mnFIDCLs = mnDrawings;
+ mxGlobal->SetDggContainer();
mnCurrentDg = 0;
- mnCurrentShapeID = 0;
- mnTotalShapesDgg = 0;
- mnCurrentShapeMaximumID = 0;
- AddAtom( 16 + ( mnDrawings << 3 ), ESCHER_Dgg ); // an FDGG and several FIDCLs
+ /* Remember the current position as start position of the DGG
+ record and BSTORECONTAINER, but do not write them actually.
+ This will be done later in Flush() when the number of drawings,
+ the size and contents of the FIDCL cluster table, and the size
+ of the BLIP container are known. */
PtReplaceOrInsert( ESCHER_Persist_Dgg, mpOutStrm->Tell() );
- *mpOutStrm << (UINT32)0 // the current maximum shape ID
- << (UINT32)0 // the number of ID clusters + 1
- << (UINT32)0 // the number of total shapes saved
- << (UINT32)0; // the total number of drawings saved
- PtReplaceOrInsert( ESCHER_Persist_Dgg_FIDCL, mpOutStrm->Tell() );
- for ( UINT32 i = 0; i < mnFIDCLs; i++ ) // Dummy FIDCLs einfuegen
- {
- *mpOutStrm << (UINT32)0 << (UINT32)0; // Drawing Nummer, Anzahl der Shapes in diesem IDCL
- }
- PtReplaceOrInsert( ESCHER_Persist_BlibStoreContainer, mpOutStrm->Tell() );
}
break;
case ESCHER_DgContainer :
{
- if ( mbEscherDgg )
+ if ( mxGlobal->HasDggContainer() )
{
if ( !mbEscherDg )
{
mbEscherDg = TRUE;
- mnCurrentDg++;
- mnTotalShapesDg = 0;
- mnTotalShapeIdUsedDg = 0;
- mnCurrentShapeID = ( mnCurrentShapeMaximumID &~0x3ff ) + 0x400; // eine neue Seite bekommt immer eine neue ShapeId die ein vielfaches von 1024 ist,
- // damit ist erste aktuelle Shape ID 0x400
+ mnCurrentDg = mxGlobal->GenerateDrawingId();
AddAtom( 8, ESCHER_Dg, 0, mnCurrentDg );
PtReplaceOrInsert( ESCHER_Persist_Dg | mnCurrentDg, mpOutStrm->Tell() );
*mpOutStrm << (UINT32)0 // The number of shapes in this drawing
@@ -4554,48 +4681,7 @@ void EscherEx::CloseContainer()
{
mbEscherDg = FALSE;
if ( DoSeek( ESCHER_Persist_Dg | mnCurrentDg ) )
- {
- // shapeanzahl des drawings setzen
- mnTotalShapesDgg += mnTotalShapesDg;
- *mpOutStrm << mnTotalShapesDg << mnCurrentShapeMaximumID;
- if ( DoSeek( ESCHER_Persist_Dgg_FIDCL ) )
- {
- if ( mnTotalShapesDg == 0 )
- {
- mpOutStrm->SeekRel( 8 );
- }
- else
- {
- if ( mnTotalShapeIdUsedDg )
- {
- // die benutzten Shape Ids des drawings in die fidcls setzen
- UINT32 i, nFIDCL = ( ( mnTotalShapeIdUsedDg - 1 ) / 0x400 );
- if ( nFIDCL )
- {
- if ( nPos > mpOutStrm->Tell() )
- nPos += ( nFIDCL << 3 );
-
- mnFIDCLs += nFIDCL;
- InsertAtCurrentPos( nFIDCL << 3 ); // platz schaffen fuer weitere FIDCL's
- }
- for ( i = 0; i <= nFIDCL; i++ )
- {
- *mpOutStrm << mnCurrentDg;
- if ( i < nFIDCL )
- *mpOutStrm << (UINT32)0x400;
- else
- {
- UINT32 nShapesLeft = mnTotalShapeIdUsedDg % 0x400;
- if ( !nShapesLeft )
- nShapesLeft = 0x400;
- *mpOutStrm << (UINT32)nShapesLeft;
- }
- }
- }
- }
- PtReplaceOrInsert( ESCHER_Persist_Dgg_FIDCL, mpOutStrm->Tell() ); // neuen FIDCL Offset fuer naechste Seite
- }
- }
+ *mpOutStrm << mxGlobal->GetDrawingShapeCount( mnCurrentDg ) << mxGlobal->GetLastShapeId( mnCurrentDg );
}
}
break;
@@ -4649,10 +4735,10 @@ void EscherEx::AddAtom( UINT32 nAtomSize, UINT16 nRecType, int nRecVersion, int
void EscherEx::AddChildAnchor( const Rectangle& rRect )
{
AddAtom( 16, ESCHER_ChildAnchor );
- GetStream() << (INT32)rRect.Left()
- << (INT32)rRect.Top()
- << (INT32)rRect.Right()
- << (INT32)rRect.Bottom();
+ *mpOutStrm << (sal_Int32)rRect.Left()
+ << (sal_Int32)rRect.Top()
+ << (sal_Int32)rRect.Right()
+ << (sal_Int32)rRect.Bottom();
}
// ---------------------------------------------------------------------------------------------
@@ -4691,12 +4777,12 @@ UINT32 EscherEx::EnterGroup( const String& rShapeName, const Rectangle* pBoundRe
<< (INT32)aRect.Right()
<< (INT32)aRect.Bottom();
- UINT32 nShapeId = GetShapeID();
+ sal_uInt32 nShapeId = GenerateShapeId();
if ( !mnGroupLevel )
- AddShape( ESCHER_ShpInst_Min, 5, nShapeId ); // Flags: Group | Patriarch
+ AddShape( ESCHER_ShpInst_Min, 5, nShapeId ); // Flags: Group | Patriarch
else
{
- AddShape( ESCHER_ShpInst_Min, 0x201, nShapeId ); // Flags: Group | HaveAnchor
+ AddShape( ESCHER_ShpInst_Min, 0x201, nShapeId ); // Flags: Group | HaveAnchor
EscherPropertyContainer aPropOpt;
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x00040004 );
aPropOpt.AddOpt( ESCHER_Prop_dxWrapDistLeft, 0 );
@@ -4782,7 +4868,7 @@ void EscherEx::AddShape( UINT32 nShpInstance, UINT32 nFlags, UINT32 nShapeID )
AddAtom( 8, ESCHER_Sp, 2, nShpInstance );
if ( !nShapeID )
- nShapeID = GetShapeID();
+ nShapeID = GenerateShapeId();
if ( nFlags ^ 1 ) // is this a group shape ?
{ // if not
@@ -4790,19 +4876,6 @@ void EscherEx::AddShape( UINT32 nShpInstance, UINT32 nFlags, UINT32 nShapeID )
nFlags |= 2; // this not a topmost shape
}
*mpOutStrm << nShapeID << nFlags;
-
- if ( mbEscherSpgr )
- mnTotalShapesDg++;
-}
-
-// ---------------------------------------------------------------------------------------------
-
-UINT32 EscherEx::GetShapeID()
-{
- mnCurrentShapeMaximumID = mnCurrentShapeID; // maximum setzen
- mnCurrentShapeID++; // mnCurrentShape ID auf nachste freie ID
- mnTotalShapeIdUsedDg++;
- return mnCurrentShapeMaximumID;
}
// ---------------------------------------------------------------------------------------------
@@ -4842,3 +4915,4 @@ UINT32 EscherEx::GetColor( const Color& rSOColor, BOOL bSwap )
}
// ---------------------------------------------------------------------------------------------
+
diff --git a/filter/source/msfilter/eschesdo.cxx b/filter/source/msfilter/eschesdo.cxx
index 3c995781f..04d2d5108 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -146,7 +146,7 @@ void ImplEESdrWriter::ImplFlipBoundingBox( ImplEESdrObject& rObj, EscherProperty
#define ADD_SHAPE( nType, nFlags ) \
{ \
nShapeType = nType; \
- nShapeID = mpEscherEx->GetShapeID(); \
+ nShapeID = mpEscherEx->GenerateShapeId(); \
rObj.SetShapeId( nShapeID ); \
mpEscherEx->AddShape( (UINT32)nType, (UINT32)nFlags, nShapeID ); \
rSolverContainer.AddShape( rObj.GetShapeRef(), nShapeID ); \
@@ -182,7 +182,7 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
UINT32 nGrpShapeID = 0;
do {
- mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef() );
+ mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), (mpEscherEx->GetGroupLevel() > 1) ? &rObj.GetRect() : 0 );
if ( mpHostAppData && mpHostAppData->DontWriteShape() )
break;
@@ -238,8 +238,8 @@ UINT32 ImplEESdrWriter::ImplWriteShape( ImplEESdrObject& rObj,
const ::com::sun::star::awt::Point aPoint100thmm( rObj.GetShapeRef()->getPosition() );
Rectangle aRect100thmm( Point( aPoint100thmm.X, aPoint100thmm.Y ), Size( aSize100thmm.Width, aSize100thmm.Height ) );
if ( !mpPicStrm )
- mpPicStrm = mpEscherEx->QueryPicStream();
- EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpEscherEx, mpPicStrm, aRect100thmm );
+ mpPicStrm = mpEscherEx->QueryPictureStream();
+ EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, aRect100thmm );
// #i51348# shape name
if( aShapeName.Len() > 0 )
@@ -764,7 +764,7 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
UINT16 nShapeType = 0;
do
{
- mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef() );
+ mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), (mpEscherEx->GetGroupLevel() > 1) ? &rObj.GetRect() : 0 );
if ( mpHostAppData && mpHostAppData->DontWriteShape() )
break;
@@ -772,8 +772,8 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
const ::com::sun::star::awt::Point aPoint100thmm( rObj.GetShapeRef()->getPosition() );
Rectangle aRect100thmm( Point( aPoint100thmm.X, aPoint100thmm.Y ), Size( aSize100thmm.Width, aSize100thmm.Height ) );
if ( !mpPicStrm )
- mpPicStrm = mpEscherEx->QueryPicStream();
- EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpEscherEx, mpPicStrm, aRect100thmm );
+ mpPicStrm = mpEscherEx->QueryPictureStream();
+ EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, aRect100thmm );
rObj.SetAngle( rObj.ImplGetInt32PropertyValue( ::rtl::OUString::createFromAscii("RotateAngle")));
INT32 nAngle = rObj.GetAngle();
if( rObj.GetType().EqualsAscii( "drawing.Line" ))
@@ -802,7 +802,7 @@ void ImplEESdrWriter::ImplWriteAdditionalText( ImplEESdrObject& rObj,
else
{
mpEscherEx->OpenContainer( ESCHER_SpContainer );
- nShapeID = mpEscherEx->GetShapeID();
+ nShapeID = mpEscherEx->GenerateShapeId();
mpEscherEx->AddShape( nShapeType = ESCHER_ShpInst_TextBox, 0xa00, nShapeID );
if ( rObj.ImplGetText() )
aPropOpt.CreateTextProperties( rObj.mXPropSet,
@@ -862,7 +862,7 @@ UINT32 ImplEESdrWriter::ImplEnterAdditionalTextGroup( const Reference< XShape >&
{
mpHostAppData = mpEscherEx->EnterAdditionalTextGroup();
UINT32 nGrpId = mpEscherEx->EnterGroup( pBoundRect );
- mpHostAppData = mpEscherEx->StartShape( rShape );
+ mpHostAppData = mpEscherEx->StartShape( rShape, pBoundRect );
return nGrpId;
}
@@ -934,7 +934,7 @@ ImplEscherExSdr::~ImplEscherExSdr()
// -------------------------------------------------------------------
-SvxDrawPage* ImplEscherExSdr::ImplInitPage( const SdrPage& rPage )
+bool ImplEscherExSdr::ImplInitPage( const SdrPage& rPage )
{
do
{
@@ -960,12 +960,32 @@ SvxDrawPage* ImplEscherExSdr::ImplInitPage( const SdrPage& rPage )
else
pSvxDrawPage = SvxDrawPage::getImplementation(mXDrawPage);
- return pSvxDrawPage;
+ return pSvxDrawPage != 0;
} while ( 0 );
- return NULL;
+ return false;
}
+// -------------------------------------------------------------------
+
+bool ImplEscherExSdr::ImplInitUnoShapes( const Reference< XShapes >& rxShapes )
+{
+ // eventually write SolverContainer of current page, deletes the Solver
+ ImplFlushSolverContainer();
+
+ if( !rxShapes.is() )
+ return false;
+
+ mpSdrPage = 0;
+ mXDrawPage.clear();
+ mXShapes = rxShapes;
+
+ if( !ImplInitPageValues() ) // ImplEESdrWriter
+ return false;
+
+ mpSolverContainer = new EscherSolverContainer;
+ return true;
+}
// -------------------------------------------------------------------
@@ -1020,6 +1040,13 @@ void EscherEx::AddSdrPage( const SdrPage& rPage )
mpImplEscherExSdr->ImplWriteCurrentPage();
}
+// -------------------------------------------------------------------
+
+void EscherEx::AddUnoShapes( const Reference< XShapes >& rxShapes )
+{
+ if ( mpImplEscherExSdr->ImplInitUnoShapes( rxShapes ) )
+ mpImplEscherExSdr->ImplWriteCurrentPage();
+}
// -------------------------------------------------------------------
@@ -1041,7 +1068,7 @@ void EscherEx::EndSdrObjectPage()
// -------------------------------------------------------------------
-EscherExHostAppData* EscherEx::StartShape( const Reference< XShape >& /* rShape */ )
+EscherExHostAppData* EscherEx::StartShape( const Reference< XShape >& /* rShape */, const Rectangle* /*pChildAnchor*/ )
{
return NULL;
}
@@ -1054,13 +1081,6 @@ void EscherEx::EndShape( UINT16 /* nShapeType */, UINT32 /* nShapeID */ )
// -------------------------------------------------------------------
-SvStream* EscherEx::QueryPicStream()
-{
- return NULL;
-}
-
-// -------------------------------------------------------------------
-
UINT32 EscherEx::QueryTextID( const Reference< XShape >&, UINT32 )
{
return 0;
@@ -1071,7 +1091,7 @@ UINT32 EscherEx::QueryTextID( const Reference< XShape >&, UINT32 )
UINT32 EscherEx::AddDummyShape()
{
OpenContainer( ESCHER_SpContainer );
- UINT32 nShapeID = GetShapeID();
+ UINT32 nShapeID = GenerateShapeId();
AddShape( ESCHER_ShpInst_Rectangle, 0xa00, nShapeID );
//?? aSolverContainer.AddShape( mXShape, nShapeID );
CloseContainer();
@@ -1109,16 +1129,12 @@ ImplEESdrObject::ImplEESdrObject( ImplEscherExSdr& rEx,
{
SdrPage* pPage = rObj.GetPage();
DBG_ASSERT( pPage, "ImplEESdrObject::ImplEESdrObject: no SdrPage" );
- if( pPage )
+ if( pPage && rEx.ImplInitPage( *pPage ) )
{
- SvxDrawPage* pSvxDrawPage = rEx.ImplInitPage( *pPage );
- if( pSvxDrawPage )
- {
- // why not declare a const parameter if the object will
- // not be modified?
- mXShape = uno::Reference< drawing::XShape >::query( ((SdrObject*)&rObj)->getUnoShape() );;
- Init( rEx );
- }
+ // why not declare a const parameter if the object will
+ // not be modified?
+ mXShape = uno::Reference< drawing::XShape >::query( ((SdrObject*)&rObj)->getUnoShape() );;
+ Init( rEx );
}
}
diff --git a/filter/source/msfilter/eschesdo.hxx b/filter/source/msfilter/eschesdo.hxx
index d5276604d..f452096bc 100644
--- a/filter/source/msfilter/eschesdo.hxx
+++ b/filter/source/msfilter/eschesdo.hxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -191,7 +191,8 @@ public:
ImplEscherExSdr( EscherEx& rEx );
virtual ~ImplEscherExSdr();
- SvxDrawPage* ImplInitPage( const SdrPage& rPage );
+ bool ImplInitPage( const SdrPage& rPage );
+ bool ImplInitUnoShapes( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes );
void ImplWriteCurrentPage();
UINT32 ImplWriteTheShape( ImplEESdrObject& rObj );
diff --git a/oox/inc/oox/drawingml/chart/chartconverter.hxx b/oox/inc/oox/drawingml/chart/chartconverter.hxx
index b2e09d60a..b05a39952 100644
--- a/oox/inc/oox/drawingml/chart/chartconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/chartconverter.hxx
@@ -32,14 +32,15 @@
#include <oox/dllapi.h>
namespace com { namespace sun { namespace star {
+ namespace awt { struct Point; }
+ namespace awt { struct Size; }
+ namespace drawing { class XShapes; }
namespace chart2 { class XChartDocument; }
namespace chart2 { namespace data { class XDataProvider; } }
namespace chart2 { namespace data { class XDataSequence; } }
} } }
-namespace oox { namespace core {
- class XmlFilterBase;
-} }
+namespace oox { namespace core { class XmlFilterBase; } }
namespace oox {
namespace drawingml {
@@ -56,11 +57,32 @@ public:
explicit ChartConverter();
virtual ~ChartConverter();
- /** Converts the passed OOXML chart model to the passed chart2 document. */
+ /** Converts the passed OOXML chart model to the passed chart2 document.
+
+ @param rChartModel The filled MSOOXML chart model structure.
+
+ @param rxChartDoc The UNO chart document model to be initialized.
+
+ @param rxExternalPage If null, all embedded shapes will be inserted
+ into the internal drawing page of the chart document. If not null,
+ all embedded shapes will be inserted into this shapes collection.
+
+ @param rChartPos The position of the chart shape in its drawing page,
+ in 1/100 mm. Will be used only, if parameter rxExternalPage is not
+ null, for correct positioning of the embedded shapes in the
+ external drawing page.
+
+ @param rChartSize The size of the chart shape in 1/100 mm. Needed for
+ calculation of position and size of the chart elements (diagram,
+ titles, legend, etc.) and embedded shapes.
+ */
void convertFromModel(
::oox::core::XmlFilterBase& rFilter,
- ChartSpaceModel& rModel,
- const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc );
+ ChartSpaceModel& rChartModel,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxExternalPage,
+ const ::com::sun::star::awt::Point& rChartPos,
+ const ::com::sun::star::awt::Size& rChartSize );
/** Creates an internal data provider. Derived classes may override this
function to create an external data provider. */
diff --git a/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
new file mode 100644
index 000000000..e38311394
--- /dev/null
+++ b/oox/inc/oox/drawingml/chart/chartdrawingfragment.hxx
@@ -0,0 +1,126 @@
+/*************************************************************************
+ *
+ * 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.hxx,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.
+ *
+ ************************************************************************/
+
+#ifndef OOX_DRAWINGML_CHART_CHARTDRAWINGFRAGMENT_HXX
+#define OOX_DRAWINGML_CHART_CHARTDRAWINGFRAGMENT_HXX
+
+#include "oox/core/fragmenthandler2.hxx"
+#include "oox/drawingml/shape.hxx"
+
+namespace oox {
+namespace drawingml {
+namespace chart {
+
+// ============================================================================
+
+/** Relative shape position in a chart object. */
+struct AnchorPosModel
+{
+ double mfX; /// X coordinate relative to chart object (0.0 to 1.0).
+ double mfY; /// Y coordinate relative to chart object (0.0 to 1.0).
+
+ inline explicit AnchorPosModel() : mfX( -1.0 ), mfY( -1.0 ) {}
+ inline bool isValid() const { return (0.0 <= mfX) && (mfX <= 1.0) && (0.0 <= mfY) && (mfY <= 1.0); }
+};
+
+// ----------------------------------------------------------------------------
+
+/** Absolute shape size in a chart object (in EMUs). */
+struct AnchorSizeModel : public EmuSize
+{
+ inline explicit AnchorSizeModel() : EmuSize( -1, -1 ) {}
+ inline bool isValid() const { return (Width >= 0) && (Height >= 0); }
+};
+
+// ============================================================================
+
+/** Contains the position of a shape in the chart object. Supports different
+ shape anchor modes (absolute, relative).
+ */
+class ShapeAnchor
+{
+public:
+ explicit ShapeAnchor( bool bRelSize );
+
+ /** Imports the absolute anchor size from the cdr:ext element. */
+ void importExt( const AttributeList& rAttribs );
+ /** Sets an the relative anchor position from the cdr:from or cdr:to element. */
+ void setPos( sal_Int32 nElement, sal_Int32 nParentContext, const ::rtl::OUString& rValue );
+
+ /** Calculates the resulting shape anchor in EMUs. */
+ ::com::sun::star::awt::Rectangle
+ calcEmuLocation( const EmuRectangle& rEmuChartRect ) const;
+
+private:
+ AnchorPosModel maFrom; /// Top-left position relative to chart object.
+ AnchorPosModel maTo; /// Bottom-right position relative to chart object.
+ AnchorSizeModel maSize; /// Shape size, if anchor has absolute size.
+ bool mbRelSize; /// True = relative size, false = absolute size.
+};
+
+typedef ::boost::shared_ptr< ShapeAnchor > ShapeAnchorRef;
+
+// ============================================================================
+
+/** Handler for a chart drawing fragment (c:userShapes root element).
+ */
+class ChartDrawingFragment : public ::oox::core::FragmentHandler2
+{
+public:
+ explicit ChartDrawingFragment(
+ ::oox::core::XmlFilterBase& rFilter,
+ const ::rtl::OUString& rFragmentPath,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxDrawPage,
+ const ::com::sun::star::awt::Size& rChartSize,
+ const ::com::sun::star::awt::Point& rShapesOffset,
+ bool bOleSupport );
+ virtual ~ChartDrawingFragment();
+
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs );
+ virtual void onEndElement( const ::rtl::OUString& rChars );
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >
+ mxDrawPage; /// Drawing page of this sheet.
+ ::oox::drawingml::ShapePtr mxShape; /// Current top-level shape.
+ ShapeAnchorRef mxAnchor; /// Current anchor of top-level shape.
+ EmuRectangle maEmuChartRect; /// Position and size of the chart object for embedded shapes (in EMUs).
+ bool mbOleSupport; /// True = allow to insert OLE objects into the drawing page.
+};
+
+// ============================================================================
+
+} // namespace chart
+} // namespace drawingml
+} // namespace oox
+
+#endif
+
diff --git a/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx b/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx
index a92e59d39..b4c40015f 100644
--- a/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx
+++ b/oox/inc/oox/drawingml/chart/chartspaceconverter.hxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -30,6 +30,10 @@
#include "oox/drawingml/chart/converterbase.hxx"
+namespace com { namespace sun { namespace star {
+ namespace drawing { class XShapes; }
+} } }
+
namespace oox {
namespace drawingml {
namespace chart {
@@ -45,7 +49,9 @@ public:
virtual ~ChartSpaceConverter();
/** Converts the contained OOXML chart model to a chart2 document. */
- void convertFromModel();
+ void convertFromModel(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxExternalPage,
+ const ::com::sun::star::awt::Point& rChartPos );
};
// ============================================================================
diff --git a/oox/inc/oox/drawingml/chart/chartspacemodel.hxx b/oox/inc/oox/drawingml/chart/chartspacemodel.hxx
index 8db4040f9..bdc7d6755 100644
--- a/oox/inc/oox/drawingml/chart/chartspacemodel.hxx
+++ b/oox/inc/oox/drawingml/chart/chartspacemodel.hxx
@@ -57,6 +57,7 @@ struct ChartSpaceModel
View3DRef mxView3D; /// 3D settings.
TitleRef mxTitle; /// Chart main title.
LegendRef mxLegend; /// Chart legend.
+ ::rtl::OUString maDrawingPath; /// Path to drawing fragment with embedded shapes.
sal_Int32 mnDispBlanksAs; /// Mode how to display blank values.
sal_Int32 mnStyle; /// Index to default formatting.
bool mbAutoTitleDel; /// True = automatic title deleted manually.
diff --git a/oox/inc/oox/drawingml/chart/converterbase.hxx b/oox/inc/oox/drawingml/chart/converterbase.hxx
index e9fb3132d..945adac59 100644
--- a/oox/inc/oox/drawingml/chart/converterbase.hxx
+++ b/oox/inc/oox/drawingml/chart/converterbase.hxx
@@ -32,6 +32,7 @@
#include "oox/drawingml/chart/objectformatter.hxx"
namespace com { namespace sun { namespace star {
+ namespace awt { struct Size; }
namespace lang { class XMultiServiceFactory; }
namespace chart2 { class XChartDocument; }
} } }
@@ -57,8 +58,9 @@ public:
explicit ConverterRoot(
::oox::core::XmlFilterBase& rFilter,
ChartConverter& rChartConverter,
+ const ChartSpaceModel& rChartModel,
const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >& rxChartDoc,
- const ChartSpaceModel& rChartSpace );
+ const ::com::sun::star::awt::Size& rChartSize );
virtual ~ConverterRoot();
/** Creates an instance for the passed service name, using the passed service factory. */
@@ -79,6 +81,8 @@ protected:
/** Returns the API chart document model. */
::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument >
getChartDocument() const;
+ /** Returns the position and size of the chart shape in 1/100 mm. */
+ const ::com::sun::star::awt::Size& getChartSize() const;
/** Returns the object formatter. */
ObjectFormatter& getFormatter() const;
diff --git a/oox/inc/oox/drawingml/drawingmltypes.hxx b/oox/inc/oox/drawingml/drawingmltypes.hxx
index 7dbce459b..2c7103036 100644
--- a/oox/inc/oox/drawingml/drawingmltypes.hxx
+++ b/oox/inc/oox/drawingml/drawingmltypes.hxx
@@ -146,6 +146,37 @@ IndexRange GetIndexRange( const ::com::sun::star::uno::Reference< ::com::sun::st
// ============================================================================
+struct EmuPoint
+{
+ sal_Int64 X;
+ sal_Int64 Y;
+
+ inline explicit EmuPoint() : X( 0 ), Y( 0 ) {}
+ inline explicit EmuPoint( sal_Int64 nX, sal_Int64 nY ) : X( nX ), Y( nY ) {}
+};
+
+// ============================================================================
+
+struct EmuSize
+{
+ sal_Int64 Width;
+ sal_Int64 Height;
+
+ inline explicit EmuSize() : Width( 0 ), Height( 0 ) {}
+ inline explicit EmuSize( sal_Int64 nWidth, sal_Int64 nHeight ) : Width( nWidth ), Height( nHeight ) {}
+};
+
+// ============================================================================
+
+struct EmuRectangle : public EmuPoint, public EmuSize
+{
+ inline explicit EmuRectangle() {}
+ inline explicit EmuRectangle( const EmuPoint& rPos, const EmuSize& rSize ) : EmuPoint( rPos ), EmuSize( rSize ) {}
+ inline explicit EmuRectangle( sal_Int64 nX, sal_Int64 nY, sal_Int64 nWidth, sal_Int64 nHeight ) : EmuPoint( nX, nY ), EmuSize( nWidth, nHeight ) {}
+};
+
+// ============================================================================
+
} // namespace drawingml
} // namespace oox
diff --git a/oox/inc/oox/drawingml/graphicshapecontext.hxx b/oox/inc/oox/drawingml/graphicshapecontext.hxx
index 7d27ca1a9..c7239fc96 100644
--- a/oox/inc/oox/drawingml/graphicshapecontext.hxx
+++ b/oox/inc/oox/drawingml/graphicshapecontext.hxx
@@ -50,10 +50,12 @@ public:
class GraphicalObjectFrameContext : public ShapeContext
{
public:
- GraphicalObjectFrameContext( ::oox::core::ContextHandler& rParent, ShapePtr pMasterShapePtr, ShapePtr pShapePtr );
+ GraphicalObjectFrameContext( ::oox::core::ContextHandler& rParent, ShapePtr pMasterShapePtr, ShapePtr pShapePtr, bool bEmbedShapesInChart );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext( ::sal_Int32 Element, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+private:
+ bool mbEmbedShapesInChart;
};
// ====================================================================
@@ -95,13 +97,16 @@ class ChartGraphicDataContext : public ShapeContext
public:
explicit ChartGraphicDataContext(
::oox::core::ContextHandler& rParent,
- const ShapePtr& rxShape );
+ const ShapePtr& rxShape, bool bEmbedShapes );
virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastContextHandler > SAL_CALL
createFastChildContext(
sal_Int32 nElement,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& rxAttribs )
throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+private:
+ bool mbEmbedShapes;
};
// ====================================================================
diff --git a/oox/inc/oox/drawingml/shape.hxx b/oox/inc/oox/drawingml/shape.hxx
index 18ff9ba8c..9f4a8e860 100644
--- a/oox/inc/oox/drawingml/shape.hxx
+++ b/oox/inc/oox/drawingml/shape.hxx
@@ -69,7 +69,8 @@ public:
const ::com::sun::star::awt::Rectangle& rShapeRect );
virtual void onXShapeCreated(
- const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape ) const;
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rxShape,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes ) const;
inline const PropertyMap& getShapeProperties() const { return maShapeProps; }
@@ -143,7 +144,7 @@ public:
// addShape is creating and inserting the corresponding XShape.
void addShape(
const oox::core::XmlFilterBase& rFilterBase,
- const ThemePtr& rxTheme,
+ const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const ::com::sun::star::awt::Rectangle* pShapeRect = 0,
ShapeIdMap* pShapeMap = 0 );
@@ -161,7 +162,7 @@ protected:
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 ::com::sun::star::awt::Rectangle* pShapeRect,
sal_Bool bClearText );
@@ -169,7 +170,7 @@ protected:
void addChildren(
const ::oox::core::XmlFilterBase& rFilterBase,
Shape& rMaster,
- const ThemePtr& rxTheme,
+ const Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const ::com::sun::star::awt::Rectangle& rClientRect,
ShapeIdMap* pShapeMap );
diff --git a/oox/inc/oox/dump/dffdumper.hxx b/oox/inc/oox/dump/dffdumper.hxx
index 83b141cbf..8d8a000b8 100644
--- a/oox/inc/oox/dump/dffdumper.hxx
+++ b/oox/inc/oox/dump/dffdumper.hxx
@@ -59,10 +59,15 @@ protected:
private:
void constructDffObj();
+ sal_uInt32 dumpDffSimpleColor( const String& rName );
+ sal_uInt32 dumpDffColor( const String& rName );
+
+ void dumpDffOpt();
sal_uInt16 dumpDffOptPropHeader();
- void dumpDffOptPropValue( sal_uInt16 nPropId, sal_uInt32 nValue );
private:
+ ItemFormatMap maSimpleProps;
+ ItemFormatMap maComplexProps;
sal_uInt16 mnInstVer;
sal_Int32 mnRealSize;
};
diff --git a/oox/inc/oox/dump/dumperbase.hxx b/oox/inc/oox/dump/dumperbase.hxx
index 61b41850b..435cf2a2a 100644
--- a/oox/inc/oox/dump/dumperbase.hxx
+++ b/oox/inc/oox/dump/dumperbase.hxx
@@ -101,6 +101,9 @@ const sal_Unicode OOX_DUMP_EMPTYVALUE = '~';
const sal_Unicode OOX_DUMP_CMDPROMPT = '?';
const sal_Unicode OOX_DUMP_PLACEHOLDER = '\x01';
+typedef ::std::pair< ::rtl::OUString, ::rtl::OUString > OUStringPair;
+typedef ::std::pair< sal_Int64, sal_Int64 > Int64Pair;
+
typedef ::std::vector< ::rtl::OUString > OUStringVector;
typedef ::std::vector< sal_Int64 > Int64Vector;
@@ -406,6 +409,7 @@ public:
// string conversion ------------------------------------------------------
static ::rtl::OUString trimSpaces( const ::rtl::OUString& rStr );
+ static ::rtl::OUString trimTrailingNul( const ::rtl::OUString& rStr );
static ::rtl::OString convertToUtf8( const ::rtl::OUString& rStr );
static DataType convertToDataType( const ::rtl::OUString& rStr );
@@ -418,6 +422,8 @@ public:
static bool convertStringToDouble( double& orfData, const ::rtl::OUString& rData );
static bool convertStringToBool( const ::rtl::OUString& rData );
+ static OUStringPair convertStringToPair( const ::rtl::OUString& rString, sal_Unicode cSep = '=' );
+
// string to list conversion ----------------------------------------------
static void convertStringToStringList( OUStringVector& orVec, const ::rtl::OUString& rData, bool bIgnoreEmpty );
@@ -764,10 +770,10 @@ class FlagsList : public NameListBase
public:
explicit FlagsList( const SharedConfigData& rCfgData );
+ /** Returns the flags to be ignored on output. */
+ inline sal_Int64 getIgnoreFlags() const { return mnIgnore; }
/** Sets flags to be ignored on output. */
- template< typename Type >
- inline void setIgnoreFlags( Type nIgnore )
- { mnIgnore = static_cast< sal_Int64 >( nIgnore ); }
+ inline void setIgnoreFlags( sal_Int64 nIgnore ) { mnIgnore = nIgnore; }
protected:
virtual void implProcessConfigItemStr(
@@ -804,12 +810,20 @@ protected:
virtual void implIncludeList( const NameListBase& rList );
private:
+ struct ExtItemFormatKey
+ {
+ sal_Int64 mnKey;
+ Int64Pair maFilter;
+ inline explicit ExtItemFormatKey( sal_Int64 nKey ) : mnKey( nKey ), maFilter( 0, 0 ) {}
+ bool operator<( const ExtItemFormatKey& rRight ) const;
+
+ };
struct ExtItemFormat : public ItemFormat
{
bool mbShiftValue;
inline explicit ExtItemFormat() : mbShiftValue( true ) {}
};
- typedef ::std::map< sal_Int64, ExtItemFormat > ExtItemFormatMap;
+ typedef ::std::map< ExtItemFormatKey, ExtItemFormat > ExtItemFormatMap;
ExtItemFormatMap maFmtMap;
};
@@ -859,6 +873,17 @@ private:
static const NameListWrapper NO_LIST;
// ============================================================================
+
+class ItemFormatMap : public ::std::map< sal_Int64, ItemFormat >
+{
+public:
+ inline explicit ItemFormatMap() {}
+ inline explicit ItemFormatMap( const NameListRef& rxNameList ) { insertFormats( rxNameList ); }
+
+ void insertFormats( const NameListRef& rxNameList );
+};
+
+// ============================================================================
// ============================================================================
class SharedConfigData : public Base, public ConfigItemBase
@@ -1582,8 +1607,8 @@ protected:
sal_Unicode dumpChar( const String& rName, rtl_TextEncoding eTextEnc );
sal_Unicode dumpUnicode( const String& rName );
- ::rtl::OUString dumpCharArray( const String& rName, sal_Int32 nLen, rtl_TextEncoding eTextEnc );
- ::rtl::OUString dumpUnicodeArray( const String& rName, sal_Int32 nLen );
+ ::rtl::OUString dumpCharArray( const String& rName, sal_Int32 nLen, rtl_TextEncoding eTextEnc, bool bHideTrailingNul = false );
+ ::rtl::OUString dumpUnicodeArray( const String& rName, sal_Int32 nLen, bool bHideTrailingNul = false );
::rtl::OUString dumpNullCharArray( const String& rName, rtl_TextEncoding eTextEnc );
::rtl::OUString dumpNullUnicodeArray( const String& rName );
diff --git a/oox/inc/oox/ppt/pptshape.hxx b/oox/inc/oox/ppt/pptshape.hxx
index 6a6338dc6..a3c138424 100644
--- a/oox/inc/oox/ppt/pptshape.hxx
+++ b/oox/inc/oox/ppt/pptshape.hxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -50,7 +50,7 @@ public:
void addShape(
const oox::core::XmlFilterBase& rFilterBase,
const SlidePersist& rPersist,
- const oox::drawingml::ThemePtr& rxTheme,
+ const oox::drawingml::Theme* pTheme,
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes >& rxShapes,
const com::sun::star::awt::Rectangle* pShapeRect = 0,
::oox::drawingml::ShapeIdMap* pShapeMap = 0 );
diff --git a/oox/inc/oox/xls/drawingfragment.hxx b/oox/inc/oox/xls/drawingfragment.hxx
index 12dfdb400..8df10c7a8 100644
--- a/oox/inc/oox/xls/drawingfragment.hxx
+++ b/oox/inc/oox/xls/drawingfragment.hxx
@@ -41,25 +41,19 @@ namespace xls {
// ============================================================================
/** Absolute position in spreadsheet (in EMUs) independent from cells. */
-struct AnchorPosModel
+struct AnchorPosModel : public ::oox::drawingml::EmuPoint
{
- sal_Int64 mnX; /// Absolute X coordinate (EMUs).
- sal_Int64 mnY; /// Absolute Y coordinate (EMUs).
-
- explicit AnchorPosModel();
- inline bool isValid() const { return (mnX >= 0) && (mnY >= 0); }
+ inline explicit AnchorPosModel() : ::oox::drawingml::EmuPoint( -1, -1 ) {}
+ inline bool isValid() const { return (X >= 0) && (Y >= 0); }
};
// ----------------------------------------------------------------------------
/** Absolute size in spreadsheet (in EMUs). */
-struct AnchorSizeModel
+struct AnchorSizeModel : public ::oox::drawingml::EmuSize
{
- sal_Int64 mnWidth; /// Total width (EMUs).
- sal_Int64 mnHeight; /// Total height (EMUs).
-
- explicit AnchorSizeModel();
- inline bool isValid() const { return (mnWidth >= 0) && (mnHeight >= 0); }
+ inline explicit AnchorSizeModel() : ::oox::drawingml::EmuSize( -1, -1 ) {}
+ inline bool isValid() const { return (Width >= 0) && (Height >= 0); }
};
// ----------------------------------------------------------------------------
diff --git a/oox/inc/oox/xls/workbookhelper.hxx b/oox/inc/oox/xls/workbookhelper.hxx
index 3a03c2b06..b9abd088a 100644
--- a/oox/inc/oox/xls/workbookhelper.hxx
+++ b/oox/inc/oox/xls/workbookhelper.hxx
@@ -302,8 +302,6 @@ public:
WorksheetBuffer& getWorksheets() const;
/** Returns the office theme object read from the theme substorage. */
ThemeBuffer& getTheme() const;
- /** Returns the office theme object reference read from the theme substorage. */
- ::boost::shared_ptr< ::oox::drawingml::Theme > getThemeRef() const;
/** Returns all cell formatting objects read from the styles substream. */
StylesBuffer& getStyles() const;
/** Returns the shared strings read from the shared strings substream. */
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index d27d77e80..75da18c4c 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 5eb79f63e..007652007 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 000000000..9df064125
--- /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 60fb155fa..4e801e5bb 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 60efa21eb..4e00d37d3 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 d50629718..c3b51c57e 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 3ba22a30f..84762e6a2 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 6fffbdde1..c80b895b5 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 b74f73def..575478ba1 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 c507d61b3..651242067 100644
--- a/oox/source/drawingml/shapegroupcontext.cxx
+++ b/oox/source/drawingml/shapegroupcontext.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -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 645bb2bb7..618e89c99 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 70eb160a7..d204081a8 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 9c3184b27..c33d733c6 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 214ebc8c6..9a3a4ebdc 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 99603e12e..84d742c2b 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 d5be1f9a5..14e6ae30f 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 96433d63c..c398b0c01 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 40d65f650..24d088af6 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 fd33137b2..5640c53af 100644
--- a/oox/source/ppt/pptshapegroupcontext.cxx
+++ b/oox/source/ppt/pptshapegroupcontext.cxx
@@ -1,7 +1,7 @@
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -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 a3418e70c..894ca118a 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 f0091823f..e61093519 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -68,13 +68,13 @@ ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element )
FragmentHandlerRef rFragmentHandler
(new ShapeFragmentHandler(*mxFilterBase, msRelationFragmentPath));
ShapePtr pMasterShape;
-
+
switch (Element & 0xffff)
{
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" ));
@@ -103,15 +103,15 @@ ShapeContextHandler::getDrawingShapeContext()
(new oox::vml::DrawingFragment
( *mxFilterBase, msRelationFragmentPath, *mpDrawing )));
}
-
+
return mxDrawingFragmentHandler;
}
-
+
uno::Reference<xml::sax::XFastContextHandler>
ShapeContextHandler::getContextHandler()
{
uno::Reference<xml::sax::XFastContextHandler> xResult;
-
+
switch (mnStartToken & NMSP_MASK)
{
case NMSP_DOC:
@@ -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());
}
}
@@ -313,8 +313,8 @@ void SAL_CALL ShapeContextHandler::setRelationFragmentPath
void SAL_CALL ShapeContextHandler::setStartToken( ::sal_Int32 _starttoken ) throw (::com::sun::star::uno::RuntimeException)
{
mnStartToken = _starttoken;
-
-
+
+
}
::rtl::OUString ShapeContextHandler::getImplementationName()
diff --git a/oox/source/token/gennamespaces.pl b/oox/source/token/gennamespaces.pl
index 1772f8662..11385c5fc 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 63ca76e95..45bb59541 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 ec11c5855..7e6cae7ee 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 800bd73be..7b0bed455 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();