View Issue Details

IDProjectCategoryView StatusLast Update
0026415CommunityOCCT:Application Frameworkpublic2016-04-20 15:50
ReporterVico Liang Assigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformWindowsOSVC++ 2013 
Product Version6.9.0 
Target Version7.0.0Fixed in Version7.0.0 
Summary0026415: <TFunction_GraphNode> XML should not break line in the middle of text.
DescriptionThe picture uploaded in file TFunction_GraphNode_NotNecessaryLineBreak.png shows the issue. The code of below has a line 'aValueStr += "\n";' which cause such issue. It's not necessary of this line from program logic. It can be removed.

void XmlMFunction_GraphNodeDriver::Paste (const Handle(TDF_Attribute)& theSource,
                      XmlObjMgt_Persistent& theTarget,
                      XmlObjMgt_SRelocationTable& ) const
{
  Handle(TFunction_GraphNode) G = Handle(TFunction_GraphNode)::DownCast(theSource);

  // Previous
  // ========

  theTarget.Element().setAttribute(::LastPreviousIndex(), G->GetPrevious().Extent());

  TCollection_AsciiString aValueStr;
  TColStd_MapIteratorOfMapOfInteger itrm(G->GetPrevious());
  for (; itrm.More(); itrm.Next())
  {
    const Standard_Integer ID = itrm.Key();
    aValueStr += TCollection_AsciiString(ID);
    aValueStr += ' ';
  }
  aValueStr += "\n";

  // Next
  // ====

  theTarget.Element().setAttribute(::LastNextIndex(), G->GetNext().Extent());

  itrm.Initialize(G->GetNext());
  for (; itrm.More(); itrm.Next())
  {
    const Standard_Integer ID = itrm.Key();
    aValueStr += TCollection_AsciiString(ID);
    aValueStr += ' ';
  }

  XmlObjMgt::SetStringValue (theTarget, aValueStr.ToCString(), Standard_True);

  // Execution status
  theTarget.Element().setAttribute(::ExecutionStatus(), (Standard_Integer) G->GetStatus());
}
Steps To ReproduceN/A
TagsNo tags attached.
Test case numberNot needed

Attached Files

  • TFunction_GraphNode_NotNecessaryLineBreak.png (3,405 bytes)
  • testxmlxml.zip (1,043 bytes)

Activities

Vico Liang

2015-07-10 13:37

developer  

TFunction_GraphNode_NotNecessaryLineBreak.png (3,405 bytes)

szy

2015-09-30 18:54

manager   ~0046350

Provide, please code snippet allowing to reproduce the specified case.
Without these additional data the registered issue is useless.

Vico Liang

2015-10-04 11:12

developer   ~0046429

Dear szy,

It's not necessary to reproduce it with code. This is not a bug. It just cause the unlecessary line break in xml format. To fix this, please remove line:

 aValueStr += "\n";

abv

2016-01-08 10:13

manager   ~0049728

Vico, it seems that current code intentionally adds line break between lists of "previous" and "next" IDs. This might have been done to be able to easily recognize those two sub-lists visually when looking at the file in text editor. Does this make any sense?

vro

2016-01-26 11:44

developer   ~0050124

Dear Colleagues, you are right all. Indeed, the "\n" symbol separates the dependent and depending GraphNodes in XML file. And this symbol is necessary only for visual observation of these two lists.
It might be better if we replace this symbol by several spaces (" ", for example), what do you think? It will still be possible to recognize these two lists of integers as well as an unnecessary line break is removed. Any ideas are welcome!
Also, I attach a XML file with replaced "\n" by " ".

vro

2016-01-26 11:46

developer  

testxmlxml.zip (1,043 bytes)

Vico Liang

2016-01-27 17:47

developer   ~0050167

Dear vro, your solution is better than line break from my point of view. I accept this solution. I'm not sure there is any compatible issue between version.

git

2016-02-01 17:33

administrator   ~0050316

Branch CR26415 has been created by abv.

SHA-1: 7e96f212077b4d161ea92e46e0046ff562b0e790


Detailed log of new commits:

Author: abv
Date: Mon Feb 1 17:33:25 2016 +0300

    0026415: <TFunction_GraphNode> XML should not break line in the middle of text.
    
    Line break between "previous" and "next" ids is replaced by additional spaces (these facilitate visual separation of the two sub-lists).

abv

2016-02-01 17:34

manager   ~0050317

Fis pushed to CR26415, please review

vro

2016-02-02 07:06

developer   ~0050325

Reviewed!

apv

2016-02-04 18:04

tester   ~0050425

Dear BugMaster,

Branch CR26415 from occt git-repository (and master from products git-repository) was compiled on Linux, MacOS and Windows platforms and tested.
SHA-1: 7e96f212077b4d161ea92e46e0046ff562b0e790

Number of compiler warnings:
occt component:
   Linux: 0 (0 on master)
   Windows: 0 (0 on master)
   MacOS: 1 (1 on master)
products component:
   Linux: 36 (36 on master)
   Windows: 0 (0 on master)

Regressions/Differences:
Not detected

Testing cases:
Not needed

Testing on Linux:
Total MEMORY difference: 89977480 / 89400824 [+0.65%]
Total CPU difference: 19146.569999999996 / 19103.82999999992 [+0.22%]

Testing on Windows:
Total MEMORY difference: 57285354 / 57306359 [-0.04%]
Total CPU difference: 18010.62745199902 / 18574.243464898933 [-3.03%]

git

2016-04-17 13:40

administrator   ~0052889

Branch CR26415 has been deleted by kgv.

SHA-1: 7e96f212077b4d161ea92e46e0046ff562b0e790

Related Changesets

occt: master 6e448ab0

2016-02-01 14:33:25

abv


Committer: bugmaster Details Diff
0026415: <TFunction_GraphNode> XML should not break line in the middle of text.

Line break between "previous" and "next" ids is replaced by additional spaces (these facilitate visual separation of the two sub-lists).
Affected Issues
0026415
mod - src/XmlMFunction/XmlMFunction_GraphNodeDriver.cxx Diff File

Issue History

Date Modified Username Field Change
2015-07-10 13:36 Vico Liang New Issue
2015-07-10 13:36 Vico Liang Assigned To => szy
2015-07-10 13:37 Vico Liang File Added: TFunction_GraphNode_NotNecessaryLineBreak.png
2015-09-30 18:54 szy Note Added: 0046350
2015-09-30 18:54 szy Status new => feedback
2015-09-30 18:54 szy Assigned To szy => Vico Liang
2015-10-04 11:12 Vico Liang Note Added: 0046429
2015-10-04 11:13 Vico Liang Assigned To Vico Liang => szy
2015-10-04 11:13 Vico Liang Status feedback => assigned
2015-12-30 16:02 szy Assigned To szy => vro
2016-01-08 10:13 abv Note Added: 0049728
2016-01-26 11:44 vro Note Added: 0050124
2016-01-26 11:46 vro File Added: testxmlxml.zip
2016-01-27 17:47 Vico Liang Note Added: 0050167
2016-02-01 17:33 git Note Added: 0050316
2016-02-01 17:34 abv Note Added: 0050317
2016-02-01 17:34 abv Status assigned => resolved
2016-02-01 17:34 abv Steps to Reproduce Updated
2016-02-02 07:06 vro Note Added: 0050325
2016-02-02 07:06 vro Assigned To vro => bugmaster
2016-02-02 07:06 vro Status resolved => reviewed
2016-02-02 11:34 apv Assigned To bugmaster => apv
2016-02-04 17:01 apv Test case number => Not needed
2016-02-04 18:04 apv Note Added: 0050425
2016-02-04 18:04 apv Assigned To apv => bugmaster
2016-02-04 18:04 apv Status reviewed => tested
2016-02-12 11:37 bugmaster Changeset attached => occt master 6e448ab0
2016-02-12 11:37 bugmaster Status tested => verified
2016-02-12 11:37 bugmaster Resolution open => fixed
2016-04-17 13:40 git Note Added: 0052889
2016-04-20 15:43 aiv Fixed in Version => 7.0.0
2016-04-20 15:50 aiv Status verified => closed