On 23 May 2001, Lars Gullik [iso-8859-1] Bjønnes wrote:
> John Levon <[EMAIL PROTECTED]> writes:
>
> | On 23 May 2001, Lars Gullik [iso-8859-1] Bjønnes wrote:
> |
> | > | - make sure that table is ready, in particular in terms of memory
> | > | consumption
> | >
> | > I guess it is still too high... It is possible that the
> | > SharedContainer could help a bit.
> |
> | actually I was experimenting with this today (for the common attributes
> | of LyXTabular::cell_struct). I'm not sure it's worth it (space saved vs.
> | time spent searching through the container) but maybe it is.
> |
> | The thing I don't like is that using shared container is a bit of a pain.
> | You have to have the get/set methods for every element of the structure,
> | as you must make sure to only change values via a temporary structure
> | that you then do container.get(tmp) on.
> |
> | I wonder if there is some way to avoid all this tedious glue code (like most
> | of PargraphParameters.C)
>
> so of this is glue code, but class variables should really _never_ be
> anything else than private anyway. All out of class access should be
> done with getters and setters. (ok I break this with the paragraph
> parameters...at least it seems like that)
ah, but for tabular.C the case is different. struct cell_struct is strictly
internal, so the get/set rule is already abided by. But using a sharecontainer
would require an /additional/ level of get/sets to make the internal code of
tabular.C use the correct method for updating params.
I basically want to avoid 10 or so little set functions that all look like :
Struct tmp(*param);
tmp.member = mem;
set_From_struct(tmp);
and the corresponding get accessors, when we are already abiding by the get/set rule.
But I can't think how :(
> I guess you mean InsetText... I have to have a look, could be.
yes.
> rememver that if it is a gain depends upon how meny objects of the
> specific types is in existance. If only a few objects the gain will be
> very small.
yes, and of course how variable the objects are; so we want to leave out things
like widths etc.
In my old cell_struct code for tabular :
/// private cell parameters
struct cell_parameters {
/// beginning/part of multicolumn span ?
MultiColType multicolumn;
/// horizontal alignment
LyXAlignment alignment;
/// vertical alignment
VAlignment valignment;
/// top line present
bool top_line;
/// bottom line present
bool bottom_line;
/// left line present
bool left_line;
/// right line present
bool right_line;
///
BoxType usebox;
///
bool rotate;
/// special alignment
string align_special;
/// multicolumn p width
string p_width;
};
as I think these are likely to stay defaults for most cells.
thanks
john
p.s. why is lyx-devel suddenly busy again ;)
--
"Khendon's Law: If the same point is made twice by the same person,
the thread is over."