[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
patch for color_properties assignment
From: |
John W. Eaton |
Subject: |
patch for color_properties assignment |
Date: |
Tue, 24 Jul 2007 15:02:00 -0400 |
On 7-Jul-2007, Shai Ayal wrote:
| I attach a patch to fix color_property assignment.
|
| As discussed earlier on at least 2 other threads, color_property and
| radio_value are unique in the graphics properties objects in that
| their set of allowable values is defined at runtime in their
| constructor. This in turn means that assignment of new values to these
| objects cannot be done by converting an octave_value object to them
| with a constructor, but rather using assignment:
| instead of
|
| color_property color("aa|bb|cc");
| octave_value ov("bb");
| ...
| // don't use this -- it will destroy the old color definition and
| throw an error!
| //color = color_property(ov);
| // use assignment to keep old definition and give no error
| color = ov;
|
| this patch adds the
| color_property& color_property::operator = (const octave_value& val)
| operator to facilitate this syntax, and also fixes the assignment in
| line_properties
OK, I think I finally understand the problem here. I applied this
patch.
Thanks,
jwe
patch for color_properties assignment,
John W. Eaton <=