~ubuntu-branches/ubuntu/intrepid/kdesdk/intrepid-updates

« back to all changes in this revision

Viewing changes to umbrello/umbrello/entityattribute.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-05-28 10:11:43 UTC
  • mto: This revision was merged to the branch mainline in revision 37.
  • Revision ID: james.westby@ubuntu.com-20080528101143-gzc3styjz1b70zxu
Tags: upstream-4.0.80
ImportĀ upstreamĀ versionĀ 4.0.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 *   the Free Software Foundation; either version 2 of the License, or     *
6
6
 *   (at your option) any later version.                                   *
7
7
 *                                                                         *
8
 
 *   copyright (C) 2002-2006                                               *
 
8
 *   copyright (C) 2002-2007                                               *
9
9
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
10
10
 ***************************************************************************/
11
11
 
21
21
#include "dialogs/umlentityattributedialog.h"
22
22
#include "object_factory.h"
23
23
 
24
 
UMLEntityAttribute::UMLEntityAttribute( const UMLObject *parent, const QString& name,
 
24
UMLEntityAttribute::UMLEntityAttribute( UMLObject *parent, const QString& name,
25
25
                                        Uml::IDType id, Uml::Visibility s,
26
26
                                        UMLObject *type, const QString& iv )
27
27
        : UMLAttribute(parent, name, id, s, type, iv) {
31
31
    }
32
32
}
33
33
 
34
 
UMLEntityAttribute::UMLEntityAttribute(const UMLObject *parent) : UMLAttribute(parent) {
 
34
UMLEntityAttribute::UMLEntityAttribute(UMLObject *parent) : UMLAttribute(parent) {
35
35
    init();
36
36
}
37
37
 
90
90
 
91
91
    if(sig == Uml::st_ShowSig || sig == Uml::st_NoSig) {
92
92
        s=m_Vis.toString(true) + ' ';
93
 
    } else
94
 
        s = "";
 
93
    }
95
94
 
96
95
    if(sig == Uml::st_ShowSig || sig == Uml::st_SigNoVis) {
97
96
        QString string = s + getName() + " : " + getTypeName();
102
101
        return s + getName();
103
102
}
104
103
 
105
 
bool UMLEntityAttribute::operator==( UMLEntityAttribute &rhs) {
 
104
bool UMLEntityAttribute::operator==(const UMLEntityAttribute &rhs) {
106
105
    if( this == &rhs )
107
106
        return true;
108
107
 
117
116
    return true;
118
117
}
119
118
 
120
 
void UMLEntityAttribute::copyInto(UMLEntityAttribute *rhs) const
 
119
void UMLEntityAttribute::copyInto(UMLObject *lhs) const
121
120
{
 
121
    UMLEntityAttribute *target = static_cast<UMLEntityAttribute*>(lhs);
 
122
 
122
123
    // call the parent first.
123
 
    UMLClassifierListItem::copyInto(rhs);
 
124
    UMLClassifierListItem::copyInto(target);
124
125
 
125
126
    // Copy all datamembers
126
 
    rhs->m_pSecondary = m_pSecondary;
127
 
    rhs->m_SecondaryId = m_SecondaryId;
128
 
    rhs->m_InitialValue = m_InitialValue;
129
 
    rhs->m_ParmKind = m_ParmKind;
 
127
    target->m_pSecondary = m_pSecondary;
 
128
    target->m_SecondaryId = m_SecondaryId;
 
129
    target->m_InitialValue = m_InitialValue;
 
130
    target->m_ParmKind = m_ParmKind;
130
131
}
131
132
 
132
133
UMLObject* UMLEntityAttribute::clone() const
141
142
void UMLEntityAttribute::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) {
142
143
    QDomElement entityattributeElement = UMLObject::save("UML:EntityAttribute", qDoc);
143
144
    if (m_pSecondary == NULL) {
144
 
        kDebug() << "UMLEntityAttribute::saveToXMI(" << m_Name
145
 
        << "): m_pSecondary is NULL, using local name "
146
 
        << m_SecondaryId << endl;
 
145
        uDebug() << m_Name << ": m_pSecondary is NULL, using local name "
 
146
            << m_SecondaryId << endl;
147
147
        entityattributeElement.setAttribute( "type", m_SecondaryId );
148
148
    } else {
149
149
        entityattributeElement.setAttribute( "type", ID2STR(m_pSecondary->getID()) );