From ac804c2e6a6a4d0734e59d6fcd58933526b1452d Mon Sep 17 00:00:00 2001 From: Bibiko Date: Fri, 28 Jan 2011 10:29:05 +0000 Subject: =?UTF-8?q?=E2=80=A2=20fixed=20exception=20for=20printing=20Conten?= =?UTF-8?q?t=20table=20if=20it=20contains=20GEOMETRY=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Source/SPTableContent.m | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/Source/SPTableContent.m b/Source/SPTableContent.m index b136d90a..5243f3ce 100644 --- a/Source/SPTableContent.m +++ b/Source/SPTableContent.m @@ -2062,6 +2062,28 @@ [tempRow addObject:NSLocalizedString(@"(not loaded)", @"value shown for hidden blob and text fields")]; else if([o isKindOfClass:[NSString class]]) [tempRow addObject:[o description]]; + else if([o isKindOfClass:[MCPGeometryData class]]) { + SPGeometryDataView *v = [[SPGeometryDataView alloc] initWithCoordinates:[o coordinates]]; + NSImage *image = [v thumbnailImage]; + NSString *imageStr = @""; + if(image) { + NSString *maxSizeValue = @"WIDTH"; + NSInteger imageWidth = [image size].width; + NSInteger imageHeight = [image size].height; + if(imageHeight > imageWidth) { + maxSizeValue = @"HEIGHT"; + imageWidth = imageHeight; + } + if (imageWidth > 100) imageWidth = 100; + imageStr = [NSString stringWithFormat: + @"
", + maxSizeValue, + (long)imageWidth, + [[image TIFFRepresentationUsingCompression:NSTIFFCompressionJPEG factor:0.01] base64EncodingWithLineLength:0]]; + } + [v release]; + [tempRow addObject:[NSString stringWithFormat:@"%@%@", [o wktString], imageStr]]; + } else { NSImage *image = [[NSImage alloc] initWithData:o]; if (image) { @@ -2476,8 +2498,7 @@ for (i = 0; i < [rowFieldsToSave count]; i++) { if (i) [queryString appendString:@", "]; [queryString appendFormat:@"%@ = %@", - [NSArrayObjectAtIndex(rowFieldsToSave, i) backtickQuotedString], - NSArrayObjectAtIndex(rowValuesToSave, i)]; + [NSArrayObjectAtIndex(rowFieldsToSave, i) backtickQuotedString], NSArrayObjectAtIndex(rowValuesToSave, i)]; } [queryString appendFormat:@" WHERE %@", [self argumentForRow:-2]]; } -- cgit v1.2.3