aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPBundleCommandTextView.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2011-03-07 20:12:52 +0000
committerstuconnolly <stuart02@gmail.com>2011-03-07 20:12:52 +0000
commit1e5288e9840e201a00bcb5ca3035d7aa807f1f8d (patch)
tree0c1a47953f57b71c41cc7a63e156629c6c9d645b /Source/SPBundleCommandTextView.m
parent915a3831525bf3a9350648d82f86dd54ae366292 (diff)
downloadsequelpro-1e5288e9840e201a00bcb5ca3035d7aa807f1f8d.tar.gz
sequelpro-1e5288e9840e201a00bcb5ca3035d7aa807f1f8d.tar.bz2
sequelpro-1e5288e9840e201a00bcb5ca3035d7aa807f1f8d.zip
Bring outline view branch up to date with trunk (r3203:r3224).
Diffstat (limited to 'Source/SPBundleCommandTextView.m')
-rw-r--r--Source/SPBundleCommandTextView.m27
1 files changed, 14 insertions, 13 deletions
diff --git a/Source/SPBundleCommandTextView.m b/Source/SPBundleCommandTextView.m
index d9aae0f7..59bebadc 100644
--- a/Source/SPBundleCommandTextView.m
+++ b/Source/SPBundleCommandTextView.m
@@ -35,6 +35,7 @@
[prefs removeObserver:self forKeyPath:SPCustomQueryEditorTabStopWidth];
[prefs release];
[lineNumberView release];
+ [super dealloc];
}
- (void)awakeFromNib
@@ -373,7 +374,7 @@
paragraphStyle = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
[paragraphStyle setTabStops:myArrayOfTabs];
// Soft wrapped lines are indented slightly
- [paragraphStyle setHeadIndent:4.0];
+ [paragraphStyle setHeadIndent:4.0f];
NSMutableDictionary *textAttributes = [[[NSMutableDictionary alloc] initWithCapacity:1] autorelease];
[textAttributes setObject:paragraphStyle forKey:NSParagraphStyleAttributeName];
@@ -668,14 +669,14 @@
{
NSUInteger glyphIndex;
NSLayoutManager *layoutManager = [self layoutManager];
- CGFloat fraction;
+ CGFloat partialFraction;
NSRange range;
range = [layoutManager glyphRangeForTextContainer:[self textContainer]];
glyphIndex = [layoutManager glyphIndexForPoint:aPoint
inTextContainer:[self textContainer]
- fractionOfDistanceThroughGlyph:&fraction];
- if( fraction > 0.5 ) glyphIndex++;
+ fractionOfDistanceThroughGlyph:&partialFraction];
+ if( partialFraction > 0.5 ) glyphIndex++;
if( glyphIndex == NSMaxRange(range) )
return [[self textStorage] length];
@@ -697,20 +698,20 @@
// Make usage of the UNIX command "file" to get an info
// about file type and encoding.
- NSTask *task=[[NSTask alloc] init];
- NSPipe *pipe=[[NSPipe alloc] init];
+ NSTask *aTask=[[NSTask alloc] init];
+ NSPipe *aPipe=[[NSPipe alloc] init];
NSFileHandle *handle;
NSString *result;
- [task setLaunchPath:@"/usr/bin/file"];
- [task setArguments:[NSArray arrayWithObjects:aPath, @"-Ib", nil]];
- [task setStandardOutput:pipe];
- handle=[pipe fileHandleForReading];
- [task launch];
+ [aTask setLaunchPath:@"/usr/bin/file"];
+ [aTask setArguments:[NSArray arrayWithObjects:aPath, @"-Ib", nil]];
+ [aTask setStandardOutput:aPipe];
+ handle=[aPipe fileHandleForReading];
+ [aTask launch];
result=[[NSString alloc] initWithData:[handle readDataToEndOfFile]
encoding:NSASCIIStringEncoding];
- [pipe release];
- [task release];
+ [aPipe release];
+ [aTask release];
// UTF16/32 files are detected as application/octet-stream resp. audio/mpeg
if( [result hasPrefix:@"text/plain"]