mirror of
https://github.com/gnustep/apps-projectcenter.git
synced 2025-03-14 06:31:31 +00:00
Cleanups and NSInteger conversion
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/apps/projectcenter/trunk@39127 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
35f05690ed
commit
75af5d310e
3 changed files with 33 additions and 32 deletions
|
@ -1,3 +1,8 @@
|
|||
2015-11-02 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Modules/Editors/ProjectCenter/PCEditorView.m
|
||||
Cleanups and NSInteger conversion.
|
||||
|
||||
2015-06-16 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Framework/GNUmakefile
|
||||
|
|
|
@ -178,9 +178,9 @@ static int ComputeIndentingOffset(NSString * string, unsigned int start)
|
|||
}
|
||||
|
||||
// Go backward to first '\n' char or start of file
|
||||
- (int)lineStartIndexForIndex:(int)index forString:(NSString *)string
|
||||
- (NSInteger)lineStartIndexForIndex:(NSInteger)index forString:(NSString *)string
|
||||
{
|
||||
int line_start;
|
||||
NSInteger line_start;
|
||||
|
||||
// Get line start index moving from index backwards
|
||||
for (line_start = index;line_start > 0;line_start--)
|
||||
|
@ -198,10 +198,10 @@ static int ComputeIndentingOffset(NSString * string, unsigned int start)
|
|||
return line_start > index ? index : line_start;
|
||||
}
|
||||
|
||||
- (int)lineEndIndexForIndex:(int)index forString:(NSString *)string
|
||||
- (NSInteger)lineEndIndexForIndex:(NSInteger)index forString:(NSString *)string
|
||||
{
|
||||
int line_end;
|
||||
int string_length = [string length];
|
||||
NSInteger line_end;
|
||||
NSInteger string_length = [string length];
|
||||
|
||||
// Get line start index moving from index backwards
|
||||
for (line_end = index;line_end < string_length;line_end++)
|
||||
|
@ -212,30 +212,30 @@ static int ComputeIndentingOffset(NSString * string, unsigned int start)
|
|||
}
|
||||
}
|
||||
|
||||
NSLog(@"index: %i end: %i", index, line_end);
|
||||
NSLog(@"index: %li end: %li", (long)index, (long)line_end);
|
||||
|
||||
return line_end < string_length ? line_end : string_length;
|
||||
}
|
||||
|
||||
- (int)previousLineStartIndexForIndex:(int)index forString:(NSString *)string
|
||||
- (NSInteger)previousLineStartIndexForIndex:(NSInteger)index forString:(NSString *)string
|
||||
{
|
||||
int cur_line_start;
|
||||
int prev_line_start;
|
||||
NSInteger cur_line_start;
|
||||
NSInteger prev_line_start;
|
||||
|
||||
cur_line_start = [self lineStartIndexForIndex:index forString:string];
|
||||
prev_line_start = [self lineStartIndexForIndex:cur_line_start-1
|
||||
forString:string];
|
||||
|
||||
NSLog(@"index: %i prev_start: %i", index, prev_line_start);
|
||||
NSLog(@"index: %li prev_start: %li", (long)index, (long)prev_line_start);
|
||||
|
||||
return prev_line_start;
|
||||
}
|
||||
|
||||
- (int)nextLineStartIndexForIndex:(int)index forString:(NSString *)string
|
||||
- (NSInteger)nextLineStartIndexForIndex:(NSInteger)index forString:(NSString *)string
|
||||
{
|
||||
int cur_line_end;
|
||||
int next_line_start;
|
||||
int string_length = [string length];
|
||||
NSInteger cur_line_end;
|
||||
NSInteger next_line_start;
|
||||
NSInteger string_length = [string length];
|
||||
|
||||
cur_line_end = [self lineEndIndexForIndex:index forString:string];
|
||||
next_line_start = cur_line_end + 1;
|
||||
|
@ -250,12 +250,13 @@ static int ComputeIndentingOffset(NSString * string, unsigned int start)
|
|||
}
|
||||
}
|
||||
|
||||
- (unichar)firstCharOfLineForIndex:(int)index forString:(NSString *)string
|
||||
- (unichar)firstCharOfLineForIndex:(NSInteger)index forString:(NSString *)string
|
||||
{
|
||||
int line_start = [self lineStartIndexForIndex:index forString:string];
|
||||
int i;
|
||||
NSInteger line_start = [self lineStartIndexForIndex:index forString:string];
|
||||
NSInteger i;
|
||||
unichar c;
|
||||
|
||||
c = 0;
|
||||
// Get leading whitespaces range
|
||||
for (i = line_start; i >= 0; i++)
|
||||
{
|
||||
|
@ -271,30 +272,25 @@ static int ComputeIndentingOffset(NSString * string, unsigned int start)
|
|||
return c;
|
||||
}
|
||||
|
||||
- (unichar)firstCharOfPrevLineForIndex:(int)index forString:(NSString *)string
|
||||
- (unichar)firstCharOfPrevLineForIndex:(NSInteger)index forString:(NSString *)string
|
||||
{
|
||||
int line_start = [self previousLineStartIndexForIndex:index
|
||||
NSInteger line_start = [self previousLineStartIndexForIndex:index
|
||||
forString:string];
|
||||
|
||||
return [self firstCharOfLineForIndex:line_start forString:string];
|
||||
}
|
||||
|
||||
- (unichar)firstCharOfNextLineForIndex:(int)index
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
- (void)performIndentation
|
||||
{
|
||||
NSString *string = [self string];
|
||||
int location;
|
||||
int line_start;
|
||||
int offset;
|
||||
unichar c, plfc, clfc;
|
||||
NSRange wsRange;
|
||||
NSString *string = [self string];
|
||||
NSInteger location;
|
||||
NSInteger line_start;
|
||||
NSInteger offset;
|
||||
unichar c, plfc, clfc;
|
||||
NSRange wsRange;
|
||||
NSMutableString *indentString;
|
||||
NSCharacterSet *wsCharSet = [NSCharacterSet whitespaceCharacterSet];
|
||||
int i;
|
||||
NSInteger i;
|
||||
// int point;
|
||||
|
||||
location = [self selectedRange].location;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"Nicola Pero",
|
||||
"Pierre-Yves Rivaille",
|
||||
"Adam Fedor",
|
||||
"Gregory Jonh Casamento",
|
||||
"Gregory John Casamento",
|
||||
"Riccardo Mottola");
|
||||
NSIcon = "ProjectCenter.tiff";
|
||||
NSExecutable = ProjectCenter;
|
||||
|
|
Loading…
Reference in a new issue