From ac1f4a1f7b4c9263d2ab490b8f346c5ef0a4b716 Mon Sep 17 00:00:00 2001 From: Felipe Corr??a da Silva Sanches Date: Sat, 18 Jun 2011 22:47:52 -0300 Subject: I am not sure if it is possible to have a script element with more than a single childnode. Since we are not handling that, this is a warning to be displayed if we even encounter a file with more than one child for one of its script element nodes (bzr r10319) --- src/ui/dialog/document-properties.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 4434e3bd6..569dd2311 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -844,6 +844,15 @@ void DocumentProperties::changeEmbeddedScript(){ SPObject* obj = SP_OBJECT(current->data); if (id == obj->getId()){ + int count=0; + for ( SPObject *child = obj->children ; child; child = child->next ) + { + count++; + } + + if (count>1) + g_warning("TODO: Found a script element with multiple (%d) child nodes! We must implement support for that!", count); + //XML Tree being used directly here while it shouldn't be. SPObject* child = obj->firstChild(); //TODO: shouldnt we get all children instead of simply the first child? -- cgit v1.2.3