diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-23 11:52:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-26 08:44:58 +0200 |
commit | 38e7aef0fad58dcf2d59a7c219b7858d6c4cd771 (patch) | |
tree | 7232362e2afea7ae387c2da7c07ff4af24d5e97a /vcl | |
parent | bea081b5099786e5fcadddd72c247b9a9488286a (diff) |
use boost::optional in OutDevState
Change-Id: I83fb85fcba6cd2a5dc4f99fdfd3238d72afb7bc2
Reviewed-on: https://gerrit.libreoffice.org/51770
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/outdev/outdevstate.cxx | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/vcl/source/outdev/outdevstate.cxx b/vcl/source/outdev/outdevstate.cxx index 38698b210330..d2226add6f1b 100644 --- a/vcl/source/outdev/outdevstate.cxx +++ b/vcl/source/outdev/outdevstate.cxx @@ -31,17 +31,9 @@ #include <salgdi.hxx> OutDevState::OutDevState() - : mpMapMode(nullptr) - , mbMapActive(false) + : mbMapActive(false) , mpClipRegion(nullptr) - , mpLineColor(nullptr) - , mpFillColor(nullptr) , mpFont(nullptr) - , mpTextColor(nullptr) - , mpTextFillColor(nullptr) - , mpTextLineColor(nullptr) - , mpOverlineColor(nullptr) - , mpRefPoint(nullptr) , meTextAlign(ALIGN_TOP) , meRasterOp(RasterOp::OverPaint) , mnTextLayoutMode(ComplexTextLayoutFlags::Default) @@ -76,27 +68,27 @@ void OutputDevice::Push( PushFlags nFlags ) if (nFlags & PushFlags::LINECOLOR && mbLineColor) { - pState->mpLineColor.reset( new Color( maLineColor ) ); + pState->mpLineColor = maLineColor; } if (nFlags & PushFlags::FILLCOLOR && mbFillColor) { - pState->mpFillColor.reset( new Color( maFillColor ) ); + pState->mpFillColor = maFillColor; } if ( nFlags & PushFlags::FONT ) pState->mpFont.reset( new vcl::Font( maFont ) ); if ( nFlags & PushFlags::TEXTCOLOR ) - pState->mpTextColor.reset( new Color( GetTextColor() ) ); + pState->mpTextColor = GetTextColor(); if (nFlags & PushFlags::TEXTFILLCOLOR && IsTextFillColor()) { - pState->mpTextFillColor.reset( new Color( GetTextFillColor() ) ); + pState->mpTextFillColor = GetTextFillColor(); } if (nFlags & PushFlags::TEXTLINECOLOR && IsTextLineColor()) { - pState->mpTextLineColor.reset( new Color( GetTextLineColor() ) ); + pState->mpTextLineColor = GetTextLineColor(); } if (nFlags & PushFlags::OVERLINECOLOR && IsOverlineColor()) { - pState->mpOverlineColor.reset( new Color( GetOverlineColor() ) ); + pState->mpOverlineColor = GetOverlineColor(); } if ( nFlags & PushFlags::TEXTALIGN ) pState->meTextAlign = GetTextAlign(); @@ -108,7 +100,7 @@ void OutputDevice::Push( PushFlags nFlags ) pState->meRasterOp = GetRasterOp(); if ( nFlags & PushFlags::MAPMODE ) { - pState->mpMapMode.reset( new MapMode( maMapMode ) ); + pState->mpMapMode = maMapMode; pState->mbMapActive = mbMap; } if (nFlags & PushFlags::CLIPREGION && mbClipRegion) @@ -117,7 +109,7 @@ void OutputDevice::Push( PushFlags nFlags ) } if (nFlags & PushFlags::REFPOINT && mbRefPoint) { - pState->mpRefPoint.reset( new Point( maRefPoint ) ); + pState->mpRefPoint = maRefPoint; } mpOutDevStateStack->push_back( pState ); |