Archived
1

Cleaned Code & Fixed Some Errors

This commit is contained in:
Kim Wittenburg
2014-11-29 00:20:05 +01:00
parent b6973dc24a
commit 98e4a6dde6
13 changed files with 61 additions and 101 deletions

View File

@@ -561,7 +561,7 @@ NSString *const MPIllegalElementExceptionElementKey = @"MPIllegalElementExceptio
}
[self fixElements];
[self didChangeElementsInRangePath:[[MPRangePath alloc] initWithRange:_editedRange]
[self changedElementsInRangePath:[[MPRangePath alloc] initWithRange:_editedRange]
replacementLength:_replacementLength];
}
@@ -592,6 +592,16 @@ NSString *const MPIllegalElementExceptionElementKey = @"MPIllegalElementExceptio
}
- (void)changedElementsInRangePath:(MPRangePath *)rangePath
replacementLength:(NSUInteger)replacementLength
{
NSUInteger selfIndex = [self.parent indexOfChild:self];
MPRangePath *newPath = MPMakeRangePath([rangePath.location indexPathByPreceedingIndex:selfIndex], rangePath.length);
[self.parent didChangeElementsInRangePath:newPath
replacementLength:replacementLength];
}
- (MPExpression *)subexpressionFromIndex:(NSUInteger)from
referenceFrame:(MPReferenceFrame)referenceFrame
{
@@ -661,19 +671,6 @@ NSString *const MPIllegalElementExceptionElementKey = @"MPIllegalElementExceptio
}
#pragma mark Notifications
- (void)didChangeElementsInRangePath:(MPRangePath *)rangePath
replacementLength:(NSUInteger)replacementLength
{
NSUInteger selfIndex = [self.parent indexOfChild:self];
MPRangePath *newPath = MPMakeRangePath([rangePath.location indexPathByPreceedingIndex:selfIndex], rangePath.length);
[self.parent didChangeElementsInRangePath:newPath
replacementLength:replacementLength];
}
#pragma mark Basic NSObject Methods