[sword-svn] r2710 - trunk/src/modules/filters
chrislit at crosswire.org
chrislit at crosswire.org
Fri Jul 20 14:54:09 MST 2012
Author: chrislit
Date: 2012-07-20 14:54:09 -0700 (Fri, 20 Jul 2012)
New Revision: 2710
Modified:
trunk/src/modules/filters/osishtmlhref.cpp
Log:
removed URL-encoding of noteName, since this isn't in an URL
moved if(vkey) into function call to reduce code repetition (DRY)
Modified: trunk/src/modules/filters/osishtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/osishtmlhref.cpp 2012-07-11 13:37:13 UTC (rev 2709)
+++ trunk/src/modules/filters/osishtmlhref.cpp 2012-07-20 21:54:09 UTC (rev 2710)
@@ -253,27 +253,14 @@
vkey = SWDYNAMIC_CAST(VerseKey, u->key);
}
SWCATCH ( ... ) { }
- if (vkey) {
- //printf("URL = %s\n",URL::encode(vkey->getText()).c_str());
- buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c%s</sup></small></a>",
- ch,
- URL::encode(footnoteNumber.c_str()).c_str(),
- URL::encode(u->version.c_str()).c_str(),
- URL::encode(vkey->getText()).c_str(),
- ch,
- ch,
- (renderNoteNumbers ? URL::encode(noteName.c_str()).c_str() : ""));
- }
- else {
- buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c%s</sup></small></a>",
- ch,
- URL::encode(footnoteNumber.c_str()).c_str(),
- URL::encode(u->version.c_str()).c_str(),
- URL::encode(u->key->getText()).c_str(),
- ch,
- ch,
- (renderNoteNumbers ? URL::encode(noteName.c_str()).c_str() : ""));
- }
+ buf.appendFormatted("<a href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c%s</sup></small></a>",
+ ch,
+ URL::encode(footnoteNumber.c_str()).c_str(),
+ URL::encode(u->version.c_str()).c_str(),
+ URL::encode(vkey ? vkey->getText() : u->key->getText()).c_str(),
+ ch,
+ ch,
+ (renderNoteNumbers ? noteName.c_str() : ""));
}
}
u->suspendTextPassThru = (++u->suspendLevel);
More information about the sword-cvs
mailing list