[Libreoffice] Duplicate code: hwpreader.cxx

Michael Meeks michael.meeks at novell.com
Tue Jun 7 11:34:34 PDT 2011

Hi Christina,

On Mon, 2011-06-06 at 09:13 +0200, Chr. Rossmanith wrote:
> I had a look at the two methods
> void HwpReader::makeCaptionStyle(FBoxStyle * fstyle) and
> void HwpReader::makeFStyle(FBoxStyle * fstyle)

	Wow - there is a nice big huge block of identical code there to
share :-)

> which share identical code which I would like to move into a seperate 
> method lcl_addCellLinetype() or some such. I just wonder why when 
> dealing with linetypes "fo:padding" is added. Around line 2610 where you 
> find the duplicate codeblock "fo:border" is set. I hope the following 
> diff makes it clear?

	Sadly the history doesn't help either it seems to come from the initial
checkin; do we have any hwp files that that filter uses to test I
wonder ?

> And maybe someone could translate those comments - obviously not from 
> Hamburg :-)

	The google translation seemed pretty helpful when someone posted it (I
guess with some hacker review & cleanup).

	For now, of course adding a boolean 'bMagic' or whatever, at least
reduces size, complexity and makes it clearer.

	How do you find these cut/paste monsters ? :-)



 michael.meeks at novell.com  <><, Pseudo Engineer, itinerant idiot

More information about the LibreOffice mailing list