vcl/inc/impgraph.hxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit 41bca9976de53c9e013438118381a646530c5365 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Mon Aug 9 18:57:54 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Aug 10 13:29:21 2021 +0200 flatten ImpGraphic a little Change-Id: If7d7462571cbee1c54965678fab790959c6e3f33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120218 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/vcl/inc/impgraph.hxx b/vcl/inc/impgraph.hxx index 142627df780d..b7697dbb7b9e 100644 --- a/vcl/inc/impgraph.hxx +++ b/vcl/inc/impgraph.hxx @@ -25,6 +25,7 @@ #include <vcl/graph.hxx> #include "graphic/Manager.hxx" #include "graphic/GraphicID.hxx" +#include <optional> struct ImpSwapInfo { @@ -79,7 +80,7 @@ private: // cache checksum computation mutable BitmapChecksum mnChecksum = 0; - std::unique_ptr<GraphicID> mpGraphicID; + std::optional<GraphicID> mxGraphicID; GraphicExternalLink maGraphicExternalLink; std::chrono::high_resolution_clock::time_point maLastUsed; @@ -118,9 +119,9 @@ private: OString getUniqueID() { - if (!mpGraphicID) - mpGraphicID.reset(new GraphicID(*this)); - return mpGraphicID->getIDString(); + if (!mxGraphicID) + mxGraphicID.emplace(*this); + return mxGraphicID->getIDString(); } void createSwapInfo();