MantisBT - Community
View Issue Details
0026415Community[OCCT] OCCT:Application Frameworkpublic2015-07-10 13:362016-04-20 15:50
Vico Liang 
bugmaster 
normalminor 
closedfixed 
WindowsVC++ 201364 bit
[OCCT] 6.9.0 
[OCCT] 7.0.0[OCCT] 7.0.0 
Not needed
0026415: <TFunction_GraphNode> XML should not break line in the middle of text.
The 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());
}
N/A
No tags attached.
png TFunction_GraphNode_NotNecessaryLineBreak.png (3,405) 2015-07-10 13:37
https://tracker.dev.opencascade.org/
zip testxmlxml.zip (1,043) 2016-01-26 11:46
https://tracker.dev.opencascade.org/
Issue History
2015-07-10 13:36Vico LiangNew Issue
2015-07-10 13:36Vico LiangAssigned To => szy
2015-07-10 13:37Vico LiangFile Added: TFunction_GraphNode_NotNecessaryLineBreak.png
2015-09-30 18:54szyNote Added: 0046350
2015-09-30 18:54szyStatusnew => feedback
2015-09-30 18:54szyAssigned Toszy => Vico Liang
2015-10-04 11:12Vico LiangNote Added: 0046429
2015-10-04 11:13Vico LiangAssigned ToVico Liang => szy
2015-10-04 11:13Vico LiangStatusfeedback => assigned
2015-12-30 16:02szyAssigned Toszy => vro
2016-01-08 10:13abvNote Added: 0049728
2016-01-26 11:44vroNote Added: 0050124
2016-01-26 11:46vroFile Added: testxmlxml.zip
2016-01-27 17:47Vico LiangNote Added: 0050167
2016-02-01 17:33gitNote Added: 0050316
2016-02-01 17:34abvNote Added: 0050317
2016-02-01 17:34abvStatusassigned => resolved
2016-02-01 17:34abvSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=12861#r12861
2016-02-02 07:06vroNote Added: 0050325
2016-02-02 07:06vroAssigned Tovro => bugmaster
2016-02-02 07:06vroStatusresolved => reviewed
2016-02-02 11:34apvAssigned Tobugmaster => apv
2016-02-04 17:01apvTest case number => Not needed
2016-02-04 18:04apvNote Added: 0050425
2016-02-04 18:04apvAssigned Toapv => bugmaster
2016-02-04 18:04apvStatusreviewed => tested
2016-02-12 11:37bugmasterChangeset attached => occt master 6e448ab0
2016-02-12 11:37bugmasterStatustested => verified
2016-02-12 11:37bugmasterResolutionopen => fixed
2016-04-17 13:40gitNote Added: 0052889
2016-04-20 15:43aivFixed in Version => 7.0.0
2016-04-20 15:50aivStatusverified => closed

Notes
(0046350)
szy   
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   
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   
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   
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   
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   
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   
2016-02-01 17:34   
Fis pushed to CR26415, please review
(0050325)
vro   
2016-02-02 07:06   
Reviewed!
(0050425)
apv   
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   
2016-04-17 13:40   
Branch CR26415 has been deleted by kgv.

SHA-1: 7e96f212077b4d161ea92e46e0046ff562b0e790