Revision: 15272
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=15272&view=rev
Author: hofman
Date: 2009-05-05 18:19:44 +0000 (Tue, 05 May 2009)
Log Message:
-----------
don't compare booleans to YES, because a true value may not equal 1.
Modified Paths:
--------------
trunk/bibdesk/BDSKBibTeXParser.m
trunk/bibdesk/BDSKComplexString.m
trunk/bibdesk/BDSKComplexStringEditor.m
trunk/bibdesk/BDSKCondition.m
trunk/bibdesk/BDSKEditor.m
trunk/bibdesk/BDSKFieldEditor.m
trunk/bibdesk/BDSKFiler.m
trunk/bibdesk/BDSKFindController.m
trunk/bibdesk/BDSKSharedGroup.m
trunk/bibdesk/BDSKStatusBar.m
trunk/bibdesk/BDSKTextImportController.m
trunk/bibdesk/BDSKTextViewCompletionController.m
trunk/bibdesk/BibDocument+Scripting.m
trunk/bibdesk/BibDocument.m
trunk/bibdesk/BibDocument_Actions.m
trunk/bibdesk/BibDocument_DataSource.m
trunk/bibdesk/BibDocument_Groups.m
trunk/bibdesk/BibDocument_Menus.m
trunk/bibdesk/BibItem.m
trunk/bibdesk/BibPref_Defaults.m
trunk/bibdesk/BibPref_Sharing.m
trunk/bibdesk/NSFileManager_BDSKExtensions.m
trunk/bibdesk/NSString_BDSKExtensions.m
Modified: trunk/bibdesk/BDSKBibTeXParser.m
===================================================================
--- trunk/bibdesk/BDSKBibTeXParser.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BDSKBibTeXParser.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -825,7 +825,7 @@
while(field = bt_next_value(entry, field, NULL, &text)){
if(text){
- if(firstValue == TRUE){
+ if(firstValue){
firstValue = FALSE;
if(strlen(text) >= smartGroupStrLength && strncmp(text,
smartGroupStr, smartGroupStrLength) == 0)
isSmartGroup = TRUE;
Modified: trunk/bibdesk/BDSKComplexString.m
===================================================================
--- trunk/bibdesk/BDSKComplexString.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BDSKComplexString.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -462,7 +462,7 @@
}
- (BDSKMacroResolver *)macroResolver{
- return (macroResolver == nil && complex == YES) ? [BDSKMacroResolver
defaultMacroResolver] : macroResolver;
+ return (macroResolver == nil && complex) ? [BDSKMacroResolver
defaultMacroResolver] : macroResolver;
}
@end
Modified: trunk/bibdesk/BDSKComplexStringEditor.m
===================================================================
--- trunk/bibdesk/BDSKComplexStringEditor.m 2009-05-05 18:16:08 UTC (rev
15271)
+++ trunk/bibdesk/BDSKComplexStringEditor.m 2009-05-05 18:19:44 UTC (rev
15272)
@@ -226,7 +226,7 @@
lowerEdgeRect = NSIntersectionRect(lowerEdgeRect, [contentView
visibleRect]);
// see if the cell's lower edge is scrolled out of sight
if (NSIsEmptyRect(lowerEdgeRect)) {
- if ([self isWindowVisible] == YES) {
+ if ([self isWindowVisible]) {
[[tableView window] removeChildWindow:[self window]];
[[self window] orderOut:self];
}
Modified: trunk/bibdesk/BDSKCondition.m
===================================================================
--- trunk/bibdesk/BDSKCondition.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BDSKCondition.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -197,7 +197,7 @@
}
- (BOOL)isSatisfiedByItem:(BibItem *)item {
- if ([NSString isEmptyString:key] == YES)
+ if ([NSString isEmptyString:key])
return YES; // empty condition matches anything
if ([self isDateCondition]) {
@@ -269,7 +269,7 @@
return NO == isContain;
} else {
if (stringComparison == BDSKGroupContain)
- return ([item isContainedInGroupNamed:stringValue
forField:key] == YES);
+ return ([item isContainedInGroupNamed:stringValue
forField:key]);
if (stringComparison == BDSKGroupNotContain)
return ([item isContainedInGroupNamed:stringValue
forField:key] == NO);
}
Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BDSKEditor.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -1498,7 +1498,7 @@
return ([NSString isEmptyString:[publication
valueOfField:BDSKCrossrefString inherit:NO]] == NO);
}
else if (theAction == @selector(createNewPubUsingCrossrefAction:)) {
- return (isEditable && [NSString isEmptyString:[publication
valueOfField:BDSKCrossrefString inherit:NO]] == YES);
+ return (isEditable && [NSString isEmptyString:[publication
valueOfField:BDSKCrossrefString inherit:NO]]);
}
else if (theAction == @selector(openLinkedFile:)) {
return [menuItem representedObject] != nil || [[publication
valueForKey:@"linkedFiles"] count] > 0;
Modified: trunk/bibdesk/BDSKFieldEditor.m
===================================================================
--- trunk/bibdesk/BDSKFieldEditor.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BDSKFieldEditor.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -348,7 +348,7 @@
- (void)doAutoCompleteIfPossible {
if (completionWindowIsVisibleForTextView(self) == NO && isEditing) {
if ([[self delegate]
respondsToSelector:@selector(textViewShouldAutoComplete:)] &&
- [[self delegate] textViewShouldAutoComplete:self] == YES)
+ [[self delegate] textViewShouldAutoComplete:self])
[self complete:self]; // NB: the self argument is critical here
(see comment in complete:)
}
}
Modified: trunk/bibdesk/BDSKFiler.m
===================================================================
--- trunk/bibdesk/BDSKFiler.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BDSKFiler.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -120,7 +120,7 @@
}
NSInteger mask = BDSKInitialAutoFileOptionMask;
- if (check == YES) mask |= BDSKCheckCompleteAutoFileOptionMask;
+ if (check) mask |= BDSKCheckCompleteAutoFileOptionMask;
[self movePapers:papers forField:BDSKLocalFileString fromDocument:doc
options:mask];
}
@@ -139,7 +139,7 @@
BOOL initial = (mask & BDSKInitialAutoFileOptionMask);
BOOL force = (mask & BDSKForceAutoFileOptionMask);
- BOOL check = (initial == YES) && (force == NO) && (mask &
BDSKCheckCompleteAutoFileOptionMask);
+ BOOL check = (initial) && (force == NO) && (mask &
BDSKCheckCompleteAutoFileOptionMask);
if (numberOfPapers == 0)
return;
@@ -312,7 +312,7 @@
for (i = 0; i < count; i++) {
info = [self objectInErrorInfoDictsAtIndex:i];
- if ([[info objectForKey:SELECT_KEY] boolValue] == YES) {
+ if ([[info objectForKey:SELECT_KEY] boolValue]) {
if (options & BDSKInitialAutoFileOptionMask) {
[fileInfoDicts addObject:[info objectForKey:PUBLICATION_KEY]];
} else {
Modified: trunk/bibdesk/BDSKFindController.m
===================================================================
--- trunk/bibdesk/BDSKFindController.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BDSKFindController.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -452,7 +452,7 @@
}
return NO;
}
- } else if([self findAsMacro] == YES) { // check the "find" complex
string
+ } else if([self findAsMacro]) { // check the "find" complex string
NSString *reason = nil;
if ([self stringIsValidAsComplexString:*value
errorMessage:&reason] == NO) {
if(error != nil){
@@ -468,7 +468,7 @@
- (BOOL)validateReplaceString:(id *)value error:(NSError **)error {
NSString *reason = nil;
- if ([self searchType] == FCTextualSearch && [self replaceAsMacro] ==
YES &&
+ if ([self searchType] == FCTextualSearch && [self replaceAsMacro] &&
[self stringIsValidAsComplexString:*value errorMessage:&reason]
== NO) {
if(error != nil){
NSString *description = NSLocalizedString(@"Invalid BibTeX
Macro.", @"Error description");
@@ -509,7 +509,7 @@
- (BOOL)validateFindAsMacro:(id *)value error:(NSError **)error {
NSString *reason = nil;
- if ([*value boolValue] == YES && [self searchType] == FCTextualSearch &&
+ if ([*value boolValue] && [self searchType] == FCTextualSearch &&
[self stringIsValidAsComplexString:[self findString]
errorMessage:&reason] == NO) {
if(error != nil){
NSString *description = NSLocalizedString(@"Invalid BibTeX Macro",
@"Error description");
@@ -524,7 +524,7 @@
- (BOOL)validateReplaceAsMacro:(id *)value error:(NSError **)error {
NSString *reason = nil;
- if([*value boolValue] == YES && [self searchType] == FCTextualSearch &&
+ if([*value boolValue] && [self searchType] == FCTextualSearch &&
[self stringIsValidAsComplexString:[self replaceString]
errorMessage:&reason] == NO){
if(error != nil){
NSString *description = NSLocalizedString(@"Invalid BibTeX Macro",
@"Error description");
@@ -748,7 +748,7 @@
}
- (void)replaceAllInSelection:(BOOL)selection{
- if (selection == YES)
+ if (selection)
[self setSearchSelection:YES];
[statusBar setStringValue:@""];
Modified: trunk/bibdesk/BDSKSharedGroup.m
===================================================================
--- trunk/bibdesk/BDSKSharedGroup.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BDSKSharedGroup.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -195,7 +195,7 @@
- (BDSKPublicationsArray *)publications;
{
- if([self isRetrieving] == NO && ([self needsUpdate] == YES || publications
== nil)){
+ if([self isRetrieving] == NO && ([self needsUpdate] || publications ==
nil)){
// let the server get the publications asynchronously
[client retrievePublications];
Modified: trunk/bibdesk/BDSKStatusBar.m
===================================================================
--- trunk/bibdesk/BDSKStatusBar.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BDSKStatusBar.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -213,7 +213,7 @@
} else {
NSRect statusRect = [contentView bounds];
statusRect.size.height = NSHeight([self frame]);
- if ([contentView isFlipped] == YES)
+ if ([contentView isFlipped])
statusRect.origin.y = NSMaxY([contentView bounds]) -
NSHeight(statusRect);
[self setFrame:statusRect];
[contentView addSubview:self positioned:NSWindowBelow
relativeTo:nil];
Modified: trunk/bibdesk/BDSKTextImportController.m
===================================================================
--- trunk/bibdesk/BDSKTextImportController.m 2009-05-05 18:16:08 UTC (rev
15271)
+++ trunk/bibdesk/BDSKTextImportController.m 2009-05-05 18:19:44 UTC (rev
15272)
@@ -1285,7 +1285,7 @@
[layoutManager addTemporaryAttributes:highlightAttrs
forCharacterRange:selRange];
}
- if ([NSString isEmptyString:selString] == YES)
+ if ([NSString isEmptyString:selString])
return NO;
NSString *oldValue = [item valueOfField:selKey];
@@ -1600,7 +1600,7 @@
}
- (void)startTemporaryTypeSelectMode{
- if (temporaryTypeSelectMode == YES)
+ if (temporaryTypeSelectMode)
return;
temporaryTypeSelectMode = YES;
savedFirstResponder = [[self window] firstResponder];
Modified: trunk/bibdesk/BDSKTextViewCompletionController.m
===================================================================
--- trunk/bibdesk/BDSKTextViewCompletionController.m 2009-05-05 18:16:08 UTC
(rev 15271)
+++ trunk/bibdesk/BDSKTextViewCompletionController.m 2009-05-05 18:19:44 UTC
(rev 15272)
@@ -218,8 +218,8 @@
- (void)endDisplayAndComplete:(BOOL)complete;
{
- BOOL shouldComplete = (complete == YES && [tableView selectedRow] >= 0);
- if(shouldComplete == YES || movement == NSCancelTextMovement){
+ BOOL shouldComplete = (complete && [tableView selectedRow] >= 0);
+ if(shouldComplete || movement == NSCancelTextMovement){
// first revert to the original state, so undo will register the full
change
// if we do this when shouldComplete == NO, it restores the original
string and effectively prevents modifying the text (i.e. all non-completable
text is deleted when you tab out)
[[textView undoManager] disableUndoRegistration];
Modified: trunk/bibdesk/BibDocument+Scripting.m
===================================================================
--- trunk/bibdesk/BibDocument+Scripting.m 2009-05-05 18:16:08 UTC (rev
15271)
+++ trunk/bibdesk/BibDocument+Scripting.m 2009-05-05 18:19:44 UTC (rev
15272)
@@ -263,19 +263,19 @@
[cmd setScriptErrorNumber:NSReceiversCantHandleCommandScriptError];
[cmd setScriptErrorString:NSLocalizedString(@"Cannot add
group.",@"Error description")];
return;
- } else if ([group isSmart] == YES) {
+ } else if ([group isSmart]) {
[groups addSmartGroup:(BDSKSmartGroup *)group];
[[self undoManager]
setActionName:NSLocalizedString(@"AppleScript",@"Undo action name for
AppleScript")];
- } else if ([group isStatic] == YES && [group
isKindOfClass:[BDSKLastImportGroup class]] == NO) {
+ } else if ([group isStatic] && [group isKindOfClass:[BDSKLastImportGroup
class]] == NO) {
[groups addStaticGroup:(BDSKStaticGroup *)group];
[[self undoManager]
setActionName:NSLocalizedString(@"AppleScript",@"Undo action name for
AppleScript")];
- } else if ([group isURL] == YES) {
+ } else if ([group isURL]) {
[groups addURLGroup:(BDSKURLGroup *)group];
[[self undoManager]
setActionName:NSLocalizedString(@"AppleScript",@"Undo action name for
AppleScript")];
- } else if ([group isScript] == YES) {
+ } else if ([group isScript]) {
[groups addScriptGroup:(BDSKScriptGroup *)group];
[[self undoManager]
setActionName:NSLocalizedString(@"AppleScript",@"Undo action name for
AppleScript")];
- } else if ([group isSearch] == YES) {
+ } else if ([group isSearch]) {
[groups addSearchGroup:(BDSKSearchGroup *)group];
} else {
NSScriptCommand *cmd = [NSScriptCommand currentCommand];
@@ -291,19 +291,19 @@
- (void)removeObjectFromScriptingGroupsAtIndex:(NSUInteger)idx {
BDSKGroup *group = [[groups staticGroups] objectAtIndex:idx];
- if ([group isSmart] == YES) {
+ if ([group isSmart]) {
[groups removeSmartGroup:(BDSKSmartGroup *)group];
[[self undoManager]
setActionName:NSLocalizedString(@"AppleScript",@"Undo action name for
AppleScript")];
- } else if ([group isStatic] == YES && [group isEqual:[groups
lastImportGroup]] == NO) {
+ } else if ([group isStatic] && [group isEqual:[groups lastImportGroup]] ==
NO) {
[groups removeStaticGroup:(BDSKStaticGroup *)group];
[[self undoManager]
setActionName:NSLocalizedString(@"AppleScript",@"Undo action name for
AppleScript")];
- } else if ([group isURL] == YES) {
+ } else if ([group isURL]) {
[groups removeURLGroup:(BDSKURLGroup *)group];
[[self undoManager]
setActionName:NSLocalizedString(@"AppleScript",@"Undo action name for
AppleScript")];
- } else if ([group isScript] == YES) {
+ } else if ([group isScript]) {
[groups removeScriptGroup:(BDSKScriptGroup *)group];
[[self undoManager]
setActionName:NSLocalizedString(@"AppleScript",@"Undo action name for
AppleScript")];
- } else if ([group isSearch] == YES) {
+ } else if ([group isSearch]) {
[groups removeSearchGroup:(BDSKSearchGroup *)group];
} else {
NSScriptCommand *cmd = [NSScriptCommand currentCommand];
Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BibDocument.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -3359,15 +3359,15 @@
}
[statusStr appendFormat:@"%ld %@", (long)groupPubsCount,
(groupPubsCount == 1) ? NSLocalizedString(@"publication", @"publication, in
status message") : NSLocalizedString(@"publications", @"publications, in status
message")];
// we can have only a single external group selected at a time
- if ([self hasWebGroupSelected] == YES) {
+ if ([self hasWebGroupSelected]) {
[statusStr appendFormat:@" %@", NSLocalizedString(@"in web group",
@"Partial status message")];
- } else if ([self hasSharedGroupsSelected] == YES) {
+ } else if ([self hasSharedGroupsSelected]) {
[statusStr appendFormat:@" %@ \"%...@\"", NSLocalizedString(@"in
shared group", @"Partial status message"), [[[self selectedGroups] lastObject]
stringValue]];
- } else if ([self hasURLGroupsSelected] == YES) {
+ } else if ([self hasURLGroupsSelected]) {
[statusStr appendFormat:@" %@ \"%...@\"", NSLocalizedString(@"in
external file group", @"Partial status message"), [[[self selectedGroups]
lastObject] stringValue]];
- } else if ([self hasScriptGroupsSelected] == YES) {
+ } else if ([self hasScriptGroupsSelected]) {
[statusStr appendFormat:@" %@ \"%...@\"", NSLocalizedString(@"in
script group", @"Partial status message"), [[[self selectedGroups] lastObject]
stringValue]];
- } else if ([self hasSearchGroupsSelected] == YES) {
+ } else if ([self hasSearchGroupsSelected]) {
BDSKSearchGroup *group = [[self selectedGroups] firstObject];
[statusStr appendFormat:NSLocalizedString(@" in \"%...@\" search
group", @"Partial status message"), [[group serverInfo] name]];
NSInteger matchCount = [group numberOfAvailableResults];
Modified: trunk/bibdesk/BibDocument_Actions.m
===================================================================
--- trunk/bibdesk/BibDocument_Actions.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BibDocument_Actions.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -269,7 +269,7 @@
- (void)deletePublications:(NSArray *)pubs {
NSInteger numPubs = [pubs count];
- if (numPubs == 0 || [self hasExternalGroupsSelected] == YES) {
+ if (numPubs == 0 || [self hasExternalGroupsSelected]) {
return;
}
@@ -1354,7 +1354,7 @@
#pragma mark AutoFile stuff
- (IBAction)consolidateLinkedFiles:(id)sender{
- if ([self hasExternalGroupsSelected] == YES) {
+ if ([self hasExternalGroupsSelected]) {
NSBeep();
return;
}
@@ -1471,7 +1471,7 @@
{
NSUInteger numberOfSelectedPubs = [self numberOfSelectedPubs];
if (numberOfSelectedPubs == 0 ||
- [self hasExternalGroupsSelected] == YES) return;
+ [self hasExternalGroupsSelected]) return;
if([[NSUserDefaults standardUserDefaults]
boolForKey:BDSKWarnOnCiteKeyChangeKey]){
NSString *alertTitle = numberOfSelectedPubs > 1 ?
NSLocalizedString(@"Really Generate Cite Keys?", @"Message in alert dialog when
generating cite keys") : NSLocalizedString(@"Really Generate Cite Key?",
@"Message in alert dialog when generating cite keys");
@@ -1570,7 +1570,7 @@
- (IBAction)duplicateTitleToBooktitle:(id)sender{
if ([self numberOfSelectedPubs] == 0 ||
- [self hasExternalGroupsSelected] == YES) return;
+ [self hasExternalGroupsSelected]) return;
NSAlert *alert = [NSAlert
alertWithMessageText:NSLocalizedString(@"Overwrite Booktitle?", @"Message in
alert dialog when duplicating Title to Booktitle")
defaultButton:NSLocalizedString(@"Don't
Overwrite", @"Button title: overwrite Booktitle")
Modified: trunk/bibdesk/BibDocument_DataSource.m
===================================================================
--- trunk/bibdesk/BibDocument_DataSource.m 2009-05-05 18:16:08 UTC (rev
15271)
+++ trunk/bibdesk/BibDocument_DataSource.m 2009-05-05 18:19:44 UTC (rev
15272)
@@ -1312,7 +1312,7 @@
}
- (NSIndexSet *)outlineView:(BDSKGroupOutlineView *)outlineView
indexesOfRowsToHighlightInRange:(NSRange)indexRange {
- if([self numberOfSelectedPubs] == 0 || [self hasExternalGroupsSelected] ==
YES)
+ if([self numberOfSelectedPubs] == 0 || [self hasExternalGroupsSelected])
return [NSIndexSet indexSet];
// Use this for the indexes we're going to return
Modified: trunk/bibdesk/BibDocument_Groups.m
===================================================================
--- trunk/bibdesk/BibDocument_Groups.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BibDocument_Groups.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -362,7 +362,7 @@
[self sortGroupsByKey:nil];
}else{
[groupOutlineView reloadData];
- if ([[self selectedGroups] containsObject:group] && succeeded == YES)
+ if ([[self selectedGroups] containsObject:group] && succeeded)
[self displaySelectedGroups];
}
@@ -430,7 +430,7 @@
[self sortGroupsByKey:nil];
}else{
[groupOutlineView reloadData];
- if ([[self selectedGroups] containsObject:group] && succeeded == YES)
+ if ([[self selectedGroups] containsObject:group] && succeeded)
[self displaySelectedGroups];
}
@@ -449,7 +449,7 @@
[self sortGroupsByKey:nil];
}else{
[groupOutlineView reloadData];
- if ([[self selectedGroups] containsObject:group] && succeeded == YES)
+ if ([[self selectedGroups] containsObject:group] && succeeded)
[self displaySelectedGroups];
}
@@ -465,7 +465,7 @@
return; /// must be from another document
[groupOutlineView reloadData];
- if ([[self selectedGroups] containsObject:group] && succeeded == YES)
+ if ([[self selectedGroups] containsObject:group] && succeeded)
[self displaySelectedGroups];
if (succeeded)
@@ -620,7 +620,7 @@
BOOL sortByCount = [sortGroupsKey isEqualToString:BDSKGroupCellCountKey];
NSArray *smartGroups = [groups smartGroups];
- if (hideCount == NO || sortByCount == YES)
+ if (hideCount == NO || sortByCount)
[smartGroups makeObjectsPerformSelector:@selector(filterItems:)
withObject:publications];
if (sortByCount) {
Modified: trunk/bibdesk/BibDocument_Menus.m
===================================================================
--- trunk/bibdesk/BibDocument_Menus.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BibDocument_Menus.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -60,7 +60,7 @@
id firstResponder = [documentWindow firstResponder];
if (firstResponder != tableView ||
[self numberOfSelectedPubs] == 0 ||
- [self hasExternalGroupsSelected] == YES) {
+ [self hasExternalGroupsSelected]) {
// no selection or selection includes shared groups
return NO;
}
@@ -96,7 +96,7 @@
}
- (BOOL)validatePasteMenuItem:(NSMenuItem *)menuItem{
- return ([documentWindow isKeyWindow] == YES && [[documentWindow
firstResponder] isEqual:tableView]);
+ return ([documentWindow isKeyWindow] && [[documentWindow
firstResponder] isEqual:tableView]);
}
- (BOOL)validateDuplicateMenuItem:(NSMenuItem *)menuItem{
@@ -104,7 +104,7 @@
return NO;
if ([[documentWindow firstResponder] isEqual:tableView] == NO ||
[self numberOfSelectedPubs] == 0 ||
- [self hasExternalGroupsSelected] == YES)
+ [self hasExternalGroupsSelected])
return NO;
return YES;
}
@@ -427,15 +427,15 @@
}
- (BOOL)validateSelectAllPublicationsMenuItem:(NSMenuItem *)menuItem{
- return ([documentWindow isKeyWindow] == YES);
+ return ([documentWindow isKeyWindow]);
}
- (BOOL)validateDeselectAllPublicationsMenuItem:(NSMenuItem *)menuItem{
- return ([documentWindow isKeyWindow] == YES);
+ return ([documentWindow isKeyWindow]);
}
- (BOOL)validateSelectLibraryGroupMenuItem:(NSMenuItem *)menuItem{
- return ([documentWindow isKeyWindow] == YES);
+ return ([documentWindow isKeyWindow]);
}
- (BOOL) validateSelectDuplicatesMenuItem:(NSMenuItem *)menuItem{
Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BibItem.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -474,9 +474,9 @@
NSString *crossref1 = [self valueOfField:BDSKCrossrefString inherit:NO];
NSString *crossref2 = [aBI valueOfField:BDSKCrossrefString inherit:NO];
- if ([NSString isEmptyString:crossref1] == YES)
+ if ([NSString isEmptyString:crossref1])
return [NSString isEmptyString:crossref2];
- else if ([NSString isEmptyString:crossref2] == YES)
+ else if ([NSString isEmptyString:crossref2])
return NO;
return ([crossref1 caseInsensitiveCompare:crossref2] == NSOrderedSame);
}
@@ -508,9 +508,9 @@
NSString *crossref1 = [self valueOfField:BDSKCrossrefString inherit:NO];
NSString *crossref2 = [aBI valueOfField:BDSKCrossrefString inherit:NO];
- if ([NSString isEmptyString:crossref1] == YES)
+ if ([NSString isEmptyString:crossref1])
return [NSString isEmptyString:crossref2];
- else if ([NSString isEmptyString:crossref2] == YES)
+ else if ([NSString isEmptyString:crossref2])
return NO;
return ([crossref1 caseInsensitiveCompare:crossref2] == NSOrderedSame);
}
@@ -534,12 +534,12 @@
while (key = [keyEnum nextObject]) {
value1 = [self stringValueOfField:key inherit:NO];
value2 = [aBI stringValueOfField:key inherit:NO];
- if ([NSString isEmptyString:value1] == YES) {
- if ([NSString isEmptyString:value2] == YES)
+ if ([NSString isEmptyString:value1]) {
+ if ([NSString isEmptyString:value2])
continue;
else
return NO;
- } else if ([NSString isEmptyString:value2] == YES) {
+ } else if ([NSString isEmptyString:value2]) {
return NO;
} else if ([value1 isEqualToString:value2] == NO) {
return NO;
@@ -1125,7 +1125,7 @@
}
- (BOOL)isValidCiteKey:(NSString *)proposedCiteKey{
- if ([NSString isEmptyString:proposedCiteKey] == YES)
+ if ([NSString isEmptyString:proposedCiteKey])
return NO;
return ([[owner publications] citeKeyIsUsed:proposedCiteKey
byItemOtherThan:self] == NO);
}
@@ -2823,7 +2823,7 @@
}
- (NSInteger)addToGroup:(BDSKGroup *)aGroup
handleInherited:(NSInteger)operation{
- BDSKASSERT([aGroup isCategory] == YES && [owner isDocument]);
+ BDSKASSERT([aGroup isCategory] && [owner isDocument]);
BDSKCategoryGroup *group = (BDSKCategoryGroup *)aGroup;
// don't add it twice; this is typed as id because it may be a BibAuthor
or NSString, so be careful
@@ -2881,7 +2881,7 @@
}
- (NSInteger)removeFromGroup:(BDSKGroup *)aGroup
handleInherited:(NSInteger)operation{
- BDSKASSERT([aGroup isCategory] == YES && [owner isDocument]);
+ BDSKASSERT([aGroup isCategory] && [owner isDocument]);
BDSKCategoryGroup *group = (BDSKCategoryGroup *)aGroup;
id groupName = [group name];
NSString *field = [group key];
@@ -2950,7 +2950,7 @@
BOOL first = YES;
while(auth = [authEnum nextObject]){
if([auth fuzzyEqual:groupName] == NO){
- if(first == YES)
+ if(first)
first = NO;
else
[string appendString:@" and "];
@@ -3006,7 +3006,7 @@
[scanner setScanLocation:[scanner scanLocation] + 5];
[scanner scanUpToCharactersFromSet:nonWhitespaceCharSet
intoString:NULL];
endLocation = [scanner scanLocation];
- if(addedToken == YES)
+ if(addedToken)
lastDelimiter = [oldString
substringWithRange:NSMakeRange(startLocation, endLocation - startLocation)];
} while([scanner isAtEnd] == NO);
@@ -3019,7 +3019,7 @@
}
- (NSInteger)replaceGroup:(BDSKGroup *)aGroup withGroupNamed:(NSString
*)newGroupName handleInherited:(NSInteger)operation{
- BDSKASSERT([aGroup isCategory] == YES && [owner isDocument]);
+ BDSKASSERT([aGroup isCategory] && [owner isDocument]);
BDSKCategoryGroup *group = (BDSKCategoryGroup *)aGroup;
id groupName = [group name];
NSString *field = [group key];
@@ -3075,7 +3075,7 @@
NSMutableString *string = [[NSMutableString alloc]
initWithCapacity:[oldString length] - [[groupName lastName] length] - 5];
BOOL first = YES;
while(auth = [authEnum nextObject]){
- if(first == YES) first = NO;
+ if(first) first = NO;
else [string appendString:@" and "];
if([auth fuzzyEqual:groupName]){
[string appendString:newGroupName];
@@ -3135,7 +3135,7 @@
[scanner setScanLocation:[scanner scanLocation] + 5];
[scanner scanUpToCharactersFromSet:nonWhitespaceCharSet
intoString:NULL];
endLocation = [scanner scanLocation];
- if(addedToken == YES)
+ if(addedToken)
lastDelimiter = [oldString
substringWithRange:NSMakeRange(startLocation, endLocation - startLocation)];
} while([scanner isAtEnd] == NO);
Modified: trunk/bibdesk/BibPref_Defaults.m
===================================================================
--- trunk/bibdesk/BibPref_Defaults.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BibPref_Defaults.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -393,7 +393,7 @@
if([[NSFileManager defaultManager] fileExistsAtPath:pathString
isDirectory:&isDir] == NO){
error = [NSString stringWithFormat:NSLocalizedString(@"The file
\"%...@\" does not exist.", @"Informative text in alert dialog"), object];
- } else if (isDir == YES) {
+ } else if (isDir) {
error = [NSString stringWithFormat:NSLocalizedString(@"\"%...@\"
is not a file.", @"Informative text in alert dialog"), object];
} else if ([extension caseInsensitiveCompare:@"bib"] != NSOrderedSame
&& [extension caseInsensitiveCompare:@"bst"] != NSOrderedSame) {
error = [NSString stringWithFormat:NSLocalizedString(@"The file
\"%...@\" is neither a BibTeX bibliography file nor a BibTeX style file.",
@"Informative text in alert dialog"), object];
Modified: trunk/bibdesk/BibPref_Sharing.m
===================================================================
--- trunk/bibdesk/BibPref_Sharing.m 2009-05-05 18:16:08 UTC (rev 15271)
+++ trunk/bibdesk/BibPref_Sharing.m 2009-05-05 18:19:44 UTC (rev 15272)
@@ -186,7 +186,7 @@
{
BOOL flag = ([sender state] == NSOnState);
[sud setBool:flag forKey:BDSKShouldLookForSharedFilesKey];
- if(flag == YES)
+ if(flag)
[[BDSKSharingBrowser sharedBrowser] enableSharedBrowsing];
else
[[BDSKSharingBrowser sharedBrowser] disableSharedBrowsing];
@@ -197,7 +197,7 @@
{
BOOL flag = ([sender state] == NSOnState);
[sud setBool:flag forKey:BDSKShouldShareFilesKey];
- if(flag == YES)
+ if(flag)
[[BDSKSharingServer defaultServer] enableSharing];
else
[[BDSKSharingServer defaultServer] disableSharing];
Modified: trunk/bibdesk/NSFileManager_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSFileManager_BDSKExtensions.m 2009-05-05 18:16:08 UTC
(rev 15271)
+++ trunk/bibdesk/NSFileManager_BDSKExtensions.m 2009-05-05 18:19:44 UTC
(rev 15272)
@@ -642,7 +642,7 @@
if(NO == success && error != nil)
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:0
userInfo:[NSDictionary dictionaryWithObject:NSLocalizedString(@"File does not
exist.", @"Error description") forKey:NSLocalizedDescriptionKey]];
- if(YES == success){
+ if(success){
success = (noErr == FSDeleteObject(&fileRef));
if(NO == success && error != nil)
*error = [NSError errorWithDomain:NSCocoaErrorDomain code:0
userInfo:[NSDictionary dictionaryWithObject:NSLocalizedString(@"Unable to
delete file.", @"Error description") forKey:NSLocalizedDescriptionKey]];
Modified: trunk/bibdesk/NSString_BDSKExtensions.m
===================================================================
--- trunk/bibdesk/NSString_BDSKExtensions.m 2009-05-05 18:16:08 UTC (rev
15271)
+++ trunk/bibdesk/NSString_BDSKExtensions.m 2009-05-05 18:19:44 UTC (rev
15272)
@@ -437,7 +437,7 @@
}
}
- return (matchFound == YES) ? cnt : NSNotFound;
+ return (matchFound) ? cnt : NSNotFound;
}
- (BOOL)isStringTeXQuotingBalancedWithBraces:(BOOL)braces
connected:(BOOL)connected{
@@ -1080,7 +1080,7 @@
}
- (NSCellStateValue)triStateValue{
- if([self booleanValue] == YES){
+ if([self booleanValue]){
return NSOnState;
}else if([self isEqualToString:@""] ||
[self compare:[NSString stringWithBool:NO]
options:NSCaseInsensitiveSearch] == NSOrderedSame ||
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit