MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0026415Community[OCCT] OCCT:Application Frameworkpublic2015-07-10 13:362016-04-20 15:50
ReporterVico Liang 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformWindowsOSVC++ 2013OS Version64 bit
Product Version[OCCT] 6.9.0 
Target Version[OCCT] 7.0.0Fixed in Version[OCCT] 7.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 Filespng file icon TFunction_GraphNode_NotNecessaryLineBreak.png (3,405 bytes) 2015-07-10 13:37
zip file icon testxmlxml.zip (1,043 bytes) 2016-01-26 11:46

- Relationships

-  Notes
(0046350)
szy (administrator)
2015-09-30 18:54

Provide, please code snippet allowing to reproduce the specified case.
Without these additional data the registered issue is useless.
(0046429)
Vico Liang (developer)
2015-10-04 11:12

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";
(0049728)
abv (manager)
2016-01-08 10:13

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?
(0050124)
vro (developer)
2016-01-26 11:44

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 " ".
(0050167)
Vico Liang (developer)
2016-01-27 17:47

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.
(0050316)
git (administrator)
2016-02-01 17:33

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).
(0050317)
abv (manager)
2016-02-01 17:34

Fis pushed to CR26415, please review
(0050325)
vro (developer)
2016-02-02 07:06

Reviewed!
(0050425)
apv (tester)
2016-02-04 18:04

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%]
(0052889)
git (administrator)
2016-04-17 13:40

Branch CR26415 has been deleted by kgv.

SHA-1: 7e96f212077b4d161ea92e46e0046ff562b0e790

- Related Changesets
occt: master 6e448ab0
Timestamp: 2016-02-01 14:33:25
Author: 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).
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 View Revisions
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 user533 Fixed in Version => 7.0.0
2016-04-20 15:50 user533 Status verified => closed


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker