-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed decode methods to return the correct defaults, removed unnecess…
…ary containsValueForKey and || with defaults
- Loading branch information
Showing
24 changed files
with
80 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,7 +251,9 @@ var CPArrayClass = Ni | |
*/ | ||
- (float)decodeFloatForKey:(CPString)aKey | ||
{ | ||
return [self decodeObjectForKey:aKey]; | ||
var f = [self decodeObjectForKey:aKey]; | ||
|
||
return f === nil ? 0.0 : f; | ||
} | ||
|
||
/* | ||
|
@@ -261,7 +263,9 @@ var CPArrayClass = Ni | |
*/ | ||
- (double)decodeDoubleForKey:(CPString)aKey | ||
{ | ||
return [self decodeObjectForKey:aKey]; | ||
var d = [self decodeObjectForKey:aKey]; | ||
|
||
return d === nil ? 0.0 : d; | ||
} | ||
|
||
/* | ||
|
@@ -271,7 +275,9 @@ var CPArrayClass = Ni | |
*/ | ||
- (int)decodeIntForKey:(CPString)aKey | ||
{ | ||
return [self decodeObjectForKey:aKey]; | ||
var i = [self decodeObjectForKey:aKey]; | ||
|
||
return i === nil ? 0 : i; | ||
} | ||
|
||
/* | ||
|
@@ -284,9 +290,9 @@ var CPArrayClass = Ni | |
var object = [self decodeObjectForKey:aKey]; | ||
|
||
if (object) | ||
return CPPointFromString(object); | ||
return CGPointFromString(object); | ||
else | ||
return CPPointMake(0.0, 0.0); | ||
return CGPointMakeZero(); | ||
} | ||
|
||
/* | ||
|
@@ -299,9 +305,9 @@ var CPArrayClass = Ni | |
var object = [self decodeObjectForKey:aKey]; | ||
|
||
if (object) | ||
return CPRectFromString(object); | ||
return CGRectFromString(object); | ||
else | ||
return CPRectMakeZero(); | ||
return CGRectMakeZero(); | ||
} | ||
|
||
/* | ||
|
@@ -314,9 +320,9 @@ var CPArrayClass = Ni | |
var object = [self decodeObjectForKey:aKey]; | ||
|
||
if (object) | ||
return CPSizeFromString(object); | ||
return CGSizeFromString(object); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
aparajita
Author
Contributor
|
||
else | ||
return CPSizeMake(0.0, 0.0); | ||
return CGSizeMakeZero(); | ||
} | ||
|
||
/* | ||
|
@@ -366,6 +372,7 @@ var CPArrayClass = Ni | |
return nil; | ||
|
||
var objectClass = data.isa; | ||
|
||
if (objectClass === CPDataClass) | ||
return data.bytes(); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Regarding the discussion here:
https://groups.google.com/forum/?fromgroups#!topic/objectivej/adBjkDFwHMg
Not sure why... but this seems to be the culprit. At least it is for me.
When I put it back to return CPSizeFromString(object); nibs work fine again with nib2cib.