diff options
author | John Luke <jluke@mono-cvs.ximian.com> | 2005-12-17 03:27:14 +0300 |
---|---|---|
committer | John Luke <jluke@mono-cvs.ximian.com> | 2005-12-17 03:27:14 +0300 |
commit | c40288dd9c6d72da193896b179ec9c4347ea4ac1 (patch) | |
tree | 5172e34f742a88eb5b200b823bceb83b151ad047 /mcs/class/Mono.Cairo | |
parent | 5381bc6e0cdecdeabac61d8177c69d742038df9e (diff) |
2005-12-16 John Luke <john.luke@gmail.com>
* Mono.Cairo/FontOptions.cs: fix bug with
fontOptions == null, check parameter to Merge
against null
* Mono.Cairo/Glyph.cs: add setters to properties
svn path=/trunk/mcs/; revision=54557
Diffstat (limited to 'mcs/class/Mono.Cairo')
-rw-r--r-- | mcs/class/Mono.Cairo/ChangeLog | 7 | ||||
-rw-r--r-- | mcs/class/Mono.Cairo/Mono.Cairo/FontOptions.cs | 16 | ||||
-rw-r--r-- | mcs/class/Mono.Cairo/Mono.Cairo/Glyph.cs | 3 |
3 files changed, 21 insertions, 5 deletions
diff --git a/mcs/class/Mono.Cairo/ChangeLog b/mcs/class/Mono.Cairo/ChangeLog index ba20d03053d..9ee2ddfbf0c 100644 --- a/mcs/class/Mono.Cairo/ChangeLog +++ b/mcs/class/Mono.Cairo/ChangeLog @@ -1,5 +1,12 @@ 2005-12-16 John Luke <john.luke@gmail.com> + * Mono.Cairo/FontOptions.cs: fix bug with + fontOptions == null, check parameter to Merge + against null + * Mono.Cairo/Glyph.cs: add setters to properties + +2005-12-16 John Luke <john.luke@gmail.com> + * Mono.Cairo/Cairo.cs: organize and add missing API split out enums and structs * Mono.Cairo/*.cs: add enums and structs as seperate files diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/FontOptions.cs b/mcs/class/Mono.Cairo/Mono.Cairo/FontOptions.cs index 3c4b30f62dc..38ae094c747 100644 --- a/mcs/class/Mono.Cairo/Mono.Cairo/FontOptions.cs +++ b/mcs/class/Mono.Cairo/Mono.Cairo/FontOptions.cs @@ -25,6 +25,7 @@ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // + using System; namespace Cairo @@ -32,7 +33,7 @@ namespace Cairo public class FontOptions : IDisposable { IntPtr handle; - bool disposed = false; + bool disposed; public FontOptions () { @@ -76,7 +77,7 @@ namespace Cairo public static bool operator == (FontOptions options, FontOptions other) { - return CairoAPI.cairo_font_options_equal (options.Handle, other.Handle); + return Equals (options, other); } public static bool operator != (FontOptions options, FontOptions other) @@ -86,9 +87,12 @@ namespace Cairo public override bool Equals (object other) { - if (other is FontOptions) - return this == (FontOptions) other; - return false; + return Equals (other as FontOptions); + } + + bool Equals (FontOptions options) + { + return options != null && CairoAPI.cairo_font_options_equal (Handle, options.Handle); } public IntPtr Handle { @@ -102,6 +106,8 @@ namespace Cairo public void Merge (FontOptions other) { + if (other == null) + throw new ArgumentNullException ("other"); CairoAPI.cairo_font_options_merge (handle, other.Handle); } diff --git a/mcs/class/Mono.Cairo/Mono.Cairo/Glyph.cs b/mcs/class/Mono.Cairo/Mono.Cairo/Glyph.cs index 23d8cbf8d4d..b1e551b65b0 100644 --- a/mcs/class/Mono.Cairo/Mono.Cairo/Glyph.cs +++ b/mcs/class/Mono.Cairo/Mono.Cairo/Glyph.cs @@ -48,14 +48,17 @@ namespace Cairo public long Index { get { return index; } + set { index = value; } } public double X { get { return x; } + set { x = value; } } public double Y { get { return y; } + set { y = value; } } public override bool Equals (object obj) |