summaryrefslogtreecommitdiff
path: root/src/frontend/cexportmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/cexportmanager.cpp')
-rw-r--r--src/frontend/cexportmanager.cpp39
1 files changed, 18 insertions, 21 deletions
diff --git a/src/frontend/cexportmanager.cpp b/src/frontend/cexportmanager.cpp
index 640eae7..e7546ba 100644
--- a/src/frontend/cexportmanager.cpp
+++ b/src/frontend/cexportmanager.cpp
@@ -2,7 +2,7 @@
*
* This file is part of BibleTime's source code, http://www.bibletime.info/.
*
-* Copyright 1999-2011 by the BibleTime developers.
+* Copyright 1999-2014 by the BibleTime developers.
* The BibleTime source code is licensed under the GNU General Public License version 2.0.
*
**********/
@@ -76,7 +76,7 @@ bool CExportManager::saveKey(CSwordKey* key, const Format format, const bool add
CSwordVerseKey *vk = dynamic_cast<CSwordVerseKey*>(key);
if (vk && vk->isBoundSet()) {
- text = render->renderKeyRange( QString::fromUtf8(vk->LowerBound()), QString::fromUtf8(vk->UpperBound()), modules );
+ text = render->renderKeyRange( QString::fromUtf8(vk->getLowerBound()), QString::fromUtf8(vk->getUpperBound()), modules );
}
else { //no range supported
text = render->renderSingleKey(key->key(), modules);
@@ -90,14 +90,12 @@ bool CExportManager::saveKey(CSwordKey* key, const Format format, const bool add
return true;
}
-bool CExportManager::saveKeyList(const sword::ListKey &l,
+bool CExportManager::saveKeyList(const sword::ListKey & l,
const CSwordModuleInfo *module,
Format format,
bool addText)
{
- /// \warning This is a workaround for Sword constness
- sword::ListKey list = l;
- if (!list.Count())
+ if (!l.getCount())
return false;
const QString filename = getSaveFileName(format);
@@ -107,12 +105,13 @@ bool CExportManager::saveKeyList(const sword::ListKey &l,
CTextRendering::KeyTree tree; /// \todo Verify that items in tree are properly freed.
- setProgressRange(list.Count());
+ setProgressRange(l.getCount());
CTextRendering::KeyTreeItem::Settings itemSettings;
itemSettings.highlight = false;
+ sword::ListKey list(l);
list.setPosition(sword::TOP);
- while (!list.Error() && !progressWasCancelled()) {
+ while (!list.popError() && !progressWasCancelled()) {
tree.append( new CTextRendering::KeyTreeItem(QString::fromLocal8Bit((const char*)list) , module, itemSettings) );
incProgress();
@@ -180,8 +179,8 @@ bool CExportManager::copyKey(CSwordKey* key, const Format format, const bool add
CSwordVerseKey * vk = dynamic_cast<CSwordVerseKey*>(key);
if (vk && vk->isBoundSet()) {
text = render->renderKeyRange(
- QString::fromUtf8(vk->LowerBound()),
- QString::fromUtf8(vk->UpperBound()),
+ QString::fromUtf8(vk->getLowerBound()),
+ QString::fromUtf8(vk->getUpperBound()),
modules
);
}
@@ -201,7 +200,7 @@ bool CExportManager::copyKeyList(const sword::ListKey &l,
bool addText)
{
sword::ListKey list = l;
- if (!list.Count())
+ if (!list.getCount())
return false;
CTextRendering::KeyTree tree; /// \todo Verify that items in tree are properly freed.
@@ -209,7 +208,7 @@ bool CExportManager::copyKeyList(const sword::ListKey &l,
itemSettings.highlight = false;
list.setPosition(sword::TOP);
- while (!list.Error() && !progressWasCancelled()) {
+ while (!list.popError() && !progressWasCancelled()) {
tree.append( new CTextRendering::KeyTreeItem(QString::fromLocal8Bit((const char*)list) , module, itemSettings) );
list.increment();
@@ -254,18 +253,16 @@ bool CExportManager::copyKeyList(const QList<CSwordKey*> &list,
return true;
}
-bool CExportManager::printKeyList(const sword::ListKey &l,
+bool CExportManager::printKeyList(const sword::ListKey & list,
const CSwordModuleInfo *module,
const DisplayOptions &displayOptions,
const FilterOptions &filterOptions)
{
- /// \warning This is a workaround for Sword constness
- sword::ListKey list = l;
CPrinter::KeyTreeItem::Settings settings;
CPrinter::KeyTree tree; /// \todo Verify that items in tree are properly freed.
- setProgressRange(list.Count());
- for (int i=0; i< list.Count(); i++) {
+ setProgressRange(list.getCount());
+ for (int i=0; i< list.getCount(); i++) {
const sword::SWKey* swKey = list.getElement(i);
const sword::VerseKey* vKey = dynamic_cast<const sword::VerseKey*>(swKey);
if (vKey != 0) {
@@ -370,13 +367,13 @@ bool CExportManager::printByHyperlink(const QString &hyperlink,
if (module) {
//check if we have a range of entries or a single one
if ((module->type() == CSwordModuleInfo::Bible) || (module->type() == CSwordModuleInfo::Commentary)) {
- sword::ListKey verses = sword::VerseKey().ParseVerseList((const char*)keyName.toUtf8(), "Genesis 1:1", true);
+ sword::ListKey verses = sword::VerseKey().parseVerseList((const char*)keyName.toUtf8(), "Genesis 1:1", true);
- for (int i = 0; i < verses.Count(); ++i) {
+ for (int i = 0; i < verses.getCount(); i++) {
sword::VerseKey* element = dynamic_cast<sword::VerseKey*>(verses.getElement(i));
if (element) {
- const QString startKey = QString::fromUtf8(element->LowerBound().getText());
- const QString stopKey = QString::fromUtf8(element->UpperBound().getText());
+ const QString startKey = QString::fromUtf8(element->getLowerBound().getText());
+ const QString stopKey = QString::fromUtf8(element->getUpperBound().getText());
tree.append( new CPrinter::KeyTreeItem(startKey, stopKey, module, settings) );
}