Commit Graph
28 Commits
Author SHA1 Message Date
Aparajita Fishman 07f9b94548 Fixed: initializer did not allow programmers to pass arbitrary types
Originally the initializer had coerced the parameter to a string, even though it is clearly documented that it should be a string. A later commit removed that coercion.

This commit reinstates the type coercion and thus saves the world from those who would pass non-string types in a parameter that says "withString".
2013-02-27 15:17:17 -05:00
Aparajita Fishman ae2ed8bf94 Fixed: empty strings and indexes out of range were not handled
Previously CPAttributedString did not provide an -init method,
with the result that an attributed string created with [[CPAttributedString alloc] init]
would not be correctly initialized.

Also, some methods that took indexes into the string were not checking for an invalid index and were not raising exceptions when the documentation said they should.

Finally, some methods that were supposed to return empty dictionaries were returning nil.

This commit fixes all of these problems. Empty strings should no longer cause errors.

Closes #533
2013-02-26 20:15:15 -05:00
Alexander Ljungberg 5b05dc92a1 More dictionary literals. 2013-02-25 18:27:44 +00:00
Alexander Ljungberg 8bcbeb0aa9 Improve code readability with dictionary literals. 2013-02-25 17:02:36 +00:00
Antoine Mercadal bbb8bdb687 Fix other small bugs 2013-01-18 14:38:37 -08:00
Alexander Ljungberg 55ca956f50 Remove nonstandard CPCopyRange. 2012-06-16 12:31:49 +01:00
Aparajita Fishman 1c2a304ee5 Assignment of function is a statement and should be semicolon terminated. Some miscellaneous linting as well. 2012-01-05 17:51:37 -10:00
Stephen Ierodiaconou 6a942630e4 Fixing spelling mistakes 2011-01-24 11:05:48 +02:00
Stephen Ierodiaconou 494f615aaa Merge branch 'master' into imports
Conflicts:
	Foundation/CPScanner.j
2011-01-15 09:11:46 +02:00
Francisco Ryan Tolmasky I e45ed19dc7 Fix remaining failing tests and add indexOfObject:inSortedRange:options:usingComparator:, and removed non-standard methods:
- indexOfObject:sortedBySelector:
- indexOfObject:sortedByFunction:
- indexOfObject:sortedByDescriptors:
- indexOfObject:sortedByFunction:context:

Reviewed by me.
2010-12-25 21:10:32 -08:00
Stephen Ierodiaconou b70018bd80 Import fixes and lint 2010-12-26 01:34:37 +02:00
Alexander Ljungberg e4f5d9b32f Fixed some comments referencing NS* classes. 2010-11-11 13:42:25 -03:00
Alexander Ljungberg a80732f13a Whitespace and style cleanup. 2010-10-27 20:44:55 -03:00
Nicholas Small f34775b038 CPAttributedString should not call its own -beginEditing or -endEditing. 2010-06-29 14:02:37 -04:00
Stephen IerodiaconouandRoss Boucher b98f0b1427 Apply style rules to Foundation 2010-05-26 08:53:05 -07:00
Stephen IerodiaconouandRoss Boucher 0d848e3d93 Add test on self in init of CPAttributedString 2010-05-26 08:52:46 -07:00
Tom Robinson 7defbce1dd Fix more incorrect type annotations 2010-02-24 22:45:34 -08:00
Francisco Ryan Tolmasky I bc53288fca Fix for failing CPAttributedString test.
Reviewed by me.
2010-02-13 16:14:18 -08:00
lowell vizonandFrancisco Ryan Tolmasky I 377f331b47 Documentation Edits: Replaced <code> and <pre> tags with \c; this allows monospaced text to be displayed with formatted text without needing a new line. See AppKit/CPView after generating documentation for examples. Also added - and + signs to the above changes when referring to either an -instanceMethod or a +classMethod. --lowell@cocoastep
Signed-off-by: Francisco Ryan Tolmasky I <francisco@280north.com>
2009-08-08 03:50:50 +08:00
Ross Boucher f46aa870a7 adding briefs and unifying class header structure
Conflicts:

	Foundation/CPArray.j
	Foundation/CPAttributedString.j
	Foundation/CPBundle.j
	Foundation/CPCountedSet.j
	Foundation/CPIndexSet.j
	Foundation/CPJSONPConnection.j
2009-05-30 13:49:10 -07:00
Ross Boucher f6bd4ddd96 Added a new group Cocoa Compatability for the empty compatability
classes like CPMutableArray

Conflicts:

	Foundation/CPAttributedString.j
	Foundation/CPSet.j
2009-05-30 13:42:57 -07:00
Ross Boucher 48f31743dd Update to docs of replaceCharactersInRange in CPAttributedString.
Conflicts:

	Foundation/CPAttributedString.j
2009-05-30 13:41:18 -07:00
Ross Boucher 50ed22c63c [#247 state:resolved milestone:0.7] 2009-03-25 02:59:53 -07:00
Ross Boucher 49accf9fc8 Fix for CPAttributedString bug #245 [#245 state:resolved milestone:0.7] 2009-03-25 02:51:54 -07:00
stephenandRoss Boucher f04a199f4c Documentation for CPAttributedString 2009-03-25 01:37:43 -07:00
Francisco Ryan Tolmasky I d0b52f7118 Replaced some imports with @imports.
Reviewed by me.
2008-11-28 11:28:20 -08:00
Ross Boucher d64e55226d Add CPMutableAttributedString 2008-11-13 19:33:48 -08:00
Ross Boucher 102c741ca3 Initial commit of CPAttributedString, and test cases. All test cases currently pass. 2008-11-13 11:23:00 -08:00