diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-16 16:08:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-17 07:57:52 +0200 |
commit | 51d474abdb8835fe8de055795f17ee580474fab4 (patch) | |
tree | adfc187361cbd46f6d13b5aa4e0d6864edcf4c08 /canvas | |
parent | dc21a49ea3a5a655e6bf70860b1b99c20e5b7473 (diff) |
drop cairocanvas::ColorType enum
since we only use the one enumerator value
Change-Id: Ifec39f4845348c753a6207795c62b27a7af1bbcd
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/cairo/cairo_canvashelper_text.cxx | 58 |
1 files changed, 13 insertions, 45 deletions
diff --git a/canvas/source/cairo/cairo_canvashelper_text.cxx b/canvas/source/cairo/cairo_canvashelper_text.cxx index 72084aee8ddb..c2a055e1154a 100644 --- a/canvas/source/cairo/cairo_canvashelper_text.cxx +++ b/canvas/source/cairo/cairo_canvashelper_text.cxx @@ -37,11 +37,6 @@ using namespace ::com::sun::star; namespace cairocanvas { - enum ColorType - { - LINE_COLOR, FILL_COLOR, TEXT_COLOR, IGNORE_COLOR - }; - uno::Reference< rendering::XCanvasFont > CanvasHelper::createFont( const rendering::XCanvas* , const rendering::FontRequest& fontRequest, const uno::Sequence< beans::PropertyValue >& extraFontProperties, @@ -114,14 +109,13 @@ namespace cairocanvas setupOutDevState( OutputDevice& rOutDev, const rendering::XCanvas* pOwner, const rendering::ViewState& viewState, - const rendering::RenderState& renderState, - ColorType eColorType ) + const rendering::RenderState& renderState ) { ::canvas::tools::verifyInput( renderState, OSL_THIS_FUNC, const_cast<rendering::XCanvas*>(pOwner), // only for refcount 2, - eColorType == IGNORE_COLOR ? 0 : 3 ); + 3 /* text */ ); int nTransparency(0); @@ -129,45 +123,19 @@ namespace cairocanvas // state and change only when update is necessary ::canvas::tools::clipOutDev(viewState, renderState, rOutDev); - if( eColorType != IGNORE_COLOR ) - { - Color aColor( COL_WHITE ); - - if( renderState.DeviceColor.getLength() > 2 ) - { - aColor = vcl::unotools::stdColorSpaceSequenceToColor( renderState.DeviceColor ); - } - - // extract alpha, and make color opaque - // afterwards. Otherwise, OutputDevice won't draw anything - nTransparency = aColor.GetTransparency(); - aColor.SetTransparency(0); - - switch( eColorType ) - { - case LINE_COLOR: - rOutDev.SetLineColor( aColor ); - rOutDev.SetFillColor(); - - break; - - case FILL_COLOR: - rOutDev.SetFillColor( aColor ); - rOutDev.SetLineColor(); - - break; + Color aColor( COL_WHITE ); - case TEXT_COLOR: - rOutDev.SetTextColor( aColor ); + if( renderState.DeviceColor.getLength() > 2 ) + { + aColor = vcl::unotools::stdColorSpaceSequenceToColor( renderState.DeviceColor ); + } - break; + // extract alpha, and make color opaque + // afterwards. Otherwise, OutputDevice won't draw anything + nTransparency = aColor.GetTransparency(); + aColor.SetTransparency(0); - default: - ENSURE_OR_THROW( false, - "CanvasHelper::setupOutDevState(): Unexpected color type"); - break; - } - } + rOutDev.SetTextColor( aColor ); return nTransparency; } @@ -204,7 +172,7 @@ namespace cairocanvas const rendering::RenderState& renderState, const uno::Reference< rendering::XCanvasFont >& xFont ) { - setupOutDevState( rOutDev, pOwner, viewState, renderState, TEXT_COLOR ); + setupOutDevState( rOutDev, pOwner, viewState, renderState ); CanvasFont* pFont = dynamic_cast< CanvasFont* >( xFont.get() ); |