summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
Diffstat (limited to 'filter')
-rw-r--r--filter/inc/filter/msfilter/escherex.hxx180
-rw-r--r--filter/source/config/fragments/types/pcd_Photo_CD_Base.xcu2
-rw-r--r--filter/source/config/fragments/types/pcd_Photo_CD_Base16.xcu2
-rw-r--r--filter/source/config/fragments/types/pcd_Photo_CD_Base4.xcu2
-rw-r--r--filter/source/config/fragments/types/svm_StarView_Metafile.xcu2
-rwxr-xr-xfilter/source/config/tools/merge/pyAltFCFGMerge1
-rw-r--r--filter/source/msfilter/escherex.cxx298
-rw-r--r--filter/source/msfilter/eschesdo.cxx76
-rw-r--r--filter/source/msfilter/eschesdo.hxx3
9 files changed, 379 insertions, 187 deletions
diff --git a/filter/inc/filter/msfilter/escherex.hxx b/filter/inc/filter/msfilter/escherex.hxx
index 4f1381749a55..b98f5dc85147 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:
@@ -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();
- EscherEx( SvStream& rOut, UINT32 nDrawings );
+ /** 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; }
+
+ /** 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.
+
+ 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. (!)
- // 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
+ @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/config/fragments/types/pcd_Photo_CD_Base.xcu b/filter/source/config/fragments/types/pcd_Photo_CD_Base.xcu
index dba3845285d7..2888c0f0ba46 100644
--- a/filter/source/config/fragments/types/pcd_Photo_CD_Base.xcu
+++ b/filter/source/config/fragments/types/pcd_Photo_CD_Base.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.draw.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>pcd</value></prop>
- <prop oor:name="MediaType"><value>image/x-photo-cd</value></prop>>
+ <prop oor:name="MediaType"><value>image/x-photo-cd</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>draw_PCD_Photo_CD_Base</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/pcd_Photo_CD_Base16.xcu b/filter/source/config/fragments/types/pcd_Photo_CD_Base16.xcu
index bb0a97823c32..e7bcee7e4c4c 100644
--- a/filter/source/config/fragments/types/pcd_Photo_CD_Base16.xcu
+++ b/filter/source/config/fragments/types/pcd_Photo_CD_Base16.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.draw.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>pcd</value></prop>
- <prop oor:name="MediaType"><value>image/x-photo-cd</value></prop>>
+ <prop oor:name="MediaType"><value>image/x-photo-cd</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>draw_PCD_Photo_CD_Base16</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/pcd_Photo_CD_Base4.xcu b/filter/source/config/fragments/types/pcd_Photo_CD_Base4.xcu
index 72ca4d282717..966a77a47c73 100644
--- a/filter/source/config/fragments/types/pcd_Photo_CD_Base4.xcu
+++ b/filter/source/config/fragments/types/pcd_Photo_CD_Base4.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.draw.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>pcd</value></prop>
- <prop oor:name="MediaType"><value>image/x-photo-cd</value></prop>>
+ <prop oor:name="MediaType"><value>image/x-photo-cd</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>draw_PCD_Photo_CD_Base4</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/svm_StarView_Metafile.xcu b/filter/source/config/fragments/types/svm_StarView_Metafile.xcu
index ac5e04e18a55..d7e52dbbb11a 100644
--- a/filter/source/config/fragments/types/svm_StarView_Metafile.xcu
+++ b/filter/source/config/fragments/types/svm_StarView_Metafile.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.draw.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>svm</value></prop>
- <prop oor:name="MediaType"><value>image/x-svm</value></prop>>
+ <prop oor:name="MediaType"><value>image/x-svm</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>SVM - StarView Metafile</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/tools/merge/pyAltFCFGMerge b/filter/source/config/tools/merge/pyAltFCFGMerge
index 17fe16fb3445..faf9b9c34cb7 100755
--- a/filter/source/config/tools/merge/pyAltFCFGMerge
+++ b/filter/source/config/tools/merge/pyAltFCFGMerge
@@ -438,7 +438,6 @@ def generateHeader(sVersion, sEncoding, sPath, sPackage, bLanguagePack):
sHeader += " xmlns:xs=\"http://www.w3.org/2001/XMLSchema\""
sHeader += " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n"
else:
- sHeader += "<!DOCTYPE oor:component-data SYSTEM \"../../../../component-update.dtd\">\n"
sHeader += "<oor:component-data xmlns:oor=\"http://openoffice.org/2001/registry\" xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" oor:package=\""
sHeader += sPath
sHeader += "\" oor:name=\""
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 10e1051eba2a..ff5be3476da7 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -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,7 +4777,7 @@ 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
else
@@ -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 b72427d78571..facc6e799d04 100644
--- a/filter/source/msfilter/eschesdo.cxx
+++ b/filter/source/msfilter/eschesdo.cxx
@@ -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 962000e5c2cf..754eb6f3a2c0 100644
--- a/filter/source/msfilter/eschesdo.hxx
+++ b/filter/source/msfilter/eschesdo.hxx
@@ -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 );