From d59b7c6e69a6fa47eca55fda006d826e988c1384 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Fri, 18 Jun 2010 12:26:06 +0000 Subject: Fix CSV exporting by correctly setting the filename when exporting to multiple files. --- Source/SPExportInitializer.m | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/SPExportInitializer.m b/Source/SPExportInitializer.m index d912f87a..e41d4a44 100644 --- a/Source/SPExportInitializer.m +++ b/Source/SPExportInitializer.m @@ -332,6 +332,7 @@ break; } } + [exportFilename setString:[exportFilename stringByAppendingPathExtension:@"xml"]]; singleFileHandle = [self getFileHandleForFilePath:[[exportPathField stringValue] stringByAppendingPathComponent:exportFilename]]; @@ -470,7 +471,10 @@ // sure the table name is included to ensure the output files are unique. [exportFilename setString:([[exportCustomFilenameTokenField stringValue] rangeOfString:@"table" options:NSLiteralSearch].location == NSNotFound) ? [exportFilename stringByAppendingFormat:@"_%@", table] : exportFilename]; } - + else { + [exportFilename setString:(dataArray) ? [tableDocumentInstance database] : table]; + } + fileHandle = [self getFileHandleForFilePath:[[exportPathField stringValue] stringByAppendingPathComponent:exportFilename]]; [csvExporter setExportOutputFileHandle:fileHandle]; @@ -484,7 +488,7 @@ // Set the progress bar's max value [exportProgressIndicator setMaxValue:[csvExporter exportMaxProgress]]; - + return [csvExporter autorelease]; } -- cgit v1.2.3