diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2021-08-24 21:29:16 +1000 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-08-26 04:27:39 +0200 |
commit | 0484630164275e2828f1420b055f05e94b8c73ee (patch) | |
tree | 3284d1aba51f5b9903b3ac4eb6587cb41c339439 /include/vcl | |
parent | 9ea129b49259231565d18f965a57c5fefb4ccc7a (diff) |
vcl: make OutDevState constructor default, no need for destructor
There is no value of having the OutDevState constructor and destructor
being in its own file, so move to header. Also, resetting the variables
in the destructor is rather pointless as they are destroyed in the next
step anyhow. This removes the need to define an empty destructor.
Use C++11 magic to make a default constructor - many thanks to Mike
Kaganski for the tip on this one.
Change-Id: I9561b311d8752fa12802b5ae8e11123aedabe8be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115460
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include/vcl')
-rw-r--r-- | include/vcl/outdevstate.hxx | 56 |
1 files changed, 26 insertions, 30 deletions
diff --git a/include/vcl/outdevstate.hxx b/include/vcl/outdevstate.hxx index 36f02e2f2e42..b1104a28f34f 100644 --- a/include/vcl/outdevstate.hxx +++ b/include/vcl/outdevstate.hxx @@ -17,22 +17,21 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_VCL_OUTDEVSTATE_HXX -#define INCLUDED_VCL_OUTDEVSTATE_HXX - -#include <vcl/mapmod.hxx> -#include <vcl/vclenum.hxx> -#include <vcl/font.hxx> +#pragma once #include <tools/color.hxx> #include <tools/gen.hxx> #include <tools/fontenum.hxx> +#include <i18nlangtag/lang.h> #include <o3tl/typed_flags_set.hxx> + +#include <vcl/font.hxx> +#include <vcl/mapmod.hxx> +#include <vcl/region.hxx> +#include <vcl/vclenum.hxx> + #include <memory> #include <optional> -#include <i18nlangtag/lang.h> - -namespace vcl { class Region; } // Flags for OutputDevice::Push() and OutDevState enum class PushFlags { @@ -77,28 +76,25 @@ namespace o3tl { struct OutDevState { - OutDevState(); - OutDevState(OutDevState&&); - ~OutDevState(); + OutDevState() = default; + OutDevState(OutDevState&&) = default; - std::optional<MapMode> mpMapMode; - bool mbMapActive; - std::unique_ptr<vcl::Region> mpClipRegion; - std::optional<Color> mpLineColor; - std::optional<Color> mpFillColor; - std::optional<vcl::Font> mpFont; - std::optional<Color> mpTextColor; - std::optional<Color> mpTextFillColor; - std::optional<Color> mpTextLineColor; - std::optional<Color> mpOverlineColor; - std::optional<Point> mpRefPoint; - TextAlign meTextAlign; - RasterOp meRasterOp; - ComplexTextLayoutFlags mnTextLayoutMode; - LanguageType meTextLanguage; - PushFlags mnFlags; + std::optional<MapMode> mpMapMode; + bool mbMapActive = false; + std::unique_ptr<vcl::Region> mpClipRegion; + std::optional<Color> mpLineColor; + std::optional<Color> mpFillColor; + std::optional<vcl::Font> mpFont; + std::optional<Color> mpTextColor; + std::optional<Color> mpTextFillColor; + std::optional<Color> mpTextLineColor; + std::optional<Color> mpOverlineColor; + std::optional<Point> mpRefPoint; + TextAlign meTextAlign = ALIGN_TOP; + RasterOp meRasterOp = RasterOp::OverPaint; + ComplexTextLayoutFlags mnTextLayoutMode = ComplexTextLayoutFlags::Default; + LanguageType meTextLanguage = LANGUAGE_SYSTEM; + PushFlags mnFlags = PushFlags::NONE; }; -#endif // INCLUDED_VCL_OUTDEVSTATE_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |