Revision: 3105
          http://skim-app.svn.sourceforge.net/skim-app/?rev=3105&view=rev
Author:   hofman
Date:     2007-10-31 02:59:03 -0700 (Wed, 31 Oct 2007)

Log Message:
-----------
Attempt to enable highlight tool note in Leopard. Text selection does not call 
mouseUp:, so it may be handled in an event loop.

Only fix change count in Tiger, as the bug is probably fixed in Leopard.

Modified Paths:
--------------
    trunk/SKPDFView.m

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2007-10-30 21:49:16 UTC (rev 3104)
+++ trunk/SKPDFView.m   2007-10-31 09:59:03 UTC (rev 3105)
@@ -1014,12 +1014,17 @@
                 case SKNoteToolMode:
                     if ([self selectAnnotationWithEvent:theEvent] == NO &&
                         (toolMode == SKTextToolMode || hideNotes || 
annotationMode == SKHighlightNote || annotationMode == SKUnderlineNote || 
annotationMode == SKStrikeOutNote)) {
-                        if (area == kPDFPageArea && [[page 
selectionForRect:NSMakeRect(p.x - 30.0, p.y - 40.0, 60.0, 80.0)] string] == nil)
+                        if (area == kPDFPageArea && [[page 
selectionForRect:NSMakeRect(p.x - 30.0, p.y - 40.0, 60.0, 80.0)] string] == 
nil) {
                             [self dragWithEvent:theEvent];
-                        else if (nil == activeAnnotation && 
mouseDownInAnnotation)
+                        } else if (nil == activeAnnotation && 
mouseDownInAnnotation) {
                             [self selectTextWithEvent:theEvent];
-                        else
+                        } else {
                             [super mouseDown:theEvent];
+                            if (NSAppKitVersion floor(NSAppKitVersionNumber) > 
NSAppKitVersionNumber10_4 && toolMode == SKNoteToolMode && hideNotes == NO && 
[self currentSelection] && (annotationMode == SKHighlightNote || annotationMode 
== SKUnderlineNote || annotationMode == SKStrikeOutNote)) {
+                                [self 
addAnnotationFromSelectionWithType:annotationMode];
+                                [self setCurrentSelection:nil];
+                            }
+                        }
                     }
                     break;
                 case SKMoveToolMode:
@@ -1079,7 +1084,8 @@
             if (didBeginUndoGrouping) {
                 [[self undoManager] endUndoGrouping];
                 // due to an Appkit bug, endUndoGrouping registers an extra 
change count, which is not reverted when the group is undone
-                [[[[self window] windowController] document] 
updateChangeCount:NSChangeUndone];
+                if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_4)
+                    [[[[self window] windowController] document] 
updateChangeCount:NSChangeUndone];
             }
             draggingAnnotation = NO;
             break;


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: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to