Revision: 4780
http://skim-app.svn.sourceforge.net/skim-app/?rev=4780&view=rev
Author: hofman
Date: 2008-10-12 21:14:01 +0000 (Sun, 12 Oct 2008)
Log Message:
-----------
Don't call selector on dictionary, use valueForKey. Remove unused code lines.
Modified Paths:
--------------
trunk/SKMainWindowController_UI.m
trunk/SKNotesDocument.m
Modified: trunk/SKMainWindowController_UI.m
===================================================================
--- trunk/SKMainWindowController_UI.m 2008-10-12 20:20:15 UTC (rev 4779)
+++ trunk/SKMainWindowController_UI.m 2008-10-12 21:14:01 UTC (rev 4780)
@@ -863,20 +863,14 @@
}
int i, count = [items count];
- NSMutableIndexSet *rowIndexes = [NSMutableIndexSet indexSet];
- int row;
- id item;
for (i = 0; i < count; i++) {
- item = [items objectAtIndex:i];
+ id item = [items objectAtIndex:i];
[cell setObjectValue:[item type] ? (id)[item string] : (id)[item
text]];
NSAttributedString *attrString = [cell attributedStringValue];
NSRect rect = [attrString boundingRectWithSize:[item type] ? size :
smallSize options:NSStringDrawingUsesLineFragmentOrigin];
float height = fmaxf(NSHeight(rect) + 3.0, rowHeight + 2.0);
CFDictionarySetValue(rowHeights, (const void *)item, &height);
- row = [noteOutlineView rowForItem:item];
- if (row != -1)
- [rowIndexes addIndex:row];
}
// don't use noteHeightOfRowsWithIndexesChanged: as this only updates the
visible rows and the scrollers
[noteOutlineView reloadData];
Modified: trunk/SKNotesDocument.m
===================================================================
--- trunk/SKNotesDocument.m 2008-10-12 20:20:15 UTC (rev 4779)
+++ trunk/SKNotesDocument.m 2008-10-12 21:14:01 UTC (rev 4780)
@@ -381,19 +381,13 @@
}
int i, count = [items count];
- NSMutableIndexSet *rowIndexes = [NSMutableIndexSet indexSet];
- int row;
- id item;
for (i = 0; i < count; i++) {
- item = [items objectAtIndex:i];
+ id item = [items objectAtIndex:i];
[cell setObjectValue:[item valueForKey:([item
valueForKey:SKNPDFAnnotationTypeKey] ? SKNPDFAnnotationStringKey :
SKNPDFAnnotationTextKey)]];
NSAttributedString *attrString = [cell attributedStringValue];
- NSRect rect = [attrString boundingRectWithSize:[item type] ? size :
smallSize options:NSStringDrawingUsesLineFragmentOrigin];
+ NSRect rect = [attrString boundingRectWithSize:[item
valueForKey:SKNPDFAnnotationTypeKey] ? size : smallSize
options:NSStringDrawingUsesLineFragmentOrigin];
[item setValue:[NSNumber numberWithFloat:fmaxf(NSHeight(rect) + 3.0,
rowHeight + 2.0)] forKey:SKNotesDocumentRowHeightKey];
- row = [outlineView rowForItem:item];
- if (row != -1)
- [rowIndexes addIndex:row];
}
// don't use noteHeightOfRowsWithIndexesChanged: as this only updates the
visible rows and the scrollers
[outlineView reloadData];
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 the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit