Changeset 484

Show
Ignore:
Timestamp:
07/14/08 3:21:55 AM (3 months ago)
Author:
nicholas
Message:

APEMain.m: Fix selection failure with Xcode 3.1.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ICeCoffEE/ICeCoffEE/APEMain.m

    r469 r484  
    137137        ICapeprintf("loaded in PDFView for PDFKit\n"); 
    138138        ICCF_loadedInPDFKit = true; 
    139     }   
     139    } 
    140140} 
    141141 
     
    151151    if (bundleID != NULL) { 
    152152        if (ICCF_CFBundleIDMatches(bundleID, CFSTR("com.apple.xcode"))) { 
    153             if (ICCF_PatchMethod("XCTextView", "ICeCoffEE", "ICeCoffEESuper", "mouseDown:")) { 
    154                 ICCF_PatchMethod("XCSourceCodeTextView", "ICeCoffEEMenuOnly", "ICeCoffEEMenuSuper", "menuForEvent:"); 
    155                 ICCF_PatchMethod("XCDiffTextView", "ICeCoffEE", "ICeCoffEESuper", "mouseDown:"); 
    156                 ICCF_PatchMethod("XCDiffTextView", "ICeCoffEE", "ICeCoffEESuper", "menuForEvent:"); // subclass of PBXTextView; patching both is bad 
     153            if (ICCF_PatchMethod("XCSourceCodeTextView", "ICeCoffEEMenuOnly", "ICeCoffEEMenuSuper", "menuForEvent:")) { 
     154                // Xcode 3.x: XCSourceCodeTextView < XCTextView < NSTextView for source 
     155                //            XCDiffTextView < PBXTextView < NSTextView for rich text 
     156                ICCF_PatchMethod("NSTextView", "ICeCoffEE", "ICeCoffEESuper", "mouseDown:"); 
     157                ICCF_PatchMethod("XCDiffTextView", "ICeCoffEE", "ICeCoffEESuper", "menuForEvent:"); 
     158                    // subclass of PBXTextView; patching both is bad 
    157159                ICCF_PatchMethod("NSTextView", "ICeCoffEE", "ICeCoffEESuper", "clickedOnLink:atIndex:"); 
    158160            } else { 
     161                // Xcode 2.x: both source and rich text views are PBXTextView 
    159162                ICCF_PatchMethod("PBXTextView", "ICeCoffEEMenuOnly", "ICeCoffEEMenuSuper", "menuForEvent:"); 
    160163            }