summaryrefslogtreecommitdiff
path: root/src/frontend/crossrefrendering.cpp
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-10-21 22:48:29 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-10-21 22:48:29 -0400
commite8a196082586bb68e0bf254a8f6f4b8f39071f32 (patch)
treeb03dbbd1b5be6092ed5e9bcb3806aa2d4938bba3 /src/frontend/crossrefrendering.cpp
parentdd2f7ce46df53f2c377c02d1bf4df8adcf092072 (diff)
Imported Upstream version 2.3.3
Diffstat (limited to 'src/frontend/crossrefrendering.cpp')
-rw-r--r--src/frontend/crossrefrendering.cpp111
1 files changed, 55 insertions, 56 deletions
diff --git a/src/frontend/crossrefrendering.cpp b/src/frontend/crossrefrendering.cpp
index 3aa8130..9785ee7 100644
--- a/src/frontend/crossrefrendering.cpp
+++ b/src/frontend/crossrefrendering.cpp
@@ -20,71 +20,70 @@ namespace InfoDisplay {
/**
*/
CrossRefRendering::CrossRefRendering( CSwordBackend::DisplayOptions displayOptions,
- CSwordBackend::FilterOptions filterOptions
- )
- : CHTMLExportRendering(Settings(), displayOptions, filterOptions)
-{}
+ CSwordBackend::FilterOptions filterOptions
+ )
+ : CHTMLExportRendering(Settings(), displayOptions, filterOptions) {}
const QString CrossRefRendering::finishText( const QString& text, KeyTree& ) {
- // qDebug("CrossRefRendering::finishText");
- return text;
+ // qDebug("CrossRefRendering::finishText");
+ return text;
}
const QString CrossRefRendering::entryLink( const KeyTreeItem& item, CSwordModuleInfo* module ) {
- QString linkText;
+ QString linkText;
- const bool isBible = module && (module->type() == CSwordModuleInfo::Bible);
- CSwordVerseKey vk(module); //only valid for bible modules, i.e. isBible == true
- if (isBible) {
- vk.key(item.key());
- }
+ const bool isBible = module && (module->type() == CSwordModuleInfo::Bible);
+ CSwordVerseKey vk(module); //only valid for bible modules, i.e. isBible == true
+ if (isBible) {
+ vk.key(item.key());
+ }
- switch (item.settings().keyRenderingFace) {
- case KeyTreeItem::Settings::NoKey: {
- linkText = QString::null;
- break; //no key is valid for all modules
- }
- case KeyTreeItem::Settings::CompleteShort: {
- if (isBible) {
- linkText = QString::fromUtf8(vk.getShortText());
- break;
- }
- //fall through for non-Bible modules
- }
- case KeyTreeItem::Settings::CompleteLong: {
- if (isBible) {
- linkText = vk.key();
- break;
- }
- //fall through for non-Bible modules
- }
- case KeyTreeItem::Settings::SimpleKey: {
- if (isBible) {
- linkText = QString::number(vk.Verse());
- break;
- }
- //fall through for non-Bible modules
- }
- default: { //default behaviour to return the passed key
- linkText = item.key();
- break;
- }
- }
+ switch (item.settings().keyRenderingFace) {
+ case KeyTreeItem::Settings::NoKey: {
+ linkText = QString::null;
+ break; //no key is valid for all modules
+ }
+ case KeyTreeItem::Settings::CompleteShort: {
+ if (isBible) {
+ linkText = QString::fromUtf8(vk.getShortText());
+ break;
+ }
+ //fall through for non-Bible modules
+ }
+ case KeyTreeItem::Settings::CompleteLong: {
+ if (isBible) {
+ linkText = vk.key();
+ break;
+ }
+ //fall through for non-Bible modules
+ }
+ case KeyTreeItem::Settings::SimpleKey: {
+ if (isBible) {
+ linkText = QString::number(vk.Verse());
+ break;
+ }
+ //fall through for non-Bible modules
+ }
+ default: { //default behaviour to return the passed key
+ linkText = item.key();
+ break;
+ }
+ }
- if (!linkText.isEmpty()) { //if we have a valid link text
- // qWarning("rendering");
- return QString("<a href=\"%1\">%2</a>")
- .arg(
- CReferenceManager::encodeHyperlink(
- module->name(),
- item.key(),
- CReferenceManager::typeFromModule(module->type())
- )
- )
- .arg(linkText);
- }
+ if (!linkText.isEmpty()) { //if we have a valid link text
+ // qWarning("rendering");
+ return QString("<a href=\"%1\">%2</a>")
+ .arg(
+ CReferenceManager::encodeHyperlink(
+ module->name(),
+ item.key(),
+ CReferenceManager::typeFromModule(module->type())
+ )
+ )
+ .arg(linkText);
+ }
- return QString::null;
+ return QString::null;
}
}