[Uml-devel] kdesdk/umbrello/umbrello
Oliver Kellogg
Oliver.Kellogg at t-online.de
Sat Sep 20 13:49:09 UTC 2003
CVS commit by okellogg:
Whoops, forgot this on the Artifact_draw_type renaming... sorry
M +20 -11 artifactwidget.cpp 1.6
--- kdesdk/umbrello/umbrello/artifactwidget.cpp #1.5:1.6
@@ -210,14 +210,22 @@ void ArtifactWidget::drawAsTable(QPainte
////////////////////////////////////////////////////////////////////////////////////////////////////
void ArtifactWidget::draw(QPainter& p, int offsetX, int offsetY) {
- if ((static_cast<UMLArtifact*>(m_pObject))->getDrawAsType() == defaultDraw) {
+ UMLArtifact *umlart = static_cast<UMLArtifact*>(m_pObject);
+ UMLArtifact::Draw_Type drawType = umlart->getDrawAsType();
+ switch (drawType) {
+ case UMLArtifact::defaultDraw:
return drawAsNormal(p, offsetX, offsetY);
- } else if ((static_cast<UMLArtifact*>(m_pObject))->getDrawAsType() == file) {
+ break;
+ case UMLArtifact::file:
return drawAsFile(p, offsetX, offsetY);
- } else if ((static_cast<UMLArtifact*>(m_pObject))->getDrawAsType() == library) {
+ break;
+ case UMLArtifact::library:
return drawAsLibrary(p, offsetX, offsetY);
- } else if ((static_cast<UMLArtifact*>(m_pObject))->getDrawAsType() == table) {
+ break;
+ case UMLArtifact::table:
return drawAsTable(p, offsetX, offsetY);
- } else {
+ break;
+ default:
kdWarning() << "Artifact drawn as unknown type" << endl;
+ break;
}
}
@@ -266,5 +274,6 @@ void ArtifactWidget::calculateSize() {
return;
}
- if ((static_cast<UMLArtifact*>(m_pObject))->getDrawAsType() == defaultDraw) {
+ UMLArtifact *umlart = static_cast<UMLArtifact*>(m_pObject);
+ if (umlart->getDrawAsType() == UMLArtifact::defaultDraw) {
calculateNormalSize();
} else {
More information about the umbrello-devel
mailing list