Revision: 5006
http://skim-app.svn.sourceforge.net/skim-app/?rev=5006&view=rev
Author: hofman
Date: 2008-11-27 17:56:53 +0000 (Thu, 27 Nov 2008)
Log Message:
-----------
save some space by writing code on a single line
Modified Paths:
--------------
trunk/PDFPage_SKExtensions.m
Modified: trunk/PDFPage_SKExtensions.m
===================================================================
--- trunk/PDFPage_SKExtensions.m 2008-11-27 16:10:27 UTC (rev 5005)
+++ trunk/PDFPage_SKExtensions.m 2008-11-27 17:56:53 UTC (rev 5006)
@@ -113,15 +113,9 @@
if ([self rotation]) {
NSAffineTransform *transform = [NSAffineTransform transform];
switch ([self rotation]) {
- case 90:
- [transform translateXBy:NSWidth(bounds) yBy:0.0];
- break;
- case 180:
- [transform translateXBy:NSHeight(bounds)
yBy:NSWidth(bounds)];
- break;
- case 270:
- [transform translateXBy:0.0 yBy:NSHeight(bounds)];
- break;
+ case 90: [transform translateXBy:NSWidth(bounds) yBy:0.0];
break;
+ case 180: [transform translateXBy:NSHeight(bounds)
yBy:NSWidth(bounds)]; break;
+ case 270: [transform translateXBy:0.0 yBy:NSHeight(bounds)];
break;
}
[transform rotateByDegrees:[self rotation]];
[transform concat];
@@ -260,29 +254,17 @@
return attrString;
}
-- (NSAttributedString *)thumbnailAttachment {
- return [self thumbnailAttachmentWithSize:0.0];
-}
+- (NSAttributedString *)thumbnailAttachment { return [self
thumbnailAttachmentWithSize:0.0]; }
-- (NSAttributedString *)thumbnail512Attachment {
- return [self thumbnailAttachmentWithSize:512.0];
-}
+- (NSAttributedString *)thumbnail512Attachment { return [self
thumbnailAttachmentWithSize:512.0]; }
-- (NSAttributedString *)thumbnail256Attachment {
- return [self thumbnailAttachmentWithSize:256.0];
-}
+- (NSAttributedString *)thumbnail256Attachment { return [self
thumbnailAttachmentWithSize:256.0]; }
-- (NSAttributedString *)thumbnail128Attachment {
- return [self thumbnailAttachmentWithSize:128.0];
-}
+- (NSAttributedString *)thumbnail128Attachment { return [self
thumbnailAttachmentWithSize:128.0]; }
-- (NSAttributedString *)thumbnail64Attachment {
- return [self thumbnailAttachmentWithSize:64.0];
-}
+- (NSAttributedString *)thumbnail64Attachment { return [self
thumbnailAttachmentWithSize:64.0]; }
-- (NSAttributedString *)thumbnail32Attachment {
- return [self thumbnailAttachmentWithSize:32.0];
-}
+- (NSAttributedString *)thumbnail32Attachment { return [self
thumbnailAttachmentWithSize:32.0]; }
- (NSData *)PDFDataForRect:(NSRect)rect {
NSData *data = [self dataRepresentation];
@@ -296,15 +278,9 @@
NSAffineTransform *transform = [NSAffineTransform transform];
NSRect bounds = [self boundsForBox:kPDFDisplayBoxMediaBox];
switch ([self rotation]) {
- case 90:
- [transform translateXBy:0.0 yBy:NSWidth(bounds)];
- break;
- case 180:
- [transform translateXBy:NSWidth(bounds) yBy:NSHeight(bounds)];
- break;
- case 270:
- [transform translateXBy:NSHeight(bounds) yBy:0.0];
- break;
+ case 90: [transform translateXBy:0.0 yBy:NSWidth(bounds)]; break;
+ case 180: [transform translateXBy:NSWidth(bounds)
yBy:NSHeight(bounds)]; break;
+ case 270: [transform translateXBy:NSHeight(bounds) yBy:0.0]; break;
}
[transform rotateByDegrees:-[self rotation]];
rect = [transform transformRect:rect];
@@ -341,18 +317,10 @@
NSAffineTransform *transform = [NSAffineTransform transform];
switch ([self rotation]) {
- case 0:
- [transform translateXBy:-NSMinX(bounds) yBy:-NSMinY(bounds)];
- break;
- case 90:
- [transform translateXBy:-NSMinY(bounds) yBy:NSMaxX(bounds)];
- break;
- case 180:
- [transform translateXBy:NSMaxX(bounds) yBy:NSMaxY(bounds)];
- break;
- case 270:
- [transform translateXBy:NSMaxY(bounds) yBy:-NSMinX(bounds)];
- break;
+ case 0: [transform translateXBy:-NSMinX(bounds)
yBy:-NSMinY(bounds)]; break;
+ case 90: [transform translateXBy:-NSMinY(bounds) yBy:NSMaxX(bounds)];
break;
+ case 180: [transform translateXBy:NSMaxX(bounds) yBy:NSMaxY(bounds)];
break;
+ case 270: [transform translateXBy:NSMaxY(bounds) yBy:-NSMinX(bounds)];
break;
}
[transform rotateByDegrees:-[self rotation]];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit