DiscussionsIssue archiveOCCT:Application Framework

Archived issue #0029371

The problem of the attributes constructor call

Open CASCADEOCCT:Application Frameworkclosed9 public notes

Search issues

Description

Since OCCT 7.1.0 there may appear a problem of creation and attachment of attributes to the label if the attribute constructor and AddAttribute method is used instead of "Set" method call:

Handle(TDataStd_Name) aNameAttr = new TDataStd_Name();
aLabel.AddAttribute(aNameAttr);

in this case an attribute with null GUID is attached, whereas in previous versions this example worked well.

It is proposed to forbid the attribute constructor call or to make this case work properly again (the default GUID of the attribute is assigned).

And it is worth to update/extend documentation with information that "Set" method must be used instead.

Steps to reproduce

use script tests\bugs\caf\bug29371.

Public activity

9 archived notes

Participants are labeled by their role within this record.

01Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: szy
Date: Wed Dec 20 12:20:29 2017 +0300

    0029371: The problem of the attributes constructor call.
    
    // default Guid is assigned in constructor.
02Commenter 2
Branch [archived branch] has been updated by Participant.

[revision removed]


Detailed log of new commits:

Author: szy
Date: Thu Dec 21 14:36:43 2017 +0300

    0029371: The problem of the attributes constructor call.
    
    //Addition of test case: tests\bugs\caf\bug29371.

03Commenter 2
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: szy
Date: Wed Dec 20 12:20:29 2017 +0300

    0029371: The problem of the attributes constructor call.
    
    //Addition of test case: tests\bugs\caf\bug29371.
    
    0029371: The problem of the attributes constructor call.
    
    // default Guid is assigned in constructor.
04Commenter 4
Fixed.
The first solution is not applicable. The second solution (the default GUID of the attribute is assigned) is implemented.
Branch CR29371_1. Review it, please.
05Commenter 5
06Commenter 1
Combination -
OCCT branch : [archived branch] SHA - [revision removed]
Products branch : [archived branch] SHA - [revision removed]
was compiled on Linux, MacOS and Windows platforms and tested on optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

Test case:
bugs caf bug29371 - OK

CPU differences:
Debian70-64:
OCCT
Total CPU difference: 18435.779999999635 / 18433.219999999703 [+0.01%]
Products
Total CPU difference: 7480.22000000001 / 7463.390000000005 [+0.23%]
Windows-64-VC10:
OCCT
Total CPU difference: 17870.67895489861 / 17919.14846559861 [-0.27%]
Products
Total CPU difference: 8002.227296000001 / 7985.956391699999 [+0.20%]

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention
07Commenter 2
Branch [archived branch] has been updated by Commenter 1.

[revision removed]


Detailed log of new commits:

Author: Commenter 1
Date: Mon Dec 25 18:17:26 2017 +0300

    // Fix warning

08Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]
09Commenter 2
Branch [archived branch] has been deleted by Participant.

[revision removed]