diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-23 10:31:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-23 12:34:51 +0100 |
commit | aea9d9b054a59ccb53b7160daba808de9db7d814 (patch) | |
tree | 4bdc11d16bc329d86c858a315af2c65f46dc3f1c /vcl/inc | |
parent | 144bc302b8e610422f0bdbfceb1726822454dfbc (diff) |
use boost::optional in vcl
instead of allocating small objects on the heap via std::unique_ptr
Change-Id: Iba1d9ad90dc5a31908027336f85046a9de6f5bc4
Reviewed-on: https://gerrit.libreoffice.org/51769
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/bitmapwriteaccess.hxx | 5 | ||||
-rw-r--r-- | vcl/inc/wall2.hxx | 4 | ||||
-rw-r--r-- | vcl/inc/window.h | 13 |
3 files changed, 13 insertions, 9 deletions
diff --git a/vcl/inc/bitmapwriteaccess.hxx b/vcl/inc/bitmapwriteaccess.hxx index 0223ad778f10..b2aba128381d 100644 --- a/vcl/inc/bitmapwriteaccess.hxx +++ b/vcl/inc/bitmapwriteaccess.hxx @@ -14,6 +14,7 @@ #include <vcl/alpha.hxx> #include <vcl/bitmap.hxx> #include <vcl/bitmapaccess.hxx> +#include <boost/optional.hpp> typedef vcl::ScopedBitmapAccess<BitmapWriteAccess, Bitmap, &Bitmap::AcquireWriteAccess> BitmapScopedWriteAccess; @@ -82,8 +83,8 @@ public: void DrawRect(const tools::Rectangle& rRect); private: - std::unique_ptr<BitmapColor> mpLineColor; - std::unique_ptr<BitmapColor> mpFillColor; + boost::optional<BitmapColor> mpLineColor; + boost::optional<BitmapColor> mpFillColor; BitmapWriteAccess() = delete; BitmapWriteAccess(const BitmapWriteAccess&) = delete; diff --git a/vcl/inc/wall2.hxx b/vcl/inc/wall2.hxx index cce5d03919ec..cad63ee4332d 100644 --- a/vcl/inc/wall2.hxx +++ b/vcl/inc/wall2.hxx @@ -20,6 +20,8 @@ #ifndef INCLUDED_VCL_INC_WALL2_HXX #define INCLUDED_VCL_INC_WALL2_HXX +#include <boost/optional.hpp> + class ImplWallpaper { friend class Wallpaper; @@ -28,7 +30,7 @@ private: Color maColor; std::unique_ptr<BitmapEx> mpBitmap; std::unique_ptr<Gradient> mpGradient; - std::unique_ptr<tools::Rectangle> mpRect; + boost::optional<tools::Rectangle> mpRect; WallpaperStyle meStyle; std::unique_ptr<BitmapEx> mpCache; diff --git a/vcl/inc/window.h b/vcl/inc/window.h index 648143e96545..da11f0bc514e 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -28,6 +28,7 @@ #include <vcl/window.hxx> #include <o3tl/typed_flags_set.hxx> +#include <boost/optional.hpp> #include <list> #include <memory> #include <vector> @@ -90,20 +91,20 @@ bool ImplWindowFrameProc( vcl::Window* pInst, SalEvent nEvent, const void* pEven struct ImplWinData { - std::unique_ptr<OUString> + boost::optional<OUString> mpExtOldText; std::unique_ptr<ExtTextInputAttr[]> mpExtOldAttrAry; - std::unique_ptr<tools::Rectangle> + boost::optional<tools::Rectangle> mpCursorRect; long mnCursorExtWidth; bool mbVertical; std::unique_ptr<tools::Rectangle[]> mpCompositionCharRects; long mnCompositionCharRects; - std::unique_ptr<tools::Rectangle> + boost::optional<tools::Rectangle> mpFocusRect; - std::unique_ptr<tools::Rectangle> + boost::optional<tools::Rectangle> mpTrackRect; ShowTrackFlags mnTrackFlags; sal_uInt16 mnIsTopWindow; @@ -175,9 +176,9 @@ struct ImplFrameData struct ImplAccessibleInfos { sal_uInt16 nAccessibleRole; - std::unique_ptr<OUString> + boost::optional<OUString> pAccessibleName; - std::unique_ptr<OUString> + boost::optional<OUString> pAccessibleDescription; VclPtr<vcl::Window> pLabeledByWindow; VclPtr<vcl::Window> pLabelForWindow; |