[bt-devel] Serious personal commentary overwrite bug - FIXED

Martin Gruner mg.pub at gmx.net
Wed Mar 9 08:02:31 MST 2011


Hi Gary,
if it is more than one line, IMHO braces should be used to signal the
ending of the block:

if (cond) {
    code
}

Don't you think? Stuff like this may be misleading:

if (cond)
    code1;
    code2;

Regards, mg

Am 04.03.11 06:13, schrieb Gary Holmlund:
> On 03/01/2011 11:39 PM, Jaak Ristioja wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On 02.03.2011 07:59, Gary Holmlund wrote:
>>>
>>> John,
>>>
>>> The Personal Commentary bug has been fixed. It is checked into the HEAD
>>> branch of Bibletime.
>>>
>>> I did find that text could be saved to the wrong reference just as you
>>> said.
>>>
>>> Gary Holmlund
>> I also backported it to the stable-2.8 branch and I think we should
>> release 2.8.2 soon after it is verified that this indeed fixes the
>> problem. Some of Patrick's fixes should also be verified and merged to
>> master and stable-2.8 branches (there are already merge requests for
>> them).
>>
>> God bless!
>> Jaak
> Jaak,
>
> I found some more problems with the Personal Commentary saving. I have
> fixed them and checked them into the master and stable-2.8 branches.
>
> It all related to methods of changing the Bible verse reference key
> (CSwordVerseKey). There are several ways it can change:
>   3 drop tabs (Book, Chapter, Verse)
>   3 next arrows (Book, Chapter, Verse)
>   3 previous arrows (Book, Chapter, Verse)
>   Forward and backward history
>   Direct entry in toolbar
>   Drop of bookmark
>   Synchronized commentary change with Bible change
>
> Each of these methods has a slightly different way of signaling before
> and after key changes. This part of the code is a mess. I believe I
> have the problems fixed and a release of stable-2.8 is ok. I believe I
> can cleanup and simplify the code doing key changes and will probably
> continue working on that in the master branch.
>
> Gary
>
>
> PS. Why do we format code so it looks like this:
>      if (expr) return;
>
> I can't set a breakpoint on the return. It should be done like this:
>     if (expr)
>         return;
>
>
> _______________________________________________
> bt-devel mailing list
> bt-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/bt-devel
>



More information about the bt-devel mailing list