CWS-TOOLING: integrate CWS chartshapes

This commit is contained in:
Ivo Hinkelmann 2010-03-03 14:30:52 +01:00
commit 2b80072351
4 changed files with 23 additions and 90 deletions

View file

@ -205,7 +205,7 @@ PPTWriter::PPTWriter( SvStorageRef& rSvStorage,
if ( !mpPicStrm )
mpPicStrm = mrStg->OpenSotStream( String( RTL_CONSTASCII_USTRINGPARAM( "Pictures" ) ) );
mpPptEscherEx = new PptEscherEx( *mpStrm, mnDrawings );
mpPptEscherEx = new PptEscherEx( *mpStrm );
if ( !ImplGetStyleSheets() )
return;
@ -1694,7 +1694,7 @@ void PPTWriter::ImplWriteBackground( ::com::sun::star::uno::Reference< ::com::su
mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xc00 ); // Flags: Connector | Background | HasSpt
Point aEmptyPoint = Point();
Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpPptEscherEx, mpPicStrm, aRect );
EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
aPropOpt.AddOpt( ESCHER_Prop_fillType, ESCHER_FillSolid );
::com::sun::star::drawing::FillStyle aFS( ::com::sun::star::drawing::FillStyle_NONE );
if ( ImplGetPropertyValue( rXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "FillStyle" ) ) ) )

View file

@ -754,7 +754,7 @@ sal_Bool PPTWriter::ImplCloseDocument()
nBytesToInsert += ImplDocumentListContainer( NULL );
// nBytes im Stream einfuegen, und abhaengige Container anpassen
mpPptEscherEx->InsertAtCurrentPos( nBytesToInsert, TRUE );
mpPptEscherEx->InsertAtCurrentPos( nBytesToInsert, false );
// CREATE HYPERLINK CONTAINER
if ( nExEmbedSize )
@ -1506,7 +1506,7 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
{
Point aEmptyPoint = Point();
Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpPptEscherEx, mpPicStrm, aRect );
EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
aPropOpt.CreateGradientProperties( mXPropSet );
aPropOpt.GetOpt( ESCHER_Prop_fillColor, nBackgroundColor );
}
@ -1529,7 +1529,7 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
{
Point aEmptyPoint = Point();
Rectangle aRect( aEmptyPoint, Size( 28000, 21000 ) );
EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpPptEscherEx, mpPicStrm, aRect );
EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect );
aPropOpt.CreateGradientProperties( mXBackgroundPropSet );
aPropOpt.GetOpt( ESCHER_Prop_fillColor, nBackgroundColor );
}
@ -4135,7 +4135,7 @@ sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPag
if ( bRet && bMasterPage )
{
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
sal_uInt32 nPresShapeID = mpPptEscherEx->GetShapeID();
sal_uInt32 nPresShapeID = mpPptEscherEx->GenerateShapeId();
mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xa00, nPresShapeID );// Flags: HaveAnchor | HasSpt
EscherPropertyContainer aPropOpt;
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x50001 );
@ -4191,7 +4191,7 @@ sal_Bool PPTWriter::ImplCreatePresentationPlaceholder( const sal_Bool bMasterPag
void PPTWriter::ImplCreateShape( sal_uInt32 nType, sal_uInt32 nFlags, EscherSolverContainer& rSolver )
{
sal_uInt32 nId = mpPptEscherEx->GetShapeID();
sal_uInt32 nId = mpPptEscherEx->GenerateShapeId();
mpPptEscherEx->AddShape( nType, nFlags, nId );
rSolver.AddShape( mXShape, nId );
}
@ -4279,7 +4279,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
const ::com::sun::star::awt::Size aSize100thmm( mXShape->getSize() );
const ::com::sun::star::awt::Point aPoint100thmm( mXShape->getPosition() );
Rectangle aRect100thmm( Point( aPoint100thmm.X, aPoint100thmm.Y ), Size( aSize100thmm.Width, aSize100thmm.Height ) );
EscherPropertyContainer aPropOpt( (EscherGraphicProvider&)*mpPptEscherEx, mpPicStrm, aRect100thmm );
EscherPropertyContainer aPropOpt( mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRect100thmm );
if ( bGroup )
{
@ -4837,7 +4837,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
sal_uInt16 nChar;
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
mnShapeMasterTitle = mpPptEscherEx->GetShapeID();
mnShapeMasterTitle = mpPptEscherEx->GenerateShapeId();
mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xa00, mnShapeMasterTitle );// Flags: HaveAnchor | HasSpt
EscherPropertyContainer aPropertyOptions;
aPropertyOptions.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x50001 );
@ -4931,7 +4931,7 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
if ( mnTextSize )
{
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
mnShapeMasterBody = mpPptEscherEx->GetShapeID();
mnShapeMasterBody = mpPptEscherEx->GenerateShapeId();
mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xa00, mnShapeMasterBody ); // Flags: HaveAnchor | HasSpt
EscherPropertyContainer aPropOpt2;
aPropOpt2.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x50001 );
@ -5540,7 +5540,7 @@ void PPTWriter::ImplCreateCellBorder( const CellBorder* pCellBorder, sal_Int32 n
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
EscherPropertyContainer aPropOptSp;
sal_uInt32 nId = mpPptEscherEx->GetShapeID();
sal_uInt32 nId = mpPptEscherEx->GenerateShapeId();
mpPptEscherEx->AddShape( ESCHER_ShpInst_Line, 0xa02, nId );
aPropOptSp.AddOpt( ESCHER_Prop_shapePath, ESCHER_ShapeComplex );
aPropOptSp.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0xa0008 );
@ -5586,7 +5586,7 @@ void PPTWriter::ImplCreateTable( uno::Reference< drawing::XShape >& rXShape, Esc
<< (INT32)maRect.Right()
<< (INT32)maRect.Bottom();
sal_uInt32 nShapeId = mpPptEscherEx->GetShapeID();
sal_uInt32 nShapeId = mpPptEscherEx->GenerateShapeId();
mpPptEscherEx->AddShape( ESCHER_ShpInst_Min, 0x201, nShapeId ); // Flags: Group | Patriarch
aSolverContainer.AddShape( rXShape, nShapeId );
EscherPropertyContainer aPropOpt2;

View file

@ -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

View file

@ -48,14 +48,9 @@ enum PPT_TextHeader
class PptEscherEx : public EscherEx
{
SvMemoryStream maFIDCLs;
sal_uInt32 ImplDggContainerSize();
void ImplWriteDggContainer( SvStream& rSt );
sal_uInt32 ImplDggAtomSize();
void ImplWriteDggAtom( SvStream& rSt );
sal_uInt32 ImplOptAtomSize();
void ImplWriteOptAtom( SvStream& rSt );
@ -64,7 +59,7 @@ class PptEscherEx : public EscherEx
public:
PptEscherEx( SvStream& rOut, UINT32 nDrawings );
PptEscherEx( SvStream& rOut );
~PptEscherEx();
void OpenContainer( UINT16 n_EscherContainer, int nRecInstance = 0 );