summaryrefslogtreecommitdiffstats
path: root/src/runtimerender/Qt3DSRenderUIPLoader.cpp
diff options
context:
space:
mode:
authorJanne Kangas <janne.kangas@qt.io>2019-10-28 12:14:26 +0200
committerJanne Kangas <janne.kangas@qt.io>2019-11-06 09:35:24 +0200
commit3e803a3ff7db5ccd5085533d094fbca3732b0f52 (patch)
tree780248b6ccdfabd6d882e34cdc8da33d8b0c4871 /src/runtimerender/Qt3DSRenderUIPLoader.cpp
parent8803caed932cb4c5627310223a72a137ea5c99f3 (diff)
Store line feeds as substitute characters in UIP
To avoid using real line breaks in UIP file for string-typed values, replace \n sequence with a non-printable unicode char at file save. Revert this at file load. Change-Id: I215a88c4d85bc2c0c3b63f31d6cd1cfdf20b16ca Task-id: QT3DS-3993 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/runtimerender/Qt3DSRenderUIPLoader.cpp')
-rw-r--r--src/runtimerender/Qt3DSRenderUIPLoader.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/runtimerender/Qt3DSRenderUIPLoader.cpp b/src/runtimerender/Qt3DSRenderUIPLoader.cpp
index 073df7f..24e4c18 100644
--- a/src/runtimerender/Qt3DSRenderUIPLoader.cpp
+++ b/src/runtimerender/Qt3DSRenderUIPLoader.cpp
@@ -960,6 +960,10 @@ struct SRenderUIPLoader : public IDOMReferenceResolver
{
ParseProperties(static_cast<SNode &>(inItem), inParser);
ITERATE_QT3DS_RENDER_TEXT_PROPERTIES
+ // QT3DS-3993: store line feeds as replacement chars in UIP
+ auto text = QString::fromUtf8(inItem.m_Text);
+ text.replace(LINE_BREAK_SUBSTITUTE, "\n");
+ inItem.m_Text = m_StrTable.RegisterStr(text);
}
void ParseProperties(SLightmaps &inItem, IPropertyParser &inParser)
{