2 * Copyright 2006, Haiku.
3 * Distributed under the terms of the MIT License.
6 * Stephan Aßmus <superstippi@gmx.de>
9 #include "UnassignPathCommand.h"
14 #include "PathContainer.h"
16 #include "VectorPath.h"
19 #undef B_TRANSLATION_CONTEXT
20 #define B_TRANSLATION_CONTEXT "Icon-O-Matic-UnassignPathCmd"
24 UnassignPathCommand::UnassignPathCommand(Shape
* shape
,
34 UnassignPathCommand::~UnassignPathCommand()
36 if (fPathRemoved
&& fPath
)
37 fPath
->ReleaseReference();
42 UnassignPathCommand::InitCheck()
44 return fShape
&& fPath
? B_OK
: B_NO_INIT
;
49 UnassignPathCommand::Perform()
51 // remove path from shape
52 fShape
->Paths()->RemovePath(fPath
);
60 UnassignPathCommand::Undo()
63 fShape
->Paths()->AddPath(fPath
);
71 UnassignPathCommand::GetName(BString
& name
)
73 name
<< B_TRANSLATE("Unassign Path");