[sipify] fix more complex member assignment removal (#48198)

This commit is contained in:
Denis Rouzaud 2022-04-13 10:22:32 +02:00 committed by GitHub
parent 650a203e26
commit 9671c90b41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 2 deletions

View File

@ -1222,8 +1222,8 @@ while ($LINE_IDX < $LINE_COUNT){
};
# remove struct member assignment
# https://regex101.com/r/tWRGkY/2
if ( $SIP_RUN != 1 && $ACCESS[$#ACCESS] == PUBLIC && $LINE =~ m/^(\s*\w+[\w<> *&:,]* \*?\w+) = [\-\w\:\.]+(<\w+( \*)?>)?(\([^()]*\))?\s*;/ ){
# https://regex101.com/r/OUwV75/1
if ( $SIP_RUN != 1 && $ACCESS[$#ACCESS] == PUBLIC && $LINE =~ m/^(\s*\w+[\w<> *&:,]* \*?\w+) = ([\-\w\:\.]+(< *\w+( \*)? *>)?)+(\([^()]*\))?\s*;/ ){
dbg_info("remove struct member assignment");
$LINE = "$1;";
}

View File

@ -292,6 +292,18 @@ Mulitline body
VertexType type;
}
class PublicMembersWithValue
{
%TypeHeaderCode
#include "sipifyheader.h"
%End
public:
double snappedDistanceAlongCurve;
double snappedHeight;
};
void combinedAnnotations() /Factory,PyName=otherName/;
void multiAnnotationArg( SomeClass **object /Out,TransferBack/, int &another /Out/ );

View File

@ -350,6 +350,14 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
VertexType type;
}
class PublicMembersWithValue
{
public:
double snappedDistanceAlongCurve = std::numeric_limits< double >::quiet_NaN();
double snappedHeight = std::numeric_limits< double >::quiet_NaN();
};
void combinedAnnotations() SIP_FACTORY SIP_PYNAME( otherName );
void multiAnnotationArg( SomeClass **object SIP_OUT SIP_TRANSFERBACK, int &another SIP_OUT );