<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 12/12/2014 10:56 AM, Troy A.
Griffitts wrote:<br>
</div>
<blockquote cite="mid:548B1034.3020804@crosswire.org" type="cite">Could
you try to run the sword/tests/versekeytest and have a look at the
end of the output. There should be a test which tried to span the
OT/NT which should output something like:<br>
<br>
Matthew.1.1-- = Malachi 4:6<br>
++ = Matthew 1:1<br>
</blockquote>
<font face="FreeSerif">OK, that's interesting, but maybe not
sufficiently informative.<br>
<br>
In Xiphos, I can forward/backward on navbar book, and it correctly
crosses between Mal.1.1 and Matt.1.1.<br>
<br>
This is the end of versekeytest, which supports book
forward/backward:<br>
<br>
Mark.1.1-- = Matthew 28:20<br>
++ = Mark 1:1<br>
.setChapter(.getChapter() - 1) = Matthew 28:1<br>
Matthew.1.1-- = Malachi 4:6<br>
++ = Matthew 1:1<br>
.setBook(.getBook() - 1) = Malachi 1:1<br>
<br>
Now I see that it claims backing up one verse from Matt.1.1 should
give me Mal.4.6, but this is the Xiphos code using a
freshly-obtained VerseKey that's doing a navbar verse spin forward
or backward (parameter "direction" determines).<br>
<br>
vkey->setAutoNormalize(1);<br>
vkey->setText(tmpkey);<br>
verse = vkey->getVerse() + (direction ? 1 : -1);<br>
vkey->setVerse(verse);<br>
<br>
In gdb, this is what happens:<br>
<br>
194 vkey->setText(tmpkey);<br>
(gdb) p tmpkey<br>
$4 = 0x7b4aeb0 "Matt 1:1"<br>
(gdb) n<br>
196 verse = vkey->getVerse() + (direction ? 1 : -1);<br>
(gdb) p verse<br>
$5 = 0<br>
</font><font face="FreeSerif"><font face="FreeSerif">(gdb) <br>
197 vkey->setVerse(verse);<br>
</font>(gdb) n<br>
199 tmpkey = g_strdup_printf("%s %d:%d",
vkey->getBookName(),<br>
(gdb) <br>
200 vkey->getChapter(),
vkey->getVerse());<br>
(gdb) <br>
201 gtk_entry_set_text(GTK_ENTRY(navbar.lookup_entry),
tmpkey);<br>
(gdb) p tmpkey<br>
$6 = 0x63f81d0 "Zechariah 13:9"<br>
<br>
This is mostly ancient code and I've never had reason to question
it, but the fact that vkey is set for auto-normalize makes me
wonder: We've taken "verse 1", decremented it, now 0, and then set
that verse#. The result is a scary traversal to Zech.13.9. A
similar thing happens for chapter spin (which lands in Zech.14.1),
though book spin does the right thing.<br>
<br>
Suggestions welcome.<br>
</font>
</body>
</html>