[sword-cvs] sword/apps/windoze/CBuilder5/BibleCS AboutBoxfrm.dfm,1.48,1.49 RxRichEditX.cpp,1.43,1.44 RxRichEditX.h,1.16,1.17 mainfrm.cpp,1.122,1.123 sword.bpr,1.113,1.114 sword.res,1.100,1.101

sword@www.crosswire.org sword@www.crosswire.org
Sun, 22 Jun 2003 16:50:25 -0700


Update of /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS
In directory www:/tmp/cvs-serv6574/apps/windoze/CBuilder5/BibleCS

Modified Files:
	AboutBoxfrm.dfm RxRichEditX.cpp RxRichEditX.h mainfrm.cpp 
	sword.bpr sword.res 
Log Message:
RTF SelText bug fixes with added SetTextWide function
Memory leak in zstr flushCache fixed
empty popups supressed

Index: AboutBoxfrm.dfm
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** AboutBoxfrm.dfm	30 Apr 2003 08:18:45 -0000	1.48
--- AboutBoxfrm.dfm	22 Jun 2003 23:50:23 -0000	1.49
***************
*** 104,108 ****
        Height = 21
        AutoSize = False
!       Caption = 'v1.5.6pre'
        IsControl = True
      end
--- 104,108 ----
        Height = 21
        AutoSize = False
!       Caption = 'v1.5.6pre3'
        IsControl = True
      end

Index: RxRichEditX.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** RxRichEditX.cpp	18 Jun 2003 23:37:21 -0000	1.43
--- RxRichEditX.cpp	22 Jun 2003 23:50:23 -0000	1.44
***************
*** 280,284 ****
  
  
! void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool heading, bool verseNum, const char *type, bool stripNewlines) {
  	string fontname;
  	TMemoryStream *RTFStream = new TMemoryStream();
--- 280,284 ----
  
  
! bool TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool heading, bool verseNum, const char *type, bool stripNewlines) {
  	string fontname;
  	TMemoryStream *RTFStream = new TMemoryStream();
***************
*** 286,289 ****
--- 286,290 ----
  	static UnicodeRTF filter;
  	SWBuf buf;
+ 	bool atLeastOneEntry = false;
  
  	this->module = module;
***************
*** 329,338 ****
  			else	{
  				char *buf2 = 0;
! 				stdstr(&buf2, (const char *)*verses);
! 				toupperstr_utf8(buf2);
  				module->getRawEntry();
  				char *buf3 = 0;
! 				stdstr(&buf3, (const char *)module->KeyText());
! 				toupperstr_utf8(buf3);
  				int i;
  				char *start1 = buf3;
--- 330,339 ----
  			else	{
  				char *buf2 = 0;
! 				stdstr(&buf2, (const char *)*verses, 2);
! 				toupperstr_utf8(buf2, strlen(buf2)*2);
  				module->getRawEntry();
  				char *buf3 = 0;
! 				stdstr(&buf3, (const char *)module->KeyText(), 2);
! 				toupperstr_utf8(buf3, strlen(buf3)*2);
  				int i;
  				char *start1 = buf3;
***************
*** 357,366 ****
  				if (!i || i < (strlen(start1)/2)) {
  					delete [] buf2;
!                                         delete [] buf3;
  					verses->Remove();
  					continue;
  				}
  				delete [] buf2;
!                                 delete [] buf3;
  				if (!first)
  					newtext += "{\\par\\par}";
--- 358,367 ----
  				if (!i || i < (strlen(start1)/2)) {
  					delete [] buf2;
! 					delete [] buf3;
  					verses->Remove();
  					continue;
  				}
  				delete [] buf2;
! 				delete [] buf3;
  				if (!first)
  					newtext += "{\\par\\par}";
***************
*** 375,378 ****
--- 376,380 ----
  				newtext += RTFHeadingPost;
  				newtext += "{\\par}";
+ 				atLeastOneEntry = true;
  			}
  //			newtext += RTFHeadingPost;
***************
*** 450,453 ****
--- 452,456 ----
  
  	delete RTFStream;
+ 	return atLeastOneEntry;
  }
  

Index: RxRichEditX.h
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/RxRichEditX.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** RxRichEditX.h	18 Jun 2003 23:37:21 -0000	1.16
--- RxRichEditX.h	22 Jun 2003 23:50:23 -0000	1.17
***************
*** 105,109 ****
  	TRxRichEditX(TWinControl *parent);
  	int paintTo(HDC, TRect *size, int margin = 4);
! 	void fillWithVerses(SWModule *module, ListKey *verses, bool heading = true, bool verseNum = true, const char* type = "Default", bool stripNewlines = true);
  	void fillWithRTFString(SWModule *module, const char *text, const char *type = "Default");
  	void getDisplayPrefs(DISP_ATTRIBS *attribs, SWModule *module);
--- 105,109 ----
  	TRxRichEditX(TWinControl *parent);
  	int paintTo(HDC, TRect *size, int margin = 4);
! 	bool fillWithVerses(SWModule *module, ListKey *verses, bool heading = true, bool verseNum = true, const char* type = "Default", bool stripNewlines = true);
  	void fillWithRTFString(SWModule *module, const char *text, const char *type = "Default");
  	void getDisplayPrefs(DISP_ATTRIBS *attribs, SWModule *module);
***************
*** 118,121 ****
--- 118,123 ----
  	WideString __fastcall GetText();
  	long __fastcall TextLen();
+ 	WideString __fastcall GetSelTextWide() {return GetTextRange(SelStart, SelStart + SelLength); }
+ 	__property WideString SelTextWide = {read=GetSelTextWide};
  	WideString __fastcall GetTextRange(int StartPos, int EndPos);
  	WideString __fastcall WordAtCursor(void);

Index: mainfrm.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp,v
retrieving revision 1.122
retrieving revision 1.123
diff -C2 -d -r1.122 -r1.123
*** mainfrm.cpp	19 Jun 2003 16:58:30 -0000	1.122
--- mainfrm.cpp	22 Jun 2003 23:50:23 -0000	1.123
***************
*** 428,432 ****
  	if (mainmgr) {
  		it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str());
! 		if (it != mainmgr->Modules.end()) {
  			SWModule *module = it->second;
  			module->Display();
--- 428,438 ----
  	if (mainmgr) {
  		it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str());
! 		if (pc->ActivePage->Caption == "PARALLEL") {
! 			parallelDisp->Display();
! 			pc->Hint = "PARALLEL";
! 			if (logmodstate)
! 				modstates.insert(modstates.begin(), new ModState(pc, pc->ActivePage, *DefaultVSKey));
! 		}
! 		else if (it != mainmgr->Modules.end()) {
  			SWModule *module = it->second;
  			module->Display();
***************
*** 437,446 ****
  				FillDictKeys();
  		}
- 		else if (pc->ActivePage->Caption == "PARALLEL") {
- 			parallelDisp->Display();
- 			pc->Hint = "PARALLEL";
- 			if (logmodstate)
- 				modstates.insert(modstates.begin(), new ModState(pc, pc->ActivePage, *DefaultVSKey));
- 		}
  	}
  }
--- 443,446 ----
***************
*** 2169,2172 ****
--- 2169,2174 ----
  	i12ize(loc);
  
+ 
+ 
  	// Change the panels attributes here
  	for (it = mainmgr->Modules.begin(); it != mainmgr->Modules.end(); it++) {
***************
*** 2178,2182 ****
  		}
  	}
- 
  	// Change the text entry field color
  	tmpval = optionsconf->Sections["Appearance"]["FieldColor"];
--- 2180,2183 ----
***************
*** 2241,2245 ****
  				TTabSheet *ts = pc->Pages[i];
  				
! 				SWModule *module = mainmgr->Modules[ts->Caption.c_str()];
  				if (module) {
  					HintStr = module->Description();
--- 2242,2255 ----
  				TTabSheet *ts = pc->Pages[i];
  				
! 				SWModule *module = 0;
! 				if (ts->Caption == "PARALLEL") {
! 					module = parallelDisp->getModules()[0];
! 				}
! 				else {
! 					ModMap::iterator it = mainmgr->Modules.find(ts->Caption.c_str());
! 					if (it != mainmgr->Modules.end())
! 						module = it->second;
! 				}
! 					
  				if (module) {
  					HintStr = module->Description();
***************
*** 2254,2257 ****
--- 2264,2268 ----
  	if ((strncmp(HintInfo.HintControl->Name.c_str(), "TextRTF", 7)) &&
  			(strncmp(HintInfo.HintControl->Name.c_str(), "CommentRTF", 10)) &&
+ 			(strncmp(HintInfo.HintControl->Name.c_str(), "ParallelRTF", 11)) &&
  			(strncmp(HintInfo.HintControl->Name.c_str(), "BookRTF", 7)) &&
  			(strncmp(HintInfo.HintControl->Name.c_str(), "LexDictRTF", 10))) {
***************
*** 2260,2264 ****
  	char *modName = 0;
  	stdstr(&modName, HintInfo.HintControl->Name.c_str());
! 	SWModule *module = mainmgr->Modules[(strstr(modName, "RTF")+3)];
  	delete [] modName;
  		
--- 2271,2287 ----
  	char *modName = 0;
  	stdstr(&modName, HintInfo.HintControl->Name.c_str());
! 	SWModule *module = 0;
! 
! 
! 	if (!strcmp(modName, "ParallelRTF")) {
! 		module = parallelDisp->getModules()[0];
! 	}
! 	else {
! 		ModMap::iterator it = mainmgr->Modules.find(strstr(modName, "RTF")+3);
! 		if (it != mainmgr->Modules.end())
! 			module = it->second;
! 	}
! 
! 
  	delete [] modName;
  		
***************
*** 2322,2326 ****
  		else {
  			selected = true;
! 			targetWord = rtf->SelText;
  		}
  			
--- 2345,2349 ----
  		else {
  			selected = true;
! 			targetWord = rtf->SelTextWide;
  		}
  			
***************
*** 2448,2452 ****
  				string tmpval = optionsconf->Sections["ModDefaults"][feature.c_str()];
  				if (tmpval.size()) {
! 					SWModule *defMod = mainmgr->Modules[tmpval];
  					if (!defMod) {
  						HintStr = "";
--- 2471,2478 ----
  				string tmpval = optionsconf->Sections["ModDefaults"][feature.c_str()];
  				if (tmpval.size()) {
! 					SWModule *defMod = 0;
! 					ModMap::iterator it = mainmgr->Modules.find(tmpval);
! 					if (it != mainmgr->Modules.end())
! 						defMod = it->second;
  					if (!defMod) {
  						HintStr = "";
***************
*** 2455,2460 ****
  					ListKey key;
  					key << WideStringToUTF8(strongsWord).c_str();
! 					RTFHintForm->rtfDrawer->fillWithVerses(defMod, &key, true, false, "Popup");
! 					HintStr = "show rtf";
  					break;
  				}
--- 2481,2486 ----
  					ListKey key;
  					key << WideStringToUTF8(strongsWord).c_str();
! 					bool validEntry = RTFHintForm->rtfDrawer->fillWithVerses(defMod, &key, true, false, "Popup");
! 					HintStr = (validEntry) ? "show rtf" : "";
  					break;
  				}
***************
*** 2466,2476 ****
  			string tmpval = optionsconf->Sections["ModDefaults"]["GenDict"];
  			if (tmpval.size()) {
! 				SWModule *defMod = mainmgr->Modules[tmpval];
  				if (!defMod)
  					break;
  				ListKey key;
  				key << WideStringToUTF8(targetWord).c_str();
! 				RTFHintForm->rtfDrawer->fillWithVerses(defMod, &key, true, false, "Popup");
! 				HintStr = (key.Count()) ? "show rtf" : "";
  				break;
  			}
--- 2492,2505 ----
  			string tmpval = optionsconf->Sections["ModDefaults"]["GenDict"];
  			if (tmpval.size()) {
! 				SWModule *defMod = 0;
! 				ModMap::iterator it = mainmgr->Modules.find(tmpval);
! 				if (it != mainmgr->Modules.end())
! 					defMod = it->second;
  				if (!defMod)
  					break;
  				ListKey key;
  				key << WideStringToUTF8(targetWord).c_str();
! 				bool validEntry = RTFHintForm->rtfDrawer->fillWithVerses(defMod, &key, true, false, "Popup");
! 				HintStr = (validEntry) ? "show rtf" : "";
  				break;
  			}

Index: sword.bpr
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/sword.bpr,v
retrieving revision 1.113
retrieving revision 1.114
diff -C2 -d -r1.113 -r1.114
*** sword.bpr	19 Jun 2003 16:58:30 -0000	1.113
--- sword.bpr	22 Jun 2003 23:50:23 -0000	1.114
***************
*** 76,80 ****
  MinorVer=5
  Release=5
! Build=33
  Debug=0
  PreRelease=0
--- 76,80 ----
  MinorVer=5
  Release=5
! Build=40
  Debug=0
  PreRelease=0
***************
*** 88,92 ****
  CompanyName=CrossWire Software &amp; Bible Society
  FileDescription=Windows 32bit User Interface to The SWORD Project
! FileVersion=1.5.5.33
  InternalName=biblecs
  LegalCopyright=(c) 2002 CrossWire Bible Society under the terms of the GNU General Public License
--- 88,92 ----
  CompanyName=CrossWire Software &amp; Bible Society
  FileDescription=Windows 32bit User Interface to The SWORD Project
! FileVersion=1.5.5.40
  InternalName=biblecs
  LegalCopyright=(c) 2002 CrossWire Bible Society under the terms of the GNU General Public License
***************
*** 94,98 ****
  OriginalFilename=
  ProductName=The SWORD Project
! ProductVersion=1.5.6pre
  Comments=Seek Him and you will find Him
  
--- 94,98 ----
  OriginalFilename=
  ProductName=The SWORD Project
! ProductVersion=1.5.6pre3
  Comments=Seek Him and you will find Him
  

Index: sword.res
===================================================================
RCS file: /usr/local/cvsroot/sword/apps/windoze/CBuilder5/BibleCS/sword.res,v
retrieving revision 1.100
retrieving revision 1.101
diff -C2 -d -r1.100 -r1.101
Binary files /tmp/cvsT8XyRU and /tmp/cvsCrG1G1 differ