[sword-devel] Problems with text rendering
Troy A. Griffitts
scribe at crosswire.org
Mon Oct 12 09:40:32 MST 2009
Dear Martin,
I believe the BPBible or Xiphos guys ran into this same problem a little
while back. I think, after talking about it, the best solution was to
simply grab a copy on the stack, near the top of your method, and let it
go out of scope after the filter completes.
AttributeTypeList entryAttributes = myModule->getEntryAttributes();
Hope this helps.
-Troy.
Martin Gruner wrote:
> Hi Troy,
>
> may I ask for your help with a rendering issue we are experiencing? I believe
> the code once came from you (simplerender.patch).
>
> It is in our OSIS filter descendant, where crossref notes are processed.
>
> <code>
> if (type == "crossReference") { //note containing cross
> references
> myUserData->inCrossrefNote = true;
> myUserData->noteType = BT_UserData::CrossReference;
>
> buf.append("<span class=\"crossreference\">");
> sword::SWBuf footnoteNumber =
> tag.getAttribute("swordFootnote");
> sword::SWBuf footnoteBody = myUserData-
>> entryAttributes["Footnote"][footnoteNumber]["body"];
> buf += myModule->RenderText(footnoteBody);
> }
> </code>
>
> Now the problem seems to be the final RenderText() call. It destroys the
> EntryAttributes structure when processing the footnote body.
>
> Can you give me a hint how I can work around that? Is there a better,
> preferred method?
>
> Thanks and regards, Martin
>
More information about the sword-devel
mailing list