summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-23 11:52:20 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-26 08:44:58 +0200
commit38e7aef0fad58dcf2d59a7c219b7858d6c4cd771 (patch)
tree7232362e2afea7ae387c2da7c07ff4af24d5e97a
parentbea081b5099786e5fcadddd72c247b9a9488286a (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>
-rw-r--r--include/vcl/metaact.hxx1
-rw-r--r--include/vcl/outdevstate.hxx17
-rw-r--r--include/vcl/pdfwriter.hxx1
-rw-r--r--sfx2/CppunitTest_sfx2_misc.mk5
-rw-r--r--vcl/source/outdev/outdevstate.cxx26
-rw-r--r--writerperfect/Library_writerperfect.mk1
-rw-r--r--xmlsecurity/Executable_pdfverify.mk2
7 files changed, 25 insertions, 28 deletions
diff --git a/include/vcl/metaact.hxx b/include/vcl/metaact.hxx
index 9fac991ac19e..930261b5866f 100644
--- a/include/vcl/metaact.hxx
+++ b/include/vcl/metaact.hxx
@@ -36,7 +36,6 @@
#include <vcl/gfxlink.hxx>
#include <vcl/lineinfo.hxx>
#include <vcl/metaactiontypes.hxx>
-#include <vcl/outdevstate.hxx>
class SvStream;
enum class DrawTextFlags;
diff --git a/include/vcl/outdevstate.hxx b/include/vcl/outdevstate.hxx
index d58faac00c52..d1f1ff6726b9 100644
--- a/include/vcl/outdevstate.hxx
+++ b/include/vcl/outdevstate.hxx
@@ -30,6 +30,7 @@
#include <tools/fontenum.hxx>
#include <o3tl/typed_flags_set.hxx>
#include <memory>
+#include <boost/optional.hpp>
class Color;
@@ -80,17 +81,17 @@ public:
OutDevState();
~OutDevState();
- std::unique_ptr<MapMode> mpMapMode;
+ boost::optional<MapMode> mpMapMode;
bool mbMapActive;
std::unique_ptr<vcl::Region> mpClipRegion;
- std::unique_ptr<Color> mpLineColor;
- std::unique_ptr<Color> mpFillColor;
+ boost::optional<Color> mpLineColor;
+ boost::optional<Color> mpFillColor;
std::unique_ptr<vcl::Font> mpFont;
- std::unique_ptr<Color> mpTextColor;
- std::unique_ptr<Color> mpTextFillColor;
- std::unique_ptr<Color> mpTextLineColor;
- std::unique_ptr<Color> mpOverlineColor;
- std::unique_ptr<Point> mpRefPoint;
+ boost::optional<Color> mpTextColor;
+ boost::optional<Color> mpTextFillColor;
+ boost::optional<Color> mpTextLineColor;
+ boost::optional<Color> mpOverlineColor;
+ boost::optional<Point> mpRefPoint;
TextAlign meTextAlign;
RasterOp meRasterOp;
ComplexTextLayoutFlags mnTextLayoutMode;
diff --git a/include/vcl/pdfwriter.hxx b/include/vcl/pdfwriter.hxx
index 758acdb1f08d..1e38a9f67cb8 100644
--- a/include/vcl/pdfwriter.hxx
+++ b/include/vcl/pdfwriter.hxx
@@ -29,7 +29,6 @@
#include <vcl/vclenum.hxx>
#include <vcl/font.hxx>
#include <vcl/graphictools.hxx>
-#include <vcl/outdevstate.hxx>
#include <vcl/outdev.hxx>
#include <com/sun/star/io/XOutputStream.hpp>
diff --git a/sfx2/CppunitTest_sfx2_misc.mk b/sfx2/CppunitTest_sfx2_misc.mk
index 0919d525d3d5..c97d97ca469b 100644
--- a/sfx2/CppunitTest_sfx2_misc.mk
+++ b/sfx2/CppunitTest_sfx2_misc.mk
@@ -27,7 +27,10 @@ $(eval $(call gb_CppunitTest_use_libraries,sfx2_misc, \
utl \
))
-$(eval $(call gb_CppunitTest_use_external,sfx2_misc,libxml2))
+$(eval $(call gb_CppunitTest_use_externals,sfx2_misc,\
+ libxml2 \
+ boost_headers \
+))
$(eval $(call gb_CppunitTest_use_sdk_api,sfx2_misc))
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 );
diff --git a/writerperfect/Library_writerperfect.mk b/writerperfect/Library_writerperfect.mk
index fd7e344822f3..64df2cba94c2 100644
--- a/writerperfect/Library_writerperfect.mk
+++ b/writerperfect/Library_writerperfect.mk
@@ -29,6 +29,7 @@ $(eval $(call gb_Library_set_include,writerperfect, \
))
$(eval $(call gb_Library_use_externals,writerperfect,\
+ boost_headers \
odfgen \
revenge \
))
diff --git a/xmlsecurity/Executable_pdfverify.mk b/xmlsecurity/Executable_pdfverify.mk
index 11c22d1d7ea6..ed8e9559fc18 100644
--- a/xmlsecurity/Executable_pdfverify.mk
+++ b/xmlsecurity/Executable_pdfverify.mk
@@ -11,6 +11,8 @@ $(eval $(call gb_Executable_Executable,pdfverify))
$(eval $(call gb_Executable_use_sdk_api,pdfverify))
+$(eval $(call gb_Executable_use_external,pdfverify,boost_headers))
+
$(eval $(call gb_Executable_set_include,pdfverify,\
$$(INCLUDE) \
-I$(SRCDIR)/xmlsecurity/inc \