diff options
author | Noel Grandin <noel@peralex.com> | 2016-05-10 11:03:19 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-05-10 11:35:14 +0200 |
commit | 12df0a2ac89cc8da216d2244aa52ca3c291ba93f (patch) | |
tree | 286c99bc48641f9bc7295d042389681e5c9832f1 /vcl | |
parent | Convert SAL_EVENT to scoped enum (diff) | |
download | core-12df0a2ac89cc8da216d2244aa52ca3c291ba93f.tar.gz core-12df0a2ac89cc8da216d2244aa52ca3c291ba93f.zip |
fix OSX build
after my "WindowStateState scoped enum" conversion.
WorkWindow::IsMinimized needs to check the return code of
SalFrame::GetWindowState, or it can end up reading uninitialised memory.
So mark the member as SAL_WARN_UNUSED_RESULT.
Change-Id: Iaeb132ed2fbf08162dbd7ec2e126dfa679cbda6c
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/salframe.hxx | 2 | ||||
-rw-r--r-- | vcl/source/window/wrkwin.cxx | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/vcl/inc/salframe.hxx b/vcl/inc/salframe.hxx index dee3639812c4..8bf79f35bb9e 100644 --- a/vcl/inc/salframe.hxx +++ b/vcl/inc/salframe.hxx @@ -149,6 +149,8 @@ public: const SalFrameGeometry& GetUnmirroredGeometry() const { return maGeometry; } virtual void SetWindowState( const SalFrameState* pState ) = 0; + // if this returns false the structure is uninitialised + SAL_WARN_UNUSED_RESULT virtual bool GetWindowState( SalFrameState* pState ) = 0; virtual void ShowFullScreen( bool bFullScreen, sal_Int32 nDisplay ) = 0; diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx index 2ebe8d808b62..20470a00c4bc 100644 --- a/vcl/source/window/wrkwin.cxx +++ b/vcl/source/window/wrkwin.cxx @@ -208,8 +208,10 @@ bool WorkWindow::IsMinimized() const { //return mpWindowImpl->mpFrameData->mbMinimized; SalFrameState aState; - mpWindowImpl->mpFrame->GetWindowState(&aState); - return bool(aState.mnState & WindowStateState::Minimized); + if (mpWindowImpl->mpFrame->GetWindowState(&aState)) + return bool(aState.mnState & WindowStateState::Minimized); + else + return false; } bool WorkWindow::SetPluginParent( SystemParentData* pParent ) |