summaryrefslogtreecommitdiff
path: root/vcl/workben/vcldemo.cxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2019-09-17 13:35:34 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-09-17 15:05:37 +0200
commit5c386a41c3cf416ed878f5ea6ece8f15990bd613 (patch)
tree938fb2257259a46ebf2e7a807e69366f7a25926e /vcl/workben/vcldemo.cxx
parentcaa211b62048ac5037b3fd4320f3eb4dea7b639d (diff)
No need for explicit OpenGLZone::enter/leave calls from vcldemo
(though I have no idea how to actually test the affected code) Change-Id: Ib74d966d021e337bfab94c223812cb51c02c705f Reviewed-on: https://gerrit.libreoffice.org/79059 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl/workben/vcldemo.cxx')
-rw-r--r--vcl/workben/vcldemo.cxx21
1 files changed, 9 insertions, 12 deletions
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 20e30811f9e2..833108467728 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -7,6 +7,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <sal/config.h>
+
+#include <memory>
+
#include <config_features.h>
#include <math.h>
@@ -2019,12 +2023,6 @@ public:
}
};
-class OpenGLZoneTest {
-public:
- static void enter() { OpenGLZone::enter(); }
- static void leave() { OpenGLZone::leave(); }
-};
-
IMPL_LINK_NOARG(DemoWidgets, GLTestClick, Button*, void)
{
sal_Int32 nSelected = mpGLCombo->GetSelectedEntryPos();
@@ -2045,14 +2043,13 @@ IMPL_LINK_NOARG(DemoWidgets, GLTestClick, Button*, void)
break;
}
- bool bEnterLeave = mpGLCheck->IsChecked();
- if (bEnterLeave)
- OpenGLZoneTest::enter();
+ // Only create OpenGLZone RAII object if asked for:
+ std::unique_ptr<OpenGLZone> zone;
+ if (mpGLCheck->IsChecked()) {
+ zone.reset(new OpenGLZone);
+ }
osl::Thread::wait(std::chrono::seconds(nDelaySeconds));
-
- if (bEnterLeave)
- OpenGLZoneTest::leave();
}
IMPL_LINK(DemoWidgets, CursorButtonClick, Button*, pButton, void)