[bt-devel] OSIS crossrefs rendering bug (added by Martin, patch by Troy - BibleTime or Sword bug?)

Ben Morgan benpmorgan at gmail.com
Sun May 10 16:50:50 MST 2009


Rendering the text of the footnotes will clear the entry attributes. You
probably need to defer rendering them...
In general, I don't think you shouldn't call the current module's RenderText
in the render filters.

God Bless,
Ben
-------------------------------------------------------------------------------------------
Multitudes, multitudes,
   in the valley of decision!
For the day of the LORD is near
   in the valley of decision.

Giôên 3:14 (ESV)



On Mon, May 11, 2009 at 8:18 AM, Eeli Kaikkonen <
eekaikko at mail.student.oulu.fi> wrote:

> Martin Gruner wrote:
>
>> Hi Eeli,
>>
>> attached you can find the original patch by Troy with the debug method
>> that he used. Good luck!  :-P
>>
>>
> OK, I added the debug function to bt_osishtml.cpp. It's called like this:
>
> #ifdef SWORD_SIMPLERENDER
>        sword::SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
>        qDebug() << "swordFootnote:" << footnoteNumber;
>        dumpEntryAttributes(myModule);
>        sword::SWBuf footnoteBody =
> myModule->getEntryAttributes()["Footnote"][footnoteNumber]["body"];
>        buf += myModule->RenderText(footnoteBody);
> #endif
>
> In the first time in a verse, when the footnote number is 1, it gives this:
>
> (BibleTime 2.0.beta2) Debug: swordFootnote: 1
> (BibleTime 2.0.beta2) Debug: ENTRY ATTRIBUTES FOR KEY:  Psalms 100:2
> (BibleTime 2.0.beta2) Debug: [  Footnote  ]
> (BibleTime 2.0.beta2) Debug:    [  1  ]
> (BibleTime 2.0.beta2) Debug:             body  =  [<reference
> osisRef="Ps.2.11">Ps. 2:11</reference>]
> (BibleTime 2.0.beta2) Debug:             n  =  q
> (BibleTime 2.0.beta2) Debug:             osisID  =
> Ps.100.2!crossReference.q
> (BibleTime 2.0.beta2) Debug:             osisRef  =  Ps.100.2
> (BibleTime 2.0.beta2) Debug:             refList  =  Ps.2.11
> (BibleTime 2.0.beta2) Debug:             type  =  crossReference
> (BibleTime 2.0.beta2) Debug:    [  2  ]
> (BibleTime 2.0.beta2) Debug:             body  =  [<reference
> osisRef="Ps.95.2">Ps. 95:2</reference>]
> (BibleTime 2.0.beta2) Debug:             n  =  r
> (BibleTime 2.0.beta2) Debug:             osisID  =
> Ps.100.2!crossReference.r
> (BibleTime 2.0.beta2) Debug:             osisRef  =  Ps.100.2
> (BibleTime 2.0.beta2) Debug:             refList  =  Ps.95.2
> (BibleTime 2.0.beta2) Debug:             type  =  crossReference
> (BibleTime 2.0.beta2) Debug: ENTRY ATTRIBUTES end
>
>
> But all the rest of the footnotes in the same verse give this:
>
> BibleTime 2.0.beta2) Debug: swordFootnote: 2 [or 3 or...]
> (BibleTime 2.0.beta2) Debug: ENTRY ATTRIBUTES FOR KEY:  Psalms 100:2
> (BibleTime 2.0.beta2) Debug: ENTRY ATTRIBUTES end
>
> So, somewhere between these calls the attributes of the key have
> disappeared. I have made sure that the objects are the same each time.
>
>
>
> --Eeli Kaikkonen
>
> _______________________________________________
> bt-devel mailing list
> bt-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/bt-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/bt-devel/attachments/20090511/88d26123/attachment.html>


More information about the bt-devel mailing list