Re: [PATCH] Database shapes and start arrow



At 26.04.2012 01:16, Jim Ursetto wrote:
On Apr 25, 2012, at 2:58 PM, Hans Breuer wrote:

At 25.04.2012 00:36, Jim Ursetto wrote:
[...]
OK.  But I don't see how to set the default value for a missing optional
property.  It seems to set to the object creation default, which will be
whatever the current default start arrow is at load time; this is
obviously wrong.  I need to override this to "no arrow" when loading an
old file.  Suggestions?

Look at e.g. http://git.gnome.org/browse/dia/commit/?id=aeb71aca
for an example.

I've made the value optional and suppressed the warning in
my own copy prior to my last mail.

However, this commit doesn't appear to address the problem above,
as it hardcodes the default value to color_black (or white).
This does not work for the start arrow case, because the start
arrow type is taken from the current setting in the toolbox,
so it cannot be hardcoded.

The initialization to:
  ref->start_arrow = attributes_get_default_start_arrow ();
is in _your_ patch. So I fail to see the problem to change that code to default to _no_ arrow.

As I said above, if you load a file with a missing start
arrow and the attribute is optional, it takes on the value
given in the create function--which is the current value set
in the toolbox.  Obviously, this is wrong--you should not
have your drawing changed when loading it.

The optional is just about complaining about missing attributes (for old files). It does not mean that new files will not contain the saved proeprty.

Hardcoding the start arrow value to none works at load time but then
you cannot set the default using the toolbox.

Yes, and that perfectly fine IMO. Of course on also could use the per-object version information to conditionally overwrite the default initiailization in a specific _load method.

So, a solution for this is needed, if possible.

Still I'm not convinced that an extra start arrow is an improvement at all.

The intent was to support things like crow's foot notation, which
uses arrows on both sides.

Soory, I fail to see any correlation between database references and crow's foot notation.

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]