[haiku-commits] Re: Re: [haiku-commits] Re: r38174 -=D=A haiku/trunk/src/apps/icon-o-matic/import_export/styled_text

  • From: Stephan Assmus <superstippi@xxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 17 Aug 2010 12:30:32 +0200

Am 17.08.2010 12:12, schrieb pulkomandy:
+                       if (shape == NULL)
+                               return B_NO_MEMORY;
                        shape->SetName(glyphName.String());
-                       if (!shape || !icon->Shapes()->AddShape(shape)) {
+                       if (!icon->Shapes()->AddShape(shape)) {
                                delete shape;
                                return B_NO_MEMORY;
                        }

The simpler fix would have been to move the SetName() line below the
existing checks. :-)

I was not sure it would get added to the icon with the new name and too
lazy to check.

Ah ok, but I think the name is only stored in the Shape. If anyone needs to know the name and when it changes, it will listen to notifications from the Shape object. But I think it's only relevant when the GUI is already displaying the objects, in which case it would work the same, though.

Best regards,
-Stephan

Other related posts:

  • » [haiku-commits] Re: Re: [haiku-commits] Re: r38174 -=D=A haiku/trunk/src/apps/icon-o-matic/import_export/styled_text - Stephan Assmus