From 6ee0116f5ed81bc34b038a360d239ae8b5dbdc1a Mon Sep 17 00:00:00 2001 From: Sam Corcoran Date: Mon, 4 Aug 2014 17:59:34 +0100 Subject: [PATCH] VAULT INTERNAL: JUCE functionality for xml parsing of \r\n carriage returns previously added to Rawtools (VP-447) Previously added to Rawtools in bd5f2c790a012439e392103d7e7dcbce100141a6 Port of JUCE 3 CODEX modification (d13adfd) to JUCE 4 Change-Id: Ia29f8cdd1b494eaae4d973fd544ea37e0b40d6c1 --- .../JuceLibraryCode/modules/juce_core/xml/juce_XmlDocument.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/juce3/JuceLibraryCode/modules/juce_core/xml/juce_XmlDocument.cpp b/juce3/JuceLibraryCode/modules/juce_core/xml/juce_XmlDocument.cpp index c0f016e..c7889c1 100644 --- a/juce3/JuceLibraryCode/modules/juce_core/xml/juce_XmlDocument.cpp +++ b/juce3/JuceLibraryCode/modules/juce_core/xml/juce_XmlDocument.cpp @@ -615,13 +615,21 @@ void XmlDocument::readChildElements (XmlElement& parent) contentShouldBeUsed = contentShouldBeUsed || entity.containsNonWhitespaceChars(); } } + else if (c == '\r') + { + if (*(input+1) == '\n') + input += 2; + else + ++input; + textElementContent.append("\n", 1); + } else { for (;;) { const juce_wchar nextChar = *input; - if (nextChar == '<' || nextChar == '&') + if (nextChar == '<' || nextChar == '&' || nextChar == '\r') break; if (nextChar == 0) -- 2.2.1