You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2012/06/01 19:57:51 UTC
svn commit: r1345289 [1/3] - in /incubator/ooo/branches/alg/aw080/main:
basegfx/source/numeric/ basegfx/source/polygon/ filter/inc/filter/msfilter/
filter/source/msfilter/ oox/inc/oox/export/ sc/source/filter/excel/
sc/source/filter/inc/ sc/source/filt...
Author: alg
Date: Fri Jun 1 17:57:48 2012
New Revision: 1345289
URL: http://svn.apache.org/viewvc?rev=1345289&view=rev
Log:
aw080: ppt export changes, first stabilizings, text handling
Modified:
incubator/ooo/branches/alg/aw080/main/basegfx/source/numeric/ftools.cxx
incubator/ooo/branches/alg/aw080/main/basegfx/source/polygon/b2dpolygontools.cxx
incubator/ooo/branches/alg/aw080/main/filter/inc/filter/msfilter/escherex.hxx
incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/escherex.cxx
incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/eschesdo.cxx
incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/eschesdo.hxx
incubator/ooo/branches/alg/aw080/main/oox/inc/oox/export/vmlexport.hxx
incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xeescher.cxx
incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xiescher.cxx
incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xlescher.cxx
incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xcl97esc.hxx
incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xcl97rec.hxx
incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xeescher.hxx
incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xlescher.hxx
incubator/ooo/branches/alg/aw080/main/sc/source/filter/xcl97/xcl97esc.cxx
incubator/ooo/branches/alg/aw080/main/sc/source/filter/xcl97/xcl97rec.cxx
incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/eppt.cxx
incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/eppt.hxx
incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/epptso.cxx
incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/escherex.cxx
incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/escherex.hxx
incubator/ooo/branches/alg/aw080/main/svx/inc/svx/svdoashp.hxx
incubator/ooo/branches/alg/aw080/main/svx/inc/svx/svdotable.hxx
incubator/ooo/branches/alg/aw080/main/svx/inc/svx/svdotext.hxx
incubator/ooo/branches/alg/aw080/main/svx/inc/svx/unopage.hxx
incubator/ooo/branches/alg/aw080/main/svx/inc/svx/unoshape.hxx
incubator/ooo/branches/alg/aw080/main/svx/inc/svx/unoshtxt.hxx
incubator/ooo/branches/alg/aw080/main/svx/source/customshapes/EnhancedCustomShape2d.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/sdrtexthelpers.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdcrtv.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdedtv2.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdlegacy.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdoashp.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdocirc.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxat.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/svdraw/svdotxtr.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/table/celleditsource.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/table/celleditsource.hxx
incubator/ooo/branches/alg/aw080/main/svx/source/table/svdotable.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/table/tablelayouter.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/table/tablelayouter.hxx
incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unopage.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshape.cxx
incubator/ooo/branches/alg/aw080/main/svx/source/unodraw/unoshtxt.cxx
incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/escher.hxx
incubator/ooo/branches/alg/aw080/main/sw/source/filter/ww8/wrtw8esh.cxx
Modified: incubator/ooo/branches/alg/aw080/main/basegfx/source/numeric/ftools.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/basegfx/source/numeric/ftools.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/basegfx/source/numeric/ftools.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/basegfx/source/numeric/ftools.cxx Fri Jun 1 17:57:48 2012
@@ -43,7 +43,14 @@ namespace basegfx
const double fHalfStep(fStep * 0.5);
const double fChange(fHalfStep - fmod(v + fHalfStep, fStep));
- return v + fChange;
+ if(basegfx::fTools::equal(fabs(v), fabs(fChange)))
+ {
+ return 0.0;
+ }
+ else
+ {
+ return v + fChange;
+ }
}
}
Modified: incubator/ooo/branches/alg/aw080/main/basegfx/source/polygon/b2dpolygontools.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/basegfx/source/polygon/b2dpolygontools.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/basegfx/source/polygon/b2dpolygontools.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/basegfx/source/polygon/b2dpolygontools.cxx Fri Jun 1 17:57:48 2012
@@ -1986,7 +1986,7 @@ namespace basegfx
// truncate fStart, fEnd to a range of [0.0 .. F_2PI[ where F_2PI
// falls back to 0.0 to ensure a unique definition
- if(fTools::less(fStart, 0.0))
+ if(fTools::lessOrEqual(fStart, 0.0))
{
fStart = 0.0;
}
@@ -1996,7 +1996,7 @@ namespace basegfx
fStart = 0.0;
}
- if(fTools::less(fEnd, 0.0))
+ if(fTools::lessOrEqual(fEnd, 0.0))
{
fEnd = 0.0;
}
Modified: incubator/ooo/branches/alg/aw080/main/filter/inc/filter/msfilter/escherex.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/filter/inc/filter/msfilter/escherex.hxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/filter/inc/filter/msfilter/escherex.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/filter/inc/filter/msfilter/escherex.hxx Fri Jun 1 17:57:48 2012
@@ -1091,8 +1091,13 @@ class MSFILTER_DLLPUBLIC EscherGraphicPr
void WriteBlibStoreContainer( SvStream& rStrm, SvStream* pMergePicStreamBSE = NULL );
sal_Bool WriteBlibStoreEntry(SvStream& rStrm, sal_uInt32 nBlipId,
sal_Bool bWritePictureOffset, sal_uInt32 nResize = 0);
- sal_uInt32 GetBlibID( SvStream& rPicOutStream, const ByteString& rGraphicId, const basegfx::B2DRange& rBoundRange,
- const com::sun::star::awt::Rectangle* pVisArea = NULL, const GraphicAttr* pGrafikAttr = NULL );
+ sal_uInt32 GetBlibID(
+ SvStream& rPicOutStream,
+ const ByteString& rGraphicId,
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale,
+ const com::sun::star::awt::Rectangle* pVisArea = NULL,
+ const GraphicAttr* pGrafikAttr = NULL );
sal_Bool HasGraphics() const { return mnBlibEntrys != 0; };
void SetNewBlipStreamOffset( sal_Int32 nOffset );
@@ -1152,7 +1157,8 @@ class MSFILTER_DLLPUBLIC EscherPropertyC
{
EscherGraphicProvider* pGraphicProvider;
SvStream* pPicOutStrm;
- basegfx::B2DRange* pShapeBoundRange;
+ basegfx::B2DPoint* mpObjectPosition;
+ basegfx::B2DVector* mpObjectScale;
EscherPropSortStruct* pSortStruct;
@@ -1176,9 +1182,9 @@ class MSFILTER_DLLPUBLIC EscherPropertyC
EscherPropertyContainer();
EscherPropertyContainer(
EscherGraphicProvider& rGraphicProvider, // the PropertyContainer needs to know
- SvStream* pPicOutStrm, // the GraphicProvider to be able to write
- basegfx::B2DRange& rShapeBoundRange ); // FillBitmaps or GraphicObjects.
- // under some cirumstances the ShapeBoundRect is adjusted
+ SvStream* pPicOutStrm, // the GraphicProvider to be able to write
+ basegfx::B2DPoint& rObjectPosition, // FillBitmaps or GraphicObjects.
+ basegfx::B2DVector& rObjectScale); // under some cirumstances the ShapeBoundRect is adjusted
// this will happen when rotated GraphicObjects
// are saved to PowerPoint
~EscherPropertyContainer();
@@ -1303,8 +1309,10 @@ public:
/// Application writes the record header
/// using rEx.AddAtom(...) followed by
/// record data written to rEx.GetStream()
- virtual void WriteData( EscherEx& rEx,
- const basegfx::B2DRange& rRange ) = 0;
+ virtual void WriteData(
+ EscherEx& rEx,
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale) = 0;
};
@@ -1337,8 +1345,8 @@ public:
EscherExClientRecord_Base* GetClientTextbox() const
{ return pClientTextbox; }
- void WriteClientAnchor( EscherEx& rEx, const basegfx::B2DRange& rRange )
- { if( pClientAnchor ) pClientAnchor->WriteData( rEx, rRange ); }
+ void WriteClientAnchor( EscherEx& rEx, const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale )
+ { if( pClientAnchor ) pClientAnchor->WriteData( rEx, rObjectPosition, rObjectScale ); }
void WriteClientData( EscherEx& rEx )
{ if( pClientData ) pClientData->WriteData( rEx ); }
void WriteClientTextbox( EscherEx& rEx )
@@ -1532,20 +1540,38 @@ public:
virtual void BeginAtom();
virtual void EndAtom( sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
virtual void AddAtom( sal_uInt32 nAtomSitze, sal_uInt16 nRecType, int nRecVersion = 0, int nRecInstance = 0 );
- virtual void AddChildAnchor( const basegfx::B2DRange& rRange );
- virtual void AddClientAnchor( const basegfx::B2DRange& rRange );
-
- virtual sal_uInt32 EnterGroup( const String& rShapeName, const basegfx::B2DRange* pBoundRange = 0 );
- sal_uInt32 EnterGroup( const basegfx::B2DRange* pBoundRange = 0 );
+ virtual void AddChildAnchor(
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale);
+ virtual void AddClientAnchor(
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale);
+
+ virtual sal_uInt32 EnterGroup(
+ const String& rShapeName,
+ const basegfx::B2DPoint* pObjectPosition = 0,
+ const basegfx::B2DVector* pObjectScale = 0 );
+ sal_uInt32 EnterGroup(
+ const basegfx::B2DPoint* pObjectPosition = 0,
+ const basegfx::B2DVector* pObjectScale = 0 );
sal_uInt32 GetGroupLevel() const { return mnGroupLevel; };
- virtual sal_Bool SetGroupSnapRange( sal_uInt32 nGroupLevel, const basegfx::B2DRange& rRange );
- virtual sal_Bool SetGroupLogicRange( sal_uInt32 nGroupLevel, const basegfx::B2DRange& rRange );
+ virtual sal_Bool SetGroupSnapPositionAndScale(
+ sal_uInt32 nGroupLevel,
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale);
+ virtual sal_Bool SetGroupLogicPositionAndScale(
+ sal_uInt32 nGroupLevel,
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale);
virtual void LeaveGroup();
// ein ESCHER_Sp wird geschrieben ( Ein ESCHER_DgContainer muss dazu geoeffnet sein !!)
virtual void AddShape( sal_uInt32 nShpInstance, sal_uInt32 nFlagIds, sal_uInt32 nShapeID = 0 );
- virtual void Commit( EscherPropertyContainer& rProps, const basegfx::B2DRange& rRange );
+ virtual void Commit(
+ EscherPropertyContainer& rProps,
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale);
sal_uInt32 GetColor( const sal_uInt32 nColor, sal_Bool bSwap = sal_True );
sal_uInt32 GetColor( const Color& rColor, sal_Bool bSwap = sal_True );
@@ -1568,7 +1594,8 @@ public:
/// shape is ignored.
virtual EscherExHostAppData* StartShape(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape,
- const basegfx::B2DRange* pChildAnchor );
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale);
/// Called after a shape is written to inform the application
/// of the resulted shape type and ID.
Modified: incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/escherex.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/escherex.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/escherex.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/escherex.cxx Fri Jun 1 17:57:48 2012
@@ -168,12 +168,14 @@ EscherPropertyContainer::EscherPropertyC
EscherPropertyContainer::EscherPropertyContainer(
EscherGraphicProvider& rGraphProv,
- SvStream* pPiOutStrm,
- basegfx::B2DRange& rShapeBoundRange ) :
+ SvStream* pPiOutStrm,
+ basegfx::B2DPoint& rObjectPosition, // FillBitmaps or GraphicObjects.
+ basegfx::B2DVector& rObjectScale) :
pGraphicProvider ( &rGraphProv ),
pPicOutStrm ( pPiOutStrm ),
- pShapeBoundRange ( &rShapeBoundRange )
+ mpObjectPosition(&rObjectPosition),
+ mpObjectScale(&rObjectScale)
{
ImplInit();
}
@@ -1172,7 +1174,7 @@ sal_Bool EscherPropertyContainer::Create
AddOpt( ESCHER_Prop_fillType, ESCHER_FillPicture );
uno::Reference< beans::XPropertySet > aXPropSet( rXShape, uno::UNO_QUERY );
- if ( pGraphicProvider && pPicOutStrm && pShapeBoundRange && aXPropSet.is() )
+ if ( pGraphicProvider && pPicOutStrm && mpObjectPosition && mpObjectScale && aXPropSet.is() )
{
::com::sun::star::uno::Any aAny;
::com::sun::star::awt::Rectangle* pVisArea = NULL;
@@ -1181,8 +1183,10 @@ sal_Bool EscherPropertyContainer::Create
pVisArea = new ::com::sun::star::awt::Rectangle;
aAny >>= (*pVisArea);
}
- const basegfx::B2DRange aRange(basegfx::B2DPoint(0.0, 0.0), pShapeBoundRange->getRange());
- sal_uInt32 nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aRange, pVisArea, NULL );
+
+ const basegfx::B2DPoint aPoint(0.0, 0.0);
+ const basegfx::B2DVector aVector(*mpObjectScale);
+ sal_uInt32 nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aPoint, aVector, pVisArea, NULL );
if ( nBlibId )
{
AddOpt( ESCHER_Prop_pib, nBlibId, sal_True );
@@ -1205,8 +1209,10 @@ sal_Bool EscherPropertyContainer::ImplCr
{
EscherGraphicProvider aProvider;
SvMemoryStream aMemStrm;
- basegfx::B2DRange aRange;
- if ( aProvider.GetBlibID( aMemStrm, rUniqueId, aRange ) )
+ const basegfx::B2DPoint aPoint(0.0, 0.0);
+ const basegfx::B2DVector aVector(1.0, 1.0);
+
+ if ( aProvider.GetBlibID( aMemStrm, rUniqueId, aPoint, aVector ) )
{
// grab BLIP from stream and insert directly as complex property
// ownership of stream memory goes to complex property
@@ -1475,15 +1481,16 @@ sal_Bool EscherPropertyContainer::Create
else
{
pGraphicAttr->SetRotation( nAngle );
- if ( nAngle && pShapeBoundRange ) // up to xp ppoint does not rotate bitmaps !
+ if ( nAngle && mpObjectPosition && mpObjectScale ) // up to xp ppoint does not rotate bitmaps !
{
Rectangle aOldRect(
- basegfx::fround(pShapeBoundRange->getMinX()), basegfx::fround(pShapeBoundRange->getMinY()),
- basegfx::fround(pShapeBoundRange->getMaxX()), basegfx::fround(pShapeBoundRange->getMaxY()));
+ Point(basegfx::fround(mpObjectPosition->getX()), basegfx::fround(mpObjectPosition->getY())),
+ Size(basegfx::fround(mpObjectScale->getX()), basegfx::fround(mpObjectScale->getY())));
Polygon aPoly( aOldRect );
aPoly.Rotate( aOldRect.TopLeft(), nAngle );
aOldRect = aPoly.GetBoundRect();
- *pShapeBoundRange = basegfx::B2DRange(aOldRect.Left(), aOldRect.Top(), aOldRect.Right(), aOldRect.Bottom());
+ *mpObjectPosition = basegfx::B2DPoint(aOldRect.Left(), aOldRect.Top());
+ *mpObjectScale = basegfx::B2DVector(aOldRect.GetWidth(), aOldRect.GetHeight());
bSuppressRotation = sal_True;
}
}
@@ -1497,12 +1504,13 @@ sal_Bool EscherPropertyContainer::Create
if ( aUniqueId.Len() )
{
// write out embedded graphic
- if ( pGraphicProvider && pPicOutStrm && pShapeBoundRange )
+ if ( pGraphicProvider && pPicOutStrm && mpObjectPosition && mpObjectScale )
{
- const basegfx::B2DRange aRange(basegfx::B2DPoint(0.0, 0.0), pShapeBoundRange->getRange());
+ const basegfx::B2DPoint aPoint(0.0, 0.0);
+ const basegfx::B2DVector aVector(*mpObjectScale);
sal_uInt32 nBlibId = 0;
- nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aRange, NULL, pGraphicAttr );
+ nBlibId = pGraphicProvider->GetBlibID( *pPicOutStrm, aUniqueId, aPoint, aVector, NULL, pGraphicAttr );
if ( nBlibId )
{
if ( bCreateFillBitmap )
@@ -1519,9 +1527,10 @@ sal_Bool EscherPropertyContainer::Create
{
EscherGraphicProvider aProvider;
SvMemoryStream aMemStrm;
- const basegfx::B2DRange aRange;
+ const basegfx::B2DPoint aPoint(0.0, 0.0);
+ const basegfx::B2DVector aVector(1.0, 1.0);
- if ( aProvider.GetBlibID( aMemStrm, aUniqueId, aRange, NULL, pGraphicAttr ) )
+ if ( aProvider.GetBlibID( aMemStrm, aUniqueId, aPoint, aVector, NULL, pGraphicAttr ) )
{
// grab BLIP from stream and insert directly as complex property
// ownership of stream memory goes to complex property
@@ -3785,8 +3794,13 @@ sal_Bool EscherGraphicProvider::GetPrefS
return bInRange;
}
-sal_uInt32 EscherGraphicProvider::GetBlibID( SvStream& rPicOutStrm, const ByteString& rId,
- const basegfx::B2DRange& /* rBoundRange */, const com::sun::star::awt::Rectangle* pVisArea, const GraphicAttr* pGraphicAttr )
+sal_uInt32 EscherGraphicProvider::GetBlibID(
+ SvStream& rPicOutStrm,
+ const ByteString& rId,
+ const basegfx::B2DPoint& /*rObjectPosition*/,
+ const basegfx::B2DVector& /*rObjectScale*/,
+ const com::sun::star::awt::Rectangle* pVisArea,
+ const GraphicAttr* pGraphicAttr )
{
sal_uInt32 nBlibId = 0;
GraphicObject aGraphicObject( rId );
@@ -4809,26 +4823,30 @@ void EscherEx::AddAtom( sal_uInt32 nAtom
// ---------------------------------------------------------------------------------------------
-void EscherEx::AddChildAnchor( const basegfx::B2DRange& rRange )
+void EscherEx::AddChildAnchor(
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale)
{
AddAtom( 16, ESCHER_ChildAnchor );
- *mpOutStrm << (sal_Int32)basegfx::fround(rRange.getMinX())
- << (sal_Int32)basegfx::fround(rRange.getMinY())
- << (sal_Int32)basegfx::fround(rRange.getMaxX())
- << (sal_Int32)basegfx::fround(rRange.getMaxY());
+ *mpOutStrm << (sal_Int32)basegfx::fround(rObjectPosition.getX())
+ << (sal_Int32)basegfx::fround(rObjectPosition.getY())
+ << (sal_Int32)basegfx::fround(rObjectPosition.getX() + rObjectScale.getX())
+ << (sal_Int32)basegfx::fround(rObjectPosition.getY() + rObjectScale.getX());
}
// ---------------------------------------------------------------------------------------------
-void EscherEx::AddClientAnchor( const basegfx::B2DRange& rRange )
+void EscherEx::AddClientAnchor(
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale)
{
AddAtom( 8, ESCHER_ClientAnchor );
// Askes SJ, here it is CORRECT to first write Y, then X (!)
// Do NOT change this, it's NOT a typo (!)
- *mpOutStrm << (sal_Int16)basegfx::fround(rRange.getMinY())
- << (sal_Int16)basegfx::fround(rRange.getMinX())
- << (sal_Int16)basegfx::fround(rRange.getMaxX())
- << (sal_Int16)basegfx::fround(rRange.getMaxY());
+ *mpOutStrm << (sal_Int16)basegfx::fround(rObjectPosition.getY())
+ << (sal_Int16)basegfx::fround(rObjectPosition.getX())
+ << (sal_Int16)basegfx::fround(rObjectPosition.getX() + rObjectScale.getX())
+ << (sal_Int16)basegfx::fround(rObjectPosition.getY() + rObjectScale.getY());
}
// ---------------------------------------------------------------------------------------------
@@ -4840,21 +4858,33 @@ EscherExHostAppData* EscherEx::EnterAddi
// ---------------------------------------------------------------------------------------------
-sal_uInt32 EscherEx::EnterGroup( const String& rShapeName, const basegfx::B2DRange* pBoundRange )
+sal_uInt32 EscherEx::EnterGroup(
+ const String& rShapeName,
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale )
{
- basegfx::B2DRange aRange;
- if( pBoundRange )
- aRange = *pBoundRange;
+ basegfx::B2DPoint aObjectPosition(0.0, 0.0);
+ basegfx::B2DVector aObjectScale(1.0, 1.0);
+
+ if(pObjectPosition)
+ {
+ aObjectPosition = *pObjectPosition;
+ }
+
+ if(pObjectScale)
+ {
+ aObjectScale = *pObjectScale;
+ }
OpenContainer( ESCHER_SpgrContainer );
OpenContainer( ESCHER_SpContainer );
AddAtom( 16, ESCHER_Spgr, 1 );
PtReplaceOrInsert( ESCHER_Persist_Grouping_Snap | mnGroupLevel,
mpOutStrm->Tell() );
- *mpOutStrm << (sal_Int32)basegfx::fround(aRange.getMinX()) // Bounding box fuer die Gruppierten shapes an die sie attached werden
- << (sal_Int32)basegfx::fround(aRange.getMinY())
- << (sal_Int32)basegfx::fround(aRange.getMaxX())
- << (sal_Int32)basegfx::fround(aRange.getMaxY());
+ *mpOutStrm << (sal_Int32)basegfx::fround(aObjectPosition.getX()) // Bounding box fuer die Gruppierten shapes an die sie attached werden
+ << (sal_Int32)basegfx::fround(aObjectPosition.getY())
+ << (sal_Int32)basegfx::fround(aObjectPosition.getX() + aObjectScale.getX())
+ << (sal_Int32)basegfx::fround(aObjectPosition.getY() + aObjectScale.getY());
sal_uInt32 nShapeId = GenerateShapeId();
if ( !mnGroupLevel )
@@ -4871,15 +4901,15 @@ sal_uInt32 EscherEx::EnterGroup( const S
if( rShapeName.Len() > 0 )
aPropOpt.AddOpt( ESCHER_Prop_wzName, rShapeName );
- Commit( aPropOpt, aRange );
+ Commit( aPropOpt, aObjectPosition, aObjectScale );
if ( mnGroupLevel > 1 )
- AddChildAnchor( aRange );
+ AddChildAnchor( aObjectPosition, aObjectScale );
EscherExHostAppData* pAppData = mpImplEscherExSdr->ImplGetHostData();
if( pAppData )
{
if ( mnGroupLevel <= 1 )
- pAppData->WriteClientAnchor( *this, aRange );
+ pAppData->WriteClientAnchor( *this, aObjectPosition, aObjectScale );
pAppData->WriteClientData( *this );
}
}
@@ -4888,14 +4918,19 @@ sal_uInt32 EscherEx::EnterGroup( const S
return nShapeId;
}
-sal_uInt32 EscherEx::EnterGroup( const basegfx::B2DRange* pBoundRange )
+sal_uInt32 EscherEx::EnterGroup(
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale)
{
- return EnterGroup( String::EmptyString(), pBoundRange );
+ return EnterGroup( String::EmptyString(), pObjectPosition, pObjectScale );
}
// ---------------------------------------------------------------------------------------------
-sal_Bool EscherEx::SetGroupSnapRange( sal_uInt32 nGroupLevel, const basegfx::B2DRange& rRange )
+sal_Bool EscherEx::SetGroupSnapPositionAndScale(
+ sal_uInt32 nGroupLevel,
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale)
{
sal_Bool bRetValue = sal_False;
if ( nGroupLevel )
@@ -4903,10 +4938,10 @@ sal_Bool EscherEx::SetGroupSnapRange( sa
sal_uInt32 nCurrentPos = mpOutStrm->Tell();
if ( DoSeek( ESCHER_Persist_Grouping_Snap | ( nGroupLevel - 1 ) ) )
{
- *mpOutStrm << (sal_Int32)basegfx::fround(rRange.getMinX()) // Bounding box fuer die Gruppierten shapes an die sie attached werden
- << (sal_Int32)basegfx::fround(rRange.getMinY())
- << (sal_Int32)basegfx::fround(rRange.getMaxX())
- << (sal_Int32)basegfx::fround(rRange.getMaxY());
+ *mpOutStrm << (sal_Int32)basegfx::fround(rObjectPosition.getX()) // Bounding box fuer die Gruppierten shapes an die sie attached werden
+ << (sal_Int32)basegfx::fround(rObjectPosition.getY())
+ << (sal_Int32)basegfx::fround(rObjectPosition.getX() + rObjectScale.getX())
+ << (sal_Int32)basegfx::fround(rObjectPosition.getY() + rObjectScale.getY());
mpOutStrm->Seek( nCurrentPos );
}
}
@@ -4915,7 +4950,10 @@ sal_Bool EscherEx::SetGroupSnapRange( sa
// ---------------------------------------------------------------------------------------------
-sal_Bool EscherEx::SetGroupLogicRange( sal_uInt32 nGroupLevel, const basegfx::B2DRange& rRange )
+sal_Bool EscherEx::SetGroupLogicPositionAndScale(
+ sal_uInt32 nGroupLevel,
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale)
{
sal_Bool bRetValue = sal_False;
if ( nGroupLevel )
@@ -4923,10 +4961,10 @@ sal_Bool EscherEx::SetGroupLogicRange( s
sal_uInt32 nCurrentPos = mpOutStrm->Tell();
if ( DoSeek( ESCHER_Persist_Grouping_Logic | ( nGroupLevel - 1 ) ) )
{
- *mpOutStrm << (sal_Int16)basegfx::fround(rRange.getMinX())
- << (sal_Int16)basegfx::fround(rRange.getMinY())
- << (sal_Int16)basegfx::fround(rRange.getMaxX())
- << (sal_Int16)basegfx::fround(rRange.getMaxY());
+ *mpOutStrm << (sal_Int16)basegfx::fround(rObjectPosition.getX())
+ << (sal_Int16)basegfx::fround(rObjectPosition.getY())
+ << (sal_Int16)basegfx::fround(rObjectPosition.getX() + rObjectScale.getX())
+ << (sal_Int16)basegfx::fround(rObjectPosition.getY() + rObjectScale.getY());
mpOutStrm->Seek( nCurrentPos );
}
}
@@ -4962,7 +5000,10 @@ void EscherEx::AddShape( sal_uInt32 nShp
// ---------------------------------------------------------------------------------------------
-void EscherEx::Commit( EscherPropertyContainer& rProps, const basegfx::B2DRange& )
+void EscherEx::Commit(
+ EscherPropertyContainer& rProps,
+ const basegfx::B2DPoint& /*rObjectPosition*/,
+ const basegfx::B2DVector& /*rObjectScale*/)
{
rProps.Commit( GetStream() );
}
Modified: incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/eschesdo.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/eschesdo.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/eschesdo.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/eschesdo.cxx Fri Jun 1 17:57:48 2012
@@ -52,6 +52,8 @@
#include <vcl/cvtgrf.hxx>
#include <svx/svdlegacy.hxx>
#include <vcl/svapp.hxx>
+#include <svx/svdocirc.hxx>
+#include <basegfx/polygon/b2dpolygon.hxx>
using ::rtl::OUString;
using namespace ::com::sun::star;
@@ -145,12 +147,13 @@ void ImplEESdrWriter::ImplFlipBoundingBo
double fCos = cos( fVal );
double fSin = sin( fVal );
- basegfx::B2DRange aRange( rObj.GetRange() );
- const basegfx::B2DVector aHalfScale(aRange.getRange() * 0.5);
+ basegfx::B2DPoint aPoint(rObj.getObjectPosition());
+ basegfx::B2DVector aScale(rObj.getObjectScale());
+ const basegfx::B2DVector aHalfScale(aScale * 0.5);
const double nXDiff(fCos * aHalfScale.getX() + fSin * (-aHalfScale.getY()));
const double nYDiff(-( fSin * aHalfScale.getX() - fCos * ( -aHalfScale.getY())));
- aRange.transform(basegfx::tools::createTranslateB2DHomMatrix(-(aHalfScale.getX() - nXDiff), -(aHalfScale.getY() + nYDiff)));
+ aPoint -= basegfx::B2DPoint(aHalfScale.getX() - nXDiff, aHalfScale.getY() + nYDiff);
nAngle *= 655;
nAngle += 0x8000;
@@ -158,7 +161,7 @@ void ImplEESdrWriter::ImplFlipBoundingBo
rPropOpt.AddOpt( ESCHER_Prop_Rotation, nAngle );
rObj.SetAngle( nAngle );
- rObj.SetRange( aRange );
+ rObj.setObjectPositionAndScale(aPoint, aScale);
}
// -----------------------------------------------------------------------
@@ -202,7 +205,8 @@ sal_uInt32 ImplEESdrWriter::ImplWriteSha
sal_uInt32 nGrpShapeID = 0;
do {
- mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), (mpEscherEx->GetGroupLevel() > 1) ? &rObj.GetRange() : 0 );
+ const bool bHandOverPosAndSize(mpEscherEx->GetGroupLevel() > 1);
+ mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), bHandOverPosAndSize ? &rObj.getObjectPosition() : 0, bHandOverPosAndSize ? &rObj.getObjectScale() : 0 );
if ( mpHostAppData && mpHostAppData->DontWriteShape() )
break;
@@ -220,7 +224,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteSha
if( xXIndexAccess.is() && 0 != xXIndexAccess->getCount() )
{
- nShapeID = mpEscherEx->EnterGroup( aShapeName, &rObj.GetRange() );
+ nShapeID = mpEscherEx->EnterGroup( aShapeName, &rObj.getObjectPosition(), &rObj.getObjectScale() );
nShapeType = ESCHER_ShpInst_Min;
for( sal_uInt32 n = 0, nCnt = xXIndexAccess->getCount();
@@ -254,12 +258,23 @@ sal_uInt32 ImplEESdrWriter::ImplWriteSha
RTL_TEXTENCODING_MS_1252 ));
}
- const ::com::sun::star::awt::Size aSize100thmm( rObj.GetShapeRef()->getSize() );
- const ::com::sun::star::awt::Point aPoint100thmm( rObj.GetShapeRef()->getPosition() );
- basegfx::B2DRange aRange100thmm(aPoint100thmm.X, aPoint100thmm.Y, aPoint100thmm.X + aSize100thmm.Width, aPoint100thmm.Y + aSize100thmm.Height);
- if ( !mpPicStrm )
+ // TTTT: adapted to transformation
+ basegfx::B2DPoint maObjectPosition(0.0, 0.0);
+ basegfx::B2DVector maObjectScale(1.0, 1.0);
+
+ if(rObj.ImplGetPropertyValue(::rtl::OUString::createFromAscii("Transformation")))
+ {
+ drawing::HomogenMatrix3 aMatrix;
+ rObj.GetUsrAny() >>= aMatrix;
+ const basegfx::tools::B2DHomMatrixBufferedDecompose aMat(basegfx::tools::UnoHomogenMatrix3ToB2DHomMatrix(aMatrix));
+ maObjectPosition = aMat.getTranslate();
+ maObjectScale = aMat.getScale();
+ }
+
+ if ( !mpPicStrm )
mpPicStrm = mpEscherEx->QueryPictureStream();
- EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, aRange100thmm );
+
+ EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, maObjectPosition, maObjectScale );
// #i51348# shape name
if( aShapeName.Len() > 0 )
@@ -287,7 +302,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteSha
const basegfx::B2DPoint aPosition(ImplMapB2DPoint(aBound.getMinimum()));
const basegfx::B2DVector aScale(ImplMapB2DVector(aBound.getRange()));
- rObj.SetRange(basegfx::B2DRange(aPosition, aPosition + aScale));
+ rObj.setObjectPositionAndScale(aPosition, aScale);
rObj.SetAngle( 0 );
bDontWriteText = sal_True;
}
@@ -317,7 +332,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteSha
{
nRadius = ImplMapB2DVector(basegfx::B2DVector(nRadius, 0.0)).getLength();
ADD_SHAPE( ESCHER_ShpInst_RoundRectangle, 0xa00 ); // Flags: Connector | HasSpt
- const sal_Int32 nLenght(basegfx::fround((std::min(rObj.GetRange().getWidth(), rObj.GetRange().getHeight())) * 0.5));
+ const sal_Int32 nLenght(basegfx::fround((std::min(rObj.getObjectScale().getX(), rObj.getObjectScale().getY())) * 0.5));
if ( nRadius >= nLenght )
nRadius = 0x2a30; // 0x2a30 ist PPTs maximum radius
else
@@ -336,99 +351,54 @@ sal_uInt32 ImplEESdrWriter::ImplWriteSha
}
else if ( rObj.GetType().EqualsAscii( "drawing.Ellipse" ))
{
- CircleKind eCircleKind = CircleKind_FULL;
- PolyStyle ePolyKind = PolyStyle();
- if ( rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("CircleKind") ) )
- {
- eCircleKind = *( (CircleKind*)rObj.GetUsrAny().getValue() );
- switch ( eCircleKind )
- {
- case CircleKind_SECTION :
- {
- ePolyKind = POLY_PIE;
- }
- break;
- case CircleKind_ARC :
- {
- ePolyKind = POLY_ARC;
- }
- break;
+ // changed to directly use the SdrObject, using the handmade creatin of the polygon data
+ // seemed too dangerous for the moment. Can be changed back to own geometry creation, of
+ // course (e.g. by getting primitives using UNO API and filtering for hairlines)
+ SdrCircObj* pCircObj = dynamic_cast< SdrCircObj* >(GetSdrObjectFromXShape(rObj.GetShapeRef()));
- case CircleKind_CUT :
- {
- ePolyKind = POLY_CHORD;
- }
- break;
+ if(!pCircObj)
+ break;
- default:
- eCircleKind = CircleKind_FULL;
- }
- }
- if ( eCircleKind == CircleKind_FULL )
- {
+ if(OBJ_CIRC == pCircObj->GetCircleKind())
+ {
mpEscherEx->OpenContainer( ESCHER_SpContainer );
ADD_SHAPE( ESCHER_ShpInst_Ellipse, 0xa00 ); // Flags: Connector | HasSpt
aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );;
- }
+ }
else
{
- sal_Int32 nStartAngle, nEndAngle;
- if ( !rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("CircleStartAngle") ) )
- break;
- nStartAngle = *( (sal_Int32*)rObj.GetUsrAny().getValue() );
- if( !rObj.ImplGetPropertyValue( ::rtl::OUString::createFromAscii("CircleEndAngle") ) )
- break;
- nEndAngle = *( (sal_Int32*)rObj.GetUsrAny().getValue() );
-
- Point aStart, aEnd, aCenter;
- aStart.X() = (sal_Int32)( ( cos( (double)( nStartAngle *
- F_PI18000 ) ) * 100.0 ) );
- aStart.Y() = - (sal_Int32)( ( sin( (double)( nStartAngle *
- F_PI18000 ) ) * 100.0 ) );
- aEnd.X() = (sal_Int32)( ( cos( (double)( nEndAngle *
- F_PI18000 ) ) * 100.0 ) );
- aEnd.Y() = - (sal_Int32)( ( sin( (double)( nEndAngle *
- F_PI18000 ) ) * 100.0 ) );
- const Rectangle aOldRect(
- basegfx::fround(aRange100thmm.getMinX()), basegfx::fround(aRange100thmm.getMinY()),
- basegfx::fround(aRange100thmm.getMaxX()), basegfx::fround(aRange100thmm.getMaxY()));
- aCenter.X() = aOldRect.Left() + ( aOldRect.GetWidth() / 2 );
- aCenter.Y() = aOldRect.Top() + ( aOldRect.GetHeight() / 2 );
- aStart.X() += aCenter.X();
- aStart.Y() += aCenter.Y();
- aEnd.X() += aCenter.X();
- aEnd.Y() += aCenter.Y();
- Polygon aPolygon( aOldRect, aStart, aEnd, ePolyKind );
+ const basegfx::B2DPolyPolygon aOutline(pCircObj->TakeXorPoly());
+
+ if(!aOutline.count())
+ break;
+
+ Polygon aPolygon(aOutline.getB2DPolygon(0));
+
if( rObj.GetAngle() )
{
- aPolygon.Rotate( aOldRect.TopLeft(), (sal_uInt16)( rObj.GetAngle() / 10 ) );
+ // already applied to the polygon, nothing to do there
rObj.SetAngle( 0 );
}
- mpEscherEx->OpenContainer( ESCHER_SpContainer );
+
+ mpEscherEx->OpenContainer( ESCHER_SpContainer );
ADD_SHAPE( ESCHER_ShpInst_NotPrimitive, 0xa00 ); // Flags: Connector | HasSpt
::com::sun::star::awt::Rectangle aNewRect;
- switch ( ePolyKind )
- {
- case POLY_PIE :
- case POLY_CHORD :
- {
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, &aPolygon );
- aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );
- }
- break;
- case POLY_ARC :
- {
- aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_False, aNewRect, &aPolygon );
- aPropOpt.CreateLineProperties( rObj.mXPropSet, sal_False );
- }
- break;
- }
+ if(aOutline.isClosed())
+ {
+ aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYPOLYGON, sal_False, aNewRect, &aPolygon );
+ aPropOpt.CreateFillProperties( rObj.mXPropSet, sal_True );
+ }
+ else
+ {
+ aPropOpt.CreatePolygonProperties( rObj.mXPropSet, ESCHER_CREATEPOLYGON_POLYLINE, sal_False, aNewRect, &aPolygon );
+ aPropOpt.CreateLineProperties( rObj.mXPropSet, sal_False );
+ }
const basegfx::B2DPoint aPosition(ImplMapB2DPoint(basegfx::B2DPoint(aNewRect.X, aNewRect.Y)));
const basegfx::B2DVector aScale(ImplMapB2DVector(basegfx::B2DVector(aNewRect.Width, aNewRect.Height)));
- rObj.SetRange(basegfx::B2DRange(aPosition, aPosition + aScale));
+ rObj.setObjectPositionAndScale(aPosition, aScale);
}
if ( rObj.ImplGetText() )
aPropOpt.CreateTextProperties( rObj.mXPropSet,
@@ -451,7 +421,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteSha
const basegfx::B2DPoint aPosition(ImplMapB2DPoint(basegfx::B2DPoint(aNewRect.X, aNewRect.Y)));
const basegfx::B2DVector aScale(ImplMapB2DVector(basegfx::B2DVector(aNewRect.Width, aNewRect.Height)));
- rObj.SetRange(basegfx::B2DRange(aPosition, aPosition + aScale));
+ rObj.setObjectPositionAndScale(aPosition, aScale);
mpEscherEx->OpenContainer( ESCHER_SpContainer );
ADD_SHAPE( nSpType, nSpFlags );
}
@@ -562,7 +532,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteSha
{
if( rObj.ImplHasText() )
{
- nGrpShapeID = ImplEnterAdditionalTextGroup( rObj.GetShapeRef(), &rObj.GetRange() );
+ nGrpShapeID = ImplEnterAdditionalTextGroup( rObj.GetShapeRef(), &rObj.getObjectPosition(), &rObj.getObjectScale() );
bAdditionalText = sal_True;
}
mpEscherEx->OpenContainer( ESCHER_SpContainer );
@@ -601,7 +571,7 @@ sal_uInt32 ImplEESdrWriter::ImplWriteSha
{
if ( rObj.ImplHasText() )
{
- nGrpShapeID = ImplEnterAdditionalTextGroup( rObj.GetShapeRef(), &rObj.GetRange() );
+ nGrpShapeID = ImplEnterAdditionalTextGroup( rObj.GetShapeRef(), &rObj.getObjectPosition(), &rObj.getObjectScale() );
bAdditionalText = sal_True;
}
mpEscherEx->OpenContainer( ESCHER_SpContainer );
@@ -749,13 +719,13 @@ sal_uInt32 ImplEESdrWriter::ImplWriteSha
ImplFlipBoundingBox( rObj, aPropOpt );
aPropOpt.CreateShapeProperties( rObj.GetShapeRef() );
- mpEscherEx->Commit( aPropOpt, rObj.GetRange() );
+ mpEscherEx->Commit( aPropOpt, rObj.getObjectPosition(), rObj.getObjectScale() );
if( mpEscherEx->GetGroupLevel() > 1 )
- mpEscherEx->AddChildAnchor( rObj.GetRange() );
+ mpEscherEx->AddChildAnchor( rObj.getObjectPosition(), rObj.getObjectScale() );
if ( mpHostAppData )
{ //! with AdditionalText the App has to control whether these are written or not
- mpHostAppData->WriteClientAnchor( *mpEscherEx, rObj.GetRange() );
+ mpHostAppData->WriteClientAnchor( *mpEscherEx, rObj.getObjectPosition(), rObj.getObjectScale() );
mpHostAppData->WriteClientData( *mpEscherEx );
if ( !bDontWriteText )
mpHostAppData->WriteClientTextbox( *mpEscherEx );
@@ -784,23 +754,36 @@ void ImplEESdrWriter::ImplWriteAdditiona
sal_uInt16 nShapeType = 0;
do
{
- mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), (mpEscherEx->GetGroupLevel() > 1) ? &rObj.GetRange() : 0 );
+ const bool bHandOver(mpEscherEx->GetGroupLevel() > 1);
+ mpHostAppData = mpEscherEx->StartShape( rObj.GetShapeRef(), bHandOver ? &rObj.getObjectPosition() : 0, bHandOver ? &rObj.getObjectScale() : 0 );
if ( mpHostAppData && mpHostAppData->DontWriteShape() )
break;
- const ::com::sun::star::awt::Size aSize100thmm( rObj.GetShapeRef()->getSize() );
- const ::com::sun::star::awt::Point aPoint100thmm( rObj.GetShapeRef()->getPosition() );
- basegfx::B2DRange aRange100thmm(aPoint100thmm.X, aPoint100thmm.Y, aPoint100thmm.X + aSize100thmm.Width, aPoint100thmm.Y + aSize100thmm.Height);
- if ( !mpPicStrm )
+ // TTTT: adapted to transformation
+ basegfx::B2DPoint maObjectPosition(0.0, 0.0);
+ basegfx::B2DVector maObjectScale(1.0, 1.0);
+
+ if(rObj.ImplGetPropertyValue(::rtl::OUString::createFromAscii("Transformation")))
+ {
+ drawing::HomogenMatrix3 aMatrix;
+ rObj.GetUsrAny() >>= aMatrix;
+ const basegfx::tools::B2DHomMatrixBufferedDecompose aMat(basegfx::tools::UnoHomogenMatrix3ToB2DHomMatrix(aMatrix));
+ maObjectPosition = aMat.getTranslate();
+ maObjectScale = aMat.getScale();
+ }
+
+ if ( !mpPicStrm )
mpPicStrm = mpEscherEx->QueryPictureStream();
- EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, aRange100thmm );
- rObj.SetAngle( rObj.ImplGetInt32PropertyValue( ::rtl::OUString::createFromAscii("RotateAngle")));
+
+ EscherPropertyContainer aPropOpt( mpEscherEx->GetGraphicProvider(), mpPicStrm, maObjectPosition, maObjectScale );
+
+ rObj.SetAngle( rObj.ImplGetInt32PropertyValue( ::rtl::OUString::createFromAscii("RotateAngle")));
sal_Int32 nAngle = rObj.GetAngle();
if( rObj.GetType().EqualsAscii( "drawing.Line" ))
{
//2do: this does not work right
- const double fDist(hypot(rObj.GetRange().getWidth(), rObj.GetRange().getHeight()));
- rObj.SetRange(basegfx::B2DRange(rTextRefPoint.X(), rTextRefPoint.Y(), rTextRefPoint.X() + fDist, rTextRefPoint.Y() - 1));
+ const double fDist(hypot(rObj.getObjectScale().getX(), rObj.getObjectScale().getY()));
+ rObj.setObjectPositionAndScale(basegfx::B2DPoint(rTextRefPoint.X(), rTextRefPoint.Y()), basegfx::B2DVector(fDist, -1));
mpEscherEx->OpenContainer( ESCHER_SpContainer );
mpEscherEx->AddShape( ESCHER_ShpInst_TextBox, 0xa00 );
@@ -838,21 +821,19 @@ void ImplEESdrWriter::ImplWriteAdditiona
nAngle += 0x8000;
nAngle &=~0xffff; // nAngle auf volle Gradzahl runden
aPropOpt.AddOpt( ESCHER_Prop_Rotation, nAngle );
- mpEscherEx->SetGroupSnapRange( mpEscherEx->GetGroupLevel(),
- rObj.GetRange() );
- mpEscherEx->SetGroupLogicRange( mpEscherEx->GetGroupLevel(),
- rObj.GetRange() );
+ mpEscherEx->SetGroupSnapPositionAndScale( mpEscherEx->GetGroupLevel(), rObj.getObjectPosition(), rObj.getObjectScale() );
+ mpEscherEx->SetGroupLogicPositionAndScale( mpEscherEx->GetGroupLevel(), rObj.getObjectPosition(), rObj.getObjectScale() );
}
rObj.SetAngle( nAngle );
aPropOpt.CreateShapeProperties( rObj.GetShapeRef() );
- mpEscherEx->Commit( aPropOpt, rObj.GetRange() );
+ mpEscherEx->Commit( aPropOpt, rObj.getObjectPosition(), rObj.getObjectScale() );
// write the childanchor
- mpEscherEx->AddChildAnchor( rObj.GetRange() );
+ mpEscherEx->AddChildAnchor( rObj.getObjectPosition(), rObj.getObjectScale() );
#if defined EES_WRITE_EPP
// ClientAnchor
- mpEscherEx->AddClientAnchor( maRange );
+ mpEscherEx->AddClientAnchor( rObj.getObjectPosition(), rObj.getObjectScale() );
// ClientTextbox
mpEscherEx->OpenContainer( ESCHER_ClientTextbox );
mpEscherEx->AddAtom( 4, EPP_TextHeaderAtom );
@@ -862,7 +843,7 @@ void ImplEESdrWriter::ImplWriteAdditiona
#else // !EES_WRITE_EPP
if ( mpHostAppData )
{ //! the App has to control whether these are written or not
- mpHostAppData->WriteClientAnchor( *mpEscherEx, rObj.GetRange() );
+ mpHostAppData->WriteClientAnchor( *mpEscherEx, rObj.getObjectPosition(), rObj.getObjectScale() );
mpHostAppData->WriteClientData( *mpEscherEx );
mpHostAppData->WriteClientTextbox( *mpEscherEx );
}
@@ -876,12 +857,14 @@ void ImplEESdrWriter::ImplWriteAdditiona
// -------------------------------------------------------------------
-sal_uInt32 ImplEESdrWriter::ImplEnterAdditionalTextGroup( const Reference< XShape >& rShape,
- const basegfx::B2DRange* pBoundRange )
+sal_uInt32 ImplEESdrWriter::ImplEnterAdditionalTextGroup(
+ const Reference< XShape >& rShape,
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale)
{
mpHostAppData = mpEscherEx->EnterAdditionalTextGroup();
- sal_uInt32 nGrpId = mpEscherEx->EnterGroup( pBoundRange );
- mpHostAppData = mpEscherEx->StartShape( rShape, pBoundRange );
+ sal_uInt32 nGrpId = mpEscherEx->EnterGroup( pObjectPosition, pObjectScale );
+ mpHostAppData = mpEscherEx->StartShape( rShape, pObjectPosition, pObjectScale );
return nGrpId;
}
@@ -1087,7 +1070,10 @@ void EscherEx::EndSdrObjectPage()
// -------------------------------------------------------------------
-EscherExHostAppData* EscherEx::StartShape( const Reference< XShape >& /* rShape */, const basegfx::B2DRange* /*pChildAnchor*/ )
+EscherExHostAppData* EscherEx::StartShape(
+ const Reference< XShape >& /* rShape */,
+ const basegfx::B2DPoint* /*pObjectPosition*/,
+ const basegfx::B2DVector* /*pObjectScale*/ )
{
return NULL;
}
@@ -1185,7 +1171,7 @@ void ImplEESdrObject::Init( ImplEESdrWri
const basegfx::B2DPoint aPosition(rEx.ImplMapB2DPoint(basegfx::B2DPoint(mXShape->getPosition().X, mXShape->getPosition().Y)));
const basegfx::B2DVector aScale(rEx.ImplMapB2DVector(basegfx::B2DVector(mXShape->getSize().Width, mXShape->getSize().Height)));
- SetRange(basegfx::B2DRange(aPosition, aPosition + aScale));
+ setObjectPositionAndScale(aPosition, aScale);
mType = String( mXShape->getShapeType() );
mType.Erase( 0, nPrefix ); // strip "com.sun.star."
xub_StrLen nPos = mType.SearchAscii( "Shape" );
Modified: incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/eschesdo.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/eschesdo.hxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/eschesdo.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/filter/source/msfilter/eschesdo.hxx Fri Jun 1 17:57:48 2012
@@ -40,8 +40,12 @@ class ImplEESdrObject
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > mXShape;
// XTextRef mXText; // TextRef des globalen Text
::com::sun::star::uno::Any mAny;
- basegfx::B2DRange maRange;
- String mType;
+
+ // the object range, split in pos and scale to keep the evtl. negative size (mirroring)
+ basegfx::B2DPoint maObjectPosition;
+ basegfx::B2DVector maObjectScale;
+
+ String mType;
sal_uInt32 mnShapeId;
sal_uInt32 mnTextSize;
sal_Int32 mnAngle;
@@ -67,8 +71,9 @@ public:
const String& GetType() const { return mType; }
void SetType( const String& rS ) { mType = rS; }
- const basegfx::B2DRange& GetRange() const { return maRange; }
- void SetRange(const basegfx::B2DRange& rRange ) { maRange = rRange; }
+ void setObjectPositionAndScale(const basegfx::B2DPoint& rNewPos, const basegfx::B2DVector& rNewSize) { maObjectPosition = rNewPos; maObjectScale = rNewSize; }
+ const basegfx::B2DPoint& getObjectPosition() const { return maObjectPosition; }
+ const basegfx::B2DVector& getObjectScale() const { return maObjectScale; }
sal_Int32 GetAngle() const { return mnAngle; }
void SetAngle( sal_Int32 nVal ) { mnAngle = nVal; }
@@ -163,7 +168,8 @@ protected:
const Point& rTextRefPoint );
sal_uInt32 ImplEnterAdditionalTextGroup(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& rShape,
- const basegfx::B2DRange* pBoundRange = 0 );
+ const basegfx::B2DPoint* pObjectPosition = 0,
+ const basegfx::B2DVector* pObjectScale = 0);
public:
Modified: incubator/ooo/branches/alg/aw080/main/oox/inc/oox/export/vmlexport.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/oox/inc/oox/export/vmlexport.hxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/oox/inc/oox/export/vmlexport.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/oox/inc/oox/export/vmlexport.hxx Fri Jun 1 17:57:48 2012
@@ -83,7 +83,10 @@ protected:
/// The parameter is just what we got from StartShape().
virtual void EndShape( sal_Int32 nShapeElement );
- virtual void Commit( EscherPropertyContainer& rProps, const Rectangle& rRect );
+ virtual void Commit(
+ EscherPropertyContainer& rProps,
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale);
private:
Modified: incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xeescher.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xeescher.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xeescher.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xeescher.cxx Fri Jun 1 17:57:48 2012
@@ -99,8 +99,9 @@ void XclExpDffAnchorBase::SetFlags( cons
void XclExpDffAnchorBase::SetSdrObject( const SdrObject& rSdrObj )
{
+ const basegfx::B2DRange aRange(rSdrObj.getObjectRange(0));
ImplSetFlags( rSdrObj );
- ImplCalcAnchorRange( rSdrObj.getObjectRange(0), MAP_100TH_MM );
+ ImplCalcAnchorRange( aRange.getMinimum(), aRange.getRange(), MAP_100TH_MM );
}
void XclExpDffAnchorBase::WriteDffData( EscherEx& rEscherEx ) const
@@ -109,10 +110,12 @@ void XclExpDffAnchorBase::WriteDffData(
rEscherEx.GetStream() << mnFlags << maAnchor;
}
-void XclExpDffAnchorBase::WriteData( EscherEx& rEscherEx, const basegfx::B2DRange& rRange )
+void XclExpDffAnchorBase::WriteData( EscherEx& rEscherEx,
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale)
{
// the passed rectangle is in twips
- ImplCalcAnchorRange( rRange, MAP_TWIP );
+ ImplCalcAnchorRange( rObjectPosition, rObjectScale, MAP_TWIP );
WriteDffData( rEscherEx );
}
@@ -121,7 +124,7 @@ void XclExpDffAnchorBase::ImplSetFlags(
OSL_ENSURE( false, "XclExpDffAnchorBase::ImplSetFlags - not implemented" );
}
-void XclExpDffAnchorBase::ImplCalcAnchorRange( const basegfx::B2DRange&, MapUnit )
+void XclExpDffAnchorBase::ImplCalcAnchorRange( const basegfx::B2DPoint& /*rObjectPosition*/, const basegfx::B2DVector& /*rObjectScale*/, MapUnit )
{
OSL_ENSURE( false, "XclExpDffAnchorBase::ImplCalcAnchorRect - not implemented" );
}
@@ -140,9 +143,9 @@ void XclExpDffSheetAnchor::ImplSetFlags(
mnFlags = rSdrObj.getUniversalApplicationFlag01() ? EXC_ESC_ANCHOR_LOCKED : 0;
}
-void XclExpDffSheetAnchor::ImplCalcAnchorRange( const basegfx::B2DRange& rRange, MapUnit eMapUnit )
+void XclExpDffSheetAnchor::ImplCalcAnchorRange( const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale, MapUnit eMapUnit )
{
- maAnchor.SetRangeAtAnchor( GetRoot(), mnScTab, rRange, eMapUnit );
+ maAnchor.SetRangeAtAnchor( GetRoot(), mnScTab, rObjectPosition, rObjectScale, eMapUnit );
}
// ----------------------------------------------------------------------------
@@ -161,17 +164,17 @@ void XclExpDffEmbeddedAnchor::ImplSetFla
// TODO (unsupported feature): fixed size
}
-void XclExpDffEmbeddedAnchor::ImplCalcAnchorRange( const basegfx::B2DRange& rRange, MapUnit eMapUnit )
+void XclExpDffEmbeddedAnchor::ImplCalcAnchorRange( const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale, MapUnit eMapUnit )
{
- maAnchor.SetRangeAtAnchor( maPageScale, mfScaleX, mfScaleY, rRange, eMapUnit, true );
+ maAnchor.SetRangeAtAnchor( maPageScale, mfScaleX, mfScaleY, rObjectPosition, rObjectScale, eMapUnit, true );
}
// ----------------------------------------------------------------------------
-XclExpDffNoteAnchor::XclExpDffNoteAnchor( const XclExpRoot& rRoot, const basegfx::B2DRange& rRange ) :
+XclExpDffNoteAnchor::XclExpDffNoteAnchor( const XclExpRoot& rRoot, const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale ) :
XclExpDffAnchorBase( rRoot, EXC_ESC_ANCHOR_SIZELOCKED )
{
- maAnchor.SetRangeAtAnchor( rRoot, rRoot.GetCurrScTab(), rRange, MAP_100TH_MM );
+ maAnchor.SetRangeAtAnchor( rRoot, rRoot.GetCurrScTab(), rObjectPosition, rObjectScale, MAP_100TH_MM );
}
// ----------------------------------------------------------------------------
@@ -375,9 +378,15 @@ void XclExpControlHelper::WriteFormulaSu
#if EXC_EXP_OCX_CTRL
-XclExpOcxControlObj::XclExpOcxControlObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape,
- const basegfx::B2DRange* pChildAnchor, const String& rClassName, sal_uInt32 nStrmStart, sal_uInt32 nStrmSize ) :
- XclObj( rObjMgr, EXC_OBJTYPE_PICTURE, true ),
+XclExpOcxControlObj::XclExpOcxControlObj(
+ XclExpObjectManager& rObjMgr,
+ Reference< XShape > xShape,
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale,
+ const String& rClassName,
+ sal_uInt32 nStrmStart,
+ sal_uInt32 nStrmSize )
+: XclObj( rObjMgr, EXC_OBJTYPE_PICTURE, true ),
XclExpControlHelper( rObjMgr.GetRoot() ),
maClassName( rClassName ),
mnStrmStart( nStrmStart ),
@@ -419,7 +428,7 @@ XclExpOcxControlObj::XclExpOcxControlObj
aPropOpt.Commit( mrEscherEx.GetStream() );
// anchor
- ImplWriteAnchor( GetRoot(), SdrObject::getSdrObjectFromXShape( xShape ), pChildAnchor );
+ ImplWriteAnchor( GetRoot(), SdrObject::getSdrObjectFromXShape( xShape ), pObjectPosition, pObjectScale);
mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
mrEscherEx.CloseContainer(); // ESCHER_SpContainer
@@ -480,8 +489,12 @@ void XclExpOcxControlObj::WriteSubRecs(
#else
-XclExpTbxControlObj::XclExpTbxControlObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape, const basegfx::B2DRange* pChildAnchor ) :
- XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN, true ),
+XclExpTbxControlObj::XclExpTbxControlObj(
+ XclExpObjectManager& rObjMgr,
+ Reference< XShape > xShape,
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale)
+: XclObj( rObjMgr, EXC_OBJTYPE_UNKNOWN, true ),
XclExpControlHelper( rObjMgr.GetRoot() ),
mnHeight( 0 ),
mnState( 0 ),
@@ -558,7 +571,7 @@ XclExpTbxControlObj::XclExpTbxControlObj
aPropOpt.Commit( mrEscherEx.GetStream() );
// anchor
- ImplWriteAnchor( GetRoot(), SdrObject::getSdrObjectFromXShape( xShape ), pChildAnchor );
+ ImplWriteAnchor( GetRoot(), SdrObject::getSdrObjectFromXShape( xShape ), pObjectPosition, pObjectScale);
mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
mrEscherEx.UpdateDffFragmentEnd();
@@ -914,8 +927,12 @@ void XclExpTbxControlObj::WriteSbs( XclE
// ----------------------------------------------------------------------------
-XclExpChartObj::XclExpChartObj( XclExpObjectManager& rObjMgr, Reference< XShape > xShape, const basegfx::B2DRange* pChildAnchor ) :
- XclObj( rObjMgr, EXC_OBJTYPE_CHART ),
+XclExpChartObj::XclExpChartObj(
+ XclExpObjectManager& rObjMgr,
+ Reference< XShape > xShape,
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale)
+: XclObj( rObjMgr, EXC_OBJTYPE_CHART ),
XclExpRoot( rObjMgr.GetRoot() )
{
// create the MSODRAWING record contents for the chart object
@@ -935,7 +952,7 @@ XclExpChartObj::XclExpChartObj( XclExpOb
// anchor
SdrObject* pSdrObj = SdrObject::getSdrObjectFromXShape( xShape );
- ImplWriteAnchor( GetRoot(), pSdrObj, pChildAnchor );
+ ImplWriteAnchor( GetRoot(), pSdrObj, pObjectPosition, pObjectScale );
// client data (the following OBJ record)
mrEscherEx.AddAtom( 0, ESCHER_ClientData );
@@ -998,7 +1015,11 @@ XclExpNote::XclExpNote( const XclExpRoot
if( pScNote )
if( SdrCaptionObj* pCaption = pScNote->GetOrCreateCaption( maScPos ) )
if( const OutlinerParaObject* pOPO = pCaption->GetOutlinerParaObject() )
- mnObjId = rRoot.GetObjectManager().AddObj( new XclObjComment( rRoot.GetObjectManager(), sdr::legacy::GetLogicRange(*pCaption), pOPO->GetTextObject(), pCaption, mbVisible ) );
+ {
+ mnObjId = rRoot.GetObjectManager().AddObj(
+ new XclObjComment(
+ rRoot.GetObjectManager(), pCaption->getSdrObjectTranslate(), pCaption->getSdrObjectScale(), pOPO->GetTextObject(), pCaption, mbVisible ) );
+ }
SetRecSize( 9 + maAuthor.GetSize() );
}
Modified: incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xiescher.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xiescher.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xiescher.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xiescher.cxx Fri Jun 1 17:57:48 2012
@@ -1739,7 +1739,7 @@ void XclImpChartObj::FinalizeTabChart()
// create the object anchor
XclObjAnchor aAnchor;
- aAnchor.SetRangeAtAnchor( GetRoot(), GetCurrScTab(), basegfx::B2DRange( 1000.0, 500.0, fWidth, fHeight ), MAP_100TH_MM );
+ aAnchor.SetRangeAtAnchor( GetRoot(), GetCurrScTab(), basegfx::B2DPoint(1000.0, 500.0), basegfx::B2DVector(fWidth, fHeight), MAP_100TH_MM );
SetAnchor( aAnchor );
}
Modified: incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xlescher.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xlescher.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xlescher.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sc/source/filter/excel/xlescher.cxx Fri Jun 1 17:57:48 2012
@@ -203,9 +203,10 @@ basegfx::B2DRange XclObjAnchor::GetRange
return aRange;
}
-void XclObjAnchor::SetRangeAtAnchor( const XclRoot& rRoot, SCTAB nScTab, const basegfx::B2DRange& rRange, MapUnit eMapUnit )
+void XclObjAnchor::SetRangeAtAnchor( const XclRoot& rRoot, SCTAB nScTab, const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale, MapUnit eMapUnit )
{
- basegfx::B2DRange aRange( rRange );
+ basegfx::B2DPoint aObjectPosition(rObjectPosition);
+ basegfx::B2DVector aObjectScale(rObjectScale);
ScDocument& rDoc = rRoot.GetDoc();
sal_uInt16 nXclMaxCol = rRoot.GetXclMaxPos().Col();
sal_uInt16 nXclMaxRow = static_cast<sal_uInt16>( rRoot.GetXclMaxPos().Row());
@@ -213,21 +214,22 @@ void XclObjAnchor::SetRangeAtAnchor( con
// #106948# adjust coordinates in mirrored sheets
if( rDoc.IsLayoutRTL( nScTab ) )
{
- lclMirrorRange( aRange );
+ aObjectPosition.setX(-aObjectPosition.getX());
+ aObjectScale.setX(-aObjectScale.getX());
}
const double fScale(lclGetTwipsScale( eMapUnit ));
long nDummy = 0;
- lclGetColFromX( rDoc, nScTab, maFirst.mnCol, mnLX, 0, nXclMaxCol, nDummy, aRange.getMinX(), fScale );
- lclGetColFromX( rDoc, nScTab, maLast.mnCol, mnRX, maFirst.mnCol, nXclMaxCol, nDummy, aRange.getMaxX(), fScale );
+ lclGetColFromX( rDoc, nScTab, maFirst.mnCol, mnLX, 0, nXclMaxCol, nDummy, aObjectPosition.getX(), fScale );
+ lclGetColFromX( rDoc, nScTab, maLast.mnCol, mnRX, maFirst.mnCol, nXclMaxCol, nDummy, aObjectPosition.getX() + aObjectScale.getX(), fScale );
nDummy = 0;
- lclGetRowFromY( rDoc, nScTab, maFirst.mnRow, mnTY, 0, nXclMaxRow, nDummy, aRange.getMinY(), fScale );
- lclGetRowFromY( rDoc, nScTab, maLast.mnRow, mnBY, maFirst.mnRow, nXclMaxRow, nDummy, aRange.getMaxY(), fScale );
+ lclGetRowFromY( rDoc, nScTab, maFirst.mnRow, mnTY, 0, nXclMaxRow, nDummy, aObjectPosition.getY(), fScale );
+ lclGetRowFromY( rDoc, nScTab, maLast.mnRow, mnBY, maFirst.mnRow, nXclMaxRow, nDummy, aObjectPosition.getY() + aObjectScale.getY(), fScale );
}
void XclObjAnchor::SetRangeAtAnchor(
const basegfx::B2DVector& rPageScale, double fScaleX, double fScaleY,
- const basegfx::B2DRange& rRange, MapUnit eMapUnit, bool bDffAnchor )
+ const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale, MapUnit eMapUnit, bool bDffAnchor )
{
double fScale = 1.0;
switch( eMapUnit )
@@ -240,10 +242,10 @@ void XclObjAnchor::SetRangeAtAnchor(
/* In objects with DFF client anchor, the position of the shape is stored
in the cell address components of the client anchor. In old BIFF3-BIFF5
objects, the position is stored in the offset components of the anchor. */
- (bDffAnchor ? maFirst.mnCol : mnLX) = lclGetEmbeddedScale( rPageScale.getX(), fScaleX, rRange.getMinX(), fScale );
- (bDffAnchor ? maFirst.mnRow : mnTY) = lclGetEmbeddedScale( rPageScale.getY(), fScaleY, rRange.getMinY(), fScale );
- (bDffAnchor ? maLast.mnCol : mnRX) = lclGetEmbeddedScale( rPageScale.getX(), fScaleX, rRange.getMaxX(), fScale );
- (bDffAnchor ? maLast.mnRow : mnBY) = lclGetEmbeddedScale( rPageScale.getY(), fScaleY, rRange.getMaxY(), fScale );
+ (bDffAnchor ? maFirst.mnCol : mnLX) = lclGetEmbeddedScale( rPageScale.getX(), fScaleX, rObjectPosition.getX(), fScale );
+ (bDffAnchor ? maFirst.mnRow : mnTY) = lclGetEmbeddedScale( rPageScale.getY(), fScaleY, rObjectPosition.getY(), fScale );
+ (bDffAnchor ? maLast.mnCol : mnRX) = lclGetEmbeddedScale( rPageScale.getX(), fScaleX, rObjectPosition.getX() + rObjectScale.getX(), fScale );
+ (bDffAnchor ? maLast.mnRow : mnBY) = lclGetEmbeddedScale( rPageScale.getY(), fScaleY, rObjectPosition.getY() + rObjectScale.getY(), fScale );
// for safety, clear the other members
if( bDffAnchor )
Modified: incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xcl97esc.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xcl97esc.hxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xcl97esc.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xcl97esc.hxx Fri Jun 1 17:57:48 2012
@@ -98,7 +98,8 @@ public:
virtual EscherExHostAppData* StartShape(
const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape>& rxShape,
- const basegfx::B2DRange* pChildAnchor );
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale);
virtual void EndShape( sal_uInt16 nShapeType, sal_uInt32 nShapeID );
virtual EscherExHostAppData* EnterAdditionalTextGroup();
@@ -110,7 +111,8 @@ public:
@descr Writes the form control data to the 'Ctls' stream. */
XclExpOcxControlObj* CreateCtrlObj(
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
- const basegfx::B2DRange* pChildAnchor );
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale);
private:
SotStorageStreamRef mxCtlsStrm; /// The 'Ctls' stream.
@@ -118,7 +120,8 @@ private:
/** Creates a TBX form control OBJ record from the passed form control. */
XclExpTbxControlObj* CreateCtrlObj(
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
- const basegfx::B2DRange* pChildAnchor );
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale);
private:
/** Tries to get the name of a Basic macro from a control. */
Modified: incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xcl97rec.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xcl97rec.hxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xcl97rec.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xcl97rec.hxx Fri Jun 1 17:57:48 2012
@@ -83,7 +83,11 @@ protected:
See SetOwnEscher() for details. */
explicit XclObj( XclExpObjectManager& rObjMgr, sal_uInt16 nObjType, bool bOwnEscher = false );
- void ImplWriteAnchor( const XclExpRoot& rRoot, const SdrObject* pSdrObj, const basegfx::B2DRange* pChildAnchor );
+ void ImplWriteAnchor(
+ const XclExpRoot& rRoot,
+ const SdrObject* pSdrObj,
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale);
// overwritten for writing MSODRAWING record
virtual void WriteBody( XclExpStream& rStrm );
@@ -134,13 +138,13 @@ class XclObjComment : public XclObj
{
public:
XclObjComment( XclExpObjectManager& rObjMgr,
- const basegfx::B2DRange& rRange, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible );
+ const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible );
virtual ~XclObjComment();
/** c'tor process for formatted text objects above .
@descr used to construct the MSODRAWING Escher object properties. */
void ProcessEscherObj( const XclExpRoot& rRoot,
- const basegfx::B2DRange& rRange, SdrObject* pCaption, bool bVisible );
+ const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale, SdrObject* pCaption, bool bVisible );
virtual void Save( XclExpStream& rStrm );
Modified: incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xeescher.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xeescher.hxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xeescher.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xeescher.hxx Fri Jun 1 17:57:48 2012
@@ -52,11 +52,14 @@ public:
/** Called from SVX DFF converter.
@param rRect The object anchor rectangle to be exported (in twips). */
- virtual void WriteData( EscherEx& rEscherEx, const basegfx::B2DRange& rRange );
+ virtual void WriteData(
+ EscherEx& rEscherEx,
+ const basegfx::B2DPoint& rObjectPosition,
+ const basegfx::B2DVector& rObjectScale);
private:
virtual void ImplSetFlags( const SdrObject& rSdrObj );
- virtual void ImplCalcAnchorRange( const basegfx::B2DRange& rRect, MapUnit eMapUnit );
+ virtual void ImplCalcAnchorRange( const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale, MapUnit eMapUnit );
protected: // for access in derived classes
XclObjAnchor maAnchor; /// The client anchor data.
@@ -73,7 +76,7 @@ public:
private:
virtual void ImplSetFlags( const SdrObject& rSdrObj );
- virtual void ImplCalcAnchorRange( const basegfx::B2DRange& rRect, MapUnit eMapUnit );
+ virtual void ImplCalcAnchorRange( const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale, MapUnit eMapUnit );
private:
SCTAB mnScTab; /// Calc sheet index.
@@ -90,7 +93,7 @@ public:
private:
virtual void ImplSetFlags( const SdrObject& rSdrObj );
- virtual void ImplCalcAnchorRange( const basegfx::B2DRange& rRect, MapUnit eMapUnit );
+ virtual void ImplCalcAnchorRange( const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale, MapUnit eMapUnit );
private:
basegfx::B2DVector maPageScale;
@@ -104,7 +107,7 @@ private:
class XclExpDffNoteAnchor : public XclExpDffAnchorBase
{
public:
- explicit XclExpDffNoteAnchor( const XclExpRoot& rRoot, const basegfx::B2DRange& rRange );
+ explicit XclExpDffNoteAnchor( const XclExpRoot& rRoot, const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale );
};
// ----------------------------------------------------------------------------
@@ -214,7 +217,8 @@ public:
explicit XclExpOcxControlObj(
XclExpObjectManager& rObjMgr,
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
- const basegfx::B2DRange* pChildAnchor,
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale,
const String& rClassName,
sal_uInt32 nStrmStart, sal_uInt32 nStrmSize );
@@ -236,7 +240,8 @@ public:
explicit XclExpTbxControlObj(
XclExpObjectManager& rObjMgr,
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
- const basegfx::B2DRange* pChildAnchor );
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale);
/** Sets the name of a macro attached to this control.
@return true = The passed event descriptor was valid, macro name has been found. */
@@ -284,7 +289,8 @@ public:
explicit XclExpChartObj(
XclExpObjectManager& rObjMgr,
::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > xShape,
- const basegfx::B2DRange* pChildAnchor );
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale);
virtual ~XclExpChartObj();
/** Writes the OBJ record and the entire chart substream. */
Modified: incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xlescher.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xlescher.hxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xlescher.hxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sc/source/filter/inc/xlescher.hxx Fri Jun 1 17:57:48 2012
@@ -320,11 +320,11 @@ struct XclObjAnchor : public XclRange
/** Calculates a rectangle from the contained coordinates. */
basegfx::B2DRange GetRangeFromAnchor( const XclRoot& rRoot, SCTAB nScTab, MapUnit eMapUnit ) const;
/** Initializes the anchor coordinates for a sheet. */
- void SetRangeAtAnchor( const XclRoot& rRoot, SCTAB nScTab, const basegfx::B2DRange& rRange, MapUnit eMapUnit );
+ void SetRangeAtAnchor( const XclRoot& rRoot, SCTAB nScTab, const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale, MapUnit eMapUnit );
/** Initializes the anchor coordinates for an embedded draw page. */
void SetRangeAtAnchor( const basegfx::B2DVector& rPageScale, double fScaleX, double fScaleY,
- const basegfx::B2DRange& rRange, MapUnit eMapUnit, bool bDffAnchor );
+ const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale, MapUnit eMapUnit, bool bDffAnchor );
};
template< typename StreamType >
Modified: incubator/ooo/branches/alg/aw080/main/sc/source/filter/xcl97/xcl97esc.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sc/source/filter/xcl97/xcl97esc.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sc/source/filter/xcl97/xcl97esc.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sc/source/filter/xcl97/xcl97esc.cxx Fri Jun 1 17:57:48 2012
@@ -190,7 +190,10 @@ bool lcl_IsFontwork( const SdrObject* pO
} // namespace
-EscherExHostAppData* XclEscherEx::StartShape( const Reference< XShape >& rxShape, const basegfx::B2DRange* pChildAnchor )
+EscherExHostAppData* XclEscherEx::StartShape(
+ const Reference< XShape >& rxShape,
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale)
{
if ( nAdditionalText )
nAdditionalText++;
@@ -226,7 +229,7 @@ EscherExHostAppData* XclEscherEx::StartS
SvGlobalName aObjClsId( xObj->getClassID() );
if ( SotExchange::IsChart( aObjClsId ) )
{ // yes, it's a chart diagram
- mrObjMgr.AddObj( new XclExpChartObj( mrObjMgr, rxShape, pChildAnchor ) );
+ mrObjMgr.AddObj( new XclExpChartObj( mrObjMgr, rxShape, pObjectPosition, pObjectScale) );
pCurrXclObj = NULL; // no metafile or whatsoever
}
else // metafile and OLE object
@@ -243,9 +246,9 @@ EscherExHostAppData* XclEscherEx::StartS
#if EXC_EXP_OCX_CTRL
// no ActiveX controls in embedded drawings (chart shapes)
if( mbIsRootDff )
- pCurrXclObj = CreateCtrlObj( rxShape, pChildAnchor );
+ pCurrXclObj = CreateCtrlObj( rxShape, pObjectPosition, pObjectScale );
#else
- pCurrXclObj = CreateCtrlObj( rxShape, pChildAnchor );
+ pCurrXclObj = CreateCtrlObj( rxShape, pObjectPosition, pObjectScale );
#endif
if( !pCurrXclObj )
pCurrXclObj = new XclObjAny( mrObjMgr ); // just a metafile
@@ -274,7 +277,7 @@ EscherExHostAppData* XclEscherEx::StartS
{
/* Create a dummy anchor carrying the flags. Real
coordinates are calculated later in virtual call of
- WriteData(EscherEx&,const basegfx::B2DRange&). */
+ WriteData(EscherEx&,const basegfx::B2DPoint&,const basegfx::B2DVector&). */
XclExpDffAnchorBase* pAnchor = mrObjMgr.CreateDffAnchor();
pAnchor->SetFlags( *pObj );
pCurrAppData->SetClientAnchor( pAnchor );
@@ -369,7 +372,10 @@ void XclEscherEx::EndDocument()
#if EXC_EXP_OCX_CTRL
-XclExpOcxControlObj* XclEscherEx::CreateCtrlObj( Reference< XShape > xShape, const basegfx::B2DRange* pChildAnchor )
+XclExpOcxControlObj* XclEscherEx::CreateCtrlObj(
+ Reference< XShape > xShape,
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale)
{
::std::auto_ptr< XclExpOcxControlObj > xOcxCtrl;
@@ -390,7 +396,7 @@ XclExpOcxControlObj* XclEscherEx::Create
sal_uInt32 nStrmSize = static_cast< sal_uInt32 >( mxCtlsStrm->Tell() - nStrmStart );
// adjust the class name to "Forms.***.1"
aClassName.InsertAscii( "Forms.", 0 ).AppendAscii( ".1" );
- xOcxCtrl.reset( new XclExpOcxControlObj( mrObjMgr, xShape, pChildAnchor, aClassName, nStrmStart, nStrmSize ) );
+ xOcxCtrl.reset( new XclExpOcxControlObj( mrObjMgr, xShape, pObjectPosition, pObjectScale, aClassName, nStrmStart, nStrmSize ) );
}
}
}
@@ -399,9 +405,12 @@ XclExpOcxControlObj* XclEscherEx::Create
#else
-XclExpTbxControlObj* XclEscherEx::CreateCtrlObj( Reference< XShape > xShape, const basegfx::B2DRange* pChildAnchor )
+XclExpTbxControlObj* XclEscherEx::CreateCtrlObj(
+ Reference< XShape > xShape,
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale)
{
- ::std::auto_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( mrObjMgr, xShape, pChildAnchor ) );
+ ::std::auto_ptr< XclExpTbxControlObj > xTbxCtrl( new XclExpTbxControlObj( mrObjMgr, xShape, pObjectPosition, pObjectScale) );
if( xTbxCtrl->GetObjType() == EXC_OBJTYPE_UNKNOWN )
xTbxCtrl.reset();
Modified: incubator/ooo/branches/alg/aw080/main/sc/source/filter/xcl97/xcl97rec.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sc/source/filter/xcl97/xcl97rec.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sc/source/filter/xcl97/xcl97rec.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sc/source/filter/xcl97/xcl97rec.cxx Fri Jun 1 17:57:48 2012
@@ -94,8 +94,7 @@ XclExpObjList::XclExpObjList( const XclE
pMsodrawingPerSheet = new XclExpMsoDrawing( rEscherEx );
// open the DGCONTAINER and the patriarch group shape
mrEscherEx.OpenContainer( ESCHER_DgContainer );
- basegfx::B2DRange aRange(basegfx::B2DPoint(0.0, 0.0));
- mrEscherEx.EnterGroup( &aRange );
+ mrEscherEx.EnterGroup();
mrEscherEx.UpdateDffFragmentEnd();
}
@@ -174,11 +173,15 @@ XclObj::~XclObj()
delete pTxo;
}
-void XclObj::ImplWriteAnchor( const XclExpRoot& /*rRoot*/, const SdrObject* pSdrObj, const basegfx::B2DRange* pChildAnchor )
+void XclObj::ImplWriteAnchor(
+ const XclExpRoot& /*rRoot*/,
+ const SdrObject* pSdrObj,
+ const basegfx::B2DPoint* pObjectPosition,
+ const basegfx::B2DVector* pObjectScale)
{
- if( pChildAnchor )
+ if( pObjectPosition && pObjectScale )
{
- mrEscherEx.AddChildAnchor( *pChildAnchor );
+ mrEscherEx.AddChildAnchor( *pObjectPosition, *pObjectScale );
}
else if( pSdrObj )
{
@@ -285,15 +288,15 @@ void XclObj::SaveTextRecs( XclExpStream&
// --- class XclObjComment -------------------------------------------
-XclObjComment::XclObjComment( XclExpObjectManager& rObjMgr, const basegfx::B2DRange& rRange, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible ) :
+XclObjComment::XclObjComment( XclExpObjectManager& rObjMgr, const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale, const EditTextObject& rEditObj, SdrObject* pCaption, bool bVisible ) :
XclObj( rObjMgr, EXC_OBJTYPE_NOTE, true )
{
- ProcessEscherObj( rObjMgr.GetRoot(), rRange, pCaption, bVisible);
+ ProcessEscherObj( rObjMgr.GetRoot(), rObjectPosition, rObjectScale, pCaption, bVisible);
// TXO
pTxo = new XclTxo( rObjMgr.GetRoot(), rEditObj, pCaption );
}
-void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const basegfx::B2DRange& rRange, SdrObject* pCaption, const bool bVisible )
+void XclObjComment::ProcessEscherObj( const XclExpRoot& rRoot, const basegfx::B2DPoint& rObjectPosition, const basegfx::B2DVector& rObjectScale, SdrObject* pCaption, const bool bVisible )
{
Reference<XShape> aXShape;
EscherPropertyContainer aPropOpt;
@@ -307,7 +310,7 @@ void XclObjComment::ProcessEscherObj( co
aPropOpt.CreateFillProperties( aXPropSet, sal_True);
aPropOpt.AddOpt( ESCHER_Prop_lTxid, 0 ); // undocumented
- aPropOpt.AddOpt( 0x0158, 0x00000000 ); // undocumented
+ aPropOpt.AddOpt( 0x0158, 0x00000000 ); // undocumented
sal_uInt32 nValue = 0;
if(!aPropOpt.GetOpt( ESCHER_Prop_FitTextToShape, nValue ))
@@ -348,7 +351,7 @@ void XclObjComment::ProcessEscherObj( co
aPropOpt.AddOpt( ESCHER_Prop_fPrint, nFlags ); // bool field
aPropOpt.Commit( mrEscherEx.GetStream() );
- XclExpDffNoteAnchor( rRoot, rRange ).WriteDffData( mrEscherEx );
+ XclExpDffNoteAnchor( rRoot, rObjectPosition, rObjectScale ).WriteDffData( mrEscherEx );
mrEscherEx.AddAtom( 0, ESCHER_ClientData ); // OBJ record
mrEscherEx.UpdateDffFragmentEnd();
Modified: incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/eppt.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/eppt.cxx?rev=1345289&r1=1345288&r2=1345289&view=diff
==============================================================================
--- incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/eppt.cxx (original)
+++ incubator/ooo/branches/alg/aw080/main/sd/source/filter/eppt/eppt.cxx Fri Jun 1 17:57:48 2012
@@ -124,9 +124,9 @@ PPTWriter::PPTWriter( const std::vector<
mbStatus ( sal_False ),
mbUseNewAnimations ( sal_True ),
mnLatestStatValue ( 0 ),
- maFraction ( 1, 576 ),
- maMapModeSrc ( MAP_100TH_MM ),
- maMapModeDest ( MAP_INCH, Point(), maFraction, maFraction ),
+ mfMap100thMmToMs(1.0),
+ maMap100thMmToMs(),
+ maInvMap100thMmToMs(),
meLatestPageType ( NORMAL ),
mXModel ( rXModel ),
mXStatusIndicator ( rXStatInd ),
@@ -142,6 +142,10 @@ PPTWriter::PPTWriter( const std::vector<
mnPagesWritten ( 0 ),
mnTxId ( 0x7a2f64 )
{
+ mfMap100thMmToMs = OutputDevice::GetFactorLogicToLogic(MAP_100TH_MM, MAP_INCH) * 576.0;
+ maMap100thMmToMs = basegfx::tools::createScaleB2DHomMatrix(mfMap100thMmToMs, mfMap100thMmToMs);
+ maInvMap100thMmToMs = basegfx::tools::createScaleB2DHomMatrix(1.0 / mfMap100thMmToMs, 1.0 / mfMap100thMmToMs);
+
sal_uInt32 i;
if ( !ImplInitSOIface() )
return;
@@ -161,7 +165,7 @@ PPTWriter::PPTWriter( const std::vector<
if ( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) )
mAny >>= nHeight;
- maNotesPageSize = ImplMapSize( ::com::sun::star::awt::Size( nWidth, nHeight ) );
+ maNotesPageSize = maMap100thMmToMs * basegfx::B2DVector(nWidth, nHeight);
if ( !ImplGetPageByIndex( 0, MASTER ) )
return;
@@ -171,7 +175,7 @@ PPTWriter::PPTWriter( const std::vector<
nHeight = 21000;
if ( ImplGetPropertyValue( mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) ) )
mAny >>= nHeight;
- maDestPageSize = ImplMapSize( ::com::sun::star::awt::Size( nWidth, nHeight ) );
+ maDestPageSize = maMap100thMmToMs * basegfx::B2DVector(nWidth, nHeight);
mrStg = rSvStorage;
if ( !mrStg.Is() )
@@ -518,9 +522,8 @@ sal_Bool PPTWriter::ImplCreateDocument()
{
sal_uInt32 i;
sal_uInt16 nSlideType = EPP_SLIDESIZE_TYPECUSTOM;
-
- sal_uInt32 nWidth = maDestPageSize.Width;
- sal_uInt32 nHeight = maDestPageSize.Height;
+ const sal_uInt32 nWidth(basegfx::fround(maDestPageSize.getX()));
+ const sal_uInt32 nHeight(basegfx::fround(maDestPageSize.getY()));
if ( ( nWidth == 0x1680 ) && ( nHeight == 0x10e0 ) )
nSlideType = EPP_SLIDESIZE_TYPEONSCREEN;
@@ -536,8 +539,8 @@ sal_Bool PPTWriter::ImplCreateDocument()
mpPptEscherEx->AddAtom( 40, EPP_DocumentAtom, 1 );
*mpStrm << nWidth // Slide Size in Master coordinates X
<< nHeight // " " " " " Y
- << (sal_Int32)maNotesPageSize.Width // Notes Page Size X
- << (sal_Int32)maNotesPageSize.Height // " " " Y
+ << (sal_Int32)basegfx::fround(maNotesPageSize.getX()) // Notes Page Size X
+ << (sal_Int32)basegfx::fround(maNotesPageSize.getY()) // " " " Y
<< (sal_Int32)1 << (sal_Int32)2; // the scale used when the Powerpoint document is embedded. the default is 1:2
mpPptEscherEx->InsertPersistOffset( EPP_MAINNOTESMASTER_PERSIST_KEY, mpStrm->Tell() );
*mpStrm << (sal_uInt32)0 // Reference to NotesMaster ( 0 if none );
@@ -1017,7 +1020,7 @@ sal_Bool PPTWriter::ImplCreateMaster( sa
mpPptEscherEx->OpenContainer( EPP_PPDrawing );
mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
- mpPptEscherEx->EnterGroup(0,0);
+ mpPptEscherEx->EnterGroup();
ImplWritePage( pPHLayout[ 0 ], aSolverContainer, MASTER, true ); // Die Shapes der Seite werden im PPT Dok. erzeugt
mpPptEscherEx->LeaveGroup();
@@ -1077,7 +1080,7 @@ sal_Bool PPTWriter::ImplCreateMainNotes(
<< (sal_uInt32)0; // follow nothing
mpPptEscherEx->OpenContainer( EPP_PPDrawing );
mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
- mpPptEscherEx->EnterGroup(0,0);
+ mpPptEscherEx->EnterGroup();
ImplWritePage( pPHLayout[ 20 ], aSolverContainer, NOTICE, true );
@@ -1528,7 +1531,7 @@ sal_Bool PPTWriter::ImplCreateSlide( sal
EscherSolverContainer aSolverContainer;
mpPptEscherEx->OpenContainer( EPP_PPDrawing );
mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
- mpPptEscherEx->EnterGroup(0,0);
+ mpPptEscherEx->EnterGroup();
ImplWritePage( rLayout, aSolverContainer, NORMAL, false, nPageNum ); // Die Shapes der Seite werden im PPT Dok. erzeugt
mpPptEscherEx->LeaveGroup();
@@ -1539,8 +1542,8 @@ sal_Bool PPTWriter::ImplCreateSlide( sal
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xc00 ); // Flags: Connector | Background | HasSpt
EscherPropertyContainer aPropOpt;
- aPropOpt.AddOpt( ESCHER_Prop_fillRectRight, PPTtoEMU( maDestPageSize.Width ) );
- aPropOpt.AddOpt( ESCHER_Prop_fillRectBottom, PPTtoEMU( maDestPageSize.Width ) );
+ aPropOpt.AddOpt( ESCHER_Prop_fillRectRight, PPTtoEMU( basegfx::fround(maDestPageSize.getX()) ) );
+ aPropOpt.AddOpt( ESCHER_Prop_fillRectBottom, PPTtoEMU( basegfx::fround(maDestPageSize.getY()) ) ); // here Height() was used in the original version, probably an error
aPropOpt.AddOpt( ESCHER_Prop_fNoFillHitTest, 0x120012 );
aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
aPropOpt.AddOpt( ESCHER_Prop_bWMode, ESCHER_wDontShow );
@@ -1664,7 +1667,7 @@ sal_Bool PPTWriter::ImplCreateNotes( sal
mpPptEscherEx->OpenContainer( EPP_PPDrawing );
mpPptEscherEx->OpenContainer( ESCHER_DgContainer );
- mpPptEscherEx->EnterGroup(0,0);
+ mpPptEscherEx->EnterGroup();
ImplWritePage( pPHLayout[ 20 ], aSolverContainer, NOTICE, false ); // Die Shapes der Seite werden im PPT Dok. erzeugt
@@ -1704,8 +1707,9 @@ void PPTWriter::ImplWriteBackground( ::c
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
mpPptEscherEx->AddShape( ESCHER_ShpInst_Rectangle, 0xc00 ); // Flags: Connector | Background | HasSpt
- basegfx::B2DRange aRange(0.0, 0.0, 28000.0, 21000.0);
- EscherPropertyContainer aPropOpt(mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aRange);
+ basegfx::B2DPoint aObjectPosition(0.0, 0.0);
+ basegfx::B2DVector aObjectScale(28000.0, 21000.0);
+ EscherPropertyContainer aPropOpt(mpPptEscherEx->GetGraphicProvider(), mpPicStrm, aObjectPosition, aObjectScale);
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" ) ) ) )
@@ -1745,8 +1749,8 @@ void PPTWriter::ImplWriteBackground( ::c
}
aPropOpt.AddOpt( ESCHER_Prop_fillColor, nFillColor );
aPropOpt.AddOpt( ESCHER_Prop_fillBackColor, nFillBackColor );
- aPropOpt.AddOpt( ESCHER_Prop_fillRectRight, PPTtoEMU( maDestPageSize.Width ) );
- aPropOpt.AddOpt( ESCHER_Prop_fillRectBottom, PPTtoEMU( maDestPageSize.Height ) );
+ aPropOpt.AddOpt( ESCHER_Prop_fillRectRight, PPTtoEMU( basegfx::fround(maDestPageSize.getX()) ) );
+ aPropOpt.AddOpt( ESCHER_Prop_fillRectBottom, PPTtoEMU( basegfx::fround(maDestPageSize.getY()) ) );
aPropOpt.AddOpt( ESCHER_Prop_fNoLineDrawDash, 0x80000 );
aPropOpt.AddOpt( ESCHER_Prop_bWMode, ESCHER_bwWhite );
aPropOpt.AddOpt( ESCHER_Prop_fBackground, 0x10001 );