[Libreoffice-commits] core.git: vcl/unx
Chris Sherlock
chris.sherlock79 at gmail.com
Thu Jan 30 03:49:49 PST 2014
vcl/unx/x11/x11sys.cxx | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
New commits:
commit 424e957ab51687ece4d69984c482e608089e0e6f
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Tue Jan 28 01:33:14 2014 +1100
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 at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/x11/x11sys.cxx b/vcl/unx/x11/x11sys.cxx
index 6d6f5b9..7a08533 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: */
More information about the Libreoffice-commits
mailing list