Revision: 14368
          http://sourceforge.net/p/skim-app/code/14368
Author:   hofman
Date:     2024-07-10 09:32:45 +0000 (Wed, 10 Jul 2024)
Log Message:
-----------
use macros to convert between temporary tool mode and note type

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

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2024-07-09 09:28:39 UTC (rev 14367)
+++ trunk/SKPDFView.m   2024-07-10 09:32:45 UTC (rev 14368)
@@ -87,6 +87,9 @@
 
 #define IS_MARKUP(noteType) (noteType == SKHighlightNote || noteType == 
SKUnderlineNote || noteType == SKStrikeOutNote)
 
+#define NOTE_TYPE_FROM_TEMP_TOOL_MODE(tempToolMode) (SKNoteType)tempToolMode
+#define TEMP_TOOL_MODE_FROM_NOTE_TYPE(noteType) (SKTemporaryToolMode)noteType
+
 #define READINGBAR_RESIZE_EDGE_HEIGHT 3.0
 #define NAVIGATION_BOTTOM_EDGE_HEIGHT 5.0
 
@@ -1930,7 +1933,7 @@
             [self setCurrentAnnotation:nil];
             [super mouseDown:theEvent];
             if ([[self currentSelection] hasCharacters]) {
-                [self addAnnotationWithType:(SKNoteType)temporaryToolMode];
+                [self 
addAnnotationWithType:NOTE_TYPE_FROM_TEMP_TOOL_MODE(temporaryToolMode)];
                 [self setCurrentSelection:nil];
             }
         }
@@ -2780,7 +2783,7 @@
 
 - (void)addAnnotationWithType:(SKNoteType)annotationType {
     if ((toolMode == SKTextToolMode || toolMode == SKNoteToolMode) && 
(annotationType == SKInkNote || (annotationType >= SKHighlightNote && 
annotationType <= SKStrikeOutNote && [[self currentSelection] hasCharacters] == 
NO))) {
-        [self setTemporaryToolMode:(SKTemporaryToolMode)annotationType];
+        [self 
setTemporaryToolMode:TEMP_TOOL_MODE_FROM_NOTE_TYPE(annotationType)];
     } else {
         [self addAnnotationWithType:annotationType context:nil];
     }
@@ -5246,7 +5249,7 @@
         case SKNoToolMode:       return [NSCursor arrowCursor];
         case SKZoomToolMode:     return [NSCursor zoomInCursor];
         case SKSnapshotToolMode: return [NSCursor cameraCursor];
-        default:                 return [self 
cursorForNoteType:(SKNoteType)temporaryToolMode];
+        default:                 return [self 
cursorForNoteType:NOTE_TYPE_FROM_TEMP_TOOL_MODE(temporaryToolMode)];
     }
     return [NSCursor arrowCursor];
 }

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

Reply via email to