From 22afbe4dacdf089c3f9f440e1ad859982cbb714e Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Thu, 7 Oct 2010 19:25:41 +0000 Subject: When printing a table/view's structure, change the heading accordingly. Also, don't include the tables indexes table if there are none. --- Source/SPPrintController.m | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Source') diff --git a/Source/SPPrintController.m b/Source/SPPrintController.m index 3a2f4148..1119fc15 100644 --- a/Source/SPPrintController.m +++ b/Source/SPPrintController.m @@ -178,7 +178,6 @@ // Cancel the print thread [printThread cancel]; - } /** @@ -217,7 +216,16 @@ NSDictionary *tableSource = [tableSourceInstance tableSourceForPrinting]; - heading = NSLocalizedString(@"Table Structure", @"table structure print heading"); + SPExportMode tableType = [tablesListInstance tableType]; + + switch (tableType) { + case SPTableTypeTable: + heading = NSLocalizedString(@"Table Structure", @"table structure print heading"); + break; + case SPTableTypeView: + heading = NSLocalizedString(@"View Structure", @"view structure print heading"); + break; + } rows = [[NSArray alloc] initWithArray: [[tableSource objectForKey:@"structure"] objectsAtIndexes: @@ -235,6 +243,8 @@ [printData setObject:indexes forKey:@"indexes"]; [printData setObject:indexColumns forKey:@"indexColumns"]; + if ([indexes count]) [printData setObject:[NSNumber numberWithInteger:1] forKey:@"hasIndexes"]; + [rows release]; [indexes release]; } -- cgit v1.2.3