Loading a message object without a text lead to a segmentation fault
in font_string_width since message->text is NULL. I'm appending a
small patch that fixed the problem for me.
I still have two (AFAIK known) problems:
- Trying to open the properties dialog via the menue I get the message
"This object has no properties" and double clicking on the object
gives a segmentation fault.
- Loading a saved file, everything is black, but ok after resizing.
Andreas
1999-03-25 Andreas Jaeger <[EMAIL PROTECTED]>
* objects/UML/message.c (message_load): Calculate text_width only
if a text exists.
--- objects/UML/message.c.~1~ Mon Mar 15 23:00:33 1999
+++ objects/UML/message.c Thu Mar 25 09:58:31 1999
@@ -1,5 +1,5 @@
/* Dia -- an diagram creation/manipulation program
- * Copyright (C) 1998 Alexander Larsson
+ * Copyright (C) 1998, 1999 Alexander Larsson
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -452,9 +452,12 @@
if (attr != NULL)
message->type = (MessageType)data_int(attribute_first_data(attr));
- message->text_width =
+ if (message->text)
+ message->text_width =
font_string_width(message->text, message_font, MESSAGE_FONTHEIGHT);
-
+ else
+ message->text_width = 0;
+
message->text_handle.id = HANDLE_MOVE_TEXT;
message->text_handle.type = HANDLE_MINOR_CONTROL;
message->text_handle.connect_type = HANDLE_NONCONNECTABLE;
--
Andreas Jaeger [EMAIL PROTECTED] [EMAIL PROTECTED]
for pgp-key finger [EMAIL PROTECTED]