Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi Christina,

On Sun, 2011-05-08 at 23:08 +0200, Chr. Rossmanith wrote:
there are two slightly different implementations of SwDoc::SplitDoc(), 

        Wow - that is -horrible- :-) sw/source/core/doc/docglbl.cxx takes quite
some reading. Anyone cutting and pasting code like that deserves a
near-death experience ...

depending on the third parameter given. As far as I can see they only 
differ in the way pSttNd (what stands Stt for?) and pEndNd are found. If 
that's true, I'd suggest to have two different GetEndNode() and 
GetSttNode() methods and only one

        Right.

with either pSplitColl OR nOutlineLevel passed as parameter but not 
both. Would that be bad coding style ?

        It would be great; we could leave the public methods as they are now,
and have a single private impl. that they call with the extra
'bool bOutline' or whatever ?

 On the other hand, are ~200 lines of identical code good style ?

        Simply terrible :-)

 Any suggestions how to get rid of the duplicates else?

        I would save each method to its own file, and do a 'diff -uw' between
them to be sure we isolated all the changes. Then add a boolean
conditional in there instead, and revert to a single version. Of course,
any differences may be bug fixes that only hit one version ;-) so I'd be
inclined to check their provenance in the git record.

        HTH,

                Michael.

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



Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.