[sword-svn] r2852 - trunk/src/modules/filters
chrislit at crosswire.org
chrislit at crosswire.org
Wed Jul 3 11:22:57 MST 2013
Author: chrislit
Date: 2013-07-03 11:22:57 -0700 (Wed, 03 Jul 2013)
New Revision: 2852
Modified:
trunk/src/modules/filters/osisvariants.cpp
Log:
addressed API-162 bug (untested in any front end)
Modified: trunk/src/modules/filters/osisvariants.cpp
===================================================================
--- trunk/src/modules/filters/osisvariants.cpp 2013-07-02 10:18:19 UTC (rev 2851)
+++ trunk/src/modules/filters/osisvariants.cpp 2013-07-03 18:22:57 UTC (rev 2852)
@@ -78,7 +78,7 @@
const char *from = orig.c_str();
//we use a fixed comparision string to make sure the loop is as fast as the original two blocks with almost the same code
- //const char* variantCompareString = (option == 0) ? "div type=\"variant\" class=\"1\"" : "div type=\"variant\" class=\"2\"";
+ const char* variantCompareString = (option == 0) ? "seg type=\"x-variant\" subType=\"x-1\"" : "seg type=\"x-variant\" subType=\"x-2\"";
for (text = ""; *from; from++) {
if (*from == '<') {
@@ -89,16 +89,12 @@
else if (*from == '>') { // process tokens
intoken = false;
- if (!strncmp(token.c_str(), "seg ", 4)) { //only one of the variants
+ if (!strncmp(token.c_str(), variantCompareString, 34)) { //only one of the variants, length of the two strings is 34 in both cases
invar = true;
hide = true;
continue;
}
- if (!strncmp(token.c_str(), "div type=\"variant\"", 18)) {
- invar = true;
- continue;
- }
- if (!strncmp(token.c_str(), "/div", 4)) {
+ if (!strncmp(token.c_str(), "/seg", 4)) {
hide = false;
if (invar) {
invar = false;
More information about the sword-cvs
mailing list