[Uml-devel] branches/KDE/3.5/kdesdk/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sun Feb 26 14:42:03 UTC 2006
SVN commit 513929 by okellogg:
Apply attachment
http://www.geeksoc.org/~jr/umbrello/uml-devel/att-9255/umbrello-isDatatype.patch
>From http://www.geeksoc.org/~jr/umbrello/uml-devel/9259.html
C++ isDatatype patch for typedef unsigned int/uint case
and fix for putting class under mouse cursor when diagram zoom is not 1:1
Many thanks to Yan Morin <yansanmo.site_AT_gmail.com>
BUG:122293
M +1 -0 THANKS
M +8 -1 umbrello/classparser/cpptree2uml.cpp
M +7 -0 umbrello/import_utils.cpp
M +5 -0 umbrello/import_utils.h
M +1 -1 umbrello/umlview.cpp
--- branches/KDE/3.5/kdesdk/umbrello/THANKS #513928:513929
@@ -47,6 +47,7 @@
martin <mv123q3 @hotmail.com>
Rene Meyer <Rene.Meyer @sturmit.de>
Laurent Montel <montel @kde.org>
+Yan Morin <yansanmo.site @gmail.com>
Tom Morris <tfmorris @gmail.com>
Lutz Mueller <lutz.mueller @gmx.de>
Heiko Nardmann <heiko.nardmann @onlinehome.de>
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/classparser/cpptree2uml.cpp #513928:513929
@@ -144,7 +144,14 @@
//#endif
/* @todo Trace typedefs back to their root type for deciding
whether to build a Datatype (for pointers.) */
- if (type.contains('*')) {
+ /* check out if the ID type is a Datatype
+ ex: typedef unsigned int uint;
+ where unsigned int is a known datatype
+ I'm not sure if setIsReference() should be run
+ */
+ bool isDatatype = Import_Utils::isDatatype(typeId, m_currentNamespace[m_nsCnt]);
+
+ if (type.contains('*') || isDatatype) {
UMLObject *inner =
Import_Utils::createUMLObject( Uml::ot_Class, typeId,
m_currentNamespace[m_nsCnt] );
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/import_utils.cpp #513928:513929
@@ -349,5 +349,12 @@
incPathList.append(path);
}
+
+bool isDatatype(QString name, UMLPackage *parentPkg) {
+ UMLDoc *umldoc = UMLApp::app()->getDocument();
+ UMLObject * o = umldoc->findUMLObject(name, Uml::ot_Datatype, parentPkg);
+ return (o!=NULL);
+}
+
} // end namespace Import_Utils
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/import_utils.h #513928:513929
@@ -134,6 +134,11 @@
*/
bool newUMLObjectWasCreated();
+ /**
+ * Returns true if a type is an actual Datatype
+ */
+ bool isDatatype(QString name, UMLPackage *parentPkg = NULL);
+
} // end namespace Import_Utils
#endif
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlview.cpp #513928:513929
@@ -697,7 +697,7 @@
return;
}
m_bCreateObject = true;
- m_Pos = e->pos();
+ m_Pos = (e->pos() * 100 ) / m_nZoom;
slotObjectCreated(o);
More information about the umbrello-devel
mailing list