aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPPrintController.m
diff options
context:
space:
mode:
authorstuconnolly <stuart02@gmail.com>2010-03-15 16:40:48 +0000
committerstuconnolly <stuart02@gmail.com>2010-03-15 16:40:48 +0000
commit4645fcac921c8ec01b1a07e460fdb538ed4c671b (patch)
tree36ebd96cbae83e5e4a6a09d443b6b50e031b5a6f /Source/SPPrintController.m
parent5a6d0f17bbf6b09463b908182dc2cbb112a0c6cb (diff)
downloadsequelpro-4645fcac921c8ec01b1a07e460fdb538ed4c671b.tar.gz
sequelpro-4645fcac921c8ec01b1a07e460fdb538ed4c671b.tar.bz2
sequelpro-4645fcac921c8ec01b1a07e460fdb538ed4c671b.zip
Fix some potential issues found during static analysis.
Diffstat (limited to 'Source/SPPrintController.m')
-rw-r--r--Source/SPPrintController.m26
1 files changed, 20 insertions, 6 deletions
diff --git a/Source/SPPrintController.m b/Source/SPPrintController.m
index f842aa04..f83f3625 100644
--- a/Source/SPPrintController.m
+++ b/Source/SPPrintController.m
@@ -155,6 +155,7 @@
NSString *heading = @"";
NSArray *rows, *indexes, *indexColumns = nil;
+
NSArray *columns = [self columnNames];
NSMutableDictionary *printData = [NSMutableDictionary dictionary];
@@ -178,10 +179,12 @@
indexColumns = [[tableSource objectForKey:@"indexes"] objectAtIndex:0];
+ [printData setObject:rows forKey:@"rows"];
[printData setObject:indexes forKey:@"indexes"];
[printData setObject:indexColumns forKey:@"indexColumns"];
- if (indexes) [indexes release];
+ [rows release];
+ [indexes release];
}
// Table content view
else if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 1) {
@@ -195,7 +198,10 @@
[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(1, [data count] - 1)]]
];
+ [printData setObject:rows forKey:@"rows"];
[connection setValue:[tableContentInstance usedQuery] forKey:@"query"];
+
+ [rows release];
}
// Custom query view
else if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 2) {
@@ -209,7 +215,10 @@
[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(1, [data count] - 1)]]
];
+ [printData setObject:rows forKey:@"rows"];
[connection setValue:[customQueryInstance usedQuery] forKey:@"query"];
+
+ [rows release];
}
// Table relations view
else if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 4) {
@@ -222,6 +231,10 @@
[data objectsAtIndexes:
[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(1, ([data count] - 1))]]
];
+
+ [printData setObject:rows forKey:@"rows"];
+
+ [rows release];
}
// Table triggers view
else if ([tableTabView indexOfTabViewItem:[tableTabView selectedTabViewItem]] == 5) {
@@ -233,18 +246,19 @@
rows = [[NSArray alloc] initWithArray:
[data objectsAtIndexes:
[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(1, ([data count] - 1))]]
- ];
- }
+ ];
+
+ [printData setObject:rows forKey:@"rows"];
+ [rows release];
+ }
+
[engine setObject:connection forKey:@"c"];
[printData setObject:heading forKey:@"heading"];
[printData setObject:columns forKey:@"columns"];
- [printData setObject:rows forKey:@"rows"];
[printData setObject:([prefs boolForKey:SPUseMonospacedFonts]) ? SPDefaultMonospacedFontName : @"Lucida Grande" forKey:@"font"];
[printData setObject:([prefs boolForKey:SPDisplayTableViewVerticalGridlines]) ? @"1px solid #CCCCCC" : @"none" forKey:@"gridlines"];
-
- if (rows) [rows release];
NSString *HTMLString = [engine processTemplateInFileAtPath:[[NSBundle mainBundle] pathForResource:SPHTMLPrintTemplate ofType:@"html"] withVariables:printData];