summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-01-28 01:33:14 +1100
committerCaolán McNamara <caolanm@redhat.com>2014-01-30 11:49:30 +0000
commit424e957ab51687ece4d69984c482e608089e0e6f (patch)
tree6ec04fa6112c80ddfb7405c39fc17057b26d907f /vcl
parent535c4c01b6d9e6341464d48077917fb7a5c242bb (diff)
Assert in X11SalSystem::GetDisplayScreenPosSizePixel
If we detect that the display is using Xinerama, then we shouldn't be able to pick a screen more than the number of screens available! Therefore, assert if we meet this condition. Also remove a comment decoration. Change-Id: Ic8d2e0acf3e65825b76472adbd4a355e5435b6df Reviewed-on: https://gerrit.libreoffice.org/7694 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/x11/x11sys.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/vcl/unx/x11/x11sys.cxx b/vcl/unx/x11/x11sys.cxx
index 6d6f5b9b405a..7a08533a2b32 100644
--- a/vcl/unx/x11/x11sys.cxx
+++ b/vcl/unx/x11/x11sys.cxx
@@ -37,8 +37,6 @@ SalSystem* X11SalInstance::CreateSalSystem()
return new X11SalSystem();
}
-// -----------------------------------------------------------------------
-
X11SalSystem::~X11SalSystem()
{
}
@@ -71,6 +69,10 @@ Rectangle X11SalSystem::GetDisplayScreenPosSizePixel( unsigned int nScreen )
if( pSalDisp->IsXinerama() )
{
const std::vector< Rectangle >& rScreens = pSalDisp->GetXineramaScreens();
+
+ // we shouldn't be able to pick a screen > number of screens available
+ assert(nScreen < rScreens.size() );
+
if( nScreen < rScreens.size() )
aRet = rScreens[nScreen];
}
@@ -154,5 +156,4 @@ int X11SalSystem::ShowNativeDialog( const OUString& rTitle, const OUString& rMes
return nRet;
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */