summaryrefslogtreecommitdiff
path: root/sd/source/filter/eppt/escherex.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sd/source/filter/eppt/escherex.cxx')
-rw-r--r--sd/source/filter/eppt/escherex.cxx82
1 files changed, 10 insertions, 72 deletions
diff --git a/sd/source/filter/eppt/escherex.cxx b/sd/source/filter/eppt/escherex.cxx
index 1f91b4947026..fbb94de67ae7 100644
--- a/sd/source/filter/eppt/escherex.cxx
+++ b/sd/source/filter/eppt/escherex.cxx
@@ -37,14 +37,10 @@
// ---------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------
-PptEscherEx::PptEscherEx( SvStream& rOutStrm, UINT32 nDrawings ) :
- EscherEx ( rOutStrm, nDrawings )
+PptEscherEx::PptEscherEx( SvStream& rOutStrm ) :
+ EscherEx( EscherExGlobalRef( new EscherExGlobal ), rOutStrm )
{
- mnFIDCLs = nDrawings;
mnCurrentDg = 0;
- mnCurrentShapeID = 0;
- mnTotalShapesDgg = 0;
- mnCurrentShapeMaximumID = 0;
}
// ---------------------------------------------------------------------------------------------
@@ -69,8 +65,8 @@ sal_uInt32 PptEscherEx::ImplDggContainerSize()
{
UINT32 nSize;
- nSize = ImplDggAtomSize();
- nSize += GetBlibStoreContainerSize();
+ nSize = mxGlobal->GetDggAtomSize();
+ nSize += mxGlobal->GetBlibStoreContainerSize();
nSize += ImplOptAtomSize();
nSize += ImplSplitMenuColorsAtomSize();
@@ -85,8 +81,9 @@ void PptEscherEx::ImplWriteDggContainer( SvStream& rSt )
rSt << (sal_uInt32)( 0xf | ( ESCHER_DggContainer << 16 ) )
<< (sal_uInt32)( nSize - 8 );
- ImplWriteDggAtom( rSt );
- WriteBlibStoreContainer( rSt );
+ mxGlobal->SetDggContainer();
+ mxGlobal->WriteDggAtom( rSt );
+ mxGlobal->WriteBlibStoreContainer( rSt );
ImplWriteOptAtom( rSt );
ImplWriteSplitMenuColorsAtom( rSt );
}
@@ -94,29 +91,6 @@ void PptEscherEx::ImplWriteDggContainer( SvStream& rSt )
// ---------------------------------------------------------------------------------------------
-sal_uInt32 PptEscherEx::ImplDggAtomSize()
-{
- return maFIDCLs.Tell() + 24;
-}
-
-void PptEscherEx::ImplWriteDggAtom( SvStream& rSt )
-{
- sal_uInt32 nSize = ImplDggAtomSize();
- if ( nSize )
- {
- rSt << (sal_uInt32)( ESCHER_Dgg << 16 )
- << (sal_uInt32)( nSize - 8 )
- << mnCurrentShapeID
- << (sal_uInt32)( mnFIDCLs + 1 )
- << mnTotalShapesDgg
- << mnDrawings;
-
- rSt.Write( maFIDCLs.GetData(), nSize - 24 );
- }
-}
-
-// ---------------------------------------------------------------------------------------------
-
#define ESCHER_OPT_COUNT 6
sal_uInt32 PptEscherEx::ImplOptAtomSize()
@@ -191,11 +165,7 @@ void PptEscherEx::OpenContainer( UINT16 n_EscherContainer, int nRecInstance )
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
@@ -246,39 +216,7 @@ void PptEscherEx::CloseContainer()
{
mbEscherDg = FALSE;
if ( DoSeek( ESCHER_Persist_Dg | mnCurrentDg ) )
- {
- // shapeanzahl des drawings setzen
- mnTotalShapesDgg += mnTotalShapesDg;
- *mpOutStrm << mnTotalShapesDg << mnCurrentShapeMaximumID;
-
- if ( !mnTotalShapesDg )
- {
- maFIDCLs << (UINT32)0
- << (UINT32)0;
- }
- else
- {
- if ( mnTotalShapeIdUsedDg )
- {
- UINT32 i, nFIDCL = ( ( mnTotalShapeIdUsedDg - 1 ) / 0x400 );
- if ( nFIDCL )
- mnFIDCLs += nFIDCL;
- for ( i = 0; i <= nFIDCL; i++ )
- {
- maFIDCLs << mnCurrentDg; // drawing number
- if ( i < nFIDCL )
- maFIDCLs << 0x400;
- else
- {
- UINT32 nShapesLeft = mnTotalShapeIdUsedDg % 0x400;
- if ( !nShapesLeft )
- nShapesLeft = 0x400; // shape count in this IDCL
- maFIDCLs << (UINT32)nShapesLeft;
- }
- }
- }
- }
- }
+ *mpOutStrm << mxGlobal->GetDrawingShapeCount( mnCurrentDg ) << mxGlobal->GetLastShapeId( mnCurrentDg );
}
}
break;
@@ -326,7 +264,7 @@ sal_uInt32 PptEscherEx::EnterGroup( Rectangle* pBoundRect, SvMemoryStream* pClie
<< (INT32)aRect.Right()
<< (INT32)aRect.Bottom();
- nShapeId = GetShapeID();
+ nShapeId = GenerateShapeId();
if ( !mnGroupLevel )
AddShape( ESCHER_ShpInst_Min, 5, nShapeId ); // Flags: Group | Patriarch
else