From 750a14b701fdad9568e7d21eae3b63f7c67db4b0 Mon Sep 17 00:00:00 2001 From: Chris Little Date: Sun, 14 Oct 2001 00:31:32 +0000 Subject: fixed PBR section headings output made each new run of the outputter recreate the SWMgr upon completion git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@10 07627401-56e2-0310-80f4-f8cd0041bdcd --- Diaspora/Diaspora.bpr | 15 ++++++++------- Diaspora/Diaspora.cpp | 18 ++++++++++++++++++ Diaspora/Main.cpp | 41 ++++++++++++++++++++++++++++++++--------- Diaspora/Main.h | 17 +++++++++++++++++ 4 files changed, 75 insertions(+), 16 deletions(-) (limited to 'Diaspora') diff --git a/Diaspora/Diaspora.bpr b/Diaspora/Diaspora.bpr index b07460b..b2b05d0 100644 --- a/Diaspora/Diaspora.bpr +++ b/Diaspora/Diaspora.bpr @@ -4,7 +4,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -34,12 +34,13 @@ - - + cpp -D_DEBUG -boa"/> + + - - + + diff --git a/Diaspora/Diaspora.cpp b/Diaspora/Diaspora.cpp index 74e063b..7fde538 100644 --- a/Diaspora/Diaspora.cpp +++ b/Diaspora/Diaspora.cpp @@ -1,3 +1,20 @@ +/* + * + * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org) + * CrossWire Bible Society + * P. O. Box 2528 + * Tempe, AZ 85280-2528 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation version 2. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + */ //--------------------------------------------------------------------------- #include @@ -5,6 +22,7 @@ USERES("Diaspora.res"); USELIB("swordlib.lib"); USEFORM("Main.cpp", MainForm); +USEUNIT("thmlpbr.cpp"); //--------------------------------------------------------------------------- WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { diff --git a/Diaspora/Main.cpp b/Diaspora/Main.cpp index 7de2bfc..e97ae8e 100644 --- a/Diaspora/Main.cpp +++ b/Diaspora/Main.cpp @@ -1,3 +1,20 @@ +/* + * + * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org) + * CrossWire Bible Society + * P. O. Box 2528 + * Tempe, AZ 85280-2528 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation version 2. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + */ //--------------------------------------------------------------------------- #include #pragma hdrstop @@ -9,6 +26,8 @@ #include #include #include +#include "thmlpbr.h" + #include #include @@ -188,6 +207,7 @@ void __fastcall TMainForm::outputClick(TObject *Sender) static ThMLOLB olboutputfilter; static ThMLGBF gbfoutputfilter; static ThMLPlain plainoutputfilter; + static ThMLPBR pbroutputfilter; int format; if (fmtOLB->Checked) format = OLB; @@ -235,9 +255,9 @@ void __fastcall TMainForm::outputClick(TObject *Sender) if (optRoman->Checked){} - if (format == OLB) { + if (format == OLB) manager->setGlobalOption("Headings","Off"); - } + for (int i = 0; i < modlist->Items->Count; i++) { if (modlist->Checked[i]) { @@ -833,12 +853,12 @@ void __fastcall TMainForm::outputClick(TObject *Sender) } } fprintf(ofile, "\n"); - mod->RemoveRenderFilter(&gbfoutputfilter); + mod->RemoveRenderFilter(&gbfoutputfilter); } } else if (format == PBR) { if (!strcmp(mod->Type(), "Biblical Texts") || !strcmp(mod->Type(), "Commentaries")) { - mod->AddRenderFilter(&plainoutputfilter); + mod->AddRenderFilter(&pbroutputfilter); LocaleMgr::systemLocaleMgr.setDefaultLocaleName(lang); fprintf(ofile, "\n\n"); fprintf(ofile, "\n", (char*)mod->Name(), (char*)mod->Description(), rtl ? "RIGHT" : "LEFT"); @@ -906,7 +926,7 @@ void __fastcall TMainForm::outputClick(TObject *Sender) int len = 2 * strlen(vkey2->books[testament - 1][book - 1].name); char* localname = new char[len]; strcpy (localname, vkey2->books[testament - 1][book - 1].name); - latin1filter.ProcessText(localname, len, NULL); + //latin1filter.ProcessText(localname, len, NULL); fprintf (ofile, "\n", localname, palmbooks[book + (39 * (testament - 1))], palmbooknames[book + (39 * (testament - 1))]); delete localname; @@ -938,13 +958,13 @@ void __fastcall TMainForm::outputClick(TObject *Sender) int len = 2 * strlen(vkey->books[testament - 1][book - 1].name); char* localname = new char[len]; strcpy (localname, vkey->books[testament - 1][book - 1].name); - latin1filter.ProcessText(localname, len, NULL); + //latin1filter.ProcessText(localname, len, NULL); fprintf(ofile, "%s", localname); delete localname; } - fprintf (ofile, "Chapter %d", chapter); + fprintf (ofile, "Chapter %d", chapter); } fprintf (ofile, "%s<\/VERSE>\n", text); @@ -989,7 +1009,7 @@ void __fastcall TMainForm::outputClick(TObject *Sender) } fprintf(ofile, "<\/CHAPTER>\n<\/BOOK>\n<\/BIBLE>\n"); - mod->RemoveRenderFilter(&plainoutputfilter); + mod->RemoveRenderFilter(&pbroutputfilter); } } @@ -997,7 +1017,10 @@ void __fastcall TMainForm::outputClick(TObject *Sender) feedback->Lines->Add(modlist->Items->Strings[i] + " - Complete"); } } - feedback->Lines->Add("All Modules Complete"); + feedback->Lines->Add("Cleaning up..."); + delete manager; + manager = new SWMgr(); + feedback->Lines->Add("Finished"); } //--------------------------------------------------------------------------- diff --git a/Diaspora/Main.h b/Diaspora/Main.h index 4bd6d6d..1636682 100644 --- a/Diaspora/Main.h +++ b/Diaspora/Main.h @@ -1,3 +1,20 @@ +/* + * + * Copyright 2001 CrossWire Bible Society (http://www.crosswire.org) + * CrossWire Bible Society + * P. O. Box 2528 + * Tempe, AZ 85280-2528 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation version 2. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + */ //--------------------------------------------------------------------------- #ifndef MainH #define MainH -- cgit