Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kdwsdl2cpp generates wrong code #118

Closed
SudakovIvan opened this issue Jan 24, 2018 · 1 comment
Closed

kdwsdl2cpp generates wrong code #118

SudakovIvan opened this issue Jan 24, 2018 · 1 comment

Comments

@SudakovIvan
Copy link
Contributor

SudakovIvan commented Jan 24, 2018

Problematic part of the WSDL:
<xs:complexType name="angleLandMarkType">
xs:complexContent
<xs:extension base="ns1:objectType">
xs:sequence
<xs:element name="source" type="xs:string" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="a" type="xs:double" use="required"/>
<xs:attribute name="b" type="xs:double" use="required"/>
<xs:attribute name="d" type="xs:double"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>

Generated code:
class __AngleLandMarkType::PrivateDPtr : public QSharedData
{
public:
PrivateDPtr();

public:
QString mSource;
bool mSource_nil;
double mA;
double mB;
double d;
bool mD_nil;
};

void __AngleLandMarkType::setD( double _d )
{
d_ptr->d_nil = false;// converter_complextype.cpp:300
d_ptr->d = _d;
}

Error: d_nil - there is no such member in the class

I found a strange code in the MemberVariable::memberVariableName() method:
else if ( name == QLatin1String("q") || name == QLatin1String("d") ) {
n = name;

@dfaure-kdab
Copy link
Member

(Looks like I completely missed this bug report, sorry about that).

The "strange code" is about the pimpl pattern, often implemented by a "d" pointer, called "d" and not "mD".
But clearly there's a bug that the _nil should be passed as input to memberVariableName, not just appended to the other variable name.

Reproduced, will fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants