aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Resources/Templates/sequel-pro-print-template.html2
-rw-r--r--Source/SPPrintController.m14
2 files changed, 13 insertions, 3 deletions
diff --git a/Resources/Templates/sequel-pro-print-template.html b/Resources/Templates/sequel-pro-print-template.html
index 5baa214f..19687f7f 100644
--- a/Resources/Templates/sequel-pro-print-template.html
+++ b/Resources/Templates/sequel-pro-print-template.html
@@ -101,7 +101,7 @@
</tbody>
</table><br />
- {% if indexes %}
+ {% if hasIndexes && indexes %}
<h2>Table Indexes</h2>
<table class="data">
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];
}