[sword-devel] book arithmetic error in engine, Matthew -> Malachi

Manfred Bergmann manfred.bergmann at me.com
Mon Mar 15 06:36:43 MST 2010

Yep, same problem in MacSword, also on a Book(-/+1) operation.


Am 14.03.2010 um 14:51 schrieb Karl Kleinpaste:

> I could use a clue for what I'm seeing in the engine when changing books.
> Xiphos' navbar provides arrow buttons for navigating up/down a single
> book, plus the spinner which provides the same function.  The code which
> reacts to this is:
> 	VerseKey vkey;
> 	tmpkey = backend->get_valid_key(navbar.key->str);
> 	vkey.AutoNormalize(1);
> 	vkey = tmpkey;
> 	book = (direction)?(vkey.Book()+1):(vkey.Book()-1);
> 	vkey.Book(book);
> 	tmpkey = g_strdup_printf("%s 1:1",vkey.getBookName());
> Pretty straightforward.  When Xiphos is sitting on Matthew, hitting the
> up button should result in a new selection of "Malachi 1:1" in the final
> setting of tmpkey, but what we actually get in that case is "Zechariah
> 1:1".  The engine has mis-analyzed where "one backward from Matthew" is.
> I've looked at the usage of Book (that is, getBook and setBook) in
> sword/src/keys/versekey.cpp, and I am a bit mystified by where this
> mis-setting can occur.
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page

More information about the sword-devel mailing list