diff --git a/ChangeLog b/ChangeLog index 1a4b7b5..005754f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,11 @@ * EOAccess/EORelationship.m (-setIsToMany): Test if the flag actually changes. Call -_setIsEdited. + * TODO: Add an item. + * DBModeler/Inspectors/RelationshipInspector.m: Fix row index check. + * DBModeler/Inspectors/GNUmakefile: Use lower case in + HAS_RESOURCE_BUNDLES. + 2008-03-07 Matt Rice * EOAccess/EORelationship.m (_makeInverseRelationship): Call diff --git a/DBModeler/Inspectors/GNUmakefile b/DBModeler/Inspectors/GNUmakefile index f239162..47e55bd 100644 --- a/DBModeler/Inspectors/GNUmakefile +++ b/DBModeler/Inspectors/GNUmakefile @@ -30,7 +30,7 @@ SUBPROJECT_NAME=Inspectors ADDITIONAL_INCLUDE_DIRS+=-I../../ Inspectors_NEEDS_GUI=YES -Inspectors_HAS_RESOURCE_BUNDLE=YES +Inspectors_HAS_RESOURCE_BUNDLE=yes Inspectors_RESOURCE_FILES+= \ RelationshipInspector.gorm \ diff --git a/DBModeler/Inspectors/RelationshipInspector.m b/DBModeler/Inspectors/RelationshipInspector.m index fab9806..8d23b3d 100644 --- a/DBModeler/Inspectors/RelationshipInspector.m +++ b/DBModeler/Inspectors/RelationshipInspector.m @@ -46,7 +46,7 @@ int row = [destEntity_tableView selectedRow]; NSArray *entities = [[[EOMApp activeDocument] model] entities]; - if (row == -1 || row == NSNotFound || row > [entities count]) + if (row == -1 || row == NSNotFound || row >= [entities count]) return nil; return [[[[EOMApp activeDocument] model] entities] objectAtIndex:row]; @@ -57,11 +57,10 @@ int row = [destAttrib_tableView selectedRow]; NSArray *attribs = [[self selectedEntity] attributes]; - if (row == -1 || row == NSNotFound || row > [attribs count]) + if (row == -1 || row == NSNotFound || row >= [attribs count]) return nil; - return [[[self selectedEntity] attributes] - objectAtIndex:[destAttrib_tableView selectedRow]]; + return [attribs objectAtIndex:[destAttrib_tableView selectedRow]]; } - (EOAttribute *)selectedSourceAttribute @@ -69,7 +68,7 @@ int row = [srcAttrib_tableView selectedRow]; NSArray *attribs = [[[self selectedObject] entity] attributes]; - if (row == -1 || row == NSNotFound || row > [attribs count]) + if (row == -1 || row == NSNotFound || row >= [attribs count]) return nil; return [attribs objectAtIndex:[srcAttrib_tableView selectedRow]]; diff --git a/TODO b/TODO index d7b3be1..2a04e3a 100644 --- a/TODO +++ b/TODO @@ -22,3 +22,8 @@ o Implement databaseFailedToFetchObject mechanism. o Implement to-one PK to Foreign Key support Not implemented by WO but it's really cool. +DBModeler: + when removing something, make sure there is no references to it, + if there are pop up a dialog allowing the user to cancel, or remove the + references. +