[sword-cvs] sword/src/modules/comments/hrefcom hrefcom.cpp,1.12,1.13

sword@www.crosswire.org sword@www.crosswire.org
Mon, 24 Feb 2003 21:12:49 -0700


Update of /usr/local/cvsroot/sword/src/modules/comments/hrefcom
In directory www:/tmp/cvs-serv2325/src/modules/comments/hrefcom

Modified Files:
	hrefcom.cpp 
Log Message:
no message

Index: hrefcom.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/modules/comments/hrefcom/hrefcom.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** hrefcom.cpp	1 Oct 2002 19:52:40 -0000	1.12
--- hrefcom.cpp	25 Feb 2003 04:12:47 -0000	1.13
***************
*** 57,64 ****
   */
  
! char *HREFCom::getRawEntry() {
  	long  start;
  	unsigned short size;
- 	char *tmpbuf;
  	VerseKey *key = 0;
  
--- 57,63 ----
   */
  
! SWBuf &HREFCom::getRawEntryBuf() {
  	long  start;
  	unsigned short size;
  	VerseKey *key = 0;
  
***************
*** 74,99 ****
  		key = new VerseKey(this->key);
  
! 	findoffset(key->Testament(), key->Index(), &start, &size);
  	entrySize = size;        // support getEntrySize call
  
! 	unsigned long newsize = ((size + 2) + strlen(prefix)) * FILTERPAD;
! 	if (newsize > entrybufallocsize) {
! 		if (entrybuf)
! 			delete [] entrybuf;
! 		entrybuf = new char [ newsize ];
! 		entrybufallocsize = newsize;
! 	}
! 	tmpbuf   = new char [ size + 10 ];
! 
! 	readtext(key->Testament(), start, size + 2, tmpbuf);
! 	sprintf(entrybuf, "%s%s", prefix, tmpbuf);
! 	preptext(entrybuf);
  
! 	delete [] tmpbuf;
  
  	if (key != this->key)
  		delete key;
  
! 	return entrybuf;
  }
  
--- 73,90 ----
  		key = new VerseKey(this->key);
  
! 	findOffset(key->Testament(), key->Index(), &start, &size);
  	entrySize = size;        // support getEntrySize call
  
! 	SWBuf tmpbuf;
  
! 	readText(key->Testament(), start, size, tmpbuf);
! 	entryBuf = prefix;
! 	entryBuf += tmpbuf.c_str();
! 	prepText(entryBuf);
  
  	if (key != this->key)
  		delete key;
  
! 	return entryBuf;
  }