Revision: 15204
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15204&view=rev
Author: hofman
Date: 2009-04-27 09:07:09 +0000 (Mon, 27 Apr 2009)
Log Message:
-----------
Don't condition editing as complex string on the complex string editor, because
that's not necessary anymore for editing anyway. Don't set cell value, because
the edited cell will be a different copy anyway.
Modified Paths:
--------------
trunk/bibdesk/BDSKEditor.m
trunk/bibdesk/BDSKMacroWindowController.m
trunk/bibdesk/BDSKTextImportController.m
Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m 2009-04-27 04:58:35 UTC (rev 15203)
+++ trunk/bibdesk/BDSKEditor.m 2009-04-27 09:07:09 UTC (rev 15204)
@@ -1816,14 +1816,15 @@
if (row == -1)
return;
[self editSelectedCellAsMacro];
- if([tableView editedRow] != row)
+ if ([tableView editedRow] != row)
[tableView editColumn:1 row:row withEvent:nil select:YES];
}
- (BOOL)editSelectedCellAsMacro{
NSInteger row = [tableView selectedRow];
- if ([complexStringEditor isEditing] || row == -1)
- return NO;
+ // this should never happen
+ if ([complexStringEditor isEditing] || row == -1)
+ return NO;
if (complexStringEditor == nil) {
complexStringEditor = [[BDSKComplexStringEditor alloc]
initWithMacroResolver:[[publication owner] macroResolver]];
[complexStringEditor setEditable:isEditable];
@@ -1833,14 +1834,14 @@
[tableCellFormatter setEditAsComplexString:YES];
if (fieldEditor) {
[fieldEditor setString:[tableCellFormatter
editingStringForObjectValue:value]];
- [[[tableView tableColumnWithIdentifier:@"value"]
dataCellForRow:row] setObjectValue:value];
[fieldEditor selectAll:self];
}
- return [complexStringEditor attachToTableView:tableView atRow:row
column:1 withValue:value];
+ [complexStringEditor attachToTableView:tableView atRow:row column:1
withValue:value];
+ return YES;
}
- (BOOL)formatter:(BDSKComplexStringFormatter *)formatter
shouldEditAsComplexString:(NSString *)object {
- return [self editSelectedCellAsMacro];
+ return [self editSelectedCellAsMacro];
}
// this is called when the user actually starts editing
Modified: trunk/bibdesk/BDSKMacroWindowController.m
===================================================================
--- trunk/bibdesk/BDSKMacroWindowController.m 2009-04-27 04:58:35 UTC (rev
15203)
+++ trunk/bibdesk/BDSKMacroWindowController.m 2009-04-27 09:07:09 UTC (rev
15204)
@@ -345,7 +345,8 @@
- (BOOL)editSelectedCellAsMacro{
NSInteger row = [tableView selectedRow];
- if ([complexStringEditor isEditing] || row == -1)
+ // this should never happen
+ if ([complexStringEditor isEditing] || row == -1)
return NO;
if(complexStringEditor == nil) {
complexStringEditor = [[BDSKComplexStringEditor alloc]
initWithMacroResolver:macroResolver];
@@ -357,16 +358,16 @@
[tableCellFormatter setEditAsComplexString:YES];
if (fieldEditor) {
[fieldEditor setString:[tableCellFormatter
editingStringForObjectValue:value]];
- [[[tableView tableColumnWithIdentifier:@"value"]
dataCellForRow:row] setObjectValue:value];
[fieldEditor selectAll:self];
}
- return [complexStringEditor attachToTableView:tableView atRow:row
column:1 withValue:value];
+ [complexStringEditor attachToTableView:tableView atRow:row column:1
withValue:value];
+ return YES;
}
#pragma mark BDSKMacroFormatter delegate
- (BOOL)formatter:(BDSKComplexStringFormatter *)formatter
shouldEditAsComplexString:(NSString *)object {
- return [self editSelectedCellAsMacro];
+ return [self editSelectedCellAsMacro];
}
#pragma mark NSControl text delegate
Modified: trunk/bibdesk/BDSKTextImportController.m
===================================================================
--- trunk/bibdesk/BDSKTextImportController.m 2009-04-27 04:58:35 UTC (rev
15203)
+++ trunk/bibdesk/BDSKTextImportController.m 2009-04-27 09:07:09 UTC (rev
15204)
@@ -1363,6 +1363,7 @@
- (BOOL)editSelectedCellAsMacro{
NSInteger row = [itemTableView selectedRow];
+ // this should never happen
if ([complexStringEditor isEditing] || row == -1 || [[fields
objectAtIndex:row] isEqualToString:BDSKCrossrefString] || [[fields
objectAtIndex:row] isCitationField])
return NO;
if (complexStringEditor == nil)
@@ -1372,16 +1373,16 @@
[tableCellFormatter setEditAsComplexString:YES];
if (fieldEditor) {
[fieldEditor setString:[tableCellFormatter
editingStringForObjectValue:value]];
- [[[itemTableView tableColumnWithIdentifier:@"value"]
dataCellForRow:row] setObjectValue:value];
[fieldEditor selectAll:self];
}
- return [complexStringEditor attachToTableView:itemTableView atRow:row
column:2 withValue:value];
+ [complexStringEditor attachToTableView:itemTableView atRow:row column:2
withValue:value];
+ return YES;
}
#pragma mark BDSKMacroFormatter delegate
- (BOOL)formatter:(BDSKComplexStringFormatter *)formatter
shouldEditAsComplexString:(NSString *)object {
- return [self editSelectedCellAsMacro];
+ return [self editSelectedCellAsMacro];
}
#pragma mark BDSKCitationFormatter and TextImportItemTableView delegate
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensign option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit