@@ -1597,49 +1597,11 @@ namespace NET_ASAM_OPENSCENARIO
1597
1597
void OpenScenarioXmlExporter::FillCustomCommandActionNode(std::shared_ptr<tinyxml2::XMLDocument> document, tinyxml2::XMLNode* elementNode, std::shared_ptr<ICustomCommandActionWriter> customCommandActionWriter)
1598
1598
{
1599
1599
// Add Attributes (Parameters)
1600
- const auto kContent = customCommandActionWriter->GetContent();
1601
-
1602
- //Modification: when parsing files with half tabs the format get mixed up
1603
- std::string modifiedContent;
1604
-
1605
- int countNewline = 0;
1606
- std::string substringNewLine = "\n";
1607
-
1608
- for (size_t offset = kContent.find(substringNewLine); offset != std::string::npos; offset = kContent.find(substringNewLine, offset + substringNewLine.length()))
1609
- {
1610
- ++countNewline;
1611
- }
1612
-
1613
- if (countNewline != 2)
1614
- {
1615
- //missing \n after CData
1616
- int countTabs = 0;
1617
- std::string substringTabs = "\t";
1618
-
1619
- for (size_t offset = kContent.find(substringTabs); offset != std::string::npos; offset = kContent.find(substringTabs, offset + substringTabs.length()))
1620
- {
1621
- ++countTabs;
1622
- }
1623
-
1624
- modifiedContent = kContent.substr(1, kContent.size());
1625
- modifiedContent = "\n\t\t" + modifiedContent;
1626
- modifiedContent.append("\n");
1627
- for (int i = 0; i < countTabs + 1; i++)
1628
- {
1629
- modifiedContent.append("\t");
1630
- }
1631
- }
1632
- else
1633
- {
1634
- modifiedContent = kContent.substr(1, kContent.size());
1635
- modifiedContent = "\n\t\t" + modifiedContent;
1636
- modifiedContent.append("\t\t");
1637
- }
1600
+ const auto kContent = customCommandActionWriter->GetContent();
1638
1601
1639
1602
if (!kContent.empty())
1640
1603
{
1641
- //elementNode->InsertEndChild(document->NewText(kContent.c_str()));
1642
- elementNode->InsertEndChild(document->NewText(modifiedContent.c_str()));
1604
+ elementNode->InsertEndChild(document->NewText(kContent.c_str()));
1643
1605
}
1644
1606
const auto kType = customCommandActionWriter->GetType();
1645
1607
if (customCommandActionWriter->IsTypeParameterized())
@@ -1657,47 +1619,9 @@ namespace NET_ASAM_OPENSCENARIO
1657
1619
// Add Attributes (Parameters)
1658
1620
const auto kContent = customContentWriter->GetContent();
1659
1621
1660
- //Modification: when parsing files with half tabs the format get mixed up
1661
- std::string modifiedContent;
1662
-
1663
- int countNewline = 0;
1664
- std::string substringNewLine = "\n";
1665
-
1666
- for (size_t offset = kContent.find(substringNewLine); offset != std::string::npos; offset = kContent.find(substringNewLine, offset + substringNewLine.length()))
1667
- {
1668
- ++countNewline;
1669
- }
1670
-
1671
- if (countNewline != 2)
1672
- {
1673
- //missing \n after CData
1674
- int countTabs = 0;
1675
- std::string substringTabs = "\t";
1676
-
1677
- for (size_t offset = kContent.find(substringTabs); offset != std::string::npos; offset = kContent.find(substringTabs, offset + substringTabs.length()))
1678
- {
1679
- ++countTabs;
1680
- }
1681
-
1682
- modifiedContent = kContent.substr(1, kContent.size());
1683
- modifiedContent = "\n\t\t" + modifiedContent;
1684
- modifiedContent.append("\n");
1685
- for (int i = 0; i < countTabs + 1; i++)
1686
- {
1687
- modifiedContent.append("\t");
1688
- }
1689
- }
1690
- else
1691
- {
1692
- modifiedContent = kContent.substr(1, kContent.size());
1693
- modifiedContent = "\n\t\t" + modifiedContent;
1694
- modifiedContent.append("\t\t");
1695
- }
1696
-
1697
1622
if (!kContent.empty())
1698
- {
1699
- //elementNode->InsertEndChild(document->NewText(kContent.c_str()));
1700
- elementNode->InsertEndChild(document->NewText(modifiedContent.c_str()));
1623
+ {
1624
+ elementNode->InsertEndChild(document->NewText(kContent.c_str()));
1701
1625
}
1702
1626
// Add Children (Normal, Wrapped, Unwrapped, simpleContent);
1703
1627
}
@@ -3256,25 +3180,10 @@ namespace NET_ASAM_OPENSCENARIO
3256
3180
// Add Attributes (Parameters)
3257
3181
const auto kText = licenseWriter->GetText();
3258
3182
3259
- //Modification: when parsing files with half tabs the format get mixed up
3260
- std::string modifiedText;
3261
-
3262
- if (kText.substr(0, 3) == "\n\t\t" || kText.substr(0, 3) == "\n\t ")
3263
- {
3264
- modifiedText = kText.substr(3, kText.size());
3265
- modifiedText = "\n\t\t\t" + modifiedText;
3266
- }
3267
- else
3268
- {
3269
- modifiedText = kText.substr(1, kText.size());
3270
- modifiedText = "\n\t" + modifiedText;
3271
- }
3272
- modifiedText.append("\t");
3273
-
3274
3183
if (!kText.empty())
3275
3184
{
3276
3185
//elementNode->InsertEndChild(document->NewText(kText.c_str()));
3277
- elementNode->InsertEndChild(document->NewText(modifiedText .c_str()));
3186
+ elementNode->InsertEndChild(document->NewText(kText .c_str()));
3278
3187
}
3279
3188
const auto kName = licenseWriter->GetName();
3280
3189
if (licenseWriter->IsNameParameterized())
@@ -7876,47 +7785,10 @@ namespace NET_ASAM_OPENSCENARIO
7876
7785
// Add Attributes (Parameters)
7877
7786
const auto kContent = userDefinedDistributionWriter->GetContent();
7878
7787
7879
- //Modification: when parsing files with half tabs the format get mixed up
7880
- std::string modifiedContent;
7881
-
7882
- int countNewline = 0;
7883
- std::string substringNewLine = "\n";
7884
-
7885
- for (size_t offset = kContent.find(substringNewLine); offset != std::string::npos; offset = kContent.find(substringNewLine, offset + substringNewLine.length()))
7886
- {
7887
- ++countNewline;
7888
- }
7889
-
7890
- if (countNewline != 2)
7891
- {
7892
- //missing \n after CData
7893
- int countTabs = 0;
7894
- std::string substringTabs = "\t";
7895
-
7896
- for (size_t offset = kContent.find(substringTabs); offset != std::string::npos; offset = kContent.find(substringTabs, offset + substringTabs.length()))
7897
- {
7898
- ++countTabs;
7899
- }
7900
-
7901
- modifiedContent = kContent.substr(1, kContent.size());
7902
- modifiedContent = "\n\t\t" + modifiedContent;
7903
- modifiedContent.append("\n");
7904
- for (int i = 0; i < countTabs + 1; i++)
7905
- {
7906
- modifiedContent.append("\t");
7907
- }
7908
- }
7909
- else
7910
- {
7911
- modifiedContent = kContent.substr(1, kContent.size());
7912
- modifiedContent = "\n\t\t" + modifiedContent;
7913
- modifiedContent.append("\t\t");
7914
- }
7915
-
7916
7788
if (!kContent.empty())
7917
7789
{
7918
7790
//elementNode->InsertEndChild(document->NewText(kContent.c_str()));
7919
- elementNode->InsertEndChild(document->NewText(modifiedContent .c_str()));
7791
+ elementNode->InsertEndChild(document->NewText(kContent .c_str()));
7920
7792
}
7921
7793
const auto kType = userDefinedDistributionWriter->GetType();
7922
7794
if (userDefinedDistributionWriter->IsTypeParameterized())
0 commit comments