File tree Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change @@ -338,11 +338,26 @@ sub processDoxygenLine
338
338
# remove keywords
339
339
if ( $line =~ m /\b override\b / ){
340
340
$is_override = 1;
341
- if ( $line !~ m / ^(\s *)virtual\b (.*)$ / ){
341
+
342
+ # handle multiline definition to add virtual keyword on opening line
343
+ if ( $MULTILINE_DEFINITION == 1 ){
344
+ my $virtual_line = $line ;
345
+ my $virtual_line_idx = $line_idx ;
346
+ while ( $virtual_line !~ m / ^[^()] *\( ([^()]*\( [^()]*\) [^()]*)*[^()] *$ / ){
347
+ $virtual_line_idx --;
348
+ $virtual_line = $lines [$virtual_line_idx ];
349
+ $virtual_line_idx >= 0 or die ' could not reach opening definition' ;
350
+ }
351
+ if ( $virtual_line !~ m / ^(\s *)virtual\b (.*)$ / ){
352
+ my $idx = $#output -$line_idx +$virtual_line_idx +2;
353
+ # print "len: $#output line_idx: $line_idx virt: $virtual_line_idx\n"idx: $idx\n$output[$idx]\n";
354
+ $output [$idx ] = $virtual_line =~ s / ^(\s *?)\b (.*)$/ $1 virtual $2 \n / r ;
355
+ }
356
+ }
357
+ elsif ( $line !~ m / ^(\s *)virtual\b (.*)$ / ){
342
358
# sip often requires the virtual keyword to be present, or it chokes on covariant return types
343
359
# in overridden methods
344
- $line =~ m / ^(\s *?)\b (.*)$ / ;
345
- $line = " $1virtual $2 \n " ;
360
+ $line =~ s / ^(\s *?)\b (.*)$/ $1virtual $2 \n / ;
346
361
}
347
362
}
348
363
$line =~ s /\s *\b override\b // ;
@@ -467,6 +482,7 @@ sub processDoxygenLine
467
482
# write comment
468
483
if ( $line =~ m / ^\s *$ / )
469
484
{
485
+ $is_override = 0;
470
486
next ;
471
487
}
472
488
elsif ( $line =~ m /\/\/ / || $line =~ m /\s *typedef / || $line =~ m /\s *struct / ){
Original file line number Diff line number Diff line change @@ -207,6 +207,9 @@ Removing function body with virtual const reference
207
207
virtual int overrideWithoutVirtual();
208
208
209
209
210
+ virtual void overrideWithoutVirtualMultLine( const QList<int, QString> &list1,
211
+ const QList<int, QString> &list2 );
212
+
210
213
QString returnTypeString() const;
211
214
%Docstring
212
215
:rtype: str
Original file line number Diff line number Diff line change @@ -225,6 +225,9 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
225
225
226
226
int overrideWithoutVirtual () override ;
227
227
228
+ void overrideWithoutVirtualMultLine ( const QList<int , QString> &list1,
229
+ const QList<int , QString> &list2 ) override ;
230
+
228
231
QString returnTypeString () const ;
229
232
230
233
double returnTypeDouble () const ;
You can’t perform that action at this time.
0 commit comments