From: <ho...@us...> - 2006-08-31 11:21:15
|
Revision: 7613 http://svn.sourceforge.net/bibdesk/?rev=7613&view=rev Author: hofman Date: 2006-08-31 04:21:08 -0700 (Thu, 31 Aug 2006) Log Message: ----------- Ignore non-regular items when parsing without frontmatter (paste/drag etc). Modified Paths: -------------- trunk/bibdesk/BibTeXParser.m Modified: trunk/bibdesk/BibTeXParser.m =================================================================== --- trunk/bibdesk/BibTeXParser.m 2006-08-31 07:40:18 UTC (rev 7612) +++ trunk/bibdesk/BibTeXParser.m 2006-08-31 11:21:08 UTC (rev 7613) @@ -153,14 +153,16 @@ entryType = [tmpStr lowercaseString]; [tmpStr release]; - if ((bt_entry_metatype (entry) != BTE_REGULAR) && nil != frontMatter){ - // put @preamble etc. into the frontmatter string so we carry them along. - if ([entryType isEqualToString:@"preamble"]){ - appendPreambleToFrontmatter(entry, frontMatter, parserEncoding); - }else if([entryType isEqualToString:@"string"]){ - addMacroToResolver(entry, macroResolver, filePath, parserEncoding, &error); - }else if([entryType isEqualToString:@"comment"]){ - appendCommentToFrontmatterOrAddGroups(entry, frontMatter, aDocument, parserEncoding); + if (bt_entry_metatype (entry) != BTE_REGULAR){ + if(nil != frontMatter){ + // put @preamble etc. into the frontmatter string so we carry them along. + if ([entryType isEqualToString:@"preamble"]){ + appendPreambleToFrontmatter(entry, frontMatter, parserEncoding); + }else if([entryType isEqualToString:@"string"]){ + addMacroToResolver(entry, macroResolver, filePath, parserEncoding, &error); + }else if([entryType isEqualToString:@"comment"]){ + appendCommentToFrontmatterOrAddGroups(entry, frontMatter, aDocument, parserEncoding); + } } }else{ @@ -204,7 +206,7 @@ pubFields:dictionary isNew:isPasteOrDrag]; - tmpStr = [[NSString alloc] initWithCString:bt_entry_key(entry) usingEncoding:parserEncoding]; + tmpStr = [[NSString alloc] initWithCString:bt_entry_key(entry) usingEncoding:parserEncoding];NSLog(@"%@ %@",entryType,tmpStr); [newBI setCiteKeyString:tmpStr]; [tmpStr release]; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |