Revision: 6525
http://skim-app.svn.sourceforge.net/skim-app/?rev=6525&view=rev
Author: hofman
Date: 2010-05-05 09:09:06 +0000 (Wed, 05 May 2010)
Log Message:
-----------
implement custom settings for printable view in place where it's used to keep
the class simple
Modified Paths:
--------------
trunk/SKNotesDocument.m
trunk/SKPrintableView.h
trunk/SKPrintableView.m
Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m 2010-05-04 15:15:27 UTC (rev 6524)
+++ trunk/SKNotesDocument.m 2010-05-05 09:09:06 UTC (rev 6525)
@@ -326,8 +326,15 @@
[printInfo setHorizontallyCentered:NO];
[printInfo setVerticallyCentered:NO];
+ SKPrintableView *printableView = [[SKPrintableView alloc]
initWithFrame:[printInfo imageablePageBounds]];
+ [printableView setVerticallyResizable:YES];
+ [printableView setHorizontallyResizable:NO];
+
NSAttributedString *attrString = [[NSAttributedString alloc]
initWithRTF:[self notesRTFData] documentAttributes:NULL];
- NSView *printableView = [[SKPrintableView alloc]
initWithAttributedString:attrString printInfo:printInfo];
+ NSTextStorage *textStorage = [printableView textStorage];
+ [textStorage beginEditing];
+ [textStorage setAttributedString:attrString];
+ [textStorage endEditing];
NSPrintOperation *printOperation = [NSPrintOperation
printOperationWithView:printableView printInfo:printInfo];
Modified: trunk/SKPrintableView.h
===================================================================
--- trunk/SKPrintableView.h 2010-05-04 15:15:27 UTC (rev 6524)
+++ trunk/SKPrintableView.h 2010-05-05 09:09:06 UTC (rev 6525)
@@ -40,5 +40,4 @@
@interface SKPrintableView : NSTextView
-- (id)initWithAttributedString:(NSAttributedString *)attributedString
printInfo:(NSPrintInfo *)printInfo;
@end
Modified: trunk/SKPrintableView.m
===================================================================
--- trunk/SKPrintableView.m 2010-05-04 15:15:27 UTC (rev 6524)
+++ trunk/SKPrintableView.m 2010-05-05 09:09:06 UTC (rev 6525)
@@ -41,19 +41,6 @@
@implementation SKPrintableView
-- (id)initWithAttributedString:(NSAttributedString *)attributedString
printInfo:(NSPrintInfo *)printInfo {
- if (self = [self initWithFrame:[(printInfo ?: [NSPrintInfo
sharedPrintInfo]) imageablePageBounds]]) {
- [self setVerticallyResizable:YES];
- [self setHorizontallyResizable:NO];
- if (attributedString) {
- [[self textStorage] beginEditing];
- [[self textStorage] setAttributedString:attributedString];
- [[self textStorage] endEditing];
- }
- }
- return self;
-}
-
- (BOOL)knowsPageRange:(NSRangePointer)range {
NSPrintInfo *info = [[NSPrintOperation currentOperation] printInfo];
if (info) {
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit