[sword-cvs] sword/apps/windoze swdisprtfchap.cpp,1.17,1.18
sword@www.crosswire.org
sword@www.crosswire.org
Fri, 9 May 2003 16:51:18 -0700
Update of /usr/local/cvsroot/sword/apps/windoze
In directory www:/tmp/cvs-serv8050
Modified Files:
swdisprtfchap.cpp
Log Message:
fixed hrefs in Bibles
Index: swdisprtfchap.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/swdisprtfchap.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** swdisprtfchap.cpp 30 Apr 2003 08:18:45 -0000 1.17
--- swdisprtfchap.cpp 9 May 2003 23:51:16 -0000 1.18
***************
*** 133,136 ****
--- 133,137 ----
}
newtext = newtext + RTFTrailer;
+
key->Verse(1); //{ When setting chapter: if (verse <> new chapter range) don't autonormalize. (we could've just turned the autonormalize option off then back on, but this is cooler) }
key->Chapter(1);
***************
*** 143,147 ****
RTFStream->WriteBuffer(newtext.c_str(), newtext.Length());
RTFStream->Position = 0;
! Lines->LoadFromStream(RTFStream);
//{ Position control text at current verse }
--- 144,172 ----
RTFStream->WriteBuffer(newtext.c_str(), newtext.Length());
RTFStream->Position = 0;
! Lines->LoadFromStream(RTFStream);
!
! // make links
! while (true) {
! int start, len, foundAt, endAt;
!
! start = (SelLength) ? SelStart + SelLength : 0;
! len = Text.Length() - start;
! foundAt = this->SearchText("<a href=\"\">", start, len, TRichSearchTypes());
! if (foundAt == -1)
! break;
!
! SelStart = foundAt;
! SelLength = 11;
! this->SelText = "";
! endAt = this->SearchText("</a>", foundAt, len, TRichSearchTypes());
! if (foundAt == -1)
! break;
! SelStart = endAt;
! SelLength = 4;
! this->SelText = "";
! SelStart = foundAt;
! SelLength = endAt - foundAt;
! this->SelAttributes->Link = true;
! }
//{ Position control text at current verse }