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... » Unnecessary variable in RTFEncoder
Unnecessary variable in RTFEncoder [message #26248] Sat, 17 April 2010 11:26 Go to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi,

I found something weird in CtrlCore/EncodeRTF.cpp. In RTFEncoder::PutTxt() on line 561 there is following code:
bool hdiff = (para.format.bullet != RichPara::BULLET_NONE
	&& para.format.bullet != RichPara::BULLET_TEXT && para_ht != para_ht);
if(pstyle != oldstyle
|| para.format.bullet != parafmt.bullet || para.format.bullet == RichPara::BULLET_TEXT
|| hdiff || para.format.tab != parafmt.tab || para.format.newpage || parafmt.newpage) {
	...
}

If I'm not mistaken para_ht != para_ht is always false, therefore hdiff is always false as well and it never changes influence the if statement evaluation.

Either hdiff can be safely removed or there is something missing.

Best regards,
Honza
Re: Unnecessary variable in RTFEncoder [message #26257 is a reply to message #26248] Mon, 19 April 2010 06:20 Go to previous messageGo to next message
rylek is currently offline  rylek
Messages: 79
Registered: November 2005
Member
Hi there!

Thanks, fixed. That was just a stupid typo which perhaps appeared during a series of refactorings; there were two para_ht's, one local in the method, the other a member variable in RTFEncoder. I've renamed the local variable as new_para_ht.

Thanks for the report

Tomas
Re: Unnecessary variable in RTFEncoder [message #26263 is a reply to message #26257] Mon, 19 April 2010 19:02 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi Tomas,

Thank to guys developing clang & llvm. It was one of the nicely verbose warnings clang emits Smile

Honza
Previous Topic: Report in landscape and portrait at the same time
Next Topic: How to define the width of a table?
Goto Forum:
  


Current Time: Thu Mar 28 22:38:24 CET 2024

Total time taken to generate the page: 0.00801 seconds