remove B2DLineJoin::Middle

and consistently map css::drawing::LineJoint_MIDDLE to the same thing that
css::drawing::LineJoint_MITRE points to everywhere else

Change-Id: I77b7586ea13f3fe84c0529172758256666488d36
This commit is contained in:
Caolán McNamara 2016-02-02 15:47:41 +00:00
parent ddd77c84cf
commit c3cc55968e
18 changed files with 26 additions and 41 deletions

View File

@ -120,9 +120,9 @@ namespace
o_rStrokeAttributes.StartCapType = rendering::PathCapType::BUTT; o_rStrokeAttributes.StartCapType = rendering::PathCapType::BUTT;
o_rStrokeAttributes.EndCapType = rendering::PathCapType::BUTT; o_rStrokeAttributes.EndCapType = rendering::PathCapType::BUTT;
switch(rLineInfo.GetLineJoin()) switch (rLineInfo.GetLineJoin())
{ {
default: // B2DLineJoin::NONE, B2DLineJoin::Middle case basegfx::B2DLineJoin::NONE:
o_rStrokeAttributes.JoinType = rendering::PathJoinType::NONE; o_rStrokeAttributes.JoinType = rendering::PathJoinType::NONE;
break; break;
case basegfx::B2DLineJoin::Bevel: case basegfx::B2DLineJoin::Bevel:

View File

@ -1451,9 +1451,9 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
switch(eLineJoint) switch(eLineJoint)
{ {
case css::drawing::LineJoint_MAKE_FIXED_SIZE: // fallback to round, unused value case css::drawing::LineJoint_MAKE_FIXED_SIZE: // fallback to round, unused value
case css::drawing::LineJoint_MIDDLE : // fallback to round, unused value
case css::drawing::LineJoint_ROUND : m_pLBEdgeStyle->SelectEntryPos(0); break; case css::drawing::LineJoint_ROUND : m_pLBEdgeStyle->SelectEntryPos(0); break;
case css::drawing::LineJoint_NONE : m_pLBEdgeStyle->SelectEntryPos(1); break; case css::drawing::LineJoint_NONE : m_pLBEdgeStyle->SelectEntryPos(1); break;
case css::drawing::LineJoint_MIDDLE : // fallback to mitre, unused value
case css::drawing::LineJoint_MITER : m_pLBEdgeStyle->SelectEntryPos(2); break; case css::drawing::LineJoint_MITER : m_pLBEdgeStyle->SelectEntryPos(2); break;
case css::drawing::LineJoint_BEVEL : m_pLBEdgeStyle->SelectEntryPos(3); break; case css::drawing::LineJoint_BEVEL : m_pLBEdgeStyle->SelectEntryPos(3); break;
} }

View File

@ -325,9 +325,8 @@ namespace drawinglayer
} }
} }
if(basegfx::B2DLineJoin::Middle == aLineJoin if (basegfx::B2DLineJoin::Bevel == aLineJoin ||
|| basegfx::B2DLineJoin::Bevel == aLineJoin basegfx::B2DLineJoin::Miter == aLineJoin)
|| basegfx::B2DLineJoin::Miter == aLineJoin)
{ {
if(basegfx::B2DLineJoin::Miter == aLineJoin) if(basegfx::B2DLineJoin::Miter == aLineJoin)
{ {

View File

@ -455,7 +455,7 @@ namespace drawinglayer
// get Join // get Join
switch(pLineAttribute->getLineJoin()) switch(pLineAttribute->getLineJoin())
{ {
default : // basegfx::B2DLineJoin::NONE : case basegfx::B2DLineJoin::NONE :
{ {
eJoin = SvtGraphicStroke::joinNone; eJoin = SvtGraphicStroke::joinNone;
break; break;
@ -465,7 +465,6 @@ namespace drawinglayer
eJoin = SvtGraphicStroke::joinBevel; eJoin = SvtGraphicStroke::joinBevel;
break; break;
} }
case basegfx::B2DLineJoin::Middle :
case basegfx::B2DLineJoin::Miter : case basegfx::B2DLineJoin::Miter :
{ {
eJoin = SvtGraphicStroke::joinMiter; eJoin = SvtGraphicStroke::joinMiter;

View File

@ -2462,7 +2462,7 @@ void PSWriter::ImplWriteLineInfo( const LineInfo& rLineInfo )
switch(rLineInfo.GetLineJoin()) switch(rLineInfo.GetLineJoin())
{ {
default: // B2DLineJoin::NONE, B2DLineJoin::Middle case basegfx::B2DLineJoin::NONE:
// do NOT use SvtGraphicStroke::joinNone here // do NOT use SvtGraphicStroke::joinNone here
// since it will be written as numerical value directly // since it will be written as numerical value directly
// and is NOT a valid EPS value // and is NOT a valid EPS value

View File

@ -1092,11 +1092,11 @@ void EscherPropertyContainer::CreateLineProperties(
switch ( eLJ ) switch ( eLJ )
{ {
case css::drawing::LineJoint_NONE : case css::drawing::LineJoint_NONE :
case css::drawing::LineJoint_MIDDLE :
case css::drawing::LineJoint_BEVEL : case css::drawing::LineJoint_BEVEL :
eLineJoin = ESCHER_LineJoinBevel; eLineJoin = ESCHER_LineJoinBevel;
break; break;
default: default:
case css::drawing::LineJoint_MIDDLE :
case css::drawing::LineJoint_MITER : case css::drawing::LineJoint_MITER :
eLineJoin = ESCHER_LineJoinMiter; eLineJoin = ESCHER_LineJoinMiter;
break; break;

View File

@ -1900,7 +1900,7 @@ void SVGActionWriter::ImplAddLineAttr( const LineInfo &rAttrs,
// support for LineJoint // support for LineJoint
switch(rAttrs.GetLineJoin()) switch(rAttrs.GetLineJoin())
{ {
default: // B2DLineJoin::NONE, B2DLineJoin::Middle case basegfx::B2DLineJoin::NONE:
case basegfx::B2DLineJoin::Miter: case basegfx::B2DLineJoin::Miter:
{ {
mrExport.AddAttribute(XML_NAMESPACE_NONE, aXMLAttrStrokeLinejoin, "miter"); mrExport.AddAttribute(XML_NAMESPACE_NONE, aXMLAttrStrokeLinejoin, "miter");
@ -1989,7 +1989,7 @@ void SVGActionWriter::ImplWriteShape( const SVGShapeDescriptor& rShape, bool bAp
// support for LineJoin // support for LineJoin
switch(rShape.maLineJoin) switch(rShape.maLineJoin)
{ {
default: // B2DLineJoin::NONE, B2DLineJoin::Middle case basegfx::B2DLineJoin::NONE:
case basegfx::B2DLineJoin::Miter: case basegfx::B2DLineJoin::Miter:
{ {
// miter is Svg default, so no need to write until the exporter might write styles. // miter is Svg default, so no need to write until the exporter might write styles.

View File

@ -56,11 +56,11 @@ namespace basegfx
*/ */
enum class B2DLineJoin enum class B2DLineJoin
{ {
NONE, // no rounding NONE = 0, // no rounding
Middle, // calc middle value between joints // removed unused Middle join type
Bevel, // join edges with line Bevel = 2, // join edges with line
Miter, // extend till cut Miter = 3, // extend till cut
Round // create arc Round = 4 // create arc
}; };
} // end of namespace basegfx } // end of namespace basegfx

View File

@ -747,11 +747,11 @@ void DrawingML::WriteOutline( Reference<XPropertySet> rXPropSet )
switch( eLineJoint ) switch( eLineJoint )
{ {
case LineJoint_NONE: case LineJoint_NONE:
case LineJoint_MIDDLE:
case LineJoint_BEVEL: case LineJoint_BEVEL:
mpFS->singleElementNS( XML_a, XML_bevel, FSEND ); mpFS->singleElementNS( XML_a, XML_bevel, FSEND );
break; break;
default: default:
case LineJoint_MIDDLE:
case LineJoint_MITER: case LineJoint_MITER:
mpFS->singleElementNS( XML_a, XML_miter, FSEND ); mpFS->singleElementNS( XML_a, XML_miter, FSEND );
break; break;

View File

@ -56,14 +56,11 @@ namespace
{ {
switch(eLineJoint) switch(eLineJoint)
{ {
case css::drawing::LineJoint_MIDDLE :
{
return basegfx::B2DLineJoin::Middle;
}
case css::drawing::LineJoint_BEVEL : case css::drawing::LineJoint_BEVEL :
{ {
return basegfx::B2DLineJoin::Bevel; return basegfx::B2DLineJoin::Bevel;
} }
case css::drawing::LineJoint_MIDDLE :
case css::drawing::LineJoint_MITER : case css::drawing::LineJoint_MITER :
{ {
return basegfx::B2DLineJoin::Miter; return basegfx::B2DLineJoin::Miter;

View File

@ -136,14 +136,11 @@ namespace drawinglayer
{ {
switch(eLineJoint) switch(eLineJoint)
{ {
case css::drawing::LineJoint_MIDDLE :
{
return basegfx::B2DLineJoin::Middle;
}
case css::drawing::LineJoint_BEVEL : case css::drawing::LineJoint_BEVEL :
{ {
return basegfx::B2DLineJoin::Bevel; return basegfx::B2DLineJoin::Bevel;
} }
case css::drawing::LineJoint_MIDDLE :
case css::drawing::LineJoint_MITER : case css::drawing::LineJoint_MITER :
{ {
return basegfx::B2DLineJoin::Miter; return basegfx::B2DLineJoin::Miter;

View File

@ -462,7 +462,6 @@ void LinePropertyPanelBase::updateLineJoint(bool bDisabled, bool bSetOrDefault,
switch(pItem->GetValue()) switch(pItem->GetValue())
{ {
case drawing::LineJoint_MIDDLE:
case drawing::LineJoint_ROUND: case drawing::LineJoint_ROUND:
{ {
nEntryPos = 1; nEntryPos = 1;
@ -473,6 +472,7 @@ void LinePropertyPanelBase::updateLineJoint(bool bDisabled, bool bSetOrDefault,
nEntryPos = 2; nEntryPos = 2;
break; break;
} }
case drawing::LineJoint_MIDDLE:
case drawing::LineJoint_MITER: case drawing::LineJoint_MITER:
{ {
nEntryPos = 3; nEntryPos = 3;

View File

@ -355,12 +355,9 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr
switch(maLineJoin) switch(maLineJoin)
{ {
default : // basegfx::B2DLineJoin::NONE case basegfx::B2DLineJoin::NONE:
mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_NONE)); mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_NONE));
break; break;
case basegfx::B2DLineJoin::Middle:
mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_MIDDLE));
break;
case basegfx::B2DLineJoin::Bevel: case basegfx::B2DLineJoin::Bevel:
mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_BEVEL)); mpLineAttr->Put(XLineJointItem(css::drawing::LineJoint_BEVEL));
break; break;

View File

@ -707,7 +707,6 @@ bool SvpSalGraphics::drawPolyLine(
eCairoLineJoin = CAIRO_LINE_JOIN_ROUND; eCairoLineJoin = CAIRO_LINE_JOIN_ROUND;
break; break;
case basegfx::B2DLineJoin::NONE: case basegfx::B2DLineJoin::NONE:
case basegfx::B2DLineJoin::Middle:
case basegfx::B2DLineJoin::Miter: case basegfx::B2DLineJoin::Miter:
eCairoLineJoin = CAIRO_LINE_JOIN_MITER; eCairoLineJoin = CAIRO_LINE_JOIN_MITER;
break; break;

View File

@ -996,7 +996,6 @@ bool AquaSalGraphics::drawPolyLine( const basegfx::B2DPolygon& rPolyLine,
switch( eLineJoin ) switch( eLineJoin )
{ {
case basegfx::B2DLineJoin::NONE: aCGLineJoin = /*TODO?*/kCGLineJoinMiter; break; case basegfx::B2DLineJoin::NONE: aCGLineJoin = /*TODO?*/kCGLineJoinMiter; break;
case basegfx::B2DLineJoin::Middle: aCGLineJoin = /*TODO?*/kCGLineJoinMiter; break;
case basegfx::B2DLineJoin::Bevel: aCGLineJoin = kCGLineJoinBevel; break; case basegfx::B2DLineJoin::Bevel: aCGLineJoin = kCGLineJoinBevel; break;
case basegfx::B2DLineJoin::Miter: aCGLineJoin = kCGLineJoinMiter; break; case basegfx::B2DLineJoin::Miter: aCGLineJoin = kCGLineJoinMiter; break;
case basegfx::B2DLineJoin::Round: aCGLineJoin = kCGLineJoinRound; break; case basegfx::B2DLineJoin::Round: aCGLineJoin = kCGLineJoinRound; break;

View File

@ -10541,9 +10541,8 @@ void PDFWriterImpl::convertLineInfoToExtLineInfo( const LineInfo& rIn, PDFWriter
rOut.m_eJoin = PDFWriter::joinBevel; rOut.m_eJoin = PDFWriter::joinBevel;
break; break;
} }
default : // basegfx::B2DLineJoin::NONE :
// Pdf has no 'none' lineJoin, default is miter // Pdf has no 'none' lineJoin, default is miter
case basegfx::B2DLineJoin::Middle : case basegfx::B2DLineJoin::NONE :
case basegfx::B2DLineJoin::Miter : case basegfx::B2DLineJoin::Miter :
{ {
rOut.m_eJoin = PDFWriter::joinMiter; rOut.m_eJoin = PDFWriter::joinMiter;

View File

@ -2052,7 +2052,7 @@ bool WinSalGraphicsImpl::drawPolyLine(
switch(eLineJoin) switch(eLineJoin)
{ {
default : // basegfx::B2DLineJoin::NONE : case basegfx::B2DLineJoin::NONE :
{ {
if(basegfx::fTools::more(rLineWidths.getX(), 0.0)) if(basegfx::fTools::more(rLineWidths.getX(), 0.0))
{ {
@ -2065,7 +2065,6 @@ bool WinSalGraphicsImpl::drawPolyLine(
Gdiplus::DllExports::GdipSetPenLineJoin(pTestPen, Gdiplus::LineJoinBevel); Gdiplus::DllExports::GdipSetPenLineJoin(pTestPen, Gdiplus::LineJoinBevel);
break; break;
} }
case basegfx::B2DLineJoin::Middle :
case basegfx::B2DLineJoin::Miter : case basegfx::B2DLineJoin::Miter :
{ {
const Gdiplus::REAL aMiterLimit(15.0); const Gdiplus::REAL aMiterLimit(15.0);

View File

@ -266,10 +266,10 @@ public:
drawing::LineCap_BUTT, drawing::LineCap_ROUND, drawing::LineCap_SQUARE, drawing::LineCap_BUTT drawing::LineCap_BUTT, drawing::LineCap_ROUND, drawing::LineCap_SQUARE, drawing::LineCap_BUTT
}; };
basegfx::B2DLineJoin eJoins[] = { basegfx::B2DLineJoin eJoins[] = {
basegfx::B2DLineJoin::NONE, basegfx::B2DLineJoin::Middle, basegfx::B2DLineJoin::Bevel, basegfx::B2DLineJoin::Miter, basegfx::B2DLineJoin::NONE, basegfx::B2DLineJoin::Bevel, basegfx::B2DLineJoin::Miter, basegfx::B2DLineJoin::Round,
basegfx::B2DLineJoin::Round, basegfx::B2DLineJoin::NONE, basegfx::B2DLineJoin::Middle, basegfx::B2DLineJoin::Bevel, basegfx::B2DLineJoin::NONE, basegfx::B2DLineJoin::Bevel, basegfx::B2DLineJoin::Miter, basegfx::B2DLineJoin::Round,
basegfx::B2DLineJoin::Miter, basegfx::B2DLineJoin::Round, basegfx::B2DLineJoin::NONE, basegfx::B2DLineJoin::Middle, basegfx::B2DLineJoin::NONE, basegfx::B2DLineJoin::Bevel, basegfx::B2DLineJoin::Miter, basegfx::B2DLineJoin::Round,
basegfx::B2DLineJoin::Bevel, basegfx::B2DLineJoin::Miter, basegfx::B2DLineJoin::Round, basegfx::B2DLineJoin::NONE basegfx::B2DLineJoin::NONE, basegfx::B2DLineJoin::Bevel, basegfx::B2DLineJoin::Miter, basegfx::B2DLineJoin::Round
}; };
double aLineWidths[] = { double aLineWidths[] = {
10.0, 15.0, 20.0, 10.0, 10.0, 15.0, 20.0, 10.0,