@@ -624,85 +624,4 @@ - (void)performInsertIconsOnMainThread:(id)array
624
624
}
625
625
}
626
626
627
-
628
- // - (FRAPrintTextView *)printView
629
- // {
630
- // Pos;
631
- // NSPrintInfo *printInfo = [FRACurrentProject printInfo];
632
- //
633
- // FRAPrintTextView *printTextView = [[FRAPrintTextView alloc] initWithFrame:NSMakeRect([printInfo leftMargin], [printInfo bottomMargin], [printInfo paperSize].width - [printInfo leftMargin] - [printInfo rightMargin], [printInfo paperSize].height - [printInfo topMargin] - [printInfo bottomMargin])];
634
- //
635
- //
636
- // // Set the tabs
637
- // NSMutableString *sizeString = [NSMutableString string];
638
- // NSUInteger numberOfSpaces = [[FRADefaults valueForKey:@"TabWidth"] integerValue];
639
- // while (numberOfSpaces--) {
640
- // [sizeString appendString:@" "];
641
- // }
642
- // NSDictionary *sizeAttribute = [[NSDictionary alloc] initWithObjectsAndKeys:[NSUnarchiver unarchiveObjectWithData:[FRADefaults valueForKey:@"PrintFont"]], NSFontAttributeName, nil];
643
- // CGFloat sizeOfTab = [sizeString sizeWithAttributes:sizeAttribute].width;
644
- //
645
- // NSMutableParagraphStyle *style = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
646
- // NSArray *array = [style tabStops];
647
- // for (id item in array) {
648
- // [style removeTabStop:item];
649
- // }
650
- //
651
- // [style setDefaultTabInterval:sizeOfTab];
652
- // NSDictionary *attributes = [[NSDictionary alloc] initWithObjectsAndKeys:style, NSParagraphStyleAttributeName, nil];
653
- // [printTextView setTypingAttributes:attributes];
654
- //
655
- // BOOL printOnlySelection = NO;
656
- // NSInteger selectionLocation = 0;
657
- //
658
- // if ([FRACurrentProject areThereAnyDocuments]) {
659
- // if ([[FRADefaults valueForKey:@"OnlyPrintSelection"] boolValue] == YES && [FRACurrentTextView selectedRange].length > 0) {
660
- // [printTextView setString:[FRACurrentText substringWithRange:[FRACurrentTextView selectedRange]]];
661
- // printOnlySelection = YES;
662
- // selectionLocation = [FRACurrentTextView selectedRange].location;
663
- // } else {
664
- // [printTextView setString:FRACurrentText];
665
- // }
666
- //
667
- // if ([[FRACurrentDocument valueForKey:@"isSyntaxColoured"] boolValue] == YES && [[FRADefaults valueForKey:@"PrintSyntaxColours"] boolValue] == YES) {
668
- // FRATextView *textView = [FRACurrentDocument valueForKey:@"firstTextView"];
669
- // FRALayoutManager *layoutManager = (FRALayoutManager *)[textView layoutManager];
670
- // NSTextStorage *textStorage = [printTextView textStorage];
671
- // NSInteger lastCharacter = [[textView string] length];
672
- // [layoutManager removeTemporaryAttribute:NSBackgroundColorAttributeName forCharacterRange:NSMakeRange(0, lastCharacter)];
673
- // NSInteger index = 0;
674
- // if (printOnlySelection == YES) {
675
- // index = [FRACurrentTextView selectedRange].location;
676
- // lastCharacter = NSMaxRange([FRACurrentTextView selectedRange]);
677
- // [[FRACurrentDocument valueForKey:@"syntaxColouring"] recolourRange:[FRACurrentTextView selectedRange]];
678
- // } else {
679
- // [[FRACurrentDocument valueForKey:@"syntaxColouring"] recolourRange:NSMakeRange(0, lastCharacter)];
680
- // }
681
- // NSRange range;
682
- // NSDictionary *attributes;
683
- // NSInteger rangeLength = 0;
684
- // while (index < lastCharacter) {
685
- // attributes = [layoutManager temporaryAttributesAtCharacterIndex:index effectiveRange:&range];
686
- // rangeLength = range.length;
687
- // if ([attributes count] != 0) {
688
- // if (printOnlySelection == YES) {
689
- // [textStorage setAttributes:attributes range:NSMakeRange(range.location - selectionLocation, rangeLength)];
690
- // } else {
691
- // [textStorage setAttributes:attributes range:range];
692
- // }
693
- // }
694
- // if (rangeLength != 0) {
695
- // index = index + rangeLength;
696
- // } else {
697
- // index++;
698
- // }
699
- // }
700
- // }
701
- // }
702
- //
703
- // [printTextView setFont:[NSUnarchiver unarchiveObjectWithData:[FRADefaults valueForKey:@"PrintFont"]]];
704
- //
705
- // return printTextView;
706
- //
707
- // }
708
627
@end
0 commit comments