Hi Malte,

> 1) SetMaxLen( 0 ) should IMHO mean "no limit" in both cases.

okay.

> 2) WTF is STRING_NOLIMIT, and how is it related to a MultiLineEdit?
> I see an EDIT_NOLIMIT, and that definition only makes sense for an
> Edit, not for a MultiLineEdit. It's STRING_LEN, which more or less a
> "no limit" for an edit which only holds one string.

Sorry, typo: It is in fact EDIT_NOLIMIT.

Digging deeper, in fact the TextView treats a 0-MaxTextLen (which is
also the construction-time default of the TextEngine) as if no
MaxTextLen has been set.

Strange: A TextView constructor calls a SetMaxTextLen at it's
TextEngine, with an argument of STRING_MAXLEN (which happens to be the
same as STRING_LEN, which is the same as EDIT_NOLIMIT).

So, the situation is:
SetMaxTextLen( 0 ) results in a unlimited MaxTextLen, but in one case, a
subsequent GetMaxTextLen returns EDIT_NOLIMIT, in the other, it returns 0.
Which makes it quite difficult to handle both classes consistently, if
you only have an Edit pointer.


So, changing MultiLineEdit to use EDIT_NOLIMIT is not an option, as you
say. Changing Edit to use 0 as "no limit" (in the sense of also
returning it) is also not an option, since this would be a pretty big
change.
So, the only ideas which come to my mind is
- work around the problem in my specific code
- introduce some
    virtual bool IsUnlimitedTextLen() const;
  (or so) in both classes

Ciao
Frank

-- 
- Frank Schönheit, Software Engineer         [EMAIL PROTECTED] -
- Sun Microsystems                      http://www.sun.com/staroffice -
- OpenOffice.org Database                   http://dba.openoffice.org -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to