[sword-devel] problem with key setting

Karl Kleinpaste karl at kleinpaste.org
Tue Sep 1 12:29:50 MST 2009

I need a help with a key problem.  I have a module name and a textual
key . I'm operating in Swedish locale, e.g. LC_ALL=sv_SE LANG=sv.

const char *BackEnd::get_osisref_from_key(const char *module, const char *key)
    ModMap::iterator it;
    it = main_mgr->Modules.find(module);
    if (it == main_mgr->Modules.end())
        it = main_mgr->Modules.begin();
    if (it == main_mgr->Modules.end())
        return "";
    VerseKey *vk = (VerseKey*)(*it).second->getKey();
    *vk = key;
    return vk->getOSISRef();

It does not have desired effect.  With module "NET" and key
"1. Timoteusbrevet 3:1", this code returns "Rev.1.1".

vk->convertToOSIS() returns something correct but wrongly formatted for
my purposes:
    "<reference osisRef=\"1Tim.3.1\">1. Timoteusbrevet 3:1</reference>"
So it knows how to do the conversion, but it's wrapped in excess crud.

I need "1Tim.3.1", all by itself.  Clues?

More information about the sword-devel mailing list