テキストエディタ「原稿」の場所
Revision | 84f38371ddfcf9dc4c708b5b37bb866777ae7298 (tree) |
---|---|
Time | 2012-08-30 09:28:17 |
Author | 二鏡 <haliccon@gmai...> |
Commiter | 二鏡 |
色々改善版
@@ -256,7 +256,7 @@ static id _sid; | ||
256 | 256 | return NSMakeRange(NSNotFound,0); |
257 | 257 | |
258 | 258 | CFIndex i; |
259 | - CFIndex first,last; | |
259 | + CFIndex first = 0,last = 0; | |
260 | 260 | for(i=0;i<limit;i++) |
261 | 261 | { |
262 | 262 | if([invalidIndexes containsIndex: i] == NO) |
@@ -378,7 +378,7 @@ _outdatedCharacterRange(NSTextStorage *storage) | ||
378 | 378 | |
379 | 379 | CFIndex location = 0; |
380 | 380 | CFIndex idx = 0; // block index |
381 | - CFIndex length; | |
381 | + CFIndex length = 0; | |
382 | 382 | |
383 | 383 | if(syncCache_.valid()) |
384 | 384 | { |
@@ -208,7 +208,8 @@ static CGFloat cCaretInterval = 0.6; | ||
208 | 208 | return; |
209 | 209 | } |
210 | 210 | |
211 | - NSPoint point = [self convertPointFromBase: [theEvent locationInWindow]]; | |
211 | + NSPoint point = [self convertPoint: [theEvent locationInWindow] | |
212 | + fromView: nil]; | |
212 | 213 | _dragState.onSelection = NO; |
213 | 214 | |
214 | 215 | NSInteger clickCount = [theEvent clickCount]; |
@@ -283,7 +284,8 @@ static CGFloat cCaretInterval = 0.6; | ||
283 | 284 | return; |
284 | 285 | } |
285 | 286 | |
286 | - NSPoint point = [self convertPointFromBase: [theEvent locationInWindow]]; | |
287 | + NSPoint point = [self convertPoint: [theEvent locationInWindow] | |
288 | + fromView: nil]; | |
287 | 289 | |
288 | 290 | if(_dragState.onSelection) |
289 | 291 | { |
@@ -598,9 +600,11 @@ static CGFloat cCaretInterval = 0.6; | ||
598 | 600 | } |
599 | 601 | |
600 | 602 | id subString = [storage attributedSubstringFromRange: range]; |
603 | + [undoManager disableUndoRegistration]; | |
601 | 604 | [self deleteCharactersInRange: range]; |
602 | 605 | [self insertText: subString |
603 | 606 | replacementRange: NSMakeRange(index,0)]; |
607 | + [undoManager enableUndoRegistration]; | |
604 | 608 | |
605 | 609 | self.selectedRange = NSMakeRange(index, range.length); |
606 | 610 | inputState.reset_selection_anchor(); |
@@ -868,7 +868,9 @@ readObjectFromPasteboard(NSPasteboard *pboard, Class aClass) | ||
868 | 868 | _dropState.dragging = YES; |
869 | 869 | |
870 | 870 | BOOL isTail; |
871 | - NSPoint point = [self convertPointFromBase: [sender draggingLocation]]; | |
871 | +// NSPoint point = [self convertPointFromBase: [sender draggingLocation]]; | |
872 | + NSPoint point = [self convertPoint: [sender draggingLocation] | |
873 | + fromView: nil]; | |
872 | 874 | caretState.locator = [pager_ indexOfCharacterOfNearestBorderAtPoint: point |
873 | 875 | isTail: &isTail]; |
874 | 876 |
@@ -905,7 +907,8 @@ readObjectFromPasteboard(NSPasteboard *pboard, Class aClass) | ||
905 | 907 | return NSDragOperationNone; |
906 | 908 | |
907 | 909 | BOOL isTail; |
908 | - NSPoint point = [self convertPointFromBase: [sender draggingLocation]]; | |
910 | + NSPoint point = [self convertPoint: [sender draggingLocation] | |
911 | + fromView: nil]; | |
909 | 912 | caretState.locator = [pager_ indexOfCharacterOfNearestBorderAtPoint: point |
910 | 913 | isTail: &isTail]; |
911 | 914 | if(caretState.locator != NSNotFound) |
@@ -52,11 +52,11 @@ | ||
52 | 52 | <key>CFBundlePackageType</key> |
53 | 53 | <string>APPL</string> |
54 | 54 | <key>CFBundleShortVersionString</key> |
55 | - <string>1.2.1</string> | |
55 | + <string>1.2.2</string> | |
56 | 56 | <key>CFBundleSignature</key> |
57 | 57 | <string>????</string> |
58 | 58 | <key>CFBundleVersion</key> |
59 | - <string>4</string> | |
59 | + <string>f</string> | |
60 | 60 | <key>LSApplicationCategoryType</key> |
61 | 61 | <string>public.app-category.productivity</string> |
62 | 62 | <key>LSHasLocalizedDisplayName</key> |
@@ -48,7 +48,7 @@ void _GlyphBufferSpace::loadStage2metrics(CTFontOrientation orientation) | ||
48 | 48 | { |
49 | 49 | CGSize *advance_ptr = &(advances[0]); |
50 | 50 | CGSize *translate_ptr = &translations[0]; |
51 | - GlyphMetricsCache *storage; | |
51 | + GlyphMetricsCache *storage = NULL; | |
52 | 52 | GlyphMetricsLoader &loader = glyphLoader; |
53 | 53 | |
54 | 54 | vector<AttributesAdapter>::const_iterator it = target->attributes.begin(); |
@@ -82,11 +82,14 @@ void _GlyphBufferSpace::loadStage2metrics(CTFontOrientation orientation) | ||
82 | 82 | advances[i] = metric->advance; |
83 | 83 | } |
84 | 84 | } |
85 | - } | |
86 | - loader.load(orientation); | |
87 | - loader.write_back(translate_ptr, advance_ptr); | |
88 | - loader.memory(storage); | |
89 | - loader.reset(); | |
85 | + } | |
86 | + if(storage) | |
87 | + { | |
88 | + loader.load(orientation); | |
89 | + loader.write_back(translate_ptr, advance_ptr); | |
90 | + loader.memory(storage); | |
91 | + loader.reset(); | |
92 | + } | |
90 | 93 | } |
91 | 94 | |
92 | 95 | void _GlyphBufferSpace::loadStage3attributes() |