summaryrefslogtreecommitdiff
path: root/svx/source/msfilter/msdffimp.cxx
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2006-11-14 12:29:50 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2006-11-14 12:29:50 +0000
commit8449ed0de32ea5411f3344c21412d4f41ac11a86 (patch)
treef5717a86ae20904042aee8aa99a8119ad04c293c /svx/source/msfilter/msdffimp.cxx
parent57b19db1f2d5a224a4c2f01fc03c24cedb0207d0 (diff)
INTEGRATION: CWS aw024 (1.118.72); FILE MERGED
2006/11/10 03:37:14 aw 1.118.72.14: RESYNC: (1.136-1.141); FILE MERGED 2006/10/27 12:14:02 aw 1.118.72.13: #i39528# ::basegfx -> basegfx adaption 2006/09/21 19:10:25 aw 1.118.72.12: RESYNC: (1.135-1.136); FILE MERGED 2006/07/04 13:02:05 aw 1.118.72.11: RESYNC: (1.134-1.135); FILE MERGED 2006/05/12 18:45:30 aw 1.118.72.10: RESYNC: (1.128-1.134); FILE MERGED 2006/01/26 22:07:22 aw 1.118.72.9: RESYNC: (1.127-1.128); FILE MERGED 2005/11/18 16:59:50 aw 1.118.72.8: RESYNC: (1.123-1.127); FILE MERGED 2005/09/18 04:34:35 aw 1.118.72.7: RESYNC: (1.122-1.123); FILE MERGED 2005/08/04 15:46:23 sj 1.118.72.6: #48467# using GraphicExporter component for exports, graphic filter progress now works now via xStatusIndicater instead of callback mechanism 2005/07/22 10:53:36 aw 1.118.72.5: RESYNC: (1.119-1.122); FILE MERGED 2005/05/25 09:50:50 aw 1.118.72.4: #i39529# 2005/05/13 15:59:23 aw 1.118.72.3: RESYNC: (1.118-1.119); FILE MERGED 2005/05/12 16:39:28 aw 1.118.72.2: #i39529# 2005/04/26 15:04:20 aw 1.118.72.1: #i39528#
Diffstat (limited to 'svx/source/msfilter/msdffimp.cxx')
-rw-r--r--svx/source/msfilter/msdffimp.cxx120
1 files changed, 53 insertions, 67 deletions
diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx
index 9e7a2de1c1..7e906cda5f 100644
--- a/svx/source/msfilter/msdffimp.cxx
+++ b/svx/source/msfilter/msdffimp.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: msdffimp.cxx,v $
*
- * $Revision: 1.141 $
+ * $Revision: 1.142 $
*
- * last change: $Author: vg $ $Date: 2006-11-01 14:19:30 $
+ * last change: $Author: ihi $ $Date: 2006-11-14 13:29:50 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -498,7 +498,7 @@ BOOL Impl_OlePres::Read( SvStream & rStm )
if( nFormat == FORMAT_GDIMETAFILE )
{
pMtf = new GDIMetaFile();
- ReadWindowMetafile( rStm, *pMtf );
+ ReadWindowMetafile( rStm, *pMtf, NULL );
}
else if( nFormat == FORMAT_BITMAP )
{
@@ -1503,11 +1503,12 @@ void SvxMSDffManager::SolveSolver( const SvxMSDffSolverContainer& rSolver )
////////////////////////////////////////////////////////////////////////////////////////////////////
-static void GetLineArrow( const sal_Int32 nLineWidth, const MSO_LineEnd eLineEnd,
- const MSO_LineEndWidth eLineWidth, const MSO_LineEndLength eLineLenght,
- sal_Int32& rnArrowWidth, XPolygon& rXPoly, sal_Bool& rbArrowCenter,
- String& rsArrowName )
+static basegfx::B2DPolygon GetLineArrow( const sal_Int32 nLineWidth, const MSO_LineEnd eLineEnd,
+ const MSO_LineEndWidth eLineWidth, const MSO_LineEndLength eLineLenght,
+ sal_Int32& rnArrowWidth, sal_Bool& rbArrowCenter,
+ String& rsArrowName )
{
+ basegfx::B2DPolygon aRetval;
double fLineWidth = nLineWidth < 70 ? 70.0 : nLineWidth;
double fLenghtMul, fWidthMul;
sal_Int32 nLineNumber;
@@ -1530,12 +1531,12 @@ static void GetLineArrow( const sal_Int32 nLineWidth, const MSO_LineEnd eLineEnd
{
case mso_lineArrowEnd :
{
- XPolygon aTriangle( 4 );
- aTriangle[ 0 ] = Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 );
- aTriangle[ 1 ] = Point( (sal_Int32)( fWidthMul * fLineWidth ), (sal_Int32)( fLenghtMul * fLineWidth ) );
- aTriangle[ 2 ] = Point( 0, (sal_Int32)( fLenghtMul * fLineWidth ) );
- aTriangle[ 3 ] = Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 );
- rXPoly = aTriangle;
+ basegfx::B2DPolygon aTriangle;
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50, 0.0 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth, fLenghtMul * fLineWidth ));
+ aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth ));
+ aTriangle.setClosed(true);
+ aRetval = aTriangle;
rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowEnd " ), RTL_TEXTENCODING_UTF8 );
}
break;
@@ -1556,48 +1557,48 @@ static void GetLineArrow( const sal_Int32 nLineWidth, const MSO_LineEnd eLineEnd
case mso_lineNarrowArrow : fWidthMul = 3.5; break;
case mso_lineWideArrow : fWidthMul = 6.0; break;
}
- XPolygon aTriangle( 7 );
- aTriangle[ 0 ] = Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 );
- aTriangle[ 1 ] = Point( (sal_Int32)( fWidthMul * fLineWidth ), (sal_Int32)( fLenghtMul * fLineWidth * 0.91 ) );
- aTriangle[ 2 ] = Point( (sal_Int32)( fWidthMul * fLineWidth * 0.85 ), (sal_Int32)( fLenghtMul * fLineWidth ) );
- aTriangle[ 3 ] = Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), (sal_Int32)( fLenghtMul * fLineWidth * 0.36 ) );
- aTriangle[ 4 ] = Point( (sal_Int32)( fWidthMul * fLineWidth * 0.15 ), (sal_Int32)( fLenghtMul * fLineWidth ) );
- aTriangle[ 5 ] = Point( 0, (sal_Int32)( fLenghtMul * fLineWidth * 0.91 ) );
- aTriangle[ 6 ] = Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 );
- rXPoly = aTriangle;
+ basegfx::B2DPolygon aTriangle;
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , 0.0 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth, fLenghtMul * fLineWidth * 0.91 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.85, fLenghtMul * fLineWidth ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50, fLenghtMul * fLineWidth * 0.36 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.15, fLenghtMul * fLineWidth ));
+ aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth * 0.91 ));
+ aTriangle.setClosed(true);
+ aRetval = aTriangle;
rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowOpenEnd " ), RTL_TEXTENCODING_UTF8 );
}
break;
case mso_lineArrowStealthEnd :
{
- XPolygon aTriangle( 5 );
- aTriangle[ 0 ] = Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 );
- aTriangle[ 1 ] = Point( (sal_Int32)( fWidthMul * fLineWidth ), (sal_Int32)( fLenghtMul * fLineWidth ) );
- aTriangle[ 2 ] = Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), (sal_Int32)( fLenghtMul * fLineWidth * 0.60 ) );
- aTriangle[ 3 ] = Point( 0, (sal_Int32)( fLenghtMul * fLineWidth ) );
- aTriangle[ 4 ] = Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 );
- rXPoly = aTriangle;
+ basegfx::B2DPolygon aTriangle;
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , 0.0 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth , fLenghtMul * fLineWidth ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , fLenghtMul * fLineWidth * 0.60 ));
+ aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth ));
+ aTriangle.setClosed(true);
+ aRetval = aTriangle;
rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowStealthEnd " ), RTL_TEXTENCODING_UTF8 );
}
break;
case mso_lineArrowDiamondEnd :
{
- XPolygon aTriangle( 5 );
- aTriangle[ 0 ] = Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 );
- aTriangle[ 1 ] = Point( (sal_Int32)( fWidthMul * fLineWidth ), (sal_Int32)( fLenghtMul * fLineWidth * 0.50 ) );
- aTriangle[ 2 ] = Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), (sal_Int32)( fLenghtMul * fLineWidth ) );
- aTriangle[ 3 ] = Point( 0, (sal_Int32)( fLenghtMul * fLineWidth * 0.50 ) );
- aTriangle[ 4 ] = Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 );
- rXPoly = aTriangle;
+ basegfx::B2DPolygon aTriangle;
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , 0.0 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth , fLenghtMul * fLineWidth * 0.50 ));
+ aTriangle.append(basegfx::B2DPoint( fWidthMul * fLineWidth * 0.50 , fLenghtMul * fLineWidth ));
+ aTriangle.append(basegfx::B2DPoint( 0.0, fLenghtMul * fLineWidth * 0.50 ));
+ aTriangle.setClosed(true);
+ aRetval = aTriangle;
rbArrowCenter = sal_True;
rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowDiamondEnd " ), RTL_TEXTENCODING_UTF8 );
}
break;
case mso_lineArrowOvalEnd :
{
- rXPoly = XPolygon( Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 ),
+ aRetval = XPolygon( Point( (sal_Int32)( fWidthMul * fLineWidth * 0.50 ), 0 ),
(sal_Int32)( fWidthMul * fLineWidth * 0.50 ),
- (sal_Int32)( fLenghtMul * fLineWidth * 0.50 ), 0, 3600 );
+ (sal_Int32)( fLenghtMul * fLineWidth * 0.50 ), 0, 3600 ).getB2DPolygon();
rbArrowCenter = sal_True;
rsArrowName = String( RTL_CONSTASCII_STRINGPARAM( "msArrowOvalEnd " ), RTL_TEXTENCODING_UTF8 );
}
@@ -1606,6 +1607,8 @@ static void GetLineArrow( const sal_Int32 nLineWidth, const MSO_LineEnd eLineEnd
}
rsArrowName.Append( String::CreateFromInt32( nLineNumber ) );
rnArrowWidth = (sal_Int32)( fLineWidth * fWidthMul );
+
+ return aRetval;
}
void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eShapeType ) const // #i28269#
@@ -1723,14 +1726,13 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
MSO_LineEndWidth eWidth = (MSO_LineEndWidth)GetPropertyValue( DFF_Prop_lineStartArrowWidth, mso_lineMediumWidthArrow );
MSO_LineEndLength eLenght = (MSO_LineEndLength)GetPropertyValue( DFF_Prop_lineStartArrowLength, mso_lineMediumLenArrow );
- XPolygon aPoly;
sal_Int32 nArrowWidth;
sal_Bool bArrowCenter;
String aArrowName;
- GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, aPoly, bArrowCenter, aArrowName );
+ basegfx::B2DPolygon aPoly(GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, bArrowCenter, aArrowName ));
rSet.Put( XLineStartWidthItem( nArrowWidth ) );
- rSet.Put( XLineStartItem( aArrowName, aPoly ) );
+ rSet.Put( XLineStartItem( aArrowName, basegfx::B2DPolyPolygon(aPoly) ) );
rSet.Put( XLineStartCenterItem( bArrowCenter ) );
}
/////////////
@@ -1742,14 +1744,13 @@ void DffPropertyReader::ApplyLineAttributes( SfxItemSet& rSet, const MSO_SPT eSh
MSO_LineEndWidth eWidth = (MSO_LineEndWidth)GetPropertyValue( DFF_Prop_lineEndArrowWidth, mso_lineMediumWidthArrow );
MSO_LineEndLength eLenght = (MSO_LineEndLength)GetPropertyValue( DFF_Prop_lineEndArrowLength, mso_lineMediumLenArrow );
- XPolygon aPoly;
sal_Int32 nArrowWidth;
sal_Bool bArrowCenter;
String aArrowName;
- GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, aPoly, bArrowCenter, aArrowName );
+ basegfx::B2DPolygon aPoly(GetLineArrow( nLineWidth, eLineEnd, eWidth, eLenght, nArrowWidth, bArrowCenter, aArrowName ));
rSet.Put( XLineEndWidthItem( nArrowWidth ) );
- rSet.Put( XLineEndItem( aArrowName, aPoly ) );
+ rSet.Put( XLineEndItem( aArrowName, basegfx::B2DPolyPolygon(aPoly) ) );
rSet.Put( XLineEndCenterItem( bArrowCenter ) );
}
if ( IsProperty( DFF_Prop_lineEndCapStyle ) )
@@ -3515,25 +3516,7 @@ void SvxMSDffManager::Scale( PolyPolygon& rPoly ) const
Scale( rPoly[ nPolyNum ] );
}
-void SvxMSDffManager::Scale( XPolygon& rPoly ) const
-{
- if ( !bNeedMap )
- return;
- USHORT nPointAnz = rPoly.GetPointCount();
- for ( USHORT nPointNum = 0; nPointNum < nPointAnz; nPointNum++ )
- Scale( rPoly[ nPointNum ] );
-}
-
-void SvxMSDffManager::Scale( XPolyPolygon& rPoly ) const
-{
- if ( !bNeedMap )
- return;
- USHORT nPolyAnz = rPoly.Count();
- for ( USHORT nPolyNum = 0; nPolyNum < nPolyAnz; nPolyNum++ )
- Scale( rPoly[ nPolyNum ] );
-}
-
-void SvxMSDffManager::ScaleEmu( sal_Int32& rVal ) const
+void SvxMSDffManager::ScaleEmu( long& rVal ) const
{
rVal = BigMulDiv( rVal, nEmuMul, nEmuDiv );
}
@@ -5253,7 +5236,10 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
}
else if ( aObjData.eShapeType == mso_sptLine )
{
- pRet = new SdrPathObj( aBoundRect.TopLeft(), aBoundRect.BottomRight() );
+ basegfx::B2DPolygon aPoly;
+ aPoly.append(basegfx::B2DPoint(aBoundRect.Left(), aBoundRect.Top()));
+ aPoly.append(basegfx::B2DPoint(aBoundRect.Right(), aBoundRect.Bottom()));
+ pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
}
else if( bIsConnector )
{
@@ -5298,8 +5284,8 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
}
nSpFlags &= ~( SP_FFLIPV | SP_FFLIPH );
- pRet->NbcSetPoint(aPoint1, 0); // Startpunkt
- pRet->NbcSetPoint(aPoint2, 1); // Endpunkt
+ pRet->NbcSetPoint(aPoint1, 0L); // Startpunkt
+ pRet->NbcSetPoint(aPoint2, 1L); // Endpunkt
sal_Int32 n1HorzDist, n1VertDist, n2HorzDist, n2VertDist;
n1HorzDist = n1VertDist = n2HorzDist = n2VertDist = 0;
@@ -5358,7 +5344,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
{
// Das Polygon des Objektes muss geschlossen werden
if(!((SdrPathObj*)pRet)->IsClosed())
- ((SdrPathObj*)pRet)->ToggleClosed(0);
+ ((SdrPathObj*)pRet)->ToggleClosed(); //0);
}
}
// Handelt es sich um 3D?