summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-10-22 11:10:27 +0200
committerArmin Le Grand <Armin.Le.Grand@Sun.COM>2009-10-22 11:10:27 +0200
commitece6eb1ab43ca851cb4c9e4cda848ecdcda9d0b0 (patch)
tree463517b4240c5987d4230e5298ddf13693d0e6bd /svx/source
parentbbe3fead695d76d107d9b2a84d53b5c1db72428b (diff)
#i105655# most changes for MetaFile consumers done
Diffstat (limited to 'svx/source')
-rw-r--r--svx/source/svdraw/svdfmtf.cxx61
-rw-r--r--svx/source/svdraw/svdfmtf.hxx2
2 files changed, 58 insertions, 5 deletions
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index 0cc1e347c949..94d62794a397 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -72,6 +72,8 @@
#include <vcl/salbtype.hxx> // FRound
#include <basegfx/matrix/b2dhommatrix.hxx>
#include <basegfx/matrix/b2dhommatrixtools.hxx>
+#include <svx/xlinjoit.hxx>
+#include <svx/xlndsit.hxx>
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -80,6 +82,8 @@ ImpSdrGDIMetaFileImport::ImpSdrGDIMetaFileImport(SdrModel& rModel):
pLineAttr(NULL),pFillAttr(NULL),pTextAttr(NULL),
pPage(NULL),pModel(NULL),nLayer(0),
nLineWidth(0),
+ maLineJoin(basegfx::B2DLINEJOIN_NONE),
+ maDash(XDASH_RECT, 0, 0, 0, 0, 0),
bFntDirty(TRUE),
bLastObjWasPolyWithoutLine(FALSE),bNoLine(FALSE),bNoFill(FALSE),bLastObjWasLine(FALSE)
{
@@ -273,6 +277,9 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, FASTBOOL bForceText
{
if ( nLineWidth )
pLineAttr->Put( XLineWidthItem( nLineWidth ) );
+ else
+ pLineAttr->Put( XLineWidthItem( 0 ) );
+
aOldLineColor = aVD.GetLineColor();
if( aVD.IsLineColor() )
{
@@ -281,6 +288,34 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, FASTBOOL bForceText
}
else
pLineAttr->Put(XLineStyleItem(XLINE_NONE));
+
+ switch(maLineJoin)
+ {
+ default : // basegfx::B2DLINEJOIN_NONE
+ pLineAttr->Put(XLineJointItem(XLINEJOINT_NONE));
+ break;
+ case basegfx::B2DLINEJOIN_MIDDLE:
+ pLineAttr->Put(XLineJointItem(XLINEJOINT_MIDDLE));
+ break;
+ case basegfx::B2DLINEJOIN_BEVEL:
+ pLineAttr->Put(XLineJointItem(XLINEJOINT_BEVEL));
+ break;
+ case basegfx::B2DLINEJOIN_MITER:
+ pLineAttr->Put(XLineJointItem(XLINEJOINT_MITER));
+ break;
+ case basegfx::B2DLINEJOIN_ROUND:
+ pLineAttr->Put(XLineJointItem(XLINEJOINT_ROUND));
+ break;
+ }
+
+ if(((maDash.GetDots() && maDash.GetDotLen()) || (maDash.GetDashes() && maDash.GetDashLen())) && maDash.GetDistance())
+ {
+ pLineAttr->Put(XLineDashItem(String(), maDash));
+ }
+ else
+ {
+ pLineAttr->Put(XLineDashItem(String(), XDash(XDASH_RECT)));
+ }
}
else
bNoLine = TRUE;
@@ -396,12 +431,19 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaLineAction& rAct)
bCreateLineObject = false;
}
- nLineWidth = nNewLineWidth;
-
if(bCreateLineObject)
{
SdrPathObj* pPath = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aLine));
+ nLineWidth = nNewLineWidth;
+ maLineJoin = rLineInfo.GetLineJoin();
+ maDash = XDash(XDASH_RECT,
+ rLineInfo.GetDotCount(), rLineInfo.GetDotLen(),
+ rLineInfo.GetDashCount(), rLineInfo.GetDashLen(),
+ rLineInfo.GetDistance());
SetAttributes(pPath);
+ nLineWidth = 0;
+ maLineJoin = basegfx::B2DLINEJOIN_NONE;
+ maDash = XDash();
InsertObj(pPath, false);
}
}
@@ -592,12 +634,21 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaPolyLineAction& rAct )
bCreateLineObject = false;
}
- nLineWidth = nNewLineWidth;
-
if(bCreateLineObject)
{
- SdrPathObj* pPath = new SdrPathObj(OBJ_PLIN, basegfx::B2DPolyPolygon(aSource));
+ SdrPathObj* pPath = new SdrPathObj(
+ aSource.isClosed() ? OBJ_POLY : OBJ_PLIN,
+ basegfx::B2DPolyPolygon(aSource));
+ nLineWidth = nNewLineWidth;
+ maLineJoin = rLineInfo.GetLineJoin();
+ maDash = XDash(XDASH_RECT,
+ rLineInfo.GetDotCount(), rLineInfo.GetDotLen(),
+ rLineInfo.GetDashCount(), rLineInfo.GetDashLen(),
+ rLineInfo.GetDistance());
SetAttributes(pPath);
+ nLineWidth = 0;
+ maLineJoin = basegfx::B2DLINEJOIN_NONE;
+ maDash = XDash();
InsertObj(pPath, false);
}
}
diff --git a/svx/source/svdraw/svdfmtf.hxx b/svx/source/svdraw/svdfmtf.hxx
index b4d583e6c506..84f2b30b6a15 100644
--- a/svx/source/svdraw/svdfmtf.hxx
+++ b/svx/source/svdraw/svdfmtf.hxx
@@ -86,6 +86,8 @@ protected:
SdrLayerID nLayer;
Color aOldLineColor;
sal_Int32 nLineWidth;
+ basegfx::B2DLineJoin maLineJoin;
+ XDash maDash;
sal_Bool bMov;
sal_Bool bSize;