mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-23 13:10:48 +00:00
EOInterface/* numberOfRowsInTableView returns NSInteger now
EOModeler/EOModelerDocument.m: do not insert a model into EditingContext. EOModeler/EOModelerEditor.m: avoid crash git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@30245 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fea268900f
commit
671dac2c7b
5 changed files with 20 additions and 7 deletions
|
@ -22,6 +22,9 @@
|
|||
added @implementation EOCustomObject (AssociationsHack)
|
||||
re-added registerAssociationForDeallocHack
|
||||
* EOControl/*: ported to new runtime and OS X
|
||||
EOInterface/* numberOfRowsInTableView returns NSInteger now
|
||||
EOModeler/EOModelerDocument.m: do not insert a model into EditingContext.
|
||||
EOModeler/EOModelerEditor.m: avoid crash
|
||||
|
||||
2010-04-21 Sergey Golovin <golovin.sv@gmail.com>
|
||||
|
||||
|
|
|
@ -164,7 +164,7 @@ textShouldBeginEditing: (NSText *)fieldEditor;
|
|||
- (EOColumnAssociation *)editingAssociation;
|
||||
|
||||
/* Providing table view data source. */
|
||||
- (int)numberOfRowsInTableView: (NSTableView *)tableView;
|
||||
- (NSInteger)numberOfRowsInTableView: (NSTableView *)tableView;
|
||||
|
||||
- (void)tableView: (NSTableView *)tableView
|
||||
setObjectValue: (id)object
|
||||
|
|
|
@ -241,7 +241,7 @@ static NSMapTable *tvAssociationMap;
|
|||
}
|
||||
}
|
||||
|
||||
- (int)numberOfRowsInTableView: (NSTableView *)tableView
|
||||
- (NSInteger)numberOfRowsInTableView: (NSTableView *)tableView
|
||||
{
|
||||
return [[[self displayGroupForAspect:@"source"] displayedObjects] count];
|
||||
}
|
||||
|
|
|
@ -155,10 +155,14 @@ NSString *EOMConsistencyModelObjectKey = @"EOMConsistencyModelObjectKey";
|
|||
|
||||
@implementation EOModelerDocument
|
||||
|
||||
|
||||
|
||||
- (BOOL) validateMenuItem:(NSMenuItem <NSMenuItem>*)menuItem
|
||||
{
|
||||
NSArray *selection = [[EOMApp currentEditor] selectionPath];
|
||||
|
||||
|
||||
|
||||
if ([[menuItem title] isEqualToString:@"Add attribute"])
|
||||
return ([selection firstSelectionOfClass:[EOEntity class]] != nil);
|
||||
else if ([[menuItem title] isEqualToString:@"Add relationship"])
|
||||
|
@ -167,6 +171,7 @@ NSString *EOMConsistencyModelObjectKey = @"EOMConsistencyModelObjectKey";
|
|||
return ([[selection lastObject] count]) ? YES : NO;
|
||||
// see -delete:
|
||||
//return ([[selection lastObject] count] || [selection count] > 2) ? YES : NO;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
@ -179,7 +184,8 @@ NSString *EOMConsistencyModelObjectKey = @"EOMConsistencyModelObjectKey";
|
|||
_userInfo = nil;
|
||||
_editors = [[NSMutableArray alloc] init];
|
||||
_editingContext = [[EOEditingContext alloc] init];
|
||||
[_editingContext insertObject:model];
|
||||
// why insert the model into the EC? -- dw
|
||||
// [_editingContext insertObject:model];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
@ -762,5 +768,6 @@ NSString *EOMConsistencyModelObjectKey = @"EOMConsistencyModelObjectKey";
|
|||
appendConsistencyCheckSuccessText:successText];
|
||||
}
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -49,7 +49,6 @@
|
|||
#endif
|
||||
|
||||
#include <GNUstepBase/GNUstep.h>
|
||||
#include <GNUstepBase/GSCategories.h>
|
||||
|
||||
@implementation EOModelerEditor
|
||||
- (void) dealloc
|
||||
|
@ -186,7 +185,7 @@
|
|||
|
||||
- (void)activateEmbeddedEditor:(EOModelerEmbedibleEditor *)editor
|
||||
{
|
||||
unsigned int index = [_editors indexOfObjectIdenticalTo: editor];
|
||||
NSUInteger index = [_editors indexOfObjectIdenticalTo: editor];
|
||||
if (index == NSNotFound)
|
||||
{
|
||||
[_editors addObject: editor];
|
||||
|
@ -241,9 +240,13 @@
|
|||
the selection arrays.</p> */
|
||||
- (void)setSelectionPath:(NSArray *)newSelection
|
||||
{
|
||||
unsigned int indexOfLast = [newSelection indexOfObject:[newSelection lastObject]];
|
||||
NSUInteger indexOfLast = NSNotFound;
|
||||
NSRange allButLastElement;
|
||||
/*
|
||||
|
||||
if ((newSelection) && ([newSelection count] > 0)) {
|
||||
indexOfLast = [newSelection indexOfObject:[newSelection lastObject]];
|
||||
}
|
||||
/*
|
||||
int i,j;
|
||||
|
||||
printf("%@\n",NSStringFromSelector(_cmd));
|
||||
|
|
Loading…
Reference in a new issue