diff options
author | Noel Grandin <noel@peralex.com> | 2016-09-02 08:36:23 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-09-05 08:21:46 +0200 |
commit | 65ca57a447bae97714b1b32aa2df5705215a95ad (patch) | |
tree | 9b62f8fb4a890d5fcba13abc446b3244e9c5232f | |
parent | a881fd7e66294ada222e1d618a7d47a0549a2342 (diff) |
convert LineStyle to scoped enum
Change-Id: I30cfa5a0649b806604c443f55683d1f2a430983d
30 files changed, 91 insertions, 96 deletions
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index 955c9ad970e6..04c85cd04296 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -158,7 +158,7 @@ namespace } } - if( LINE_DASH == rLineInfo.GetStyle() ) + if( LineStyle::Dash == rLineInfo.GetStyle() ) { const ::cppcanvas::internal::OutDevState& rState( rParms.mrStates.getState() ); @@ -1890,7 +1890,7 @@ namespace cppcanvas io_rCurrActionIndex += pLineAction->getActionCount()-1; } } - else if( LINE_NONE != rLineInfo.GetStyle() ) + else if( LineStyle::NONE != rLineInfo.GetStyle() ) { // 'thick' line rendering::StrokeAttributes aStrokeAttributes; @@ -2075,7 +2075,7 @@ namespace cppcanvas io_rCurrActionIndex += pLineAction->getActionCount()-1; } } - else if( LINE_NONE != rLineInfo.GetStyle() ) + else if( LineStyle::NONE != rLineInfo.GetStyle() ) { // 'thick' line polygon rendering::StrokeAttributes aStrokeAttributes; diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx index cf4182cbbd44..4407647a7e24 100644 --- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx @@ -658,7 +658,7 @@ namespace { if(rLinePolygon.count()) { - const bool bDashDotUsed(LINE_DASH == rLineInfo.GetStyle()); + const bool bDashDotUsed(LineStyle::Dash == rLineInfo.GetStyle()); const bool bWidthUsed(rLineInfo.GetWidth() > 1); if(bDashDotUsed || bWidthUsed) diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 37218e020bda..d35d7804b8a9 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -1228,7 +1228,7 @@ namespace drawinglayer impStartSvtGraphicStroke(pSvtGraphicStroke); const attribute::LineAttribute& rLine = rStrokePrimitive.getLineAttribute(); - // create MetaPolyLineActions, but without LINE_DASH + // create MetaPolyLineActions, but without LineStyle::Dash if(basegfx::fTools::more(rLine.getWidth(), 0.0)) { const attribute::StrokeAttribute& rStroke = rStrokePrimitive.getStrokeAttribute(); @@ -1251,7 +1251,7 @@ namespace drawinglayer aHairLinePolyPolygon.transform(maCurrentTransformation); // use the transformed line width - LineInfo aLineInfo(LINE_SOLID, basegfx::fround(getTransformedLineWidth(rLine.getWidth()))); + LineInfo aLineInfo(LineStyle::Solid, basegfx::fround(getTransformedLineWidth(rLine.getWidth()))); aLineInfo.SetLineJoin(rLine.getLineJoin()); aLineInfo.SetLineCap(rLine.getLineCap()); diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx index b28c11e76b0a..8bbc834d83b1 100644 --- a/extensions/source/update/ui/updatecheckui.cxx +++ b/extensions/source/update/ui/updatecheckui.cxx @@ -806,7 +806,7 @@ void BubbleWindow::Paint(vcl::RenderContext& /*rRenderContext*/, const Rectangle { SolarMutexGuard aGuard; - LineInfo aThickLine( LINE_SOLID, 2 ); + LineInfo aThickLine( LineStyle::Solid, 2 ); DrawPolyLine( maRectPoly, aThickLine ); DrawPolyLine( maTriPoly ); diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index 7036da7690fc..ee909bb948ca 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -2277,7 +2277,7 @@ void PSWriter::ImplWriteLineInfo( double fLWidth, double fMLimit, void PSWriter::ImplWriteLineInfo( const LineInfo& rLineInfo ) { SvtGraphicStroke::DashArray l_aDashArray; - if ( rLineInfo.GetStyle() == LINE_DASH ) + if ( rLineInfo.GetStyle() == LineStyle::Dash ) l_aDashArray.push_back( 2 ); const double fLWidth(( ( rLineInfo.GetWidth() + 1 ) + ( rLineInfo.GetWidth() + 1 ) ) * 0.5); SvtGraphicStroke::JoinType aJoinType(SvtGraphicStroke::joinMiter); diff --git a/filter/source/graphicfilter/idxf/dxf2mtf.cxx b/filter/source/graphicfilter/idxf/dxf2mtf.cxx index 72af29d269f4..43534f9e6629 100644 --- a/filter/source/graphicfilter/idxf/dxf2mtf.cxx +++ b/filter/source/graphicfilter/idxf/dxf2mtf.cxx @@ -71,11 +71,11 @@ DXFLineInfo DXF2GDIMetaFile::LTypeToDXFLineInfo(OString const& rLineType) pLT = pDXF->aTables.SearchLType(rLineType); if (pLT==nullptr || pLT->nDashCount == 0) { - aDXFLineInfo.eStyle = LINE_SOLID; + aDXFLineInfo.eStyle = LineStyle::Solid; } else { sal_Int32 i; - aDXFLineInfo.eStyle = LINE_DASH; + aDXFLineInfo.eStyle = LineStyle::Dash; for (i=0; i < (pLT->nDashCount); i++) { const double x = pLT->fDash[i] * pDXF->getGlobalLineTypeScale(); if ( x >= 0.0 ) { @@ -116,7 +116,7 @@ DXFLineInfo DXF2GDIMetaFile::GetEntityDXFLineInfo(const DXFBasicEntity & rE) { DXFLineInfo aDXFLineInfo; - aDXFLineInfo.eStyle = LINE_SOLID; + aDXFLineInfo.eStyle = LineStyle::Solid; aDXFLineInfo.fWidth = 0; aDXFLineInfo.nDashCount = 0; aDXFLineInfo.fDashLen = 0; @@ -788,7 +788,7 @@ bool DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF nMainEntitiesCount=CountEntities(pDXF->aEntities); nBlockColor=7; - aBlockDXFLineInfo.eStyle = LINE_SOLID; + aBlockDXFLineInfo.eStyle = LineStyle::Solid; aBlockDXFLineInfo.fWidth = 0; aBlockDXFLineInfo.nDashCount = 0; aBlockDXFLineInfo.fDashLen = 0; @@ -803,7 +803,7 @@ bool DXF2GDIMetaFile::Convert(const DXFRepresentation & rDXF, GDIMetaFile & rMTF } else { nParentLayerColor=7; - aParentLayerDXFLineInfo.eStyle = LINE_SOLID; + aParentLayerDXFLineInfo.eStyle = LineStyle::Solid; aParentLayerDXFLineInfo.fWidth = 0; aParentLayerDXFLineInfo.nDashCount = 0; aParentLayerDXFLineInfo.fDashLen = 0; diff --git a/filter/source/graphicfilter/idxf/dxfvec.hxx b/filter/source/graphicfilter/idxf/dxfvec.hxx index 8c8a4f7bba0c..4f22e6ef97fe 100644 --- a/filter/source/graphicfilter/idxf/dxfvec.hxx +++ b/filter/source/graphicfilter/idxf/dxfvec.hxx @@ -36,7 +36,7 @@ public: double fDistance; DXFLineInfo() : - eStyle(LINE_SOLID), + eStyle(LineStyle::Solid), fWidth(0), nDashCount(0), fDashLen(0), diff --git a/filter/source/graphicfilter/ios2met/ios2met.cxx b/filter/source/graphicfilter/ios2met/ios2met.cxx index 7a3efb97469b..20f367a6e2dc 100644 --- a/filter/source/graphicfilter/ios2met/ios2met.cxx +++ b/filter/source/graphicfilter/ios2met/ios2met.cxx @@ -460,12 +460,12 @@ OS2METReader::~OS2METReader() bool OS2METReader::IsLineInfo() { - return ( ! ( aLineInfo.IsDefault() || ( aLineInfo.GetStyle() == LINE_NONE ) || ( pVirDev->GetLineColor() == COL_TRANSPARENT ) ) ); + return ( ! ( aLineInfo.IsDefault() || ( aLineInfo.GetStyle() == LineStyle::NONE ) || ( pVirDev->GetLineColor() == COL_TRANSPARENT ) ) ); } void OS2METReader::DrawPolyLine( const tools::Polygon& rPolygon ) { - if ( aLineInfo.GetStyle() == LINE_DASH || ( aLineInfo.GetWidth() > 1 ) ) + if ( aLineInfo.GetStyle() == LineStyle::Dash || ( aLineInfo.GetWidth() > 1 ) ) pVirDev->DrawPolyLine( rPolygon, aLineInfo ); else pVirDev->DrawPolyLine( rPolygon ); @@ -683,7 +683,7 @@ void OS2METReader::ChangeBrush(const Color& rPatColor, const Color& /*rBGColor*/ void OS2METReader::SetPen( const Color& rColor, sal_uInt16 nLineWidth, PenStyle ePenStyle ) { - LineStyle eLineStyle( LINE_SOLID ); + LineStyle eLineStyle( LineStyle::Solid ); if ( pVirDev->GetLineColor() != rColor ) pVirDev->SetLineColor( rColor ); @@ -694,7 +694,7 @@ void OS2METReader::SetPen( const Color& rColor, sal_uInt16 nLineWidth, PenStyle switch ( ePenStyle ) { case PEN_NULL : - eLineStyle = LINE_NONE; + eLineStyle = LineStyle::NONE; break; case PEN_DASHDOT : nDashCount++; @@ -710,7 +710,7 @@ void OS2METReader::SetPen( const Color& rColor, sal_uInt16 nLineWidth, PenStyle aLineInfo.SetDistance( nLineWidth ); aLineInfo.SetDotLen( nLineWidth ); aLineInfo.SetDashLen( nLineWidth << 2 ); - eLineStyle = LINE_DASH; + eLineStyle = LineStyle::Dash; break; case PEN_SOLID: break; // -Wall not handled... diff --git a/include/vcl/lineinfo.hxx b/include/vcl/lineinfo.hxx index e36c1c0b4747..99dda6242cf8 100644 --- a/include/vcl/lineinfo.hxx +++ b/include/vcl/lineinfo.hxx @@ -53,7 +53,7 @@ struct ImplLineInfo class VCL_DLLPUBLIC LineInfo { public: - LineInfo( LineStyle eLineStyle = LINE_SOLID, long nWidth = 0L ); + LineInfo( LineStyle eLineStyle = LineStyle::Solid, long nWidth = 0L ); LineInfo( const LineInfo& rLineInfo ); LineInfo( LineInfo&& rLineInfo ); ~LineInfo(); diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx index 0934db7d539e..a6931b354d4e 100644 --- a/include/vcl/vclenum.hxx +++ b/include/vcl/vclenum.hxx @@ -58,17 +58,12 @@ enum HatchStyle HatchStyle_FORCE_EQUAL_SIZE = SAL_MAX_ENUM }; -// to avoid conflicts with enum's declared otherwise -#define LINE_NONE LineStyle_NONE -#define LINE_SOLID LineStyle_SOLID -#define LINE_DASH LineStyle_DASH - -enum LineStyle +enum class LineStyle { - LINE_NONE = 0, - LINE_SOLID = 1, - LINE_DASH = 2, - LineStyle_FORCE_EQUAL_SIZE = SAL_MAX_ENUM + NONE = 0, + Solid = 1, + Dash = 2, + FORCE_EQUAL_SIZE = SAL_MAX_ENUM }; enum class RasterOp { OverPaint, Xor, N0, N1, Invert }; diff --git a/reportdesign/source/ui/report/EndMarker.cxx b/reportdesign/source/ui/report/EndMarker.cxx index cdf9681eac7f..ee75fcec5e6b 100644 --- a/reportdesign/source/ui/report/EndMarker.cxx +++ b/reportdesign/source/ui/report/EndMarker.cxx @@ -72,7 +72,7 @@ void OEndMarker::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*rR Size(aSize.Width() - nCornerSpace, aSize.Height() - nCornerSpace - nCornerSpace)); ColorChanger aColors(this, COL_WHITE, COL_WHITE); - rRenderContext.DrawPolyLine( tools::Polygon(PixelToLogic(aRect)), LineInfo(LINE_SOLID, 2)); + rRenderContext.DrawPolyLine( tools::Polygon(PixelToLogic(aRect)), LineInfo(LineStyle::Solid, 2)); } } diff --git a/reportdesign/source/ui/report/StartMarker.cxx b/reportdesign/source/ui/report/StartMarker.cxx index 2d794da3f5c0..70b134e74413 100644 --- a/reportdesign/source/ui/report/StartMarker.cxx +++ b/reportdesign/source/ui/report/StartMarker.cxx @@ -147,7 +147,7 @@ void OStartMarker::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /* aSize.Height() - nCornerHeight - nCornerHeight)); ColorChanger aColors(&rRenderContext, COL_WHITE, COL_WHITE); rRenderContext.DrawPolyLine( tools::Polygon(rRenderContext.PixelToLogic(aRect)), - LineInfo(LINE_SOLID, 2)); + LineInfo(LineStyle::Solid, 2)); } } diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index f5dedb72f36a..064bfa858caf 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -861,7 +861,7 @@ void drawDataBars(vcl::RenderContext& rRenderContext, const ScDataBarInfo* pOldD { Point aPoint1(nPosZero, rRect.Top()); Point aPoint2(nPosZero, rRect.Bottom()); - LineInfo aLineInfo(LINE_DASH, 1); + LineInfo aLineInfo(LineStyle::Dash, 1); aLineInfo.SetDashCount( 4 ); aLineInfo.SetDistance( 3 ); aLineInfo.SetDashLen( 3 ); diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index 505090716bf4..4c6b9151dc93 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -2828,7 +2828,7 @@ void SvxIconChoiceCtrl_Impl::DrawFocusRect(vcl::RenderContext& rRenderContext) rRenderContext.SetFillColor(); tools::Polygon aPolygon (aFocus.aRect); - LineInfo aLineInfo(LINE_DASH); + LineInfo aLineInfo(LineStyle::Dash); aLineInfo.SetDashLen(1); aLineInfo.SetDotLen(1L); diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index f75e7126284e..a50b85d4285c 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -728,7 +728,7 @@ static void lcl_DrawLineForWrongListData( aStart.Y() +=30; aEnd.Y() +=30; - LineInfo aLineInfo( LINE_DASH ); + LineInfo aLineInfo( LineStyle::Dash ); aLineInfo.SetDistance( 40 ); aLineInfo.SetDashLen( 1 ); aLineInfo.SetDashCount(1); diff --git a/test/source/mtfxmldump.cxx b/test/source/mtfxmldump.cxx index f1e2dd059fc1..e89c1cd0983c 100644 --- a/test/source/mtfxmldump.cxx +++ b/test/source/mtfxmldump.cxx @@ -116,10 +116,10 @@ OUString convertLineStyleToString(LineStyle eAlign) { switch (eAlign) { - case LINE_NONE: return OUString("none"); - case LINE_SOLID: return OUString("solid"); - case LINE_DASH: return OUString("dash"); - case LineStyle_FORCE_EQUAL_SIZE: return OUString("equalsize"); + case LineStyle::NONE: return OUString("none"); + case LineStyle::Solid: return OUString("solid"); + case LineStyle::Dash: return OUString("dash"); + default: break; } return OUString(); } diff --git a/vcl/source/filter/wmf/enhwmf.cxx b/vcl/source/filter/wmf/enhwmf.cxx index c8f72a909d1c..9b3a42a8b47e 100644 --- a/vcl/source/filter/wmf/enhwmf.cxx +++ b/vcl/source/filter/wmf/enhwmf.cxx @@ -918,33 +918,33 @@ bool EnhWMFReader::ReadEnhWMF() switch( nStyle & PS_STYLE_MASK ) { case PS_DASHDOTDOT : - aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetStyle( LineStyle::Dash ); aLineInfo.SetDashCount( 1 ); aLineInfo.SetDotCount( 2 ); break; case PS_DASHDOT : - aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetStyle( LineStyle::Dash ); aLineInfo.SetDashCount( 1 ); aLineInfo.SetDotCount( 1 ); break; case PS_DOT : - aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetStyle( LineStyle::Dash ); aLineInfo.SetDashCount( 0 ); aLineInfo.SetDotCount( 1 ); break; case PS_DASH : - aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetStyle( LineStyle::Dash ); aLineInfo.SetDashCount( 1 ); aLineInfo.SetDotCount( 0 ); break; case PS_NULL : bTransparent = true; - aLineInfo.SetStyle( LINE_NONE ); + aLineInfo.SetStyle( LineStyle::NONE ); break; case PS_INSIDEFRAME : case PS_SOLID : default : - aLineInfo.SetStyle( LINE_SOLID ); + aLineInfo.SetStyle( LineStyle::Solid ); } switch( nStyle & PS_ENDCAP_STYLE_MASK ) { @@ -1007,34 +1007,34 @@ bool EnhWMFReader::ReadEnhWMF() switch( nStyle & PS_STYLE_MASK ) { case PS_DASHDOTDOT : - aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetStyle( LineStyle::Dash ); aLineInfo.SetDashCount( 1 ); aLineInfo.SetDotCount( 2 ); break; case PS_DASHDOT : - aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetStyle( LineStyle::Dash ); aLineInfo.SetDashCount( 1 ); aLineInfo.SetDotCount( 1 ); break; case PS_DOT : - aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetStyle( LineStyle::Dash ); aLineInfo.SetDashCount( 0 ); aLineInfo.SetDotCount( 1 ); break; case PS_DASH : - aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetStyle( LineStyle::Dash ); aLineInfo.SetDashCount( 1 ); aLineInfo.SetDotCount( 0 ); break; case PS_NULL : bTransparent = true; - aLineInfo.SetStyle( LINE_NONE ); + aLineInfo.SetStyle( LineStyle::NONE ); break; case PS_INSIDEFRAME : case PS_SOLID : default : - aLineInfo.SetStyle( LINE_SOLID ); + aLineInfo.SetStyle( LineStyle::Solid ); } switch( nStyle & PS_ENDCAP_STYLE_MASK ) { diff --git a/vcl/source/filter/wmf/winmtf.cxx b/vcl/source/filter/wmf/winmtf.cxx index de2a01294102..f7fd07e33c99 100644 --- a/vcl/source/filter/wmf/winmtf.cxx +++ b/vcl/source/filter/wmf/winmtf.cxx @@ -747,7 +747,7 @@ void WinMtfOutput::CreateObjectIndexed( sal_Int32 nIndex, std::unique_ptr<GDIObj Size aSize(pLineStyle->aLineInfo.GetWidth(), 0); pLineStyle->aLineInfo.SetWidth( ImplMap(aSize).Width() ); - if ( pLineStyle->aLineInfo.GetStyle() == LINE_DASH ) + if ( pLineStyle->aLineInfo.GetStyle() == LineStyle::Dash ) { aSize.Width() += 1; long nDotLen = ImplMap( aSize ).Width(); @@ -1065,7 +1065,7 @@ void WinMtfOutput::DrawRect( const Rectangle& rRect, bool bEdge ) { if ( bEdge ) { - if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) ) + if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LineStyle::Dash ) ) { ImplSetNonPersistentLineColorTransparenz(); mpGDIMetaFile->AddAction( new MetaRectAction( ImplMap( rRect ) ) ); @@ -1099,7 +1099,7 @@ void WinMtfOutput::DrawEllipse( const Rectangle& rRect ) UpdateClipRegion(); UpdateFillStyle(); - if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) ) + if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LineStyle::Dash ) ) { Point aCenter( ImplMap( rRect.Center() ) ); Size aRad( ImplMap( Size( rRect.GetWidth() / 2, rRect.GetHeight() / 2 ) ) ); @@ -1126,7 +1126,7 @@ void WinMtfOutput::DrawArc( const Rectangle& rRect, const Point& rStart, const P Point aStart( ImplMap( rStart ) ); Point aEnd( ImplMap( rEnd ) ); - if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) ) + if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LineStyle::Dash ) ) { if ( aStart == aEnd ) { // SJ: #i53768# if start & end is identical, then we have to draw a full ellipse @@ -1154,7 +1154,7 @@ void WinMtfOutput::DrawPie( const Rectangle& rRect, const Point& rStart, const P Point aStart( ImplMap( rStart ) ); Point aEnd( ImplMap( rEnd ) ); - if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) ) + if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LineStyle::Dash ) ) { ImplSetNonPersistentLineColorTransparenz(); mpGDIMetaFile->AddAction( new MetaPieAction( aRect, aStart, aEnd ) ); @@ -1177,7 +1177,7 @@ void WinMtfOutput::DrawChord( const Rectangle& rRect, const Point& rStart, const Point aStart( ImplMap( rStart ) ); Point aEnd( ImplMap( rEnd ) ); - if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) ) + if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LineStyle::Dash ) ) { ImplSetNonPersistentLineColorTransparenz(); mpGDIMetaFile->AddAction( new MetaChordAction( aRect, aStart, aEnd ) ); @@ -1210,7 +1210,7 @@ void WinMtfOutput::DrawPolygon( tools::Polygon& rPolygon, bool bRecordPath ) } else { - if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) ) + if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LineStyle::Dash ) ) { sal_uInt16 nCount = rPolygon.GetSize(); if ( nCount ) @@ -1285,7 +1285,7 @@ void WinMtfOutput::DrawPolyPolygon( tools::PolyPolygon& rPolyPolygon, bool bReco { UpdateLineStyle(); mpGDIMetaFile->AddAction( new MetaPolyPolygonAction( rPolyPolygon ) ); - if (maLineStyle.aLineInfo.GetWidth() > 0 || maLineStyle.aLineInfo.GetStyle() == LINE_DASH) + if (maLineStyle.aLineInfo.GetWidth() > 0 || maLineStyle.aLineInfo.GetStyle() == LineStyle::Dash) { for (sal_uInt16 nPoly = 0; nPoly < rPolyPolygon.Count(); ++nPoly) { diff --git a/vcl/source/filter/wmf/winwmf.cxx b/vcl/source/filter/wmf/winwmf.cxx index 06431af03f88..e66f3ed8d8a0 100644 --- a/vcl/source/filter/wmf/winwmf.cxx +++ b/vcl/source/filter/wmf/winwmf.cxx @@ -816,33 +816,33 @@ void WMFReader::ReadRecordParams( sal_uInt16 nFunc ) switch( nStyle & 0xFF ) { case PS_DASHDOTDOT : - aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetStyle( LineStyle::Dash ); aLineInfo.SetDashCount( 1 ); aLineInfo.SetDotCount( 2 ); break; case PS_DASHDOT : - aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetStyle( LineStyle::Dash ); aLineInfo.SetDashCount( 1 ); aLineInfo.SetDotCount( 1 ); break; case PS_DOT : - aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetStyle( LineStyle::Dash ); aLineInfo.SetDashCount( 0 ); aLineInfo.SetDotCount( 1 ); break; case PS_DASH : - aLineInfo.SetStyle( LINE_DASH ); + aLineInfo.SetStyle( LineStyle::Dash ); aLineInfo.SetDashCount( 1 ); aLineInfo.SetDotCount( 0 ); break; case PS_NULL : bTransparent = true; - aLineInfo.SetStyle( LINE_NONE ); + aLineInfo.SetStyle( LineStyle::NONE ); break; default : case PS_INSIDEFRAME : case PS_SOLID : - aLineInfo.SetStyle( LINE_SOLID ); + aLineInfo.SetStyle( LineStyle::Solid ); } switch( nStyle & 0xF00 ) { diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 9bf1431e83b1..dfdb36e21e1d 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -375,7 +375,7 @@ void WMFWriter::WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& sal_uInt16 nStyle = rColor == Color( COL_TRANSPARENT ) ? W_PS_NULL : W_PS_SOLID; switch( rLineInfo.GetStyle() ) { - case LINE_DASH : + case LineStyle::Dash : { if ( rLineInfo.GetDotCount() ) { @@ -393,7 +393,7 @@ void WMFWriter::WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& nStyle = W_PS_DASH; } break; - case LINE_NONE : + case LineStyle::NONE : nStyle = W_PS_NULL; break; default: diff --git a/vcl/source/gdi/lineinfo.cxx b/vcl/source/gdi/lineinfo.cxx index 608ce4d7b995..a82d82cf2103 100644 --- a/vcl/source/gdi/lineinfo.cxx +++ b/vcl/source/gdi/lineinfo.cxx @@ -28,7 +28,7 @@ ImplLineInfo::ImplLineInfo() : - meStyle ( LINE_SOLID ), + meStyle ( LineStyle::Solid ), mnWidth ( 0 ), mnDashCount ( 0 ), mnDashLen ( 0 ), @@ -157,7 +157,7 @@ void LineInfo::SetLineCap(css::drawing::LineCap eLineCap) bool LineInfo::IsDefault() const { return( !mpImplLineInfo->mnWidth - && ( LINE_SOLID == mpImplLineInfo->meStyle ) + && ( LineStyle::Solid == mpImplLineInfo->meStyle ) && ( css::drawing::LineCap_BUTT == mpImplLineInfo->meLineCap)); } @@ -202,7 +202,7 @@ SvStream& WriteLineInfo( SvStream& rOStm, const LineInfo& rLineInfo ) VersionCompat aCompat( rOStm, StreamMode::WRITE, 4 ); // version 1 - rOStm.WriteUInt16( rLineInfo.mpImplLineInfo->meStyle ) + rOStm.WriteUInt16( (sal_uInt16)rLineInfo.mpImplLineInfo->meStyle ) .WriteInt32( rLineInfo.mpImplLineInfo->mnWidth ); // since version2 @@ -229,7 +229,7 @@ void LineInfo::applyToB2DPolyPolygon( if(io_rLinePolyPolygon.count()) { - if(LINE_DASH == GetStyle()) + if(LineStyle::Dash == GetStyle()) { ::std::vector< double > fDotDashArray; const double fDashLen(GetDashLen()); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 6a62eacc9e28..5f232b1f688d 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -330,7 +330,7 @@ void doTestCode() aWriter.EndStructureElement(); aWriter.EndStructureElement(); - LineInfo aLI( LINE_DASH, 3 ); + LineInfo aLI( LineStyle::Dash, 3 ); aLI.SetDashCount( 2 ); aLI.SetDashLen( 50 ); aLI.SetDotCount( 2 ); @@ -1604,7 +1604,7 @@ void PDFWriterImpl::PDFPage::appendMappedLength( double fLength, OStringBuffer& bool PDFWriterImpl::PDFPage::appendLineInfo( const LineInfo& rInfo, OStringBuffer& rBuffer ) const { - if(LINE_DASH == rInfo.GetStyle() && rInfo.GetDashLen() != rInfo.GetDotLen()) + if(LineStyle::Dash == rInfo.GetStyle() && rInfo.GetDashLen() != rInfo.GetDotLen()) { // dashed and non-degraded case, check for implementation limits of dash array // in PDF reader apps (e.g. acroread) @@ -1626,7 +1626,7 @@ bool PDFWriterImpl::PDFPage::appendLineInfo( const LineInfo& rInfo, OStringBuffe return false; } - if( rInfo.GetStyle() == LINE_DASH ) + if( rInfo.GetStyle() == LineStyle::Dash ) { rBuffer.append( "[ " ); if( rInfo.GetDashLen() == rInfo.GetDotLen() ) // degraded case @@ -9365,7 +9365,7 @@ void PDFWriterImpl::drawLine( const Point& rStart, const Point& rStop, const Lin if( m_aGraphicsStack.front().m_aLineColor == Color( COL_TRANSPARENT ) ) return; - if( rInfo.GetStyle() == LINE_SOLID && rInfo.GetWidth() < 2 ) + if( rInfo.GetStyle() == LineStyle::Solid && rInfo.GetWidth() < 2 ) { drawLine( rStart, rStop ); return; @@ -10418,7 +10418,7 @@ void PDFWriterImpl::drawPolyLine( const tools::Polygon& rPoly, const LineInfo& r void PDFWriterImpl::convertLineInfoToExtLineInfo( const LineInfo& rIn, PDFWriter::ExtLineInfo& rOut ) { - SAL_WARN_IF( rIn.GetStyle() != LINE_DASH, "vcl", "invalid conversion" ); + SAL_WARN_IF( rIn.GetStyle() != LineStyle::Dash, "vcl", "invalid conversion" ); rOut.m_fLineWidth = rIn.GetWidth(); rOut.m_fTransparency = 0.0; rOut.m_eCap = PDFWriter::capButt; diff --git a/vcl/source/gdi/svmconverter.cxx b/vcl/source/gdi/svmconverter.cxx index 7086c21d8d30..e25df3127dcc 100644 --- a/vcl/source/gdi/svmconverter.cxx +++ b/vcl/source/gdi/svmconverter.cxx @@ -497,7 +497,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) return; } - LineInfo aLineInfo( LINE_NONE, 0 ); + LineInfo aLineInfo( LineStyle::NONE, 0 ); ::std::stack< LineInfo* > aLIStack; ScopedVclPtrInstance< VirtualDevice > aFontVDev; rtl_TextEncoding eActualCharSet = osl_getThreadTextEncoding(); @@ -588,7 +588,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) || (aLineInfo.GetDotCount() && aLineInfo.GetDotLen())) && aLineInfo.GetDistance()) { - aLineInfo.SetStyle(LINE_DASH); + aLineInfo.SetStyle(LineStyle::Dash); } } break; @@ -997,7 +997,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) ImplReadColor( rIStm, aActionColor ); rIStm.ReadInt32( nPenWidth ).ReadInt16( nPenStyle ); - aLineInfo.SetStyle( nPenStyle ? LINE_SOLID : LINE_NONE ); + aLineInfo.SetStyle( nPenStyle ? LineStyle::Solid : LineStyle::NONE ); aLineInfo.SetWidth( nPenWidth ); bFatLine = nPenStyle && !aLineInfo.IsDefault(); @@ -1154,7 +1154,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf ) { aLineInfo = *pLineInfo; delete pLineInfo; - bFatLine = ( LINE_NONE != aLineInfo.GetStyle() ) && !aLineInfo.IsDefault(); + bFatLine = ( LineStyle::NONE != aLineInfo.GetStyle() ) && !aLineInfo.IsDefault(); } rMtf.AddAction( new MetaPopAction() ); @@ -1448,10 +1448,10 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, { const MetaLineAction* pAct = static_cast<const MetaLineAction*>(pAction); const LineInfo& rInfo = pAct->GetLineInfo(); - const bool bFatLine(!rInfo.IsDefault() && (LINE_NONE != rInfo.GetStyle())); + const bool bFatLine(!rInfo.IsDefault() && (LineStyle::NONE != rInfo.GetStyle())); const bool bLineJoin(bFatLine && basegfx::B2DLineJoin::Round != rInfo.GetLineJoin()); const bool bLineCap(bFatLine && css::drawing::LineCap_BUTT != rInfo.GetLineCap()); - const bool bLineDashDot(LINE_DASH == rInfo.GetStyle()); + const bool bLineDashDot(LineStyle::Dash == rInfo.GetStyle()); if( bFatLine ) { @@ -1604,10 +1604,10 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf, pAct->GetPolygon().AdaptiveSubdivide(aSimplePoly); const LineInfo& rInfo = pAct->GetLineInfo(); const sal_uInt16 nPoints(aSimplePoly.GetSize()); - const bool bFatLine(!rInfo.IsDefault() && (LINE_NONE != rInfo.GetStyle())); + const bool bFatLine(!rInfo.IsDefault() && (LineStyle::NONE != rInfo.GetStyle())); const bool bLineJoin(bFatLine && basegfx::B2DLineJoin::Round != rInfo.GetLineJoin()); const bool bLineCap(bFatLine && css::drawing::LineCap_BUTT != rInfo.GetLineCap()); - const bool bLineDashDot(LINE_DASH == rInfo.GetStyle()); + const bool bLineDashDot(LineStyle::Dash == rInfo.GetStyle()); if( bFatLine ) { diff --git a/vcl/source/outdev/line.cxx b/vcl/source/outdev/line.cxx index 990efb555e34..83c755893d71 100644 --- a/vcl/source/outdev/line.cxx +++ b/vcl/source/outdev/line.cxx @@ -47,7 +47,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt, if ( mpMetaFile ) mpMetaFile->AddAction( new MetaLineAction( rStartPt, rEndPt, rLineInfo ) ); - if ( !IsDeviceOutputNecessary() || !mbLineColor || ( LINE_NONE == rLineInfo.GetStyle() ) || ImplIsRecordLayout() ) + if ( !IsDeviceOutputNecessary() || !mbLineColor || ( LineStyle::NONE == rLineInfo.GetStyle() ) || ImplIsRecordLayout() ) return; if( !mpGraphics ) @@ -65,7 +65,7 @@ void OutputDevice::DrawLine( const Point& rStartPt, const Point& rEndPt, const Point aStartPt( ImplLogicToDevicePixel( rStartPt ) ); const Point aEndPt( ImplLogicToDevicePixel( rEndPt ) ); const LineInfo aInfo( ImplLogicToDevicePixel( rLineInfo ) ); - const bool bDashUsed(LINE_DASH == aInfo.GetStyle()); + const bool bDashUsed(LineStyle::Dash == aInfo.GetStyle()); const bool bLineWidthUsed(aInfo.GetWidth() > 1); if ( mbInitLineColor ) @@ -163,7 +163,7 @@ void OutputDevice::drawLine( basegfx::B2DPolyPolygon aLinePolyPolygon, const Lin && RasterOp::OverPaint == GetRasterOp() && IsLineColor()); basegfx::B2DPolyPolygon aFillPolyPolygon; - const bool bDashUsed(LINE_DASH == rInfo.GetStyle()); + const bool bDashUsed(LineStyle::Dash == rInfo.GetStyle()); const bool bLineWidthUsed(rInfo.GetWidth() > 1); if(bDashUsed && aLinePolyPolygon.count()) diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx index 871407dec5d3..24ca3306604e 100644 --- a/vcl/source/outdev/map.cxx +++ b/vcl/source/outdev/map.cxx @@ -593,7 +593,7 @@ LineInfo OutputDevice::ImplLogicToDevicePixel( const LineInfo& rLineInfo ) const { LineInfo aInfo( rLineInfo ); - if( aInfo.GetStyle() == LINE_DASH ) + if( aInfo.GetStyle() == LineStyle::Dash ) { if( aInfo.GetDotCount() && aInfo.GetDotLen() ) aInfo.SetDotLen( std::max( ImplLogicWidthToDevicePixel( aInfo.GetDotLen() ), 1L ) ); @@ -608,7 +608,7 @@ LineInfo OutputDevice::ImplLogicToDevicePixel( const LineInfo& rLineInfo ) const aInfo.SetDistance( ImplLogicWidthToDevicePixel( aInfo.GetDistance() ) ); if( ( !aInfo.GetDashCount() && !aInfo.GetDotCount() ) || !aInfo.GetDistance() ) - aInfo.SetStyle( LINE_SOLID ); + aInfo.SetStyle( LineStyle::Solid ); } aInfo.SetWidth( ImplLogicWidthToDevicePixel( aInfo.GetWidth() ) ); diff --git a/vcl/source/outdev/polyline.cxx b/vcl/source/outdev/polyline.cxx index 289d7926acff..b3e47804ef75 100644 --- a/vcl/source/outdev/polyline.cxx +++ b/vcl/source/outdev/polyline.cxx @@ -121,7 +121,7 @@ void OutputDevice::DrawPolyLine( const tools::Polygon& rPoly, const LineInfo& rL // #i101491# // Try direct Fallback to B2D-Version of DrawPolyLine if((mnAntialiasing & AntialiasingFlags::EnableB2dDraw) && - LINE_SOLID == rLineInfo.GetStyle()) + LineStyle::Solid == rLineInfo.GetStyle()) { DrawPolyLine( rPoly.getB2DPolygon(), @@ -240,7 +240,7 @@ void OutputDevice::drawPolyLine(const tools::Polygon& rPoly, const LineInfo& rLi { sal_uInt16 nPoints(rPoly.GetSize()); - if ( !IsDeviceOutputNecessary() || !mbLineColor || ( nPoints < 2 ) || ( LINE_NONE == rLineInfo.GetStyle() ) || ImplIsRecordLayout() ) + if ( !IsDeviceOutputNecessary() || !mbLineColor || ( nPoints < 2 ) || ( LineStyle::NONE == rLineInfo.GetStyle() ) || ImplIsRecordLayout() ) return; tools::Polygon aPoly = ImplLogicToDevicePixel( rPoly ); @@ -259,7 +259,7 @@ void OutputDevice::drawPolyLine(const tools::Polygon& rPoly, const LineInfo& rLi InitLineColor(); const LineInfo aInfo( ImplLogicToDevicePixel( rLineInfo ) ); - const bool bDashUsed(LINE_DASH == aInfo.GetStyle()); + const bool bDashUsed(LineStyle::Dash == aInfo.GetStyle()); const bool bLineWidthUsed(aInfo.GetWidth() > 1); if(bDashUsed || bLineWidthUsed) diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index 50c4dfe7d770..fe473fff994d 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -632,7 +632,7 @@ void ImplPopupFloatWin::DrawGrip(vcl::RenderContext& rRenderContext) { #ifdef TEAROFF_DASHED // draw single dashed line - LineInfo aLineInfo(LINE_DASH); + LineInfo aLineInfo(LineStyle::Dash); aLineInfo.SetDistance(4); aLineInfo.SetDashLen(12); aLineInfo.SetDashCount(1); diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx index daf4dd16e5a3..2dbe388c1916 100644 --- a/vcl/source/window/split.cxx +++ b/vcl/source/window/split.cxx @@ -679,7 +679,7 @@ void Splitter::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rPaint if (mbKbdSplitting) { - LineInfo aInfo( LINE_DASH ); + LineInfo aInfo( LineStyle::Dash ); //aInfo.SetDashLen( 2 ); //aInfo.SetDashCount( 1 ); aInfo.SetDistance( 1 ); diff --git a/vcl/workben/outdevgrind.cxx b/vcl/workben/outdevgrind.cxx index ced001f178a2..01bbefca691d 100644 --- a/vcl/workben/outdevgrind.cxx +++ b/vcl/workben/outdevgrind.cxx @@ -103,7 +103,7 @@ void setupMethodStubs( functor_vector_type& res ) aPolyPoly.Insert( aPoly2 ); tools::Polygon aPoly3(aPoly2); aPoly3.Rotate( aPoly3.GetBoundRect().Center(), 900 ); - const LineInfo aLineInfo(LINE_SOLID,5); + const LineInfo aLineInfo(LineStyle::Solid,5); #ifdef FIXME_VDEV const OUString aString("This is a test"); diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx index 1610fb3d3633..357a56b8dea8 100644 --- a/vcl/workben/svptest.cxx +++ b/vcl/workben/svptest.cxx @@ -314,7 +314,7 @@ void MyWin::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) Size(aPaperSize.Width() - 2000, 500)), aGradient); - LineInfo aLineInfo(LINE_SOLID, 200); + LineInfo aLineInfo(LineStyle::Solid, 200); double sind = sin(DELTA * M_PI / 180.0); double cosd = cos(DELTA * M_PI / 180.0); double factor = 1 + (DELTA / 1000.0); |