Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » RichText,QTF,RTF... » page numbering
Re: page numbering [message #5261 is a reply to message #5256] Tue, 12 September 2006 01:09 Go to previous messageGo to previous message
zsolt is currently offline  zsolt
Messages: 698
Registered: December 2005
Location: Budapest, Hungary
Contributor
When using Report::Header(), the stylesheet data is shown also. This is because a bug in Report::FormatHF() method.

The original one was:
String  Report::FormatHF(const char *s, int pageno)
{
	String result;
	while(*s) {
		if(s[0] == '$' && s[1] == '$') {
			if(s[2] == 'P')
				result.Cat(Format("%d", pageno + 1));
			if(s[2] == 'D')
				result.Cat(Format(GetSysDate()));
			s += 3;
		}
		result.Cat(*s++);
	}
	return result;
}


And the fixed one is:
String  Report::FormatHF(const char *s, int pageno)
{
	String result;
	while(*s) {
		if(s[0] == '$' && s[1] == '$') {
			if(s[2] == 'P'){
				result.Cat(Format("%d", pageno + 1));
				s += 3;
			}
			if(s[2] == 'D'){
				result.Cat(Format(GetSysDate()));
				s += 3;
			}
		}
		result.Cat(*s++);
	}
	return result;
}

BTW, this code is very tricky Smile First I thought, this can generate a segfault. I'm learning every time when reading your code Smile
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to insert and display *.png file in UWord and/or qtf??
Next Topic: report / qtf to pdf saving
Goto Forum:
  


Current Time: Sun May 12 21:01:48 CEST 2024

Total time taken to generate the page: 0.02941 seconds