Re: msevior - r22991 - abiword/trunk/src/text/fmt/xp

From: Ryan Pavlik <abiryan_at_ryand.net>
Date: Sun Mar 02 2008 - 13:54:57 CET

J.M. Maurer wrote:
> On Sun, 2008-03-02 at 13:14 +0100, cvs@abisource.com wrote:
>
>> + m_iClearLeftOffset = getHeight()/5;
>>
>
> Huh? This /5 looks very random, where does it come from?
>
>
>> + if(getGraphics() && (m_iClearLeftOffset <
>> getGraphics()->tlu(3)))
>> + m_iClearLeftOffset = getGraphics()->tlu(3);
>>
>
> Same for this 3 :)
>
> Cheers!
> Marc
>
>
>
I don't like magic numbers in the code either. Solution:

+ #define FIVE 5
+ #define THREE 3

+ m_iClearLeftOffset = getHeight()/FIVE;

+ if(getGraphics() && (m_iClearLeftOffset <
getGraphics()->tlu(THREE)))
+ m_iClearLeftOffset = getGraphics()->tlu(THREE);

:D

Hopefully it made you smile...

-- 
Ryan Pavlik
www.cleardefinition.com
#282  +  (442) -  [X]
A programmer started to cuss
Because getting to sleep was a fuss
As he lay there in bed
Looping 'round in his head
was: while(!asleep()) sheep++;
Received on Sun Mar 2 13:56:14 2008

This archive was generated by hypermail 2.1.8 : Sun Mar 02 2008 - 13:56:14 CET