summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-03-12 14:12:59 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-03-16 16:55:01 +0100
commit3741d70743c297029f54b20b0ca711f40cff7097 (patch)
treec6ae93e83324dd160cf4b897c0414ca535d0d016 /vcl/win
parente11796866f94d2f51023e6bc2b23a39af10a7d96 (diff)
Some more checks for correct screen size
Change-Id: Id5a811e4227052fd9117ab2b099de31e8e3b90c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90413 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/app/salinfo.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/vcl/win/app/salinfo.cxx b/vcl/win/app/salinfo.cxx
index ccb6d3806f95..a19ca597f9c5 100644
--- a/vcl/win/app/salinfo.cxx
+++ b/vcl/win/app/salinfo.cxx
@@ -20,6 +20,7 @@
#include <svsys.h>
#include <o3tl/char16_t2wchar_t.hxx>
+#include <sal/log.hxx>
#include <vcl/window.hxx>
#include <win/salsys.h>
@@ -155,7 +156,14 @@ unsigned int WinSalSystem::GetDisplayBuiltInScreen()
tools::Rectangle WinSalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
{
initMonitors();
- return (nScreen < m_aMonitors.size()) ? m_aMonitors[nScreen].m_aArea : tools::Rectangle();
+ if (nScreen >= m_aMonitors.size())
+ {
+ SAL_WARN("vcl", "Requested screen size/pos for screen #"
+ << nScreen << ", but only " << m_aMonitors.size() << " screens found.");
+ assert(false);
+ return tools::Rectangle();
+ }
+ return m_aMonitors[nScreen].m_aArea;
}
int WinSalSystem::ShowNativeMessageBox(const OUString& rTitle, const OUString& rMessage)