summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2016-09-06 14:07:43 (GMT)
committerRalf Habacker <ralf.habacker@freenet.de>2016-09-06 14:45:52 (GMT)
commit668c6ad4e493b80d1a8537a840632f98368ba579 (patch)
tree112ad5a4dbd640d7595ea8a92bdf62d2aa8d8141
parent6811456a28954ad5d77949f4b8e1f6bc985589f6 (diff)
Reorder some methods in UMLObject according to there declaration.
-rw-r--r--umbrello/umlmodel/umlobject.cpp56
-rw-r--r--umbrello/umlmodel/umlobject.h4
2 files changed, 30 insertions, 30 deletions
diff --git a/umbrello/umlmodel/umlobject.cpp b/umbrello/umlmodel/umlobject.cpp
index 62e28d7..288ae47 100644
--- a/umbrello/umlmodel/umlobject.cpp
+++ b/umbrello/umlmodel/umlobject.cpp
@@ -531,34 +531,6 @@ void UMLObject::setStereotypeCmd(const QString& name)
}
/**
- * Sets the UMLPackage in which this class is located.
- *
- * @param pPkg Pointer to the class' UMLPackage.
- */
-bool UMLObject::setUMLPackage(UMLPackage* pPkg)
-{
- if (pPkg == this) {
- uDebug() << "setting parent to myself is not allowed";
- return false;
- }
-
- if (pPkg == NULL) {
- // Allow setting to NULL for stereotypes
- m_pUMLPackage = pPkg;
- return true;
- }
-
- if (pPkg->umlPackage() == this) {
- uDebug() << "setting parent to an object of which I'm already the parent is not allowed";
- return false;
- }
-
- m_pUMLPackage = pPkg;
- emitModified();
- return true;
-}
-
-/**
* Returns the classes UMLStereotype object.
*
* @return Returns the classes UMLStereotype object.
@@ -624,6 +596,34 @@ UMLPackageList UMLObject::packages(bool includeRoot) const
}
/**
+ * Sets the UMLPackage in which this class is located.
+ *
+ * @param pPkg Pointer to the class' UMLPackage.
+ */
+bool UMLObject::setUMLPackage(UMLPackage *pPkg)
+{
+ if (pPkg == this) {
+ uDebug() << "setting parent to myself is not allowed";
+ return false;
+ }
+
+ if (pPkg == NULL) {
+ // Allow setting to NULL for stereotypes
+ setParent(pPkg);
+ return true;
+ }
+
+ if (pPkg->umlParent()->asUMLPackage() == this) {
+ uDebug() << "setting parent to an object of which I'm already the parent is not allowed";
+ return false;
+ }
+
+ setParent(pPkg);
+ emitModified();
+ return true;
+}
+
+/**
* Returns the UMLPackage that this class is located in.
*
* @return Pointer to the UMLPackage of this class.
diff --git a/umbrello/umlmodel/umlobject.h b/umbrello/umlmodel/umlobject.h
index 0830aba..fac1780 100644
--- a/umbrello/umlmodel/umlobject.h
+++ b/umbrello/umlmodel/umlobject.h
@@ -142,11 +142,11 @@ public:
QString package(const QString& separator = QString(),
bool includeRoot = false);
+ UMLPackageList packages(bool includeRoot = false) const;
+
bool setUMLPackage(UMLPackage* pPkg);
UMLPackage* umlPackage();
- UMLPackageList packages(bool includeRoot = false) const;
-
virtual void setName(const QString &strName);
void setNameCmd(const QString &strName) ;
QString name() const;