Author: alg
Date: Fri Jan 6 17:14:34 2012
New Revision: 1228285
URL: http://svn.apache.org/viewvc?rev=1228285&view=rev
Log:
linecap: Adapted Svm exporter, adapted Break method (convert Metafile to
SdrObjects), Adapted MetafilePrimitive to support LineCap, Adapted SVMConverter
Modified:
incubator/ooo/branches/alg/linecap/main/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
incubator/ooo/branches/alg/linecap/main/svx/source/svdraw/svdfmtf.cxx
incubator/ooo/branches/alg/linecap/main/svx/source/svdraw/svdfmtf.hxx
incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/cvtsvm.hxx
incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/print.hxx
incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/cvtsvm.cxx
Modified:
incubator/ooo/branches/alg/linecap/main/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
URL:
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/drawinglayer/source/primitive2d/metafileprimitive2d.cxx?rev=1228285&r1=1228284&r2=1228285&view=diff
==============================================================================
---
incubator/ooo/branches/alg/linecap/main/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
(original)
+++
incubator/ooo/branches/alg/linecap/main/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
Fri Jan 6 17:14:34 2012
@@ -706,7 +706,8 @@ namespace
const drawinglayer::attribute::LineAttribute
aLineAttribute(
rProperties.getLineColor(),
bWidthUsed ? rLineInfo.GetWidth() : 0.0,
- rLineInfo.GetLineJoin());
+ rLineInfo.GetLineJoin(),
+ rLineInfo.GetLineCap());
if(bDashDotUsed)
{
Modified: incubator/ooo/branches/alg/linecap/main/svx/source/svdraw/svdfmtf.cxx
URL:
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/source/svdraw/svdfmtf.cxx?rev=1228285&r1=1228284&r2=1228285&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/source/svdraw/svdfmtf.cxx
(original)
+++ incubator/ooo/branches/alg/linecap/main/svx/source/svdraw/svdfmtf.cxx Fri
Jan 6 17:14:34 2012
@@ -37,6 +37,7 @@
#include <editeng/crsditem.hxx>
#include <editeng/shdditem.hxx>
#include <svx/xlnclit.hxx>
+#include <svx/xlncapit.hxx>
#include <svx/xlnwtit.hxx>
#include <svx/xflclit.hxx>
#include <svx/xgrad.hxx>
@@ -76,6 +77,7 @@ ImpSdrGDIMetaFileImport::ImpSdrGDIMetaFi
pPage(NULL),pModel(NULL),nLayer(0),
nLineWidth(0),
maLineJoin(basegfx::B2DLINEJOIN_NONE),
+ maLineCap(com::sun::star::drawing::LineCap_BUTT),
maDash(XDASH_RECT, 0, 0, 0, 0, 0),
bFntDirty(sal_True),
bLastObjWasPolyWithoutLine(sal_False),bNoLine(sal_False),bNoFill(sal_False),bLastObjWasLine(sal_False)
@@ -305,6 +307,9 @@ void ImpSdrGDIMetaFileImport::SetAttribu
break;
}
+ // Add LineCap support
+ pLineAttr->Put(XLineCapItem(maLineCap));
+
if(((maDash.GetDots() && maDash.GetDotLen()) ||
(maDash.GetDashes() && maDash.GetDashLen())) && maDash.GetDistance())
{
pLineAttr->Put(XLineDashItem(String(), maDash));
@@ -480,6 +485,7 @@ void ImpSdrGDIMetaFileImport::DoAction(M
SdrPathObj* pPath = new SdrPathObj(OBJ_LINE,
basegfx::B2DPolyPolygon(aLine));
nLineWidth = nNewLineWidth;
maLineJoin = rLineInfo.GetLineJoin();
+ maLineCap = rLineInfo.GetLineCap();
maDash = XDash(XDASH_RECT,
rLineInfo.GetDotCount(), rLineInfo.GetDotLen(),
rLineInfo.GetDashCount(),
rLineInfo.GetDashLen(),
@@ -685,6 +691,7 @@ void ImpSdrGDIMetaFileImport::DoAction(
basegfx::B2DPolyPolygon(aSource));
nLineWidth = nNewLineWidth;
maLineJoin = rLineInfo.GetLineJoin();
+ maLineCap = rLineInfo.GetLineCap();
maDash = XDash(XDASH_RECT,
rLineInfo.GetDotCount(), rLineInfo.GetDotLen(),
rLineInfo.GetDashCount(), rLineInfo.GetDashLen(),
Modified: incubator/ooo/branches/alg/linecap/main/svx/source/svdraw/svdfmtf.hxx
URL:
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/svx/source/svdraw/svdfmtf.hxx?rev=1228285&r1=1228284&r2=1228285&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/svx/source/svdraw/svdfmtf.hxx
(original)
+++ incubator/ooo/branches/alg/linecap/main/svx/source/svdraw/svdfmtf.hxx Fri
Jan 6 17:14:34 2012
@@ -80,6 +80,7 @@ protected:
Color aOldLineColor;
sal_Int32 nLineWidth;
basegfx::B2DLineJoin maLineJoin;
+ com::sun::star::drawing::LineCap maLineCap;
XDash maDash;
sal_Bool bMov;
Modified: incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/cvtsvm.hxx
URL:
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/cvtsvm.hxx?rev=1228285&r1=1228284&r2=1228285&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/cvtsvm.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/cvtsvm.hxx Fri Jan 6
17:14:34 2012
@@ -82,6 +82,9 @@
#define GDI_EXTENDEDPOLYGON_ACTION 1034
#define GDI_LINEDASHDOT_ACTION 1035
+// Added LineCap support
+#define GDI_LINECAP_ACTION 1036
+
// ----------------
// - SVMConverter -
// ----------------
Modified: incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/print.hxx
URL:
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/print.hxx?rev=1228285&r1=1228284&r2=1228285&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/print.hxx (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/inc/vcl/print.hxx Fri Jan 6
17:14:34 2012
@@ -84,11 +84,6 @@ public:
GDIMetaFile* GetGDIMetaFile() const { return mpMtf; }
const JobSetup& GetJobSetup() const { return maJobSetup; }
sal_Bool IsNewJobSetup() const { return (mbNewJobSetup != 0); }
-
- friend VCL_DLLPUBLIC SvStream& operator<<( SvStream& rOStm, const
PrinterPage& rPage )
- { rOStm << rPage.mbNewJobSetup; rOStm << rPage.maJobSetup;
rPage.mpMtf->Write( rOStm ); return rOStm; }
- friend VCL_DLLPUBLIC SvStream& operator>>( SvStream& rIStm, PrinterPage&
rPage )
- { return rIStm >> rPage.mbNewJobSetup >> rPage.maJobSetup >> *rPage.mpMtf;
}
};
Modified: incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/cvtsvm.cxx
URL:
http://svn.apache.org/viewvc/incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/cvtsvm.cxx?rev=1228285&r1=1228284&r2=1228285&view=diff
==============================================================================
--- incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/cvtsvm.cxx (original)
+++ incubator/ooo/branches/alg/linecap/main/vcl/source/gdi/cvtsvm.cxx Fri Jan
6 17:14:34 2012
@@ -599,6 +599,14 @@ void SVMConverter::ImplConvertFromSVM1(
}
break;
+ case (GDI_LINECAP_ACTION) :
+ {
+ sal_Int16 nLineCap(0);
+ rIStm >> nLineCap;
+
aLineInfo.SetLineCap((com::sun::star::drawing::LineCap)nLineCap);
+ }
+ break;
+
case (GDI_LINEDASHDOT_ACTION) :
{
sal_Int16 a(0);
@@ -1457,6 +1465,7 @@ sal_uLong SVMConverter::ImplWriteActions
const LineInfo& rInfo = pAct->GetLineInfo();
const bool bFatLine(!rInfo.IsDefault() &&
(LINE_NONE != rInfo.GetStyle()));
const bool bLineJoin(bFatLine &&
basegfx::B2DLINEJOIN_ROUND != rInfo.GetLineJoin());
+ const bool bLineCap(bFatLine &&
com::sun::star::drawing::LineCap_BUTT != rInfo.GetLineCap());
const bool bLineDashDot(LINE_DASH ==
rInfo.GetStyle());
if( bFatLine )
@@ -1471,16 +1480,23 @@ sal_uLong SVMConverter::ImplWriteActions
rOStm << (sal_Int16)
rInfo.GetLineJoin();
}
- if(bLineDashDot)
- {
- rOStm << (sal_Int16)
GDI_LINEDASHDOT_ACTION;
- rOStm << (sal_Int32) 4 + 16;
- rOStm <<
(sal_Int16)rInfo.GetDashCount();
- rOStm <<
(sal_Int32)rInfo.GetDashLen();
- rOStm <<
(sal_Int16)rInfo.GetDotCount();
- rOStm <<
(sal_Int32)rInfo.GetDotLen();
- rOStm <<
(sal_Int32)rInfo.GetDistance();
- }
+ if(bLineCap)
+ {
+ rOStm << (sal_Int16) GDI_LINECAP_ACTION;
+ rOStm << (sal_Int32) 6;
+ rOStm << (sal_Int16) rInfo.GetLineCap();
+ }
+ }
+
+ if(bLineDashDot)
+ {
+ rOStm << (sal_Int16)
GDI_LINEDASHDOT_ACTION;
+ rOStm << (sal_Int32) 4 + 16;
+ rOStm <<
(sal_Int16)rInfo.GetDashCount();
+ rOStm << (sal_Int32)rInfo.GetDashLen();
+ rOStm << (sal_Int16)rInfo.GetDotCount();
+ rOStm << (sal_Int32)rInfo.GetDotLen();
+ rOStm << (sal_Int32)rInfo.GetDistance();
}
rOStm << (sal_Int16) GDI_LINE_ACTION;
@@ -1498,11 +1514,16 @@ sal_uLong SVMConverter::ImplWriteActions
{
nCount += 1;
}
-
- if(bLineDashDot)
- {
- nCount += 1;
- }
+
+ if(bLineCap)
+ {
+ nCount += 1;
+ }
+ }
+
+ if(bLineDashDot)
+ {
+ nCount += 1;
}
}
break;
@@ -1600,6 +1621,7 @@ sal_uLong SVMConverter::ImplWriteActions
const sal_uInt16 nPoints(aSimplePoly.GetSize());
const bool bFatLine(!rInfo.IsDefault() &&
(LINE_NONE != rInfo.GetStyle()));
const bool bLineJoin(bFatLine &&
basegfx::B2DLINEJOIN_ROUND != rInfo.GetLineJoin());
+ const bool bLineCap(bFatLine &&
com::sun::star::drawing::LineCap_BUTT != rInfo.GetLineCap());
const bool bLineDashDot(LINE_DASH ==
rInfo.GetStyle());
if( bFatLine )
@@ -1613,6 +1635,13 @@ sal_uLong SVMConverter::ImplWriteActions
rOStm << (sal_Int32) 6;
rOStm << (sal_Int16)
rInfo.GetLineJoin();
}
+
+ if(bLineCap)
+ {
+ rOStm << (sal_Int16) GDI_LINECAP_ACTION;
+ rOStm << (sal_Int32) 6;
+ rOStm << (sal_Int16) rInfo.GetLineCap();
+ }
}
if(bLineDashDot)
@@ -1652,6 +1681,11 @@ sal_uLong SVMConverter::ImplWriteActions
{
nCount += 1;
}
+
+ if(bLineCap)
+ {
+ nCount += 1;
+ }
}
if(bLineDashDot)