summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdomeas.cxx
diff options
context:
space:
mode:
authorThorsten Behrens <thb@openoffice.org>2002-08-22 08:54:41 +0000
committerThorsten Behrens <thb@openoffice.org>2002-08-22 08:54:41 +0000
commit9450c32e86ced194b5f42a4e4df0e107d5bd9013 (patch)
tree54981141ed43f1bfb4478252859ef890258fff2a /svx/source/svdraw/svdomeas.cxx
parente55a15f9d9be93297c6d77f52e91d914868be907 (diff)
#100127# Reworked line geometry generation for draw shapes, such that the line parameters are stored in the returned ImpLineGeometry, and made explicit the ownership transfer of the returned pointer. Adding metafile comments for stroke and fill of shape geometry
Diffstat (limited to 'svx/source/svdraw/svdomeas.cxx')
-rw-r--r--svx/source/svdraw/svdomeas.cxx37
1 files changed, 24 insertions, 13 deletions
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index 73ae2cb3fca7..5b77a190a252 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: svdomeas.cxx,v $
*
- * $Revision: 1.14 $
+ * $Revision: 1.15 $
*
- * last change: $Author: cl $ $Date: 2002-06-07 12:08:47 $
+ * last change: $Author: thb $ $Date: 2002-08-22 09:54:39 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -140,6 +140,10 @@
#include <svtools/syslocale.hxx>
#endif
+#ifndef _SVX_SVDOIMP_HXX
+#include "svdoimp.hxx"
+#endif
+
////////////////////////////////////////////////////////////////////////////////////////////////////
SdrMeasureObjGeoData::SdrMeasureObjGeoData() {}
@@ -674,11 +678,11 @@ FASTBOOL SdrMeasureObj::Paint(ExtOutputDevice& rXOut, const SdrPaintInfoRec& rIn
// prepare line geometry
BOOL bIsLineDraft(0 != (rInfoRec.nPaintMode & SDRPAINTMODE_DRAFTLINE));
- ImpLineGeometry* pLineGeometry = ImpPrepareLineGeometry(rXOut, rSet, bIsLineDraft);
+ ::std::auto_ptr< ImpLineGeometry > pLineGeometry( ImpPrepareLineGeometry(rXOut, rSet, bIsLineDraft) );
// Shadows
BOOL bShadOn = ((SdrShadowItem&)(rSet.Get(SDRATTR_SHADOW))).GetValue();
- if(bShadOn && pLineGeometry)
+ if( bShadOn && pLineGeometry.get() )
{
// draw the line geometry
ImpDrawShadowLineGeometry(rXOut, rSet, *pLineGeometry);
@@ -715,7 +719,7 @@ FASTBOOL SdrMeasureObj::Paint(ExtOutputDevice& rXOut, const SdrPaintInfoRec& rIn
rXOut.DrawLine(aMPol.aHelpline2.aP1,aMPol.aHelpline2.aP2);
// Own line drawing
- if(pLineGeometry)
+ if( pLineGeometry.get() )
{
// draw the line geometry
ImpDrawColorLineGeometry(rXOut, rSet, *pLineGeometry);
@@ -728,10 +732,6 @@ FASTBOOL SdrMeasureObj::Paint(ExtOutputDevice& rXOut, const SdrPaintInfoRec& rIn
bOk=PaintGluePoints(rXOut,rInfoRec);
}
- // throw away line geometry
- if(pLineGeometry)
- delete pLineGeometry;
-
return bOk;
}
@@ -1388,16 +1388,21 @@ void SdrMeasureObj::RestGeoData(const SdrObjGeoData& rGeo)
SetTextDirty();
}
-void SdrMeasureObj::CreateLinePoly(PolyPolygon3D& rPolyPolygon, PolyPolygon3D& rPolyLine, OutputDevice& rOut,
- BOOL bForceHair, BOOL bIsLineDraft) const
+::std::auto_ptr< ImpLineGeometry > SdrMeasureObj::CreateLinePoly( OutputDevice& rOut,
+ BOOL bForceOnePixel,
+ BOOL bForceTwoPixel,
+ BOOL bIsLineDraft ) const
{
+ PolyPolygon3D aPolyPoly3D;
+ PolyPolygon3D aLinePoly3D;
+
// get XOR Poly as base
XPolyPolygon aTmpPolyPolygon;
TakeXorPoly(aTmpPolyPolygon, TRUE);
// get ImpLineStyleParameterPack
- ImpLineStyleParameterPack aLineAttr(GetItemSet(), bForceHair || bIsLineDraft, &rOut);
- ImpLineGeometryCreator aLineCreator(aLineAttr, rPolyPolygon, rPolyLine, bIsLineDraft);
+ ImpLineStyleParameterPack aLineAttr(GetItemSet(), bForceOnePixel || bForceTwoPixel || bIsLineDraft, &rOut);
+ ImpLineGeometryCreator aLineCreator(aLineAttr, aPolyPoly3D, aLinePoly3D, bIsLineDraft);
UINT16 nCount(aTmpPolyPolygon.Count());
Polygon3D aPoly3D;
UINT16 nLoopStart(0);
@@ -1453,6 +1458,12 @@ void SdrMeasureObj::CreateLinePoly(PolyPolygon3D& rPolyPolygon, PolyPolygon3D& r
aPoly3D = Polygon3D(aTmpPolyPolygon[nLoopStart]);
aLineCreator.AddPolygon3D(aPoly3D);
}
+
+ if(aPolyPoly3D.Count() || aLinePoly3D.Count())
+ return ::std::auto_ptr< ImpLineGeometry > (new ImpLineGeometry(aPolyPoly3D, aLinePoly3D,
+ aLineAttr, bForceOnePixel, bForceTwoPixel));
+ else
+ return NULL;
}
SdrObject* SdrMeasureObj::DoConvertToPolyObj(BOOL bBezier) const