diff options
author | Kurt Zenker <kz@openoffice.org> | 2007-12-12 12:20:13 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2007-12-12 12:20:13 +0000 |
commit | da0c5f7e09466a8dfd28645491f1e1ffa516fd80 (patch) | |
tree | 7e17eb8e00ab7fe5e9e436f7a9869fb42bc5bc36 /vcl/source/window | |
parent | ffa8920eb2393ea930327decca775e0fabeddcb5 (diff) |
INTEGRATION: CWS vcl84 (1.49.96); FILE MERGED
2007/12/03 10:02:28 pl 1.49.96.2: RESYNC: (1.49-1.50); FILE MERGED
2007/10/29 11:12:35 pl 1.49.96.1: #i83080# protect against wrong input
Diffstat (limited to 'vcl/source/window')
-rw-r--r-- | vcl/source/window/syswin.cxx | 44 |
1 files changed, 34 insertions, 10 deletions
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index 78a6a2554f66..817503ad0d40 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -4,9 +4,9 @@ * * $RCSfile: syswin.cxx,v $ * - * $Revision: 1.50 $ + * $Revision: 1.51 $ * - * last change: $Author: ihi $ $Date: 2007-11-26 15:15:01 $ + * last change: $Author: kz $ $Date: 2007-12-12 13:20:13 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -520,7 +520,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS if ( aTokenStr.Len() ) { rData.SetX( aTokenStr.ToInt32() ); - nValidMask |= WINDOWSTATE_MASK_X; + if( rData.GetX() > -16384 && rData.GetX() < 16384 ) + nValidMask |= WINDOWSTATE_MASK_X; + else + rData.SetX( 0 ); } else rData.SetX( 0 ); @@ -528,7 +531,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS if ( aTokenStr.Len() ) { rData.SetY( aTokenStr.ToInt32() ); - nValidMask |= WINDOWSTATE_MASK_Y; + if( rData.GetY() > -16384 && rData.GetY() < 16384 ) + nValidMask |= WINDOWSTATE_MASK_Y; + else + rData.SetY( 0 ); } else rData.SetY( 0 ); @@ -536,7 +542,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS if ( aTokenStr.Len() ) { rData.SetWidth( aTokenStr.ToInt32() ); - nValidMask |= WINDOWSTATE_MASK_WIDTH; + if( rData.GetWidth() > 0 && rData.GetWidth() < 16384 ) + nValidMask |= WINDOWSTATE_MASK_WIDTH; + else + rData.SetWidth( 0 ); } else rData.SetWidth( 0 ); @@ -544,7 +553,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS if ( aTokenStr.Len() ) { rData.SetHeight( aTokenStr.ToInt32() ); - nValidMask |= WINDOWSTATE_MASK_HEIGHT; + if( rData.GetHeight() > 0 && rData.GetHeight() < 16384 ) + nValidMask |= WINDOWSTATE_MASK_HEIGHT; + else + rData.SetHeight( 0 ); } else rData.SetHeight( 0 ); @@ -566,7 +578,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS if ( aTokenStr.Len() ) { rData.SetMaximizedX( aTokenStr.ToInt32() ); - nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_X; + if( rData.GetMaximizedX() > -16384 && rData.GetMaximizedX() < 16384 ) + nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_X; + else + rData.SetMaximizedX( 0 ); } else rData.SetMaximizedX( 0 ); @@ -574,7 +589,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS if ( aTokenStr.Len() ) { rData.SetMaximizedY( aTokenStr.ToInt32() ); - nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_Y; + if( rData.GetMaximizedY() > -16384 && rData.GetMaximizedY() < 16384 ) + nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_Y; + else + rData.SetMaximizedY( 0 ); } else rData.SetMaximizedY( 0 ); @@ -582,7 +600,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS if ( aTokenStr.Len() ) { rData.SetMaximizedWidth( aTokenStr.ToInt32() ); - nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_WIDTH; + if( rData.GetMaximizedWidth() > 0 && rData.GetMaximizedWidth() < 16384 ) + nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_WIDTH; + else + rData.SetMaximizedWidth( 0 ); } else rData.SetMaximizedWidth( 0 ); @@ -590,7 +611,10 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS if ( aTokenStr.Len() ) { rData.SetMaximizedHeight( aTokenStr.ToInt32() ); - nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_HEIGHT; + if( rData.GetMaximizedHeight() > 0 && rData.GetMaximizedHeight() < 16384 ) + nValidMask |= WINDOWSTATE_MASK_MAXIMIZED_HEIGHT; + else + rData.SetMaximizedHeight( 0 ); } else rData.SetMaximizedHeight( 0 ); |