f-spot r4647 - in trunk: . src/Cms
- From: sdelcroix svn gnome org
- To: svn-commits-list gnome org
- Subject: f-spot r4647 - in trunk: . src/Cms
- Date: Mon, 1 Dec 2008 13:59:18 +0000 (UTC)
Author: sdelcroix
Date: Mon Dec 1 13:59:18 2008
New Revision: 4647
URL: http://svn.gnome.org/viewvc/f-spot?rev=4647&view=rev
Log:
2008-12-01 Stephane Delcroix <sdelcroix novell com>
* src/Cms/Profile.cs:
* src/Cms/Transform.cs: check for null args on public methods
Modified:
trunk/ChangeLog
trunk/src/Cms/GammaTable.cs
trunk/src/Cms/Profile.cs
trunk/src/Cms/Transform.cs
Modified: trunk/src/Cms/GammaTable.cs
==============================================================================
--- trunk/src/Cms/GammaTable.cs (original)
+++ trunk/src/Cms/GammaTable.cs Mon Dec 1 13:59:18 2008
@@ -117,6 +117,9 @@
public GammaTable (ushort [] values, int start_offset, int length)
{
#if true
+ if (values == null)
+ throw new ArgumentNullException ("values");
+
handle = new HandleRef (this, NativeMethods.FCmsGammaTableNew (values, start_offset, length));
//System.Console.WriteLine ("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXhandle = {0}", handle.Handle);
#else
Modified: trunk/src/Cms/Profile.cs
==============================================================================
--- trunk/src/Cms/Profile.cs (original)
+++ trunk/src/Cms/Profile.cs Mon Dec 1 13:59:18 2008
@@ -83,6 +83,9 @@
public static Profile GetScreenProfile (Gdk.Screen screen)
{
+ if (screen == null)
+ throw new ArgumentNullException ("screen");
+
IntPtr profile = NativeMethods.FScreenGetProfile (screen.Handle);
if (profile == IntPtr.Zero)
@@ -197,13 +200,19 @@
throw new SaveException ("Error Saving Profile");
}
- public Profile (byte [] data) : this (data, 0, data.Length) {}
+ public Profile (byte [] data) : this (data, 0, data.Length) {
+ if (data == null)
+ throw new ArgumentNullException ("data");
+ }
public Profile (byte [] data, int start_offset, int length)
{
if (start_offset < 0)
throw new System.ArgumentOutOfRangeException ("start_offset < 0");
+ if (data == null)
+ throw new ArgumentNullException ("data");
+
if (data.Length - start_offset < 0)
throw new System.ArgumentOutOfRangeException ("start_offset > data.Length");
Modified: trunk/src/Cms/Transform.cs
==============================================================================
--- trunk/src/Cms/Transform.cs (original)
+++ trunk/src/Cms/Transform.cs Mon Dec 1 13:59:18 2008
@@ -28,6 +28,9 @@
Format output_format,
Intent intent, uint flags)
{
+ if (profiles == null)
+ throw new ArgumentNullException ("profiles");
+
HandleRef [] handles = new HandleRef [profiles.Length];
for (int i = 0; i < profiles.Length; i++) {
handles [i] = profiles [i].Handle;
@@ -43,6 +46,11 @@
Profile output, Format output_format,
Intent intent, uint flags)
{
+ if (input == null)
+ throw new ArgumentNullException ("input");
+ if (output == null)
+ throw new ArgumentNullException ("output");
+
this.handle = new HandleRef (this, NativeMethods.CmsCreateTransform (input.Handle, input_format,
output.Handle, output_format,
(int)intent, flags));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]