diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 4ec08b257bf2..ce8a5efc28c3 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -60,8 +60,8 @@ #include #include +#include #include -#include #include #include @@ -1921,15 +1921,8 @@ protected: [[nodiscard]] inline auto OutputDevice::ScopedPush(vcl::PushFlags nFlags) { - struct OutputDeviceRestoreStateGuard - { - OutputDevice& m_rDev; - ~OutputDeviceRestoreStateGuard() { suppress_fun_call_w_exception(m_rDev.Pop()); } - }; - Push(nFlags); - // [-loplugin:redundantfcast] - return OutputDeviceRestoreStateGuard{ *this }; + return comphelper::ScopeGuard([this]() { Pop(); }); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */