Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | | - |
5 | | - |
6 | | - |
7 | static void qt_split_namespace(QString& prefix, QString& name, const QString& qName, bool hasURI) | - |
8 | { | - |
9 | int i = qName.indexOf(QLatin1Char(':')); | - |
10 | if (i == -1) { evaluated: i == -1 yes Evaluation Count:223 | yes Evaluation Count:194 |
| 194-223 |
11 | if (hasURI) evaluated: hasURI yes Evaluation Count:171 | yes Evaluation Count:52 |
| 52-171 |
12 | prefix = QLatin1String(""); executed: prefix = QLatin1String(""); Execution Count:171 | 171 |
13 | else | - |
14 | prefix.clear(); executed: prefix.clear(); Execution Count:52 | 52 |
15 | name = qName; | - |
16 | } else { executed: } Execution Count:223 | 223 |
17 | prefix = qName.left(i); | - |
18 | name = qName.mid(i + 1); | - |
19 | } executed: } Execution Count:194 | 194 |
20 | } | - |
21 | | - |
22 | | - |
23 | | - |
24 | | - |
25 | | - |
26 | | - |
27 | | - |
28 | class QDomImplementationPrivate | - |
29 | { | - |
30 | public: | - |
31 | inline QDomImplementationPrivate() {} | - |
32 | | - |
33 | QDomImplementationPrivate* clone(); | - |
34 | QAtomicInt ref; | - |
35 | static QDomImplementation::InvalidDataPolicy invalidDataPolicy; | - |
36 | }; | - |
37 | | - |
38 | class QDomNodePrivate | - |
39 | { | - |
40 | public: | - |
41 | QDomNodePrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = 0); | - |
42 | QDomNodePrivate(QDomNodePrivate* n, bool deep); | - |
43 | virtual ~QDomNodePrivate(); | - |
44 | | - |
45 | QString nodeName() const { return name; } executed: return name; Execution Count:33732 | 33732 |
46 | QString nodeValue() const { return value; } executed: return value; Execution Count:40 | 40 |
47 | virtual void setNodeValue(const QString& v) { value = v; } | 0 |
48 | | - |
49 | QDomDocumentPrivate* ownerDocument(); | - |
50 | void setOwnerDocument(QDomDocumentPrivate* doc); | - |
51 | | - |
52 | virtual QDomNodePrivate* insertBefore(QDomNodePrivate* newChild, QDomNodePrivate* refChild); | - |
53 | virtual QDomNodePrivate* insertAfter(QDomNodePrivate* newChild, QDomNodePrivate* refChild); | - |
54 | virtual QDomNodePrivate* replaceChild(QDomNodePrivate* newChild, QDomNodePrivate* oldChild); | - |
55 | virtual QDomNodePrivate* removeChild(QDomNodePrivate* oldChild); | - |
56 | virtual QDomNodePrivate* appendChild(QDomNodePrivate* newChild); | - |
57 | | - |
58 | QDomNodePrivate* namedItem(const QString& name); | - |
59 | | - |
60 | virtual QDomNodePrivate* cloneNode(bool deep = true); | - |
61 | virtual void normalize(); | - |
62 | virtual void clear(); | - |
63 | | - |
64 | inline QDomNodePrivate* parent() const { return hasParent ? ownerNode : 0; } executed: return hasParent ? ownerNode : 0; Execution Count:4157131 | 4157131 |
65 | inline void setParent(QDomNodePrivate *p) { ownerNode = p; hasParent = true; } executed: } Execution Count:127721 | 127721 |
66 | | - |
67 | void setNoParent() { | - |
68 | ownerNode = hasParent ? (QDomNodePrivate*)ownerDocument() : 0; partially evaluated: hasParent yes Evaluation Count:17 | no Evaluation Count:0 |
| 0-17 |
69 | hasParent = false; | - |
70 | } executed: } Execution Count:17 | 17 |
71 | | - |
72 | | - |
73 | bool isAttr() const { return nodeType() == QDomNode::AttributeNode; } executed: return nodeType() == QDomNode::AttributeNode; Execution Count:1 | 1 |
74 | bool isCDATASection() const { return nodeType() == QDomNode::CDATASectionNode; } executed: return nodeType() == QDomNode::CDATASectionNode; Execution Count:1 | 1 |
75 | bool isDocumentFragment() const { return nodeType() == QDomNode::DocumentFragmentNode; } executed: return nodeType() == QDomNode::DocumentFragmentNode; Execution Count:93365 | 93365 |
76 | bool isDocument() const { return nodeType() == QDomNode::DocumentNode; } executed: return nodeType() == QDomNode::DocumentNode; Execution Count:4500614 | 4500614 |
77 | bool isDocumentType() const { return nodeType() == QDomNode::DocumentTypeNode; } never executed: return nodeType() == QDomNode::DocumentTypeNode; | 0 |
78 | bool isElement() const { return nodeType() == QDomNode::ElementNode; } executed: return nodeType() == QDomNode::ElementNode; Execution Count:30723 | 30723 |
79 | bool isEntityReference() const { return nodeType() == QDomNode::EntityReferenceNode; } never executed: return nodeType() == QDomNode::EntityReferenceNode; | 0 |
80 | bool isText() const { const QDomNode::NodeType nt = nodeType(); | - |
81 | return (nt == QDomNode::TextNode) | 107741 |
82 | || (nt == QDomNode::CDATASectionNode); } executed: return (nt == QDomNode::TextNode) || (nt == QDomNode::CDATASectionNode); Execution Count:107741 | 107741 |
83 | bool isEntity() const { return nodeType() == QDomNode::EntityNode; } executed: return nodeType() == QDomNode::EntityNode; Execution Count:16 | 16 |
84 | bool isNotation() const { return nodeType() == QDomNode::NotationNode; } executed: return nodeType() == QDomNode::NotationNode; Execution Count:8 | 8 |
85 | bool isProcessingInstruction() const { return nodeType() == QDomNode::ProcessingInstructionNode; } executed: return nodeType() == QDomNode::ProcessingInstructionNode; Execution Count:60748 | 60748 |
86 | bool isCharacterData() const { const QDomNode::NodeType nt = nodeType(); | - |
87 | return (nt == QDomNode::CharacterDataNode) | 0 |
88 | || (nt == QDomNode::TextNode) | 0 |
89 | || (nt == QDomNode::CommentNode); } never executed: return (nt == QDomNode::CharacterDataNode) || (nt == QDomNode::TextNode) || (nt == QDomNode::CommentNode); | 0 |
90 | bool isComment() const { return nodeType() == QDomNode::CommentNode; } never executed: return nodeType() == QDomNode::CommentNode; | 0 |
91 | | - |
92 | virtual QDomNode::NodeType nodeType() const { return QDomNode::BaseNode; } executed: return QDomNode::BaseNode; Execution Count:35 | 35 |
93 | | - |
94 | virtual void save(QTextStream&, int, int) const; | - |
95 | | - |
96 | void setLocation(int lineNumber, int columnNumber); | - |
97 | | - |
98 | | - |
99 | QAtomicInt ref; | - |
100 | QDomNodePrivate* prev; | - |
101 | QDomNodePrivate* next; | - |
102 | QDomNodePrivate* ownerNode; | - |
103 | QDomNodePrivate* first; | - |
104 | QDomNodePrivate* last; | - |
105 | | - |
106 | QString name; | - |
107 | QString value; | - |
108 | QString prefix; | - |
109 | QString namespaceURI; | - |
110 | bool createdWithDom1Interface : 1; | - |
111 | bool hasParent : 1; | - |
112 | | - |
113 | int lineNumber; | - |
114 | int columnNumber; | - |
115 | }; | - |
116 | | - |
117 | class QDomNodeListPrivate | - |
118 | { | - |
119 | public: | - |
120 | QDomNodeListPrivate(QDomNodePrivate*); | - |
121 | QDomNodeListPrivate(QDomNodePrivate*, const QString& ); | - |
122 | QDomNodeListPrivate(QDomNodePrivate*, const QString&, const QString& ); | - |
123 | ~QDomNodeListPrivate(); | - |
124 | | - |
125 | bool operator== (const QDomNodeListPrivate&) const; | - |
126 | bool operator!= (const QDomNodeListPrivate&) const; | - |
127 | | - |
128 | void createList(); | - |
129 | QDomNodePrivate* item(int index); | - |
130 | int length() const; | - |
131 | | - |
132 | QAtomicInt ref; | - |
133 | | - |
134 | | - |
135 | | - |
136 | QDomNodePrivate* node_impl; | - |
137 | QString tagname; | - |
138 | QString nsURI; | - |
139 | QList<QDomNodePrivate*> list; | - |
140 | long timestamp; | - |
141 | }; | - |
142 | | - |
143 | class QDomNamedNodeMapPrivate | - |
144 | { | - |
145 | public: | - |
146 | QDomNamedNodeMapPrivate(QDomNodePrivate*); | - |
147 | ~QDomNamedNodeMapPrivate(); | - |
148 | | - |
149 | QDomNodePrivate* namedItem(const QString& name) const; | - |
150 | QDomNodePrivate* namedItemNS(const QString& nsURI, const QString& localName) const; | - |
151 | QDomNodePrivate* setNamedItem(QDomNodePrivate* arg); | - |
152 | QDomNodePrivate* setNamedItemNS(QDomNodePrivate* arg); | - |
153 | QDomNodePrivate* removeNamedItem(const QString& name); | - |
154 | QDomNodePrivate* item(int index) const; | - |
155 | int length() const; | - |
156 | bool contains(const QString& name) const; | - |
157 | bool containsNS(const QString& nsURI, const QString & localName) const; | - |
158 | | - |
159 | | - |
160 | | - |
161 | | - |
162 | void clearMap(); | - |
163 | bool isReadOnly() { return readonly; } never executed: return readonly; | 0 |
164 | void setReadOnly(bool r) { readonly = r; } | 0 |
165 | bool isAppendToParent() { return appendToParent; } never executed: return appendToParent; | 0 |
166 | void setAppendToParent(bool b) { appendToParent = b; } executed: } Execution Count:1714 | 1714 |
167 | | - |
168 | | - |
169 | | - |
170 | | - |
171 | | - |
172 | QDomNamedNodeMapPrivate* clone(QDomNodePrivate* parent); | - |
173 | | - |
174 | | - |
175 | QAtomicInt ref; | - |
176 | QHash<QString, QDomNodePrivate *> map; | - |
177 | QDomNodePrivate* parent; | - |
178 | bool readonly; | - |
179 | bool appendToParent; | - |
180 | }; | - |
181 | | - |
182 | class QDomDocumentTypePrivate : public QDomNodePrivate | - |
183 | { | - |
184 | public: | - |
185 | QDomDocumentTypePrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = 0); | - |
186 | QDomDocumentTypePrivate(QDomDocumentTypePrivate* n, bool deep); | - |
187 | ~QDomDocumentTypePrivate(); | - |
188 | void init(); | - |
189 | | - |
190 | | - |
191 | QDomNodePrivate* cloneNode(bool deep = true); | - |
192 | QDomNodePrivate* insertBefore(QDomNodePrivate* newChild, QDomNodePrivate* refChild); | - |
193 | QDomNodePrivate* insertAfter(QDomNodePrivate* newChild, QDomNodePrivate* refChild); | - |
194 | QDomNodePrivate* replaceChild(QDomNodePrivate* newChild, QDomNodePrivate* oldChild); | - |
195 | QDomNodePrivate* removeChild(QDomNodePrivate* oldChild); | - |
196 | QDomNodePrivate* appendChild(QDomNodePrivate* newChild); | - |
197 | | - |
198 | QDomNode::NodeType nodeType() const { return QDomNode::DocumentTypeNode; } executed: return QDomNode::DocumentTypeNode; Execution Count:11 | 11 |
199 | | - |
200 | void save(QTextStream& s, int, int) const; | - |
201 | | - |
202 | | - |
203 | QDomNamedNodeMapPrivate* entities; | - |
204 | QDomNamedNodeMapPrivate* notations; | - |
205 | QString publicId; | - |
206 | QString systemId; | - |
207 | QString internalSubset; | - |
208 | }; | - |
209 | | - |
210 | class QDomDocumentFragmentPrivate : public QDomNodePrivate | - |
211 | { | - |
212 | public: | - |
213 | QDomDocumentFragmentPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent = 0); | - |
214 | QDomDocumentFragmentPrivate(QDomNodePrivate* n, bool deep); | - |
215 | | - |
216 | | - |
217 | virtual QDomNodePrivate* cloneNode(bool deep = true); | - |
218 | QDomNode::NodeType nodeType() const { return QDomNode::DocumentFragmentNode; } executed: return QDomNode::DocumentFragmentNode; Execution Count:36 | 36 |
219 | }; | - |
220 | | - |
221 | class QDomCharacterDataPrivate : public QDomNodePrivate | - |
222 | { | - |
223 | public: | - |
224 | QDomCharacterDataPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent, const QString& data); | - |
225 | QDomCharacterDataPrivate(QDomCharacterDataPrivate* n, bool deep); | - |
226 | | - |
227 | int dataLength() const; | - |
228 | QString substringData(unsigned long offset, unsigned long count) const; | - |
229 | void appendData(const QString& arg); | - |
230 | void insertData(unsigned long offset, const QString& arg); | - |
231 | void deleteData(unsigned long offset, unsigned long count); | - |
232 | void replaceData(unsigned long offset, unsigned long count, const QString& arg); | - |
233 | | - |
234 | | - |
235 | QDomNode::NodeType nodeType() const { return QDomNode::CharacterDataNode; } never executed: return QDomNode::CharacterDataNode; | 0 |
236 | QDomNodePrivate* cloneNode(bool deep = true); | - |
237 | }; | - |
238 | | - |
239 | class QDomTextPrivate : public QDomCharacterDataPrivate | - |
240 | { | - |
241 | public: | - |
242 | QDomTextPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent, const QString& val); | - |
243 | QDomTextPrivate(QDomTextPrivate* n, bool deep); | - |
244 | | - |
245 | QDomTextPrivate* splitText(int offset); | - |
246 | | - |
247 | | - |
248 | QDomNodePrivate* cloneNode(bool deep = true); | - |
249 | QDomNode::NodeType nodeType() const { return QDomNode::TextNode; } executed: return QDomNode::TextNode; Execution Count:339176 | 339176 |
250 | virtual void save(QTextStream& s, int, int) const; | - |
251 | }; | - |
252 | | - |
253 | class QDomAttrPrivate : public QDomNodePrivate | - |
254 | { | - |
255 | public: | - |
256 | QDomAttrPrivate(QDomDocumentPrivate*, QDomNodePrivate*, const QString& name); | - |
257 | QDomAttrPrivate(QDomDocumentPrivate*, QDomNodePrivate*, const QString& nsURI, const QString& qName); | - |
258 | QDomAttrPrivate(QDomAttrPrivate* n, bool deep); | - |
259 | | - |
260 | bool specified() const; | - |
261 | | - |
262 | | - |
263 | void setNodeValue(const QString& v); | - |
264 | QDomNodePrivate* cloneNode(bool deep = true); | - |
265 | QDomNode::NodeType nodeType() const { return QDomNode::AttributeNode; } executed: return QDomNode::AttributeNode; Execution Count:33591 | 33591 |
266 | virtual void save(QTextStream& s, int, int) const; | - |
267 | | - |
268 | | - |
269 | bool m_specified; | - |
270 | }; | - |
271 | | - |
272 | class QDomElementPrivate : public QDomNodePrivate | - |
273 | { | - |
274 | public: | - |
275 | QDomElementPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent, const QString& name); | - |
276 | QDomElementPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent, const QString& nsURI, const QString& qName); | - |
277 | QDomElementPrivate(QDomElementPrivate* n, bool deep); | - |
278 | ~QDomElementPrivate(); | - |
279 | | - |
280 | QString attribute(const QString& name, const QString& defValue) const; | - |
281 | QString attributeNS(const QString& nsURI, const QString& localName, const QString& defValue) const; | - |
282 | void setAttribute(const QString& name, const QString& value); | - |
283 | void setAttributeNS(const QString& nsURI, const QString& qName, const QString& newValue); | - |
284 | void removeAttribute(const QString& name); | - |
285 | QDomAttrPrivate* attributeNode(const QString& name); | - |
286 | QDomAttrPrivate* attributeNodeNS(const QString& nsURI, const QString& localName); | - |
287 | QDomAttrPrivate* setAttributeNode(QDomAttrPrivate* newAttr); | - |
288 | QDomAttrPrivate* setAttributeNodeNS(QDomAttrPrivate* newAttr); | - |
289 | QDomAttrPrivate* removeAttributeNode(QDomAttrPrivate* oldAttr); | - |
290 | bool hasAttribute(const QString& name); | - |
291 | bool hasAttributeNS(const QString& nsURI, const QString& localName); | - |
292 | | - |
293 | QString text(); | - |
294 | | - |
295 | | - |
296 | QDomNamedNodeMapPrivate* attributes() { return m_attr; } executed: return m_attr; Execution Count:11 | 11 |
297 | bool hasAttributes() { return (m_attr->length() > 0); } executed: return (m_attr->length() > 0); Execution Count:9 | 9 |
298 | QDomNode::NodeType nodeType() const { return QDomNode::ElementNode; } executed: return QDomNode::ElementNode; Execution Count:3961443 | 3961443 |
299 | QDomNodePrivate* cloneNode(bool deep = true); | - |
300 | virtual void save(QTextStream& s, int, int) const; | - |
301 | | - |
302 | | - |
303 | QDomNamedNodeMapPrivate* m_attr; | - |
304 | }; | - |
305 | | - |
306 | | - |
307 | class QDomCommentPrivate : public QDomCharacterDataPrivate | - |
308 | { | - |
309 | public: | - |
310 | QDomCommentPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent, const QString& val); | - |
311 | QDomCommentPrivate(QDomCommentPrivate* n, bool deep); | - |
312 | | - |
313 | | - |
314 | QDomNodePrivate* cloneNode(bool deep = true); | - |
315 | QDomNode::NodeType nodeType() const { return QDomNode::CommentNode; } executed: return QDomNode::CommentNode; Execution Count:14491 | 14491 |
316 | virtual void save(QTextStream& s, int, int) const; | - |
317 | }; | - |
318 | | - |
319 | class QDomCDATASectionPrivate : public QDomTextPrivate | - |
320 | { | - |
321 | public: | - |
322 | QDomCDATASectionPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent, const QString& val); | - |
323 | QDomCDATASectionPrivate(QDomCDATASectionPrivate* n, bool deep); | - |
324 | | - |
325 | | - |
326 | QDomNodePrivate* cloneNode(bool deep = true); | - |
327 | QDomNode::NodeType nodeType() const { return QDomNode::CDATASectionNode; } executed: return QDomNode::CDATASectionNode; Execution Count:1735 | 1735 |
328 | virtual void save(QTextStream& s, int, int) const; | - |
329 | }; | - |
330 | | - |
331 | class QDomNotationPrivate : public QDomNodePrivate | - |
332 | { | - |
333 | public: | - |
334 | QDomNotationPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent, const QString& name, | - |
335 | const QString& pub, const QString& sys); | - |
336 | QDomNotationPrivate(QDomNotationPrivate* n, bool deep); | - |
337 | | - |
338 | | - |
339 | QDomNodePrivate* cloneNode(bool deep = true); | - |
340 | QDomNode::NodeType nodeType() const { return QDomNode::NotationNode; } executed: return QDomNode::NotationNode; Execution Count:10 | 10 |
341 | virtual void save(QTextStream& s, int, int) const; | - |
342 | | - |
343 | | - |
344 | QString m_sys; | - |
345 | QString m_pub; | - |
346 | }; | - |
347 | | - |
348 | class QDomEntityPrivate : public QDomNodePrivate | - |
349 | { | - |
350 | public: | - |
351 | QDomEntityPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent, const QString& name, | - |
352 | const QString& pub, const QString& sys, const QString& notation); | - |
353 | QDomEntityPrivate(QDomEntityPrivate* n, bool deep); | - |
354 | | - |
355 | | - |
356 | QDomNodePrivate* cloneNode(bool deep = true); | - |
357 | QDomNode::NodeType nodeType() const { return QDomNode::EntityNode; } executed: return QDomNode::EntityNode; Execution Count:26 | 26 |
358 | virtual void save(QTextStream& s, int, int) const; | - |
359 | | - |
360 | | - |
361 | QString m_sys; | - |
362 | QString m_pub; | - |
363 | QString m_notationName; | - |
364 | }; | - |
365 | | - |
366 | class QDomEntityReferencePrivate : public QDomNodePrivate | - |
367 | { | - |
368 | public: | - |
369 | QDomEntityReferencePrivate(QDomDocumentPrivate*, QDomNodePrivate* parent, const QString& name); | - |
370 | QDomEntityReferencePrivate(QDomNodePrivate* n, bool deep); | - |
371 | | - |
372 | | - |
373 | QDomNodePrivate* cloneNode(bool deep = true); | - |
374 | QDomNode::NodeType nodeType() const { return QDomNode::EntityReferenceNode; } executed: return QDomNode::EntityReferenceNode; Execution Count:38 | 38 |
375 | virtual void save(QTextStream& s, int, int) const; | - |
376 | }; | - |
377 | | - |
378 | class QDomProcessingInstructionPrivate : public QDomNodePrivate | - |
379 | { | - |
380 | public: | - |
381 | QDomProcessingInstructionPrivate(QDomDocumentPrivate*, QDomNodePrivate* parent, const QString& target, | - |
382 | const QString& data); | - |
383 | QDomProcessingInstructionPrivate(QDomProcessingInstructionPrivate* n, bool deep); | - |
384 | | - |
385 | | - |
386 | QDomNodePrivate* cloneNode(bool deep = true); | - |
387 | QDomNode::NodeType nodeType() const { return QDomNode::ProcessingInstructionNode; } executed: return QDomNode::ProcessingInstructionNode; Execution Count:639 | 639 |
388 | virtual void save(QTextStream& s, int, int) const; | - |
389 | }; | - |
390 | | - |
391 | class QDomDocumentPrivate : public QDomNodePrivate | - |
392 | { | - |
393 | public: | - |
394 | QDomDocumentPrivate(); | - |
395 | QDomDocumentPrivate(const QString& name); | - |
396 | QDomDocumentPrivate(QDomDocumentTypePrivate* dt); | - |
397 | QDomDocumentPrivate(QDomDocumentPrivate* n, bool deep); | - |
398 | ~QDomDocumentPrivate(); | - |
399 | | - |
400 | bool setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn); | - |
401 | bool setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg, int *errorLine, int *errorColumn); | - |
402 | | - |
403 | | - |
404 | QDomDocumentTypePrivate* doctype() { return type.data(); } executed: return type.data(); Execution Count:382 | 382 |
405 | QDomImplementationPrivate* implementation() { return impl.data(); } never executed: return impl.data(); | 0 |
406 | QDomElementPrivate* documentElement(); | - |
407 | | - |
408 | | - |
409 | QDomElementPrivate* createElement(const QString& tagName); | - |
410 | QDomElementPrivate* createElementNS(const QString& nsURI, const QString& qName); | - |
411 | QDomDocumentFragmentPrivate* createDocumentFragment(); | - |
412 | QDomTextPrivate* createTextNode(const QString& data); | - |
413 | QDomCommentPrivate* createComment(const QString& data); | - |
414 | QDomCDATASectionPrivate* createCDATASection(const QString& data); | - |
415 | QDomProcessingInstructionPrivate* createProcessingInstruction(const QString& target, const QString& data); | - |
416 | QDomAttrPrivate* createAttribute(const QString& name); | - |
417 | QDomAttrPrivate* createAttributeNS(const QString& nsURI, const QString& qName); | - |
418 | QDomEntityReferencePrivate* createEntityReference(const QString& name); | - |
419 | | - |
420 | QDomNodePrivate* importNode(const QDomNodePrivate* importedNode, bool deep); | - |
421 | | - |
422 | | - |
423 | QDomNodePrivate* cloneNode(bool deep = true); | - |
424 | QDomNode::NodeType nodeType() const { return QDomNode::DocumentNode; } executed: return QDomNode::DocumentNode; Execution Count:569241 | 569241 |
425 | void clear(); | - |
426 | | - |
427 | | - |
428 | QExplicitlySharedDataPointer<QDomImplementationPrivate> impl; | - |
429 | QExplicitlySharedDataPointer<QDomDocumentTypePrivate> type; | - |
430 | | - |
431 | void saveDocument(QTextStream& stream, const int indent, QDomNode::EncodingPolicy encUsed) const; | - |
432 | long nodeListTime; | - |
433 | }; | - |
434 | | - |
435 | | - |
436 | | - |
437 | | - |
438 | | - |
439 | | - |
440 | | - |
441 | class QDomHandler : public QXmlDefaultHandler | - |
442 | { | - |
443 | public: | - |
444 | QDomHandler(QDomDocumentPrivate* d, bool namespaceProcessing); | - |
445 | ~QDomHandler(); | - |
446 | | - |
447 | | - |
448 | bool endDocument(); | - |
449 | bool startElement(const QString& nsURI, const QString& localName, const QString& qName, const QXmlAttributes& atts); | - |
450 | bool endElement(const QString& nsURI, const QString& localName, const QString& qName); | - |
451 | bool characters(const QString& ch); | - |
452 | bool processingInstruction(const QString& target, const QString& data); | - |
453 | bool skippedEntity(const QString& name); | - |
454 | | - |
455 | | - |
456 | bool fatalError(const QXmlParseException& exception); | - |
457 | | - |
458 | | - |
459 | bool startCDATA(); | - |
460 | bool endCDATA(); | - |
461 | bool startEntity(const QString &); | - |
462 | bool endEntity(const QString &); | - |
463 | bool startDTD(const QString& name, const QString& publicId, const QString& systemId); | - |
464 | bool comment(const QString& ch); | - |
465 | | - |
466 | | - |
467 | bool externalEntityDecl(const QString &name, const QString &publicId, const QString &systemId) ; | - |
468 | | - |
469 | | - |
470 | bool notationDecl(const QString & name, const QString & publicId, const QString & systemId); | - |
471 | bool unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId, const QString ¬ationName) ; | - |
472 | | - |
473 | void setDocumentLocator(QXmlLocator *locator); | - |
474 | | - |
475 | QString errorMsg; | - |
476 | int errorLine; | - |
477 | int errorColumn; | - |
478 | | - |
479 | private: | - |
480 | QDomDocumentPrivate *doc; | - |
481 | QDomNodePrivate *node; | - |
482 | QString entityName; | - |
483 | bool cdata; | - |
484 | bool nsProcessing; | - |
485 | QXmlLocator *locator; | - |
486 | }; | - |
487 | | - |
488 | | - |
489 | | - |
490 | | - |
491 | | - |
492 | | - |
493 | QDomImplementation::InvalidDataPolicy QDomImplementationPrivate::invalidDataPolicy | - |
494 | = QDomImplementation::AcceptInvalidChars; | - |
495 | | - |
496 | | - |
497 | | - |
498 | static QString fixedXmlName(const QString &_name, bool *ok, bool namespaces = false) | - |
499 | { | - |
500 | QString name, prefix; | - |
501 | if (namespaces) evaluated: namespaces yes Evaluation Count:238 | yes Evaluation Count:38162 |
| 238-38162 |
502 | qt_split_namespace(prefix, name, _name, true); executed: qt_split_namespace(prefix, name, _name, true); Execution Count:238 | 238 |
503 | else | - |
504 | name = _name; executed: name = _name; Execution Count:38162 | 38162 |
505 | | - |
506 | if (name.isEmpty()) { evaluated: name.isEmpty() yes Evaluation Count:52 | yes Evaluation Count:38348 |
| 52-38348 |
507 | *ok = false; | - |
508 | return QString(); executed: return QString(); Execution Count:52 | 52 |
509 | } | - |
510 | | - |
511 | if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars) { evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars yes Evaluation Count:38187 | yes Evaluation Count:161 |
| 161-38187 |
512 | *ok = true; | - |
513 | return _name; executed: return _name; Execution Count:38187 | 38187 |
514 | } | - |
515 | | - |
516 | QString result; | - |
517 | bool firstChar = true; | - |
518 | for (int i = 0; i < name.size(); ++i) { evaluated: i < name.size() yes Evaluation Count:520 | yes Evaluation Count:128 |
| 128-520 |
519 | QChar c = name.at(i); | - |
520 | if (firstChar) { evaluated: firstChar yes Evaluation Count:207 | yes Evaluation Count:313 |
| 207-313 |
521 | if (QXmlUtils::isLetter(c) || c.unicode() == '_' || c.unicode() == ':') { evaluated: QXmlUtils::isLetter(c) yes Evaluation Count:92 | yes Evaluation Count:115 |
evaluated: c.unicode() == '_' yes Evaluation Count:10 | yes Evaluation Count:105 |
evaluated: c.unicode() == ':' yes Evaluation Count:9 | yes Evaluation Count:96 |
| 9-115 |
522 | result.append(c); | - |
523 | firstChar = false; | - |
524 | } else if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode) { executed: } Execution Count:111 evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode yes Evaluation Count:32 | yes Evaluation Count:64 |
| 32-111 |
525 | *ok = false; | - |
526 | return QString(); executed: return QString(); Execution Count:32 | 32 |
527 | } | - |
528 | } else { | - |
529 | if (QXmlUtils::isNameChar(c)) evaluated: QXmlUtils::isNameChar(c) yes Evaluation Count:297 | yes Evaluation Count:16 |
| 16-297 |
530 | result.append(c); executed: result.append(c); Execution Count:297 | 297 |
531 | else if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode) { evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode yes Evaluation Count:1 | yes Evaluation Count:15 |
| 1-15 |
532 | *ok = false; | - |
533 | return QString(); executed: return QString(); Execution Count:1 | 1 |
534 | } | - |
535 | } | - |
536 | } | - |
537 | | - |
538 | if (result.isEmpty()) { evaluated: result.isEmpty() yes Evaluation Count:18 | yes Evaluation Count:110 |
| 18-110 |
539 | *ok = false; | - |
540 | return QString(); executed: return QString(); Execution Count:18 | 18 |
541 | } | - |
542 | | - |
543 | *ok = true; | - |
544 | if (namespaces && !prefix.isEmpty()) evaluated: namespaces yes Evaluation Count:49 | yes Evaluation Count:61 |
evaluated: !prefix.isEmpty() yes Evaluation Count:29 | yes Evaluation Count:20 |
| 20-61 |
545 | return prefix + QLatin1Char(':') + result; executed: return prefix + QLatin1Char(':') + result; Execution Count:29 | 29 |
546 | return result; executed: return result; Execution Count:81 | 81 |
547 | } | - |
548 | | - |
549 | | - |
550 | | - |
551 | | - |
552 | static QString fixedCharData(const QString &data, bool *ok) | - |
553 | { | - |
554 | if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars) { evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars yes Evaluation Count:36351 | yes Evaluation Count:25 |
| 25-36351 |
555 | *ok = true; | - |
556 | return data; executed: return data; Execution Count:36351 | 36351 |
557 | } | - |
558 | | - |
559 | QString result; | - |
560 | for (int i = 0; i < data.size(); ++i) { evaluated: i < data.size() yes Evaluation Count:316 | yes Evaluation Count:24 |
| 24-316 |
561 | QChar c = data.at(i); | - |
562 | if (QXmlUtils::isChar(c)) { evaluated: QXmlUtils::isChar(c) yes Evaluation Count:313 | yes Evaluation Count:3 |
| 3-313 |
563 | result.append(c); | - |
564 | } else if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode) { executed: } Execution Count:313 evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode yes Evaluation Count:1 | yes Evaluation Count:2 |
| 1-313 |
565 | *ok = false; | - |
566 | return QString(); executed: return QString(); Execution Count:1 | 1 |
567 | } | - |
568 | } | - |
569 | | - |
570 | *ok = true; | - |
571 | return result; executed: return result; Execution Count:24 | 24 |
572 | } | - |
573 | | - |
574 | | - |
575 | | - |
576 | | - |
577 | static QString fixedComment(const QString &data, bool *ok) | - |
578 | { | - |
579 | if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars) { evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars yes Evaluation Count:1958 | yes Evaluation Count:4 |
| 4-1958 |
580 | *ok = true; | - |
581 | return data; executed: return data; Execution Count:1958 | 1958 |
582 | } | - |
583 | | - |
584 | QString fixedData = fixedCharData(data, ok); | - |
585 | if (!*ok) partially evaluated: !*ok no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
586 | return QString(); never executed: return QString(); | 0 |
587 | | - |
588 | for (;;) { | - |
589 | int idx = fixedData.indexOf(QLatin1String("--")); | - |
590 | if (idx == -1) partially evaluated: idx == -1 yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
591 | break; executed: break; Execution Count:4 | 4 |
592 | if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode) { never evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode | 0 |
593 | *ok = false; | - |
594 | return QString(); never executed: return QString(); | 0 |
595 | } | - |
596 | fixedData.remove(idx, 2); | - |
597 | } | 0 |
598 | | - |
599 | *ok = true; | - |
600 | return fixedData; executed: return fixedData; Execution Count:4 | 4 |
601 | } | - |
602 | | - |
603 | | - |
604 | | - |
605 | | - |
606 | static QString fixedCDataSection(const QString &data, bool *ok) | - |
607 | { | - |
608 | if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars) { evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars yes Evaluation Count:202 | yes Evaluation Count:1 |
| 1-202 |
609 | *ok = true; | - |
610 | return data; executed: return data; Execution Count:202 | 202 |
611 | } | - |
612 | | - |
613 | QString fixedData = fixedCharData(data, ok); | - |
614 | if (!*ok) partially evaluated: !*ok no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
615 | return QString(); never executed: return QString(); | 0 |
616 | | - |
617 | for (;;) { | - |
618 | int idx = fixedData.indexOf(QLatin1String("]]>")); | - |
619 | if (idx == -1) partially evaluated: idx == -1 yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
620 | break; executed: break; Execution Count:1 | 1 |
621 | if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode) { never evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode | 0 |
622 | *ok = false; | - |
623 | return QString(); never executed: return QString(); | 0 |
624 | } | - |
625 | fixedData.remove(idx, 3); | - |
626 | } | 0 |
627 | | - |
628 | *ok = true; | - |
629 | return fixedData; executed: return fixedData; Execution Count:1 | 1 |
630 | } | - |
631 | | - |
632 | | - |
633 | | - |
634 | static QString fixedPIData(const QString &data, bool *ok) | - |
635 | { | - |
636 | if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars) { evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars yes Evaluation Count:145 | yes Evaluation Count:6 |
| 6-145 |
637 | *ok = true; | - |
638 | return data; executed: return data; Execution Count:145 | 145 |
639 | } | - |
640 | | - |
641 | QString fixedData = fixedCharData(data, ok); | - |
642 | if (!*ok) partially evaluated: !*ok no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
643 | return QString(); never executed: return QString(); | 0 |
644 | | - |
645 | for (;;) { | - |
646 | int idx = fixedData.indexOf(QLatin1String("?>")); | - |
647 | if (idx == -1) partially evaluated: idx == -1 yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-6 |
648 | break; executed: break; Execution Count:6 | 6 |
649 | if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode) { never evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode | 0 |
650 | *ok = false; | - |
651 | return QString(); never executed: return QString(); | 0 |
652 | } | - |
653 | fixedData.remove(idx, 2); | - |
654 | } | 0 |
655 | | - |
656 | *ok = true; | - |
657 | return fixedData; executed: return fixedData; Execution Count:6 | 6 |
658 | } | - |
659 | | - |
660 | | - |
661 | | - |
662 | | - |
663 | static QString fixedPubidLiteral(const QString &data, bool *ok) | - |
664 | { | - |
665 | if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars) { evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars yes Evaluation Count:5 | yes Evaluation Count:5 |
| 5 |
666 | *ok = true; | - |
667 | return data; executed: return data; Execution Count:5 | 5 |
668 | } | - |
669 | | - |
670 | QString result; | - |
671 | | - |
672 | if(QXmlUtils::isPublicID(data)) partially evaluated: QXmlUtils::isPublicID(data) yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
673 | result = data; executed: result = data; Execution Count:5 | 5 |
674 | else if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode) { never evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode | 0 |
675 | *ok = false; | - |
676 | return QString(); never executed: return QString(); | 0 |
677 | } | - |
678 | | - |
679 | if (result.indexOf(QLatin1Char('\'')) != -1 partially evaluated: result.indexOf(QLatin1Char('\'')) != -1 no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
680 | && result.indexOf(QLatin1Char('"')) != -1) { never evaluated: result.indexOf(QLatin1Char('"')) != -1 | 0 |
681 | if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode) { never evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode | 0 |
682 | *ok = false; | - |
683 | return QString(); never executed: return QString(); | 0 |
684 | } else { | - |
685 | result.remove(QLatin1Char('\'')); | - |
686 | } | 0 |
687 | } | - |
688 | | - |
689 | *ok = true; | - |
690 | return result; executed: return result; Execution Count:5 | 5 |
691 | } | - |
692 | | - |
693 | | - |
694 | | - |
695 | | - |
696 | static QString fixedSystemLiteral(const QString &data, bool *ok) | - |
697 | { | - |
698 | if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars) { evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::AcceptInvalidChars yes Evaluation Count:5 | yes Evaluation Count:5 |
| 5 |
699 | *ok = true; | - |
700 | return data; executed: return data; Execution Count:5 | 5 |
701 | } | - |
702 | | - |
703 | QString result = data; | - |
704 | | - |
705 | if (result.indexOf(QLatin1Char('\'')) != -1 partially evaluated: result.indexOf(QLatin1Char('\'')) != -1 no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
706 | && result.indexOf(QLatin1Char('"')) != -1) { never evaluated: result.indexOf(QLatin1Char('"')) != -1 | 0 |
707 | if (QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode) { never evaluated: QDomImplementationPrivate::invalidDataPolicy == QDomImplementation::ReturnNullNode | 0 |
708 | *ok = false; | - |
709 | return QString(); never executed: return QString(); | 0 |
710 | } else { | - |
711 | result.remove(QLatin1Char('\'')); | - |
712 | } | 0 |
713 | } | - |
714 | | - |
715 | *ok = true; | - |
716 | return result; executed: return result; Execution Count:5 | 5 |
717 | } | - |
718 | | - |
719 | | - |
720 | | - |
721 | | - |
722 | | - |
723 | | - |
724 | | - |
725 | QDomImplementationPrivate* QDomImplementationPrivate::clone() | - |
726 | { | - |
727 | return new QDomImplementationPrivate; executed: return new QDomImplementationPrivate; Execution Count:1 | 1 |
728 | } | - |
729 | QDomImplementation::QDomImplementation() | - |
730 | { | - |
731 | impl = 0; | - |
732 | } executed: } Execution Count:19 | 19 |
733 | | - |
734 | | - |
735 | | - |
736 | | - |
737 | QDomImplementation::QDomImplementation(const QDomImplementation &x) | - |
738 | { | - |
739 | impl = x.impl; | - |
740 | if (impl) | 0 |
741 | impl->ref.ref(); never executed: impl->ref.ref(); | 0 |
742 | } | 0 |
743 | | - |
744 | QDomImplementation::QDomImplementation(QDomImplementationPrivate *p) | - |
745 | { | - |
746 | | - |
747 | impl = p; | - |
748 | if (impl) | 0 |
749 | impl->ref.ref(); never executed: impl->ref.ref(); | 0 |
750 | } | 0 |
751 | | - |
752 | | - |
753 | | - |
754 | | - |
755 | QDomImplementation& QDomImplementation::operator=(const QDomImplementation &x) | - |
756 | { | - |
757 | if (x.impl) | 0 |
758 | x.impl->ref.ref(); never executed: x.impl->ref.ref(); | 0 |
759 | if (impl && !impl->ref.deref()) never evaluated: !impl->ref.deref() | 0 |
760 | delete impl; never executed: delete impl; | 0 |
761 | impl = x.impl; | - |
762 | return *this; never executed: return *this; | 0 |
763 | } | - |
764 | | - |
765 | | - |
766 | | - |
767 | | - |
768 | | - |
769 | bool QDomImplementation::operator==(const QDomImplementation &x) const | - |
770 | { | - |
771 | return (impl == x.impl); never executed: return (impl == x.impl); | 0 |
772 | } | - |
773 | | - |
774 | | - |
775 | | - |
776 | | - |
777 | | - |
778 | bool QDomImplementation::operator!=(const QDomImplementation &x) const | - |
779 | { | - |
780 | return (impl != x.impl); never executed: return (impl != x.impl); | 0 |
781 | } | - |
782 | | - |
783 | | - |
784 | | - |
785 | | - |
786 | QDomImplementation::~QDomImplementation() | - |
787 | { | - |
788 | if (impl && !impl->ref.deref()) partially evaluated: impl no Evaluation Count:0 | yes Evaluation Count:19 |
never evaluated: !impl->ref.deref() | 0-19 |
789 | delete impl; never executed: delete impl; | 0 |
790 | } executed: } Execution Count:19 | 19 |
791 | bool QDomImplementation::hasFeature(const QString& feature, const QString& version) const | - |
792 | { | - |
793 | if (feature == QLatin1String("XML")) { never evaluated: feature == QLatin1String("XML") | 0 |
794 | if (version.isEmpty() || version == QLatin1String("1.0")) { never evaluated: version.isEmpty() never evaluated: version == QLatin1String("1.0") | 0 |
795 | return true; never executed: return true; | 0 |
796 | } | - |
797 | } | 0 |
798 | | - |
799 | return false; never executed: return false; | 0 |
800 | } | - |
801 | QDomDocumentType QDomImplementation::createDocumentType(const QString& qName, const QString& publicId, const QString& systemId) | - |
802 | { | - |
803 | bool ok; | - |
804 | QString fixedName = fixedXmlName(qName, &ok, true); | - |
805 | if (!ok) evaluated: !ok yes Evaluation Count:14 | yes Evaluation Count:10 |
| 10-14 |
806 | return QDomDocumentType(); executed: return QDomDocumentType(); Execution Count:14 | 14 |
807 | | - |
808 | QString fixedPublicId = fixedPubidLiteral(publicId, &ok); | - |
809 | if (!ok) partially evaluated: !ok no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-10 |
810 | return QDomDocumentType(); never executed: return QDomDocumentType(); | 0 |
811 | | - |
812 | QString fixedSystemId = fixedSystemLiteral(systemId, &ok); | - |
813 | if (!ok) partially evaluated: !ok no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-10 |
814 | return QDomDocumentType(); never executed: return QDomDocumentType(); | 0 |
815 | | - |
816 | QDomDocumentTypePrivate *dt = new QDomDocumentTypePrivate(0); | - |
817 | dt->name = fixedName; | - |
818 | if (systemId.isNull()) { partially evaluated: systemId.isNull() no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-10 |
819 | dt->publicId.clear(); | - |
820 | dt->systemId.clear(); | - |
821 | } else { | 0 |
822 | dt->publicId = fixedPublicId; | - |
823 | dt->systemId = fixedSystemId; | - |
824 | } executed: } Execution Count:10 | 10 |
825 | dt->ref.deref(); | - |
826 | return QDomDocumentType(dt); executed: return QDomDocumentType(dt); Execution Count:10 | 10 |
827 | } | - |
828 | | - |
829 | | - |
830 | | - |
831 | | - |
832 | | - |
833 | | - |
834 | QDomDocument QDomImplementation::createDocument(const QString& nsURI, const QString& qName, const QDomDocumentType& doctype) | - |
835 | { | - |
836 | QDomDocument doc(doctype); | - |
837 | QDomElement root = doc.createElementNS(nsURI, qName); | - |
838 | if (root.isNull()) evaluated: root.isNull() yes Evaluation Count:14 | yes Evaluation Count:14 |
| 14 |
839 | return QDomDocument(); executed: return QDomDocument(); Execution Count:14 | 14 |
840 | doc.appendChild(root); | - |
841 | return doc; executed: return doc; Execution Count:14 | 14 |
842 | } | - |
843 | | - |
844 | | - |
845 | | - |
846 | | - |
847 | | - |
848 | bool QDomImplementation::isNull() | - |
849 | { | - |
850 | return (impl == 0); never executed: return (impl == 0); | 0 |
851 | } | - |
852 | QDomImplementation::InvalidDataPolicy QDomImplementation::invalidDataPolicy() | - |
853 | { | - |
854 | return QDomImplementationPrivate::invalidDataPolicy; never executed: return QDomImplementationPrivate::invalidDataPolicy; | 0 |
855 | } | - |
856 | void QDomImplementation::setInvalidDataPolicy(InvalidDataPolicy policy) | - |
857 | { | - |
858 | QDomImplementationPrivate::invalidDataPolicy = policy; | - |
859 | } executed: } Execution Count:59 | 59 |
860 | | - |
861 | | - |
862 | | - |
863 | | - |
864 | | - |
865 | | - |
866 | | - |
867 | QDomNodeListPrivate::QDomNodeListPrivate(QDomNodePrivate *n_impl) : ref(1) | - |
868 | { | - |
869 | node_impl = n_impl; | - |
870 | if (node_impl) partially evaluated: node_impl yes Evaluation Count:127242 | no Evaluation Count:0 |
| 0-127242 |
871 | node_impl->ref.ref(); executed: node_impl->ref.ref(); Execution Count:127242 | 127242 |
872 | timestamp = 0; | - |
873 | } executed: } Execution Count:127242 | 127242 |
874 | | - |
875 | QDomNodeListPrivate::QDomNodeListPrivate(QDomNodePrivate *n_impl, const QString &name) : | - |
876 | ref(1) | - |
877 | { | - |
878 | node_impl = n_impl; | - |
879 | if (node_impl) partially evaluated: node_impl yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
880 | node_impl->ref.ref(); executed: node_impl->ref.ref(); Execution Count:1 | 1 |
881 | tagname = name; | - |
882 | timestamp = 0; | - |
883 | } executed: } Execution Count:1 | 1 |
884 | | - |
885 | QDomNodeListPrivate::QDomNodeListPrivate(QDomNodePrivate *n_impl, const QString &_nsURI, const QString &localName) : | - |
886 | ref(1) | - |
887 | { | - |
888 | node_impl = n_impl; | - |
889 | if (node_impl) never evaluated: node_impl | 0 |
890 | node_impl->ref.ref(); never executed: node_impl->ref.ref(); | 0 |
891 | tagname = localName; | - |
892 | nsURI = _nsURI; | - |
893 | timestamp = 0; | - |
894 | } | 0 |
895 | | - |
896 | QDomNodeListPrivate::~QDomNodeListPrivate() | - |
897 | { | - |
898 | if (node_impl && !node_impl->ref.deref()) partially evaluated: node_impl yes Evaluation Count:127243 | no Evaluation Count:0 |
partially evaluated: !node_impl->ref.deref() no Evaluation Count:0 | yes Evaluation Count:127243 |
| 0-127243 |
899 | delete node_impl; never executed: delete node_impl; | 0 |
900 | } executed: } Execution Count:127243 | 127243 |
901 | | - |
902 | bool QDomNodeListPrivate::operator==(const QDomNodeListPrivate &other) const | - |
903 | { | - |
904 | return (node_impl == other.node_impl) && (tagname == other.tagname); never executed: return (node_impl == other.node_impl) && (tagname == other.tagname); | 0 |
905 | } | - |
906 | | - |
907 | bool QDomNodeListPrivate::operator!=(const QDomNodeListPrivate &other) const | - |
908 | { | - |
909 | return (node_impl != other.node_impl) || (tagname != other.tagname); never executed: return (node_impl != other.node_impl) || (tagname != other.tagname); | 0 |
910 | } | - |
911 | | - |
912 | void QDomNodeListPrivate::createList() | - |
913 | { | - |
914 | if (!node_impl) partially evaluated: !node_impl no Evaluation Count:0 | yes Evaluation Count:127244 |
| 0-127244 |
915 | return; | 0 |
916 | | - |
917 | const QDomDocumentPrivate *const doc = node_impl->ownerDocument(); | - |
918 | if (doc && timestamp != doc->nodeListTime) partially evaluated: doc yes Evaluation Count:127244 | no Evaluation Count:0 |
partially evaluated: timestamp != doc->nodeListTime yes Evaluation Count:127244 | no Evaluation Count:0 |
| 0-127244 |
919 | timestamp = doc->nodeListTime; executed: timestamp = doc->nodeListTime; Execution Count:127244 | 127244 |
920 | | - |
921 | QDomNodePrivate* p = node_impl->first; | - |
922 | | - |
923 | list.clear(); | - |
924 | if (tagname.isNull()) { evaluated: tagname.isNull() yes Evaluation Count:127243 | yes Evaluation Count:1 |
| 1-127243 |
925 | while (p) { evaluated: p yes Evaluation Count:127189 | yes Evaluation Count:127243 |
| 127189-127243 |
926 | list.append(p); | - |
927 | p = p->next; | - |
928 | } executed: } Execution Count:127189 | 127189 |
929 | } else if (nsURI.isNull()) { partially evaluated: nsURI.isNull() yes Evaluation Count:1 | no Evaluation Count:0 |
executed: } Execution Count:127243 | 0-127243 |
930 | while (p && p != node_impl) { partially evaluated: p yes Evaluation Count:2 | no Evaluation Count:0 |
evaluated: p != node_impl yes Evaluation Count:1 | yes Evaluation Count:1 |
| 0-2 |
931 | if (p->isElement() && p->nodeName() == tagname) { partially evaluated: p->isElement() yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: p->nodeName() == tagname yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
932 | list.append(p); | - |
933 | } executed: } Execution Count:1 | 1 |
934 | if (p->first) partially evaluated: p->first no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
935 | p = p->first; never executed: p = p->first; | 0 |
936 | else if (p->next) partially evaluated: p->next no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
937 | p = p->next; never executed: p = p->next; | 0 |
938 | else { | - |
939 | p = p->parent(); | - |
940 | while (p && p != node_impl && !p->next) partially evaluated: p yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: p != node_impl no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: !p->next | 0-1 |
941 | p = p->parent(); never executed: p = p->parent(); | 0 |
942 | if (p && p != node_impl) partially evaluated: p yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: p != node_impl no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
943 | p = p->next; never executed: p = p->next; | 0 |
944 | } executed: } Execution Count:1 | 1 |
945 | } | - |
946 | } else { executed: } Execution Count:1 | 1 |
947 | while (p && p != node_impl) { never evaluated: p != node_impl | 0 |
948 | if (p->isElement() && p->name==tagname && p->namespaceURI==nsURI) { never evaluated: p->isElement() never evaluated: p->name==tagname never evaluated: p->namespaceURI==nsURI | 0 |
949 | list.append(p); | - |
950 | } | 0 |
951 | if (p->first) never evaluated: p->first | 0 |
952 | p = p->first; never executed: p = p->first; | 0 |
953 | else if (p->next) | 0 |
954 | p = p->next; never executed: p = p->next; | 0 |
955 | else { | - |
956 | p = p->parent(); | - |
957 | while (p && p != node_impl && !p->next) never evaluated: p != node_impl never evaluated: !p->next | 0 |
958 | p = p->parent(); never executed: p = p->parent(); | 0 |
959 | if (p && p != node_impl) never evaluated: p != node_impl | 0 |
960 | p = p->next; never executed: p = p->next; | 0 |
961 | } | 0 |
962 | } | - |
963 | } | 0 |
964 | } | - |
965 | | - |
966 | QDomNodePrivate* QDomNodeListPrivate::item(int index) | - |
967 | { | - |
968 | if (!node_impl) partially evaluated: !node_impl no Evaluation Count:0 | yes Evaluation Count:187306 |
| 0-187306 |
969 | return 0; never executed: return 0; | 0 |
970 | | - |
971 | const QDomDocumentPrivate *const doc = node_impl->ownerDocument(); | - |
972 | if (!doc || timestamp != doc->nodeListTime) partially evaluated: !doc no Evaluation Count:0 | yes Evaluation Count:187306 |
evaluated: timestamp != doc->nodeListTime yes Evaluation Count:33 | yes Evaluation Count:187273 |
| 0-187306 |
973 | createList(); executed: createList(); Execution Count:33 | 33 |
974 | | - |
975 | if (index >= list.size()) evaluated: index >= list.size() yes Evaluation Count:1 | yes Evaluation Count:187305 |
| 1-187305 |
976 | return 0; executed: return 0; Execution Count:1 | 1 |
977 | | - |
978 | return list.at(index); executed: return list.at(index); Execution Count:187305 | 187305 |
979 | } | - |
980 | | - |
981 | int QDomNodeListPrivate::length() const | - |
982 | { | - |
983 | if (!node_impl) partially evaluated: !node_impl no Evaluation Count:0 | yes Evaluation Count:127233 |
| 0-127233 |
984 | return 0; never executed: return 0; | 0 |
985 | | - |
986 | const QDomDocumentPrivate *const doc = node_impl->ownerDocument(); | - |
987 | if (!doc || timestamp != doc->nodeListTime) { partially evaluated: !doc no Evaluation Count:0 | yes Evaluation Count:127233 |
evaluated: timestamp != doc->nodeListTime yes Evaluation Count:127211 | yes Evaluation Count:22 |
| 0-127233 |
988 | QDomNodeListPrivate *that = const_cast<QDomNodeListPrivate *>(this); | - |
989 | that->createList(); | - |
990 | } executed: } Execution Count:127211 | 127211 |
991 | | - |
992 | return list.count(); executed: return list.count(); Execution Count:127233 | 127233 |
993 | } | - |
994 | QDomNodeList::QDomNodeList() | - |
995 | { | - |
996 | impl = 0; | - |
997 | } | 0 |
998 | | - |
999 | QDomNodeList::QDomNodeList(QDomNodeListPrivate* p) | - |
1000 | { | - |
1001 | impl = p; | - |
1002 | } executed: } Execution Count:127243 | 127243 |
1003 | | - |
1004 | | - |
1005 | | - |
1006 | | - |
1007 | QDomNodeList::QDomNodeList(const QDomNodeList& n) | - |
1008 | { | - |
1009 | impl = n.impl; | - |
1010 | if (impl) | 0 |
1011 | impl->ref.ref(); never executed: impl->ref.ref(); | 0 |
1012 | } | 0 |
1013 | | - |
1014 | | - |
1015 | | - |
1016 | | - |
1017 | QDomNodeList& QDomNodeList::operator=(const QDomNodeList &n) | - |
1018 | { | - |
1019 | if (n.impl) | 0 |
1020 | n.impl->ref.ref(); never executed: n.impl->ref.ref(); | 0 |
1021 | if (impl && !impl->ref.deref()) never evaluated: !impl->ref.deref() | 0 |
1022 | delete impl; never executed: delete impl; | 0 |
1023 | impl = n.impl; | - |
1024 | return *this; never executed: return *this; | 0 |
1025 | } | - |
1026 | | - |
1027 | | - |
1028 | | - |
1029 | | - |
1030 | | - |
1031 | bool QDomNodeList::operator==(const QDomNodeList &n) const | - |
1032 | { | - |
1033 | if (impl == n.impl) never evaluated: impl == n.impl | 0 |
1034 | return true; never executed: return true; | 0 |
1035 | if (!impl || !n.impl) | 0 |
1036 | return false; never executed: return false; | 0 |
1037 | return (*impl == *n.impl); never executed: return (*impl == *n.impl); | 0 |
1038 | } | - |
1039 | | - |
1040 | | - |
1041 | | - |
1042 | | - |
1043 | | - |
1044 | bool QDomNodeList::operator!=(const QDomNodeList &n) const | - |
1045 | { | - |
1046 | return !operator==(n); never executed: return !operator==(n); | 0 |
1047 | } | - |
1048 | | - |
1049 | | - |
1050 | | - |
1051 | | - |
1052 | QDomNodeList::~QDomNodeList() | - |
1053 | { | - |
1054 | if (impl && !impl->ref.deref()) partially evaluated: impl yes Evaluation Count:127243 | no Evaluation Count:0 |
partially evaluated: !impl->ref.deref() yes Evaluation Count:127243 | no Evaluation Count:0 |
| 0-127243 |
1055 | delete impl; executed: delete impl; Execution Count:127243 | 127243 |
1056 | } executed: } Execution Count:127243 | 127243 |
1057 | QDomNode QDomNodeList::item(int index) const | - |
1058 | { | - |
1059 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:187306 |
| 0-187306 |
1060 | return QDomNode(); never executed: return QDomNode(); | 0 |
1061 | | - |
1062 | return QDomNode(impl->item(index)); executed: return QDomNode(impl->item(index)); Execution Count:187306 | 187306 |
1063 | } | - |
1064 | | - |
1065 | | - |
1066 | | - |
1067 | | - |
1068 | int QDomNodeList::length() const | - |
1069 | { | - |
1070 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:127233 |
| 0-127233 |
1071 | return 0; never executed: return 0; | 0 |
1072 | return impl->length(); executed: return impl->length(); Execution Count:127233 | 127233 |
1073 | } | - |
1074 | inline void QDomNodePrivate::setOwnerDocument(QDomDocumentPrivate *doc) | - |
1075 | { | - |
1076 | ownerNode = doc; | - |
1077 | hasParent = false; | - |
1078 | } executed: } Execution Count:77503 | 77503 |
1079 | | - |
1080 | QDomNodePrivate::QDomNodePrivate(QDomDocumentPrivate *doc, QDomNodePrivate *par) : ref(1) | - |
1081 | { | - |
1082 | if (par) evaluated: par yes Evaluation Count:34353 | yes Evaluation Count:77324 |
| 34353-77324 |
1083 | setParent(par); executed: setParent(par); Execution Count:34353 | 34353 |
1084 | else | - |
1085 | setOwnerDocument(doc); executed: setOwnerDocument(doc); Execution Count:77324 | 77324 |
1086 | prev = 0; | - |
1087 | next = 0; | - |
1088 | first = 0; | - |
1089 | last = 0; | - |
1090 | createdWithDom1Interface = true; | - |
1091 | lineNumber = -1; | - |
1092 | columnNumber = -1; | - |
1093 | } executed: } Execution Count:111677 | 111677 |
1094 | | - |
1095 | QDomNodePrivate::QDomNodePrivate(QDomNodePrivate *n, bool deep) : ref(1) | - |
1096 | { | - |
1097 | setOwnerDocument(n->ownerDocument()); | - |
1098 | prev = 0; | - |
1099 | next = 0; | - |
1100 | first = 0; | - |
1101 | last = 0; | - |
1102 | | - |
1103 | name = n->name; | - |
1104 | value = n->value; | - |
1105 | prefix = n->prefix; | - |
1106 | namespaceURI = n->namespaceURI; | - |
1107 | createdWithDom1Interface = n->createdWithDom1Interface; | - |
1108 | lineNumber = -1; | - |
1109 | columnNumber = -1; | - |
1110 | | - |
1111 | if (!deep) evaluated: !deep yes Evaluation Count:37 | yes Evaluation Count:81 |
| 37-81 |
1112 | return; executed: return; Execution Count:37 | 37 |
1113 | | - |
1114 | for (QDomNodePrivate* x = n->first; x; x = x->next) evaluated: x yes Evaluation Count:35 | yes Evaluation Count:81 |
| 35-81 |
1115 | appendChild(x->cloneNode(true)); executed: appendChild(x->cloneNode(true)); Execution Count:35 | 35 |
1116 | } executed: } Execution Count:81 | 81 |
1117 | | - |
1118 | QDomNodePrivate::~QDomNodePrivate() | - |
1119 | { | - |
1120 | QDomNodePrivate* p = first; | - |
1121 | QDomNodePrivate* n; | - |
1122 | | - |
1123 | while (p) { evaluated: p yes Evaluation Count:93348 | yes Evaluation Count:111795 |
| 93348-111795 |
1124 | n = p->next; | - |
1125 | if (!p->ref.deref()) partially evaluated: !p->ref.deref() yes Evaluation Count:93348 | no Evaluation Count:0 |
| 0-93348 |
1126 | delete p; executed: delete p; Execution Count:93348 | 93348 |
1127 | else | - |
1128 | p->setNoParent(); never executed: p->setNoParent(); | 0 |
1129 | p = n; | - |
1130 | } executed: } Execution Count:93348 | 93348 |
1131 | first = 0; | - |
1132 | last = 0; | - |
1133 | } executed: } Execution Count:111795 | 111795 |
1134 | | - |
1135 | void QDomNodePrivate::clear() | - |
1136 | { | - |
1137 | QDomNodePrivate* p = first; | - |
1138 | QDomNodePrivate* n; | - |
1139 | | - |
1140 | while (p) { partially evaluated: p no Evaluation Count:0 | yes Evaluation Count:385 |
| 0-385 |
1141 | n = p->next; | - |
1142 | if (!p->ref.deref()) never evaluated: !p->ref.deref() | 0 |
1143 | delete p; never executed: delete p; | 0 |
1144 | p = n; | - |
1145 | } | 0 |
1146 | first = 0; | - |
1147 | last = 0; | - |
1148 | } executed: } Execution Count:385 | 385 |
1149 | | - |
1150 | QDomNodePrivate* QDomNodePrivate::namedItem(const QString &n) | - |
1151 | { | - |
1152 | QDomNodePrivate* p = first; | - |
1153 | while (p) { partially evaluated: p yes Evaluation Count:15 | no Evaluation Count:0 |
| 0-15 |
1154 | if (p->nodeName() == n) evaluated: p->nodeName() == n yes Evaluation Count:10 | yes Evaluation Count:5 |
| 5-10 |
1155 | return p; executed: return p; Execution Count:10 | 10 |
1156 | p = p->next; | - |
1157 | } executed: } Execution Count:5 | 5 |
1158 | return 0; never executed: return 0; | 0 |
1159 | } | - |
1160 | | - |
1161 | | - |
1162 | QDomNodePrivate* QDomNodePrivate::insertBefore(QDomNodePrivate* newChild, QDomNodePrivate* refChild) | - |
1163 | { | - |
1164 | | - |
1165 | if (!newChild) never evaluated: !newChild | 0 |
1166 | return 0; never executed: return 0; | 0 |
1167 | | - |
1168 | | - |
1169 | if (newChild == refChild) never evaluated: newChild == refChild | 0 |
1170 | return 0; never executed: return 0; | 0 |
1171 | | - |
1172 | | - |
1173 | if (refChild && refChild->parent() != this) never evaluated: refChild never evaluated: refChild->parent() != this | 0 |
1174 | return 0; never executed: return 0; | 0 |
1175 | | - |
1176 | | - |
1177 | QDomDocumentPrivate *const doc = ownerDocument(); | - |
1178 | if(doc) | 0 |
1179 | doc->nodeListTime++; never executed: doc->nodeListTime++; | 0 |
1180 | | - |
1181 | | - |
1182 | | - |
1183 | if (newChild->isDocumentFragment()) { never evaluated: newChild->isDocumentFragment() | 0 |
1184 | | - |
1185 | if (newChild->first == 0) never evaluated: newChild->first == 0 | 0 |
1186 | return newChild; never executed: return newChild; | 0 |
1187 | | - |
1188 | | - |
1189 | QDomNodePrivate* n = newChild->first; | - |
1190 | while (n) { | 0 |
1191 | n->setParent(this); | - |
1192 | n = n->next; | - |
1193 | } | 0 |
1194 | | - |
1195 | | - |
1196 | if (!refChild || refChild->prev == 0) { never evaluated: !refChild never evaluated: refChild->prev == 0 | 0 |
1197 | if (first) | 0 |
1198 | first->prev = newChild->last; never executed: first->prev = newChild->last; | 0 |
1199 | newChild->last->next = first; | - |
1200 | if (!last) | 0 |
1201 | last = newChild->last; never executed: last = newChild->last; | 0 |
1202 | first = newChild->first; | - |
1203 | } else { | 0 |
1204 | | - |
1205 | newChild->last->next = refChild; | - |
1206 | newChild->first->prev = refChild->prev; | - |
1207 | refChild->prev->next = newChild->first; | - |
1208 | refChild->prev = newChild->last; | - |
1209 | } | 0 |
1210 | | - |
1211 | | - |
1212 | | - |
1213 | | - |
1214 | | - |
1215 | newChild->first = 0; | - |
1216 | newChild->last = 0; | - |
1217 | return newChild; never executed: return newChild; | 0 |
1218 | } | - |
1219 | | - |
1220 | | - |
1221 | | - |
1222 | newChild->ref.ref(); | - |
1223 | | - |
1224 | if (newChild->parent()) never evaluated: newChild->parent() | 0 |
1225 | newChild->parent()->removeChild(newChild); never executed: newChild->parent()->removeChild(newChild); | 0 |
1226 | | - |
1227 | newChild->setParent(this); | - |
1228 | | - |
1229 | if (!refChild) { never evaluated: !refChild | 0 |
1230 | if (first) | 0 |
1231 | first->prev = newChild; never executed: first->prev = newChild; | 0 |
1232 | newChild->next = first; | - |
1233 | if (!last) | 0 |
1234 | last = newChild; never executed: last = newChild; | 0 |
1235 | first = newChild; | - |
1236 | return newChild; never executed: return newChild; | 0 |
1237 | } | - |
1238 | | - |
1239 | if (refChild->prev == 0) { never evaluated: refChild->prev == 0 | 0 |
1240 | if (first) | 0 |
1241 | first->prev = newChild; never executed: first->prev = newChild; | 0 |
1242 | newChild->next = first; | - |
1243 | if (!last) | 0 |
1244 | last = newChild; never executed: last = newChild; | 0 |
1245 | first = newChild; | - |
1246 | return newChild; never executed: return newChild; | 0 |
1247 | } | - |
1248 | | - |
1249 | newChild->next = refChild; | - |
1250 | newChild->prev = refChild->prev; | - |
1251 | refChild->prev->next = newChild; | - |
1252 | refChild->prev = newChild; | - |
1253 | | - |
1254 | return newChild; never executed: return newChild; | 0 |
1255 | } | - |
1256 | | - |
1257 | QDomNodePrivate* QDomNodePrivate::insertAfter(QDomNodePrivate* newChild, QDomNodePrivate* refChild) | - |
1258 | { | - |
1259 | | - |
1260 | if (!newChild) partially evaluated: !newChild no Evaluation Count:0 | yes Evaluation Count:93353 |
| 0-93353 |
1261 | return 0; never executed: return 0; | 0 |
1262 | | - |
1263 | | - |
1264 | if (newChild == refChild) partially evaluated: newChild == refChild no Evaluation Count:0 | yes Evaluation Count:93353 |
| 0-93353 |
1265 | return 0; never executed: return 0; | 0 |
1266 | | - |
1267 | | - |
1268 | if (refChild && refChild->parent() != this) partially evaluated: refChild no Evaluation Count:0 | yes Evaluation Count:93353 |
never evaluated: refChild->parent() != this | 0-93353 |
1269 | return 0; never executed: return 0; | 0 |
1270 | | - |
1271 | | - |
1272 | QDomDocumentPrivate *const doc = ownerDocument(); | - |
1273 | if(doc) partially evaluated: doc yes Evaluation Count:93353 | no Evaluation Count:0 |
| 0-93353 |
1274 | doc->nodeListTime++; executed: doc->nodeListTime++; Execution Count:93353 | 93353 |
1275 | | - |
1276 | | - |
1277 | | - |
1278 | if (newChild->isDocumentFragment()) { partially evaluated: newChild->isDocumentFragment() no Evaluation Count:0 | yes Evaluation Count:93353 |
| 0-93353 |
1279 | | - |
1280 | if (newChild->first == 0) never evaluated: newChild->first == 0 | 0 |
1281 | return newChild; never executed: return newChild; | 0 |
1282 | | - |
1283 | | - |
1284 | QDomNodePrivate* n = newChild->first; | - |
1285 | while (n) { | 0 |
1286 | n->setParent(this); | - |
1287 | n = n->next; | - |
1288 | } | 0 |
1289 | | - |
1290 | | - |
1291 | if (!refChild || refChild->next == 0) { never evaluated: !refChild never evaluated: refChild->next == 0 | 0 |
1292 | if (last) | 0 |
1293 | last->next = newChild->first; never executed: last->next = newChild->first; | 0 |
1294 | newChild->first->prev = last; | - |
1295 | if (!first) | 0 |
1296 | first = newChild->first; never executed: first = newChild->first; | 0 |
1297 | last = newChild->last; | - |
1298 | } else { | 0 |
1299 | newChild->first->prev = refChild; | - |
1300 | newChild->last->next = refChild->next; | - |
1301 | refChild->next->prev = newChild->last; | - |
1302 | refChild->next = newChild->first; | - |
1303 | } | 0 |
1304 | | - |
1305 | | - |
1306 | | - |
1307 | | - |
1308 | | - |
1309 | newChild->first = 0; | - |
1310 | newChild->last = 0; | - |
1311 | return newChild; never executed: return newChild; | 0 |
1312 | } | - |
1313 | | - |
1314 | | - |
1315 | if (newChild->parent()) evaluated: newChild->parent() yes Evaluation Count:16756 | yes Evaluation Count:76597 |
| 16756-76597 |
1316 | newChild->parent()->removeChild(newChild); executed: newChild->parent()->removeChild(newChild); Execution Count:16756 | 16756 |
1317 | | - |
1318 | | - |
1319 | | - |
1320 | newChild->ref.ref(); | - |
1321 | | - |
1322 | newChild->setParent(this); | - |
1323 | | - |
1324 | | - |
1325 | if (!refChild) { partially evaluated: !refChild yes Evaluation Count:93353 | no Evaluation Count:0 |
| 0-93353 |
1326 | if (last) evaluated: last yes Evaluation Count:39928 | yes Evaluation Count:53425 |
| 39928-53425 |
1327 | last->next = newChild; executed: last->next = newChild; Execution Count:39928 | 39928 |
1328 | newChild->prev = last; | - |
1329 | if (!first) evaluated: !first yes Evaluation Count:53425 | yes Evaluation Count:39928 |
| 39928-53425 |
1330 | first = newChild; executed: first = newChild; Execution Count:53425 | 53425 |
1331 | last = newChild; | - |
1332 | return newChild; executed: return newChild; Execution Count:93353 | 93353 |
1333 | } | - |
1334 | | - |
1335 | if (refChild->next == 0) { never evaluated: refChild->next == 0 | 0 |
1336 | if (last) | 0 |
1337 | last->next = newChild; never executed: last->next = newChild; | 0 |
1338 | newChild->prev = last; | - |
1339 | if (!first) | 0 |
1340 | first = newChild; never executed: first = newChild; | 0 |
1341 | last = newChild; | - |
1342 | return newChild; never executed: return newChild; | 0 |
1343 | } | - |
1344 | | - |
1345 | newChild->prev = refChild; | - |
1346 | newChild->next = refChild->next; | - |
1347 | refChild->next->prev = newChild; | - |
1348 | refChild->next = newChild; | - |
1349 | | - |
1350 | return newChild; never executed: return newChild; | 0 |
1351 | } | - |
1352 | | - |
1353 | QDomNodePrivate* QDomNodePrivate::replaceChild(QDomNodePrivate* newChild, QDomNodePrivate* oldChild) | - |
1354 | { | - |
1355 | if (!newChild || !oldChild) partially evaluated: !newChild no Evaluation Count:0 | yes Evaluation Count:12 |
partially evaluated: !oldChild no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1356 | return 0; never executed: return 0; | 0 |
1357 | if (oldChild->parent() != this) partially evaluated: oldChild->parent() != this no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1358 | return 0; never executed: return 0; | 0 |
1359 | if (newChild == oldChild) partially evaluated: newChild == oldChild no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1360 | return 0; never executed: return 0; | 0 |
1361 | | - |
1362 | | - |
1363 | QDomDocumentPrivate *const doc = ownerDocument(); | - |
1364 | if(doc) partially evaluated: doc yes Evaluation Count:12 | no Evaluation Count:0 |
| 0-12 |
1365 | doc->nodeListTime++; executed: doc->nodeListTime++; Execution Count:12 | 12 |
1366 | | - |
1367 | | - |
1368 | | - |
1369 | if (newChild->isDocumentFragment()) { partially evaluated: newChild->isDocumentFragment() no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1370 | | - |
1371 | if (newChild->first == 0) never evaluated: newChild->first == 0 | 0 |
1372 | return newChild; never executed: return newChild; | 0 |
1373 | | - |
1374 | | - |
1375 | QDomNodePrivate* n = newChild->first; | - |
1376 | while (n) { | 0 |
1377 | n->setParent(this); | - |
1378 | n = n->next; | - |
1379 | } | 0 |
1380 | | - |
1381 | | - |
1382 | if (oldChild->next) never evaluated: oldChild->next | 0 |
1383 | oldChild->next->prev = newChild->last; never executed: oldChild->next->prev = newChild->last; | 0 |
1384 | if (oldChild->prev) never evaluated: oldChild->prev | 0 |
1385 | oldChild->prev->next = newChild->first; never executed: oldChild->prev->next = newChild->first; | 0 |
1386 | | - |
1387 | newChild->last->next = oldChild->next; | - |
1388 | newChild->first->prev = oldChild->prev; | - |
1389 | | - |
1390 | if (first == oldChild) never evaluated: first == oldChild | 0 |
1391 | first = newChild->first; never executed: first = newChild->first; | 0 |
1392 | if (last == oldChild) never evaluated: last == oldChild | 0 |
1393 | last = newChild->last; never executed: last = newChild->last; | 0 |
1394 | | - |
1395 | oldChild->setNoParent(); | - |
1396 | oldChild->next = 0; | - |
1397 | oldChild->prev = 0; | - |
1398 | | - |
1399 | | - |
1400 | | - |
1401 | | - |
1402 | | - |
1403 | newChild->first = 0; | - |
1404 | newChild->last = 0; | - |
1405 | | - |
1406 | | - |
1407 | if (oldChild) never evaluated: oldChild | 0 |
1408 | oldChild->ref.deref(); never executed: oldChild->ref.deref(); | 0 |
1409 | | - |
1410 | return oldChild; never executed: return oldChild; | 0 |
1411 | } | - |
1412 | | - |
1413 | | - |
1414 | | - |
1415 | newChild->ref.ref(); | - |
1416 | | - |
1417 | | - |
1418 | if (newChild->parent()) partially evaluated: newChild->parent() no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1419 | newChild->parent()->removeChild(newChild); never executed: newChild->parent()->removeChild(newChild); | 0 |
1420 | | - |
1421 | newChild->setParent(this); | - |
1422 | | - |
1423 | if (oldChild->next) evaluated: oldChild->next yes Evaluation Count:8 | yes Evaluation Count:4 |
| 4-8 |
1424 | oldChild->next->prev = newChild; executed: oldChild->next->prev = newChild; Execution Count:8 | 8 |
1425 | if (oldChild->prev) evaluated: oldChild->prev yes Evaluation Count:4 | yes Evaluation Count:8 |
| 4-8 |
1426 | oldChild->prev->next = newChild; executed: oldChild->prev->next = newChild; Execution Count:4 | 4 |
1427 | | - |
1428 | newChild->next = oldChild->next; | - |
1429 | newChild->prev = oldChild->prev; | - |
1430 | | - |
1431 | if (first == oldChild) evaluated: first == oldChild yes Evaluation Count:8 | yes Evaluation Count:4 |
| 4-8 |
1432 | first = newChild; executed: first = newChild; Execution Count:8 | 8 |
1433 | if (last == oldChild) evaluated: last == oldChild yes Evaluation Count:4 | yes Evaluation Count:8 |
| 4-8 |
1434 | last = newChild; executed: last = newChild; Execution Count:4 | 4 |
1435 | | - |
1436 | oldChild->setNoParent(); | - |
1437 | oldChild->next = 0; | - |
1438 | oldChild->prev = 0; | - |
1439 | | - |
1440 | | - |
1441 | if (oldChild) partially evaluated: oldChild yes Evaluation Count:12 | no Evaluation Count:0 |
| 0-12 |
1442 | oldChild->ref.deref(); executed: oldChild->ref.deref(); Execution Count:12 | 12 |
1443 | | - |
1444 | return oldChild; executed: return oldChild; Execution Count:12 | 12 |
1445 | } | - |
1446 | | - |
1447 | QDomNodePrivate* QDomNodePrivate::removeChild(QDomNodePrivate* oldChild) | - |
1448 | { | - |
1449 | | - |
1450 | if (oldChild->parent() != this) partially evaluated: oldChild->parent() != this no Evaluation Count:0 | yes Evaluation Count:16760 |
| 0-16760 |
1451 | return 0; never executed: return 0; | 0 |
1452 | | - |
1453 | | - |
1454 | QDomDocumentPrivate *const doc = ownerDocument(); | - |
1455 | if(doc) partially evaluated: doc yes Evaluation Count:16760 | no Evaluation Count:0 |
| 0-16760 |
1456 | doc->nodeListTime++; executed: doc->nodeListTime++; Execution Count:16760 | 16760 |
1457 | | - |
1458 | | - |
1459 | | - |
1460 | if (oldChild->next == 0 && oldChild->prev == 0 && first != oldChild) evaluated: oldChild->next == 0 yes Evaluation Count:16759 | yes Evaluation Count:1 |
partially evaluated: oldChild->prev == 0 yes Evaluation Count:16759 | no Evaluation Count:0 |
evaluated: first != oldChild yes Evaluation Count:16755 | yes Evaluation Count:4 |
| 0-16759 |
1461 | return 0; executed: return 0; Execution Count:16755 | 16755 |
1462 | | - |
1463 | if (oldChild->next) evaluated: oldChild->next yes Evaluation Count:1 | yes Evaluation Count:4 |
| 1-4 |
1464 | oldChild->next->prev = oldChild->prev; executed: oldChild->next->prev = oldChild->prev; Execution Count:1 | 1 |
1465 | if (oldChild->prev) partially evaluated: oldChild->prev no Evaluation Count:0 | yes Evaluation Count:5 |
| 0-5 |
1466 | oldChild->prev->next = oldChild->next; never executed: oldChild->prev->next = oldChild->next; | 0 |
1467 | | - |
1468 | if (last == oldChild) evaluated: last == oldChild yes Evaluation Count:4 | yes Evaluation Count:1 |
| 1-4 |
1469 | last = oldChild->prev; executed: last = oldChild->prev; Execution Count:4 | 4 |
1470 | if (first == oldChild) partially evaluated: first == oldChild yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-5 |
1471 | first = oldChild->next; executed: first = oldChild->next; Execution Count:5 | 5 |
1472 | | - |
1473 | oldChild->setNoParent(); | - |
1474 | oldChild->next = 0; | - |
1475 | oldChild->prev = 0; | - |
1476 | | - |
1477 | | - |
1478 | oldChild->ref.deref(); | - |
1479 | | - |
1480 | return oldChild; executed: return oldChild; Execution Count:5 | 5 |
1481 | } | - |
1482 | | - |
1483 | QDomNodePrivate* QDomNodePrivate::appendChild(QDomNodePrivate* newChild) | - |
1484 | { | - |
1485 | | - |
1486 | return insertAfter(newChild, 0); executed: return insertAfter(newChild, 0); Execution Count:93345 | 93345 |
1487 | } | - |
1488 | | - |
1489 | QDomDocumentPrivate* QDomNodePrivate::ownerDocument() | - |
1490 | { | - |
1491 | QDomNodePrivate* p = this; | - |
1492 | while (p && !p->isDocument()) { partially evaluated: p yes Evaluation Count:4500374 | no Evaluation Count:0 |
evaluated: !p->isDocument() yes Evaluation Count:3931623 | yes Evaluation Count:568751 |
| 0-4500374 |
1493 | if (!p->hasParent) evaluated: !p->hasParent yes Evaluation Count:522 | yes Evaluation Count:3931101 |
| 522-3931101 |
1494 | return (QDomDocumentPrivate*)p->ownerNode; executed: return (QDomDocumentPrivate*)p->ownerNode; Execution Count:522 | 522 |
1495 | p = p->parent(); | - |
1496 | } executed: } Execution Count:3931101 | 3931101 |
1497 | | - |
1498 | return static_cast<QDomDocumentPrivate *>(p); executed: return static_cast<QDomDocumentPrivate *>(p); Execution Count:568751 | 568751 |
1499 | } | - |
1500 | | - |
1501 | QDomNodePrivate* QDomNodePrivate::cloneNode(bool deep) | - |
1502 | { | - |
1503 | QDomNodePrivate* p = new QDomNodePrivate(this, deep); | - |
1504 | | - |
1505 | p->ref.deref(); | - |
1506 | return p; never executed: return p; | 0 |
1507 | } | - |
1508 | | - |
1509 | static void qNormalizeNode(QDomNodePrivate* n) | - |
1510 | { | - |
1511 | QDomNodePrivate* p = n->first; | - |
1512 | QDomTextPrivate* t = 0; | - |
1513 | | - |
1514 | while (p) { | 0 |
1515 | if (p->isText()) { never evaluated: p->isText() | 0 |
1516 | if (t) { | 0 |
1517 | QDomNodePrivate* tmp = p->next; | - |
1518 | t->appendData(p->nodeValue()); | - |
1519 | n->removeChild(p); | - |
1520 | p = tmp; | - |
1521 | } else { | 0 |
1522 | t = (QDomTextPrivate*)p; | - |
1523 | p = p->next; | - |
1524 | } | 0 |
1525 | } else { | - |
1526 | p = p->next; | - |
1527 | t = 0; | - |
1528 | } | 0 |
1529 | } | - |
1530 | } | 0 |
1531 | void QDomNodePrivate::normalize() | - |
1532 | { | - |
1533 | | - |
1534 | | - |
1535 | qNormalizeNode(this); | - |
1536 | } | 0 |
1537 | | - |
1538 | | - |
1539 | | - |
1540 | | - |
1541 | void QDomNodePrivate::save(QTextStream& s, int depth, int indent) const | - |
1542 | { | - |
1543 | const QDomNodePrivate* n = first; | - |
1544 | while (n) { evaluated: n yes Evaluation Count:63280 | yes Evaluation Count:30174 |
| 30174-63280 |
1545 | n->save(s, depth, indent); | - |
1546 | n = n->next; | - |
1547 | } executed: } Execution Count:63280 | 63280 |
1548 | } executed: } Execution Count:30174 | 30174 |
1549 | | - |
1550 | void QDomNodePrivate::setLocation(int lineNumber, int columnNumber) | - |
1551 | { | - |
1552 | this->lineNumber = lineNumber; | - |
1553 | this->columnNumber = columnNumber; | - |
1554 | } executed: } Execution Count:76460 | 76460 |
1555 | QDomNode::QDomNode() | - |
1556 | { | - |
1557 | impl = 0; | - |
1558 | } executed: } Execution Count:573 | 573 |
1559 | QDomNode::QDomNode(const QDomNode &n) | - |
1560 | { | - |
1561 | impl = n.impl; | - |
1562 | if (impl) partially evaluated: impl yes Evaluation Count:60 | no Evaluation Count:0 |
| 0-60 |
1563 | impl->ref.ref(); executed: impl->ref.ref(); Execution Count:60 | 60 |
1564 | } executed: } Execution Count:60 | 60 |
1565 | | - |
1566 | | - |
1567 | | - |
1568 | | - |
1569 | QDomNode::QDomNode(QDomNodePrivate *n) | - |
1570 | { | - |
1571 | impl = n; | - |
1572 | if (impl) evaluated: impl yes Evaluation Count:188475 | yes Evaluation Count:161 |
| 161-188475 |
1573 | impl->ref.ref(); executed: impl->ref.ref(); Execution Count:188475 | 188475 |
1574 | } executed: } Execution Count:188636 | 188636 |
1575 | QDomNode& QDomNode::operator=(const QDomNode &n) | - |
1576 | { | - |
1577 | if (n.impl) evaluated: n.impl yes Evaluation Count:109 | yes Evaluation Count:3 |
| 3-109 |
1578 | n.impl->ref.ref(); executed: n.impl->ref.ref(); Execution Count:109 | 109 |
1579 | if (impl && !impl->ref.deref()) evaluated: impl yes Evaluation Count:52 | yes Evaluation Count:60 |
partially evaluated: !impl->ref.deref() no Evaluation Count:0 | yes Evaluation Count:52 |
| 0-60 |
1580 | delete impl; never executed: delete impl; | 0 |
1581 | impl = n.impl; | - |
1582 | return *this; executed: return *this; Execution Count:112 | 112 |
1583 | } | - |
1584 | bool QDomNode::operator== (const QDomNode& n) const | - |
1585 | { | - |
1586 | return (impl == n.impl); executed: return (impl == n.impl); Execution Count:319 | 319 |
1587 | } | - |
1588 | | - |
1589 | | - |
1590 | | - |
1591 | | - |
1592 | | - |
1593 | bool QDomNode::operator!= (const QDomNode& n) const | - |
1594 | { | - |
1595 | return (impl != n.impl); executed: return (impl != n.impl); Execution Count:120 | 120 |
1596 | } | - |
1597 | | - |
1598 | | - |
1599 | | - |
1600 | | - |
1601 | QDomNode::~QDomNode() | - |
1602 | { | - |
1603 | if (impl && !impl->ref.deref()) evaluated: impl yes Evaluation Count:189063 | yes Evaluation Count:206 |
evaluated: !impl->ref.deref() yes Evaluation Count:843 | yes Evaluation Count:188220 |
| 206-189063 |
1604 | delete impl; executed: delete impl; Execution Count:843 | 843 |
1605 | } executed: } Execution Count:189269 | 189269 |
1606 | QString QDomNode::nodeName() const | - |
1607 | { | - |
1608 | if (!impl) evaluated: !impl yes Evaluation Count:2 | yes Evaluation Count:127426 |
| 2-127426 |
1609 | return QString(); executed: return QString(); Execution Count:2 | 2 |
1610 | | - |
1611 | if (!((QDomNodePrivate*)impl)->prefix.isEmpty()) evaluated: !((QDomNodePrivate*)impl)->prefix.isEmpty() yes Evaluation Count:27 | yes Evaluation Count:127399 |
| 27-127399 |
1612 | return ((QDomNodePrivate*)impl)->prefix + QLatin1Char(':') + ((QDomNodePrivate*)impl)->name; executed: return ((QDomNodePrivate*)impl)->prefix + QLatin1Char(':') + ((QDomNodePrivate*)impl)->name; Execution Count:27 | 27 |
1613 | return ((QDomNodePrivate*)impl)->name; executed: return ((QDomNodePrivate*)impl)->name; Execution Count:127399 | 127399 |
1614 | } | - |
1615 | QString QDomNode::nodeValue() const | - |
1616 | { | - |
1617 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:127205 |
| 0-127205 |
1618 | return QString(); never executed: return QString(); | 0 |
1619 | return ((QDomNodePrivate*)impl)->value; executed: return ((QDomNodePrivate*)impl)->value; Execution Count:127205 | 127205 |
1620 | } | - |
1621 | | - |
1622 | | - |
1623 | | - |
1624 | | - |
1625 | | - |
1626 | | - |
1627 | void QDomNode::setNodeValue(const QString& v) | - |
1628 | { | - |
1629 | if (!impl) | 0 |
1630 | return; | 0 |
1631 | ((QDomNodePrivate*)impl)->setNodeValue(v); | - |
1632 | } | 0 |
1633 | QDomNode::NodeType QDomNode::nodeType() const | - |
1634 | { | - |
1635 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:127194 |
| 0-127194 |
1636 | return QDomNode::BaseNode; never executed: return QDomNode::BaseNode; | 0 |
1637 | return ((QDomNodePrivate*)impl)->nodeType(); executed: return ((QDomNodePrivate*)impl)->nodeType(); Execution Count:127194 | 127194 |
1638 | } | - |
1639 | | - |
1640 | | - |
1641 | | - |
1642 | | - |
1643 | | - |
1644 | QDomNode QDomNode::parentNode() const | - |
1645 | { | - |
1646 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:73 |
| 0-73 |
1647 | return QDomNode(); never executed: return QDomNode(); | 0 |
1648 | return QDomNode(((QDomNodePrivate*)impl)->parent()); executed: return QDomNode(((QDomNodePrivate*)impl)->parent()); Execution Count:73 | 73 |
1649 | } | - |
1650 | QDomNodeList QDomNode::childNodes() const | - |
1651 | { | - |
1652 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:127242 |
| 0-127242 |
1653 | return QDomNodeList(); never executed: return QDomNodeList(); | 0 |
1654 | return QDomNodeList(new QDomNodeListPrivate(impl)); executed: return QDomNodeList(new QDomNodeListPrivate(impl)); Execution Count:127242 | 127242 |
1655 | } | - |
1656 | QDomNode QDomNode::firstChild() const | - |
1657 | { | - |
1658 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:9 |
| 0-9 |
1659 | return QDomNode(); never executed: return QDomNode(); | 0 |
1660 | return QDomNode(((QDomNodePrivate*)impl)->first); executed: return QDomNode(((QDomNodePrivate*)impl)->first); Execution Count:9 | 9 |
1661 | } | - |
1662 | QDomNode QDomNode::lastChild() const | - |
1663 | { | - |
1664 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1665 | return QDomNode(); never executed: return QDomNode(); | 0 |
1666 | return QDomNode(((QDomNodePrivate*)impl)->last); executed: return QDomNode(((QDomNodePrivate*)impl)->last); Execution Count:1 | 1 |
1667 | } | - |
1668 | QDomNode QDomNode::previousSibling() const | - |
1669 | { | - |
1670 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
1671 | return QDomNode(); never executed: return QDomNode(); | 0 |
1672 | return QDomNode(((QDomNodePrivate*)impl)->prev); executed: return QDomNode(((QDomNodePrivate*)impl)->prev); Execution Count:6 | 6 |
1673 | } | - |
1674 | QDomNode QDomNode::nextSibling() const | - |
1675 | { | - |
1676 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:17 |
| 0-17 |
1677 | return QDomNode(); never executed: return QDomNode(); | 0 |
1678 | return QDomNode(((QDomNodePrivate*)impl)->next); executed: return QDomNode(((QDomNodePrivate*)impl)->next); Execution Count:17 | 17 |
1679 | } | - |
1680 | QDomNamedNodeMap QDomNode::attributes() const | - |
1681 | { | - |
1682 | if (!impl || !impl->isElement()) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:26 |
evaluated: !impl->isElement() yes Evaluation Count:16 | yes Evaluation Count:10 |
| 0-26 |
1683 | return QDomNamedNodeMap(); executed: return QDomNamedNodeMap(); Execution Count:16 | 16 |
1684 | | - |
1685 | return QDomNamedNodeMap(static_cast<QDomElementPrivate *>(impl)->attributes()); executed: return QDomNamedNodeMap(static_cast<QDomElementPrivate *>(impl)->attributes()); Execution Count:10 | 10 |
1686 | } | - |
1687 | | - |
1688 | | - |
1689 | | - |
1690 | | - |
1691 | QDomDocument QDomNode::ownerDocument() const | - |
1692 | { | - |
1693 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:478 |
| 0-478 |
1694 | return QDomDocument(); never executed: return QDomDocument(); | 0 |
1695 | return QDomDocument(((QDomNodePrivate*)impl)->ownerDocument()); executed: return QDomDocument(((QDomNodePrivate*)impl)->ownerDocument()); Execution Count:478 | 478 |
1696 | } | - |
1697 | QDomNode QDomNode::cloneNode(bool deep) const | - |
1698 | { | - |
1699 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:20 |
| 0-20 |
1700 | return QDomNode(); never executed: return QDomNode(); | 0 |
1701 | return QDomNode(((QDomNodePrivate*)impl)->cloneNode(deep)); executed: return QDomNode(((QDomNodePrivate*)impl)->cloneNode(deep)); Execution Count:20 | 20 |
1702 | } | - |
1703 | | - |
1704 | | - |
1705 | | - |
1706 | | - |
1707 | | - |
1708 | | - |
1709 | | - |
1710 | void QDomNode::normalize() | - |
1711 | { | - |
1712 | if (!impl) | 0 |
1713 | return; | 0 |
1714 | ((QDomNodePrivate*)impl)->normalize(); | - |
1715 | } | 0 |
1716 | bool QDomNode::isSupported(const QString& feature, const QString& version) const | - |
1717 | { | - |
1718 | QDomImplementation i; | - |
1719 | return i.hasFeature(feature, version); never executed: return i.hasFeature(feature, version); | 0 |
1720 | } | - |
1721 | QString QDomNode::namespaceURI() const | - |
1722 | { | - |
1723 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:127182 |
| 0-127182 |
1724 | return QString(); never executed: return QString(); | 0 |
1725 | return ((QDomNodePrivate*)impl)->namespaceURI; executed: return ((QDomNodePrivate*)impl)->namespaceURI; Execution Count:127182 | 127182 |
1726 | } | - |
1727 | QString QDomNode::prefix() const | - |
1728 | { | - |
1729 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1730 | return QString(); never executed: return QString(); | 0 |
1731 | return ((QDomNodePrivate*)impl)->prefix; executed: return ((QDomNodePrivate*)impl)->prefix; Execution Count:12 | 12 |
1732 | } | - |
1733 | void QDomNode::setPrefix(const QString& pre) | - |
1734 | { | - |
1735 | if (!impl || ((QDomNodePrivate*)impl)->prefix.isNull()) never evaluated: ((QDomNodePrivate*)impl)->prefix.isNull() | 0 |
1736 | return; | 0 |
1737 | if (isAttr() || isElement()) never evaluated: isAttr() never evaluated: isElement() | 0 |
1738 | ((QDomNodePrivate*)impl)->prefix = pre; never executed: ((QDomNodePrivate*)impl)->prefix = pre; | 0 |
1739 | } | 0 |
1740 | QString QDomNode::localName() const | - |
1741 | { | - |
1742 | if (!impl || ((QDomNodePrivate*)impl)->createdWithDom1Interface) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:12 |
partially evaluated: ((QDomNodePrivate*)impl)->createdWithDom1Interface yes Evaluation Count:12 | no Evaluation Count:0 |
| 0-12 |
1743 | return QString(); executed: return QString(); Execution Count:12 | 12 |
1744 | return ((QDomNodePrivate*)impl)->name; never executed: return ((QDomNodePrivate*)impl)->name; | 0 |
1745 | } | - |
1746 | | - |
1747 | | - |
1748 | | - |
1749 | | - |
1750 | | - |
1751 | | - |
1752 | bool QDomNode::hasAttributes() const | - |
1753 | { | - |
1754 | if (!impl || !impl->isElement()) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:25 |
evaluated: !impl->isElement() yes Evaluation Count:16 | yes Evaluation Count:9 |
| 0-25 |
1755 | return false; executed: return false; Execution Count:16 | 16 |
1756 | return static_cast<QDomElementPrivate *>(impl)->hasAttributes(); executed: return static_cast<QDomElementPrivate *>(impl)->hasAttributes(); Execution Count:9 | 9 |
1757 | } | - |
1758 | QDomNode QDomNode::insertBefore(const QDomNode& newChild, const QDomNode& refChild) | - |
1759 | { | - |
1760 | if (!impl) | 0 |
1761 | return QDomNode(); never executed: return QDomNode(); | 0 |
1762 | return QDomNode(((QDomNodePrivate*)impl)->insertBefore(newChild.impl, refChild.impl)); never executed: return QDomNode(((QDomNodePrivate*)impl)->insertBefore(newChild.impl, refChild.impl)); | 0 |
1763 | } | - |
1764 | QDomNode QDomNode::insertAfter(const QDomNode& newChild, const QDomNode& refChild) | - |
1765 | { | - |
1766 | if (!impl) | 0 |
1767 | return QDomNode(); never executed: return QDomNode(); | 0 |
1768 | return QDomNode(((QDomNodePrivate*)impl)->insertAfter(newChild.impl, refChild.impl)); never executed: return QDomNode(((QDomNodePrivate*)impl)->insertAfter(newChild.impl, refChild.impl)); | 0 |
1769 | } | - |
1770 | QDomNode QDomNode::replaceChild(const QDomNode& newChild, const QDomNode& oldChild) | - |
1771 | { | - |
1772 | if (!impl || !newChild.impl || !oldChild.impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:12 |
partially evaluated: !newChild.impl no Evaluation Count:0 | yes Evaluation Count:12 |
partially evaluated: !oldChild.impl no Evaluation Count:0 | yes Evaluation Count:12 |
| 0-12 |
1773 | return QDomNode(); never executed: return QDomNode(); | 0 |
1774 | return QDomNode(((QDomNodePrivate*)impl)->replaceChild(newChild.impl, oldChild.impl)); executed: return QDomNode(((QDomNodePrivate*)impl)->replaceChild(newChild.impl, oldChild.impl)); Execution Count:12 | 12 |
1775 | } | - |
1776 | QDomNode QDomNode::removeChild(const QDomNode& oldChild) | - |
1777 | { | - |
1778 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1779 | return QDomNode(); never executed: return QDomNode(); | 0 |
1780 | | - |
1781 | if (oldChild.isNull()) partially evaluated: oldChild.isNull() no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
1782 | return QDomNode(); never executed: return QDomNode(); | 0 |
1783 | | - |
1784 | return QDomNode(((QDomNodePrivate*)impl)->removeChild(oldChild.impl)); executed: return QDomNode(((QDomNodePrivate*)impl)->removeChild(oldChild.impl)); Execution Count:1 | 1 |
1785 | } | - |
1786 | QDomNode QDomNode::appendChild(const QDomNode& newChild) | - |
1787 | { | - |
1788 | if (!impl) { partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:95 |
| 0-95 |
1789 | QMessageLogger("dom/qdom.cpp", 2604, __PRETTY_FUNCTION__).warning("Calling appendChild() on a null node does nothing."); | - |
1790 | return QDomNode(); never executed: return QDomNode(); | 0 |
1791 | } | - |
1792 | return QDomNode(((QDomNodePrivate*)impl)->appendChild(newChild.impl)); executed: return QDomNode(((QDomNodePrivate*)impl)->appendChild(newChild.impl)); Execution Count:95 | 95 |
1793 | } | - |
1794 | | - |
1795 | | - |
1796 | | - |
1797 | | - |
1798 | | - |
1799 | bool QDomNode::hasChildNodes() const | - |
1800 | { | - |
1801 | if (!impl) | 0 |
1802 | return false; never executed: return false; | 0 |
1803 | return ((QDomNodePrivate*)impl)->first != 0; never executed: return ((QDomNodePrivate*)impl)->first != 0; | 0 |
1804 | } | - |
1805 | | - |
1806 | | - |
1807 | | - |
1808 | | - |
1809 | | - |
1810 | bool QDomNode::isNull() const | - |
1811 | { | - |
1812 | return (impl == 0); executed: return (impl == 0); Execution Count:424 | 424 |
1813 | } | - |
1814 | | - |
1815 | | - |
1816 | | - |
1817 | | - |
1818 | | - |
1819 | | - |
1820 | | - |
1821 | void QDomNode::clear() | - |
1822 | { | - |
1823 | if (impl && !impl->ref.deref()) never evaluated: !impl->ref.deref() | 0 |
1824 | delete impl; never executed: delete impl; | 0 |
1825 | impl = 0; | - |
1826 | } | 0 |
1827 | QDomNode QDomNode::namedItem(const QString& name) const | - |
1828 | { | - |
1829 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-10 |
1830 | return QDomNode(); never executed: return QDomNode(); | 0 |
1831 | return QDomNode(impl->namedItem(name)); executed: return QDomNode(impl->namedItem(name)); Execution Count:10 | 10 |
1832 | } | - |
1833 | void QDomNode::save(QTextStream& stream, int indent, EncodingPolicy encodingPolicy) const | - |
1834 | { | - |
1835 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:238 |
| 0-238 |
1836 | return; | 0 |
1837 | | - |
1838 | if(isDocument()) evaluated: isDocument() yes Evaluation Count:226 | yes Evaluation Count:12 |
| 12-226 |
1839 | static_cast<const QDomDocumentPrivate *>(impl)->saveDocument(stream, indent, encodingPolicy); executed: static_cast<const QDomDocumentPrivate *>(impl)->saveDocument(stream, indent, encodingPolicy); Execution Count:226 | 226 |
1840 | else | - |
1841 | ((QDomNodePrivate*)impl)->save(stream, 1, indent); executed: ((QDomNodePrivate*)impl)->save(stream, 1, indent); Execution Count:12 | 12 |
1842 | } | - |
1843 | | - |
1844 | | - |
1845 | | - |
1846 | | - |
1847 | | - |
1848 | | - |
1849 | | - |
1850 | QTextStream& operator<<(QTextStream& str, const QDomNode& node) | - |
1851 | { | - |
1852 | node.save(str, 1); | - |
1853 | | - |
1854 | return str; executed: return str; Execution Count:12 | 12 |
1855 | } | - |
1856 | bool QDomNode::isAttr() const | - |
1857 | { | - |
1858 | if(impl) | 0 |
1859 | return impl->isAttr(); never executed: return impl->isAttr(); | 0 |
1860 | return false; never executed: return false; | 0 |
1861 | } | - |
1862 | bool QDomNode::isCDATASection() const | - |
1863 | { | - |
1864 | if(impl) partially evaluated: impl yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
1865 | return impl->isCDATASection(); executed: return impl->isCDATASection(); Execution Count:1 | 1 |
1866 | return false; never executed: return false; | 0 |
1867 | } | - |
1868 | bool QDomNode::isDocumentFragment() const | - |
1869 | { | - |
1870 | if(impl) | 0 |
1871 | return impl->isDocumentFragment(); never executed: return impl->isDocumentFragment(); | 0 |
1872 | return false; never executed: return false; | 0 |
1873 | } | - |
1874 | bool QDomNode::isDocument() const | - |
1875 | { | - |
1876 | if(impl) partially evaluated: impl yes Evaluation Count:238 | no Evaluation Count:0 |
| 0-238 |
1877 | return impl->isDocument(); executed: return impl->isDocument(); Execution Count:238 | 238 |
1878 | return false; never executed: return false; | 0 |
1879 | } | - |
1880 | bool QDomNode::isDocumentType() const | - |
1881 | { | - |
1882 | if(impl) | 0 |
1883 | return impl->isDocumentType(); never executed: return impl->isDocumentType(); | 0 |
1884 | return false; never executed: return false; | 0 |
1885 | } | - |
1886 | bool QDomNode::isElement() const | - |
1887 | { | - |
1888 | if(impl) partially evaluated: impl yes Evaluation Count:22 | no Evaluation Count:0 |
| 0-22 |
1889 | return impl->isElement(); executed: return impl->isElement(); Execution Count:22 | 22 |
1890 | return false; never executed: return false; | 0 |
1891 | } | - |
1892 | bool QDomNode::isEntityReference() const | - |
1893 | { | - |
1894 | if(impl) | 0 |
1895 | return impl->isEntityReference(); never executed: return impl->isEntityReference(); | 0 |
1896 | return false; never executed: return false; | 0 |
1897 | } | - |
1898 | bool QDomNode::isText() const | - |
1899 | { | - |
1900 | if(impl) | 0 |
1901 | return impl->isText(); never executed: return impl->isText(); | 0 |
1902 | return false; never executed: return false; | 0 |
1903 | } | - |
1904 | bool QDomNode::isEntity() const | - |
1905 | { | - |
1906 | if(impl) partially evaluated: impl yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
1907 | return impl->isEntity(); executed: return impl->isEntity(); Execution Count:2 | 2 |
1908 | return false; never executed: return false; | 0 |
1909 | } | - |
1910 | bool QDomNode::isNotation() const | - |
1911 | { | - |
1912 | if(impl) partially evaluated: impl yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
1913 | return impl->isNotation(); executed: return impl->isNotation(); Execution Count:2 | 2 |
1914 | return false; never executed: return false; | 0 |
1915 | } | - |
1916 | bool QDomNode::isProcessingInstruction() const | - |
1917 | { | - |
1918 | if(impl) partially evaluated: impl yes Evaluation Count:60318 | no Evaluation Count:0 |
| 0-60318 |
1919 | return impl->isProcessingInstruction(); executed: return impl->isProcessingInstruction(); Execution Count:60318 | 60318 |
1920 | return false; never executed: return false; | 0 |
1921 | } | - |
1922 | bool QDomNode::isCharacterData() const | - |
1923 | { | - |
1924 | if (impl) | 0 |
1925 | return impl->isCharacterData(); never executed: return impl->isCharacterData(); | 0 |
1926 | return false; never executed: return false; | 0 |
1927 | } | - |
1928 | bool QDomNode::isComment() const | - |
1929 | { | - |
1930 | if (impl) | 0 |
1931 | return impl->isComment(); never executed: return impl->isComment(); | 0 |
1932 | return false; never executed: return false; | 0 |
1933 | } | - |
1934 | QDomElement QDomNode::firstChildElement(const QString &tagName) const | - |
1935 | { | - |
1936 | for (QDomNode child = firstChild(); !child.isNull(); child = child.nextSibling()) { evaluated: !child.isNull() yes Evaluation Count:11 | yes Evaluation Count:2 |
| 2-11 |
1937 | if (child.isElement()) { partially evaluated: child.isElement() yes Evaluation Count:11 | no Evaluation Count:0 |
| 0-11 |
1938 | QDomElement elt = child.toElement(); | - |
1939 | if (tagName.isEmpty() || elt.tagName() == tagName) evaluated: tagName.isEmpty() yes Evaluation Count:1 | yes Evaluation Count:10 |
evaluated: elt.tagName() == tagName yes Evaluation Count:4 | yes Evaluation Count:6 |
| 1-10 |
1940 | return elt; executed: return elt; Execution Count:5 | 5 |
1941 | } executed: } Execution Count:6 | 6 |
1942 | } executed: } Execution Count:6 | 6 |
1943 | return QDomElement(); executed: return QDomElement(); Execution Count:2 | 2 |
1944 | } | - |
1945 | QDomElement QDomNode::lastChildElement(const QString &tagName) const | - |
1946 | { | - |
1947 | for (QDomNode child = lastChild(); !child.isNull(); child = child.previousSibling()) { partially evaluated: !child.isNull() yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
1948 | if (child.isElement()) { partially evaluated: child.isElement() yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
1949 | QDomElement elt = child.toElement(); | - |
1950 | if (tagName.isEmpty() || elt.tagName() == tagName) partially evaluated: tagName.isEmpty() no Evaluation Count:0 | yes Evaluation Count:1 |
partially evaluated: elt.tagName() == tagName yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
1951 | return elt; executed: return elt; Execution Count:1 | 1 |
1952 | } | 0 |
1953 | } | 0 |
1954 | return QDomElement(); never executed: return QDomElement(); | 0 |
1955 | } | - |
1956 | QDomElement QDomNode::nextSiblingElement(const QString &tagName) const | - |
1957 | { | - |
1958 | for (QDomNode sib = nextSibling(); !sib.isNull(); sib = sib.nextSibling()) { evaluated: !sib.isNull() yes Evaluation Count:8 | yes Evaluation Count:3 |
| 3-8 |
1959 | if (sib.isElement()) { partially evaluated: sib.isElement() yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
1960 | QDomElement elt = sib.toElement(); | - |
1961 | if (tagName.isEmpty() || elt.tagName() == tagName) evaluated: tagName.isEmpty() yes Evaluation Count:1 | yes Evaluation Count:7 |
evaluated: elt.tagName() == tagName yes Evaluation Count:3 | yes Evaluation Count:4 |
| 1-7 |
1962 | return elt; executed: return elt; Execution Count:4 | 4 |
1963 | } executed: } Execution Count:4 | 4 |
1964 | } executed: } Execution Count:4 | 4 |
1965 | return QDomElement(); executed: return QDomElement(); Execution Count:3 | 3 |
1966 | } | - |
1967 | QDomElement QDomNode::previousSiblingElement(const QString &tagName) const | - |
1968 | { | - |
1969 | for (QDomNode sib = previousSibling(); !sib.isNull(); sib = sib.previousSibling()) { evaluated: !sib.isNull() yes Evaluation Count:2 | yes Evaluation Count:4 |
| 2-4 |
1970 | if (sib.isElement()) { partially evaluated: sib.isElement() yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
1971 | QDomElement elt = sib.toElement(); | - |
1972 | if (tagName.isEmpty() || elt.tagName() == tagName) partially evaluated: tagName.isEmpty() no Evaluation Count:0 | yes Evaluation Count:2 |
partially evaluated: elt.tagName() == tagName yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
1973 | return elt; executed: return elt; Execution Count:2 | 2 |
1974 | } | 0 |
1975 | } | 0 |
1976 | return QDomElement(); executed: return QDomElement(); Execution Count:4 | 4 |
1977 | } | - |
1978 | int QDomNode::lineNumber() const | - |
1979 | { | - |
1980 | return impl ? impl->lineNumber : -1; never executed: return impl ? impl->lineNumber : -1; | 0 |
1981 | } | - |
1982 | int QDomNode::columnNumber() const | - |
1983 | { | - |
1984 | return impl ? impl->columnNumber : -1; never executed: return impl ? impl->columnNumber : -1; | 0 |
1985 | } | - |
1986 | QDomNamedNodeMapPrivate::QDomNamedNodeMapPrivate(QDomNodePrivate* n) : ref(1) | - |
1987 | { | - |
1988 | readonly = false; | - |
1989 | parent = n; | - |
1990 | appendToParent = false; | - |
1991 | } executed: } Execution Count:39807 | 39807 |
1992 | | - |
1993 | QDomNamedNodeMapPrivate::~QDomNamedNodeMapPrivate() | - |
1994 | { | - |
1995 | clearMap(); | - |
1996 | } executed: } Execution Count:39807 | 39807 |
1997 | | - |
1998 | QDomNamedNodeMapPrivate* QDomNamedNodeMapPrivate::clone(QDomNodePrivate* p) | - |
1999 | { | - |
2000 | QScopedPointer<QDomNamedNodeMapPrivate> m(new QDomNamedNodeMapPrivate(p)); | - |
2001 | m->readonly = readonly; | - |
2002 | m->appendToParent = appendToParent; | - |
2003 | | - |
2004 | QHash<QString, QDomNodePrivate*>::const_iterator it = map.constBegin(); | - |
2005 | for (; it != map.constEnd(); ++it) { evaluated: it != map.constEnd() yes Evaluation Count:1 | yes Evaluation Count:63 |
| 1-63 |
2006 | QDomNodePrivate *new_node = (*it)->cloneNode(); | - |
2007 | new_node->setParent(p); | - |
2008 | m->setNamedItem(new_node); | - |
2009 | } executed: } Execution Count:1 | 1 |
2010 | | - |
2011 | | - |
2012 | m->ref.deref(); | - |
2013 | return m.take(); executed: return m.take(); Execution Count:63 | 63 |
2014 | } | - |
2015 | | - |
2016 | void QDomNamedNodeMapPrivate::clearMap() | - |
2017 | { | - |
2018 | | - |
2019 | if (!appendToParent) { evaluated: !appendToParent yes Evaluation Count:38093 | yes Evaluation Count:1714 |
| 1714-38093 |
2020 | QHash<QString, QDomNodePrivate *>::const_iterator it = map.constBegin(); | - |
2021 | for (; it != map.constEnd(); ++it) evaluated: it != map.constEnd() yes Evaluation Count:16754 | yes Evaluation Count:38093 |
| 16754-38093 |
2022 | if (!(*it)->ref.deref()) partially evaluated: !(*it)->ref.deref() yes Evaluation Count:16754 | no Evaluation Count:0 |
| 0-16754 |
2023 | delete *it; executed: delete *it; Execution Count:16754 | 16754 |
2024 | } executed: } Execution Count:38093 | 38093 |
2025 | map.clear(); | - |
2026 | } executed: } Execution Count:39807 | 39807 |
2027 | | - |
2028 | QDomNodePrivate* QDomNamedNodeMapPrivate::namedItem(const QString& name) const | - |
2029 | { | - |
2030 | QDomNodePrivate* p = map[name]; | - |
2031 | return p; executed: return p; Execution Count:16745 | 16745 |
2032 | } | - |
2033 | | - |
2034 | QDomNodePrivate* QDomNamedNodeMapPrivate::namedItemNS(const QString& nsURI, const QString& localName) const | - |
2035 | { | - |
2036 | QHash<QString, QDomNodePrivate *>::const_iterator it = map.constBegin(); | - |
2037 | QDomNodePrivate *n; | - |
2038 | for (; it != map.constEnd(); ++it) { evaluated: it != map.constEnd() yes Evaluation Count:1 | yes Evaluation Count:13 |
| 1-13 |
2039 | n = *it; | - |
2040 | if (!n->prefix.isNull()) { partially evaluated: !n->prefix.isNull() yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
2041 | | - |
2042 | if (n->namespaceURI == nsURI && n->name == localName) partially evaluated: n->namespaceURI == nsURI yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: n->name == localName no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2043 | return n; never executed: return n; | 0 |
2044 | } executed: } Execution Count:1 | 1 |
2045 | } executed: } Execution Count:1 | 1 |
2046 | return 0; executed: return 0; Execution Count:13 | 13 |
2047 | } | - |
2048 | | - |
2049 | QDomNodePrivate* QDomNamedNodeMapPrivate::setNamedItem(QDomNodePrivate* arg) | - |
2050 | { | - |
2051 | if (readonly || !arg) partially evaluated: readonly no Evaluation Count:0 | yes Evaluation Count:16754 |
partially evaluated: !arg no Evaluation Count:0 | yes Evaluation Count:16754 |
| 0-16754 |
2052 | return 0; never executed: return 0; | 0 |
2053 | | - |
2054 | if (appendToParent) partially evaluated: appendToParent no Evaluation Count:0 | yes Evaluation Count:16754 |
| 0-16754 |
2055 | return parent->appendChild(arg); never executed: return parent->appendChild(arg); | 0 |
2056 | | - |
2057 | QDomNodePrivate *n = map.value(arg->nodeName()); | - |
2058 | | - |
2059 | arg->ref.ref(); | - |
2060 | map.insertMulti(arg->nodeName(), arg); | - |
2061 | return n; executed: return n; Execution Count:16754 | 16754 |
2062 | } | - |
2063 | | - |
2064 | QDomNodePrivate* QDomNamedNodeMapPrivate::setNamedItemNS(QDomNodePrivate* arg) | - |
2065 | { | - |
2066 | if (readonly || !arg) never evaluated: readonly | 0 |
2067 | return 0; never executed: return 0; | 0 |
2068 | | - |
2069 | if (appendToParent) never evaluated: appendToParent | 0 |
2070 | return parent->appendChild(arg); never executed: return parent->appendChild(arg); | 0 |
2071 | | - |
2072 | if (!arg->prefix.isNull()) { never evaluated: !arg->prefix.isNull() | 0 |
2073 | | - |
2074 | QDomNodePrivate *n = namedItemNS(arg->namespaceURI, arg->name); | - |
2075 | | - |
2076 | arg->ref.ref(); | - |
2077 | map.insertMulti(arg->nodeName(), arg); | - |
2078 | return n; never executed: return n; | 0 |
2079 | } else { | - |
2080 | | - |
2081 | return setNamedItem(arg); never executed: return setNamedItem(arg); | 0 |
2082 | } | - |
2083 | } | - |
2084 | | - |
2085 | QDomNodePrivate* QDomNamedNodeMapPrivate::removeNamedItem(const QString& name) | - |
2086 | { | - |
2087 | if (readonly) never evaluated: readonly | 0 |
2088 | return 0; never executed: return 0; | 0 |
2089 | | - |
2090 | QDomNodePrivate* p = namedItem(name); | - |
2091 | if (p == 0) | 0 |
2092 | return 0; never executed: return 0; | 0 |
2093 | if (appendToParent) never evaluated: appendToParent | 0 |
2094 | return parent->removeChild(p); never executed: return parent->removeChild(p); | 0 |
2095 | | - |
2096 | map.remove(p->nodeName()); | - |
2097 | | - |
2098 | p->ref.deref(); | - |
2099 | return p; never executed: return p; | 0 |
2100 | } | - |
2101 | | - |
2102 | QDomNodePrivate* QDomNamedNodeMapPrivate::item(int index) const | - |
2103 | { | - |
2104 | if (index >= length()) evaluated: index >= length() yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
2105 | return 0; executed: return 0; Execution Count:1 | 1 |
2106 | return *(map.constBegin() + index); executed: return *(map.constBegin() + index); Execution Count:1 | 1 |
2107 | } | - |
2108 | | - |
2109 | int QDomNamedNodeMapPrivate::length() const | - |
2110 | { | - |
2111 | return map.count(); executed: return map.count(); Execution Count:83 | 83 |
2112 | } | - |
2113 | | - |
2114 | bool QDomNamedNodeMapPrivate::contains(const QString& name) const | - |
2115 | { | - |
2116 | return map.value(name) != 0; never executed: return map.value(name) != 0; | 0 |
2117 | } | - |
2118 | | - |
2119 | bool QDomNamedNodeMapPrivate::containsNS(const QString& nsURI, const QString & localName) const | - |
2120 | { | - |
2121 | return namedItemNS(nsURI, localName) != 0; never executed: return namedItemNS(nsURI, localName) != 0; | 0 |
2122 | } | - |
2123 | QDomNamedNodeMap::QDomNamedNodeMap() | - |
2124 | { | - |
2125 | impl = 0; | - |
2126 | } executed: } Execution Count:16 | 16 |
2127 | | - |
2128 | | - |
2129 | | - |
2130 | | - |
2131 | QDomNamedNodeMap::QDomNamedNodeMap(const QDomNamedNodeMap &n) | - |
2132 | { | - |
2133 | impl = n.impl; | - |
2134 | if (impl) | 0 |
2135 | impl->ref.ref(); never executed: impl->ref.ref(); | 0 |
2136 | } | 0 |
2137 | | - |
2138 | QDomNamedNodeMap::QDomNamedNodeMap(QDomNamedNodeMapPrivate *n) | - |
2139 | { | - |
2140 | impl = n; | - |
2141 | if (impl) partially evaluated: impl yes Evaluation Count:13 | no Evaluation Count:0 |
| 0-13 |
2142 | impl->ref.ref(); executed: impl->ref.ref(); Execution Count:13 | 13 |
2143 | } executed: } Execution Count:13 | 13 |
2144 | | - |
2145 | | - |
2146 | | - |
2147 | | - |
2148 | QDomNamedNodeMap& QDomNamedNodeMap::operator=(const QDomNamedNodeMap &n) | - |
2149 | { | - |
2150 | if (n.impl) | 0 |
2151 | n.impl->ref.ref(); never executed: n.impl->ref.ref(); | 0 |
2152 | if (impl && !impl->ref.deref()) never evaluated: !impl->ref.deref() | 0 |
2153 | delete impl; never executed: delete impl; | 0 |
2154 | impl = n.impl; | - |
2155 | return *this; never executed: return *this; | 0 |
2156 | } | - |
2157 | | - |
2158 | | - |
2159 | | - |
2160 | | - |
2161 | | - |
2162 | bool QDomNamedNodeMap::operator== (const QDomNamedNodeMap& n) const | - |
2163 | { | - |
2164 | return (impl == n.impl); never executed: return (impl == n.impl); | 0 |
2165 | } | - |
2166 | | - |
2167 | | - |
2168 | | - |
2169 | | - |
2170 | | - |
2171 | bool QDomNamedNodeMap::operator!= (const QDomNamedNodeMap& n) const | - |
2172 | { | - |
2173 | return (impl != n.impl); never executed: return (impl != n.impl); | 0 |
2174 | } | - |
2175 | | - |
2176 | | - |
2177 | | - |
2178 | | - |
2179 | QDomNamedNodeMap::~QDomNamedNodeMap() | - |
2180 | { | - |
2181 | if (impl && !impl->ref.deref()) evaluated: impl yes Evaluation Count:13 | yes Evaluation Count:16 |
partially evaluated: !impl->ref.deref() no Evaluation Count:0 | yes Evaluation Count:13 |
| 0-16 |
2182 | delete impl; never executed: delete impl; | 0 |
2183 | } executed: } Execution Count:29 | 29 |
2184 | QDomNode QDomNamedNodeMap::namedItem(const QString& name) const | - |
2185 | { | - |
2186 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2187 | return QDomNode(); never executed: return QDomNode(); | 0 |
2188 | return QDomNode(((QDomNamedNodeMapPrivate*)impl)->namedItem(name)); executed: return QDomNode(((QDomNamedNodeMapPrivate*)impl)->namedItem(name)); Execution Count:1 | 1 |
2189 | } | - |
2190 | QDomNode QDomNamedNodeMap::setNamedItem(const QDomNode& newNode) | - |
2191 | { | - |
2192 | if (!impl) | 0 |
2193 | return QDomNode(); never executed: return QDomNode(); | 0 |
2194 | return QDomNode(((QDomNamedNodeMapPrivate*)impl)->setNamedItem((QDomNodePrivate*)newNode.impl)); never executed: return QDomNode(((QDomNamedNodeMapPrivate*)impl)->setNamedItem((QDomNodePrivate*)newNode.impl)); | 0 |
2195 | } | - |
2196 | QDomNode QDomNamedNodeMap::removeNamedItem(const QString& name) | - |
2197 | { | - |
2198 | if (!impl) | 0 |
2199 | return QDomNode(); never executed: return QDomNode(); | 0 |
2200 | return QDomNode(((QDomNamedNodeMapPrivate*)impl)->removeNamedItem(name)); never executed: return QDomNode(((QDomNamedNodeMapPrivate*)impl)->removeNamedItem(name)); | 0 |
2201 | } | - |
2202 | QDomNode QDomNamedNodeMap::item(int index) const | - |
2203 | { | - |
2204 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
2205 | return QDomNode(); never executed: return QDomNode(); | 0 |
2206 | return QDomNode(((QDomNamedNodeMapPrivate*)impl)->item(index)); executed: return QDomNode(((QDomNamedNodeMapPrivate*)impl)->item(index)); Execution Count:2 | 2 |
2207 | } | - |
2208 | QDomNode QDomNamedNodeMap::namedItemNS(const QString& nsURI, const QString& localName) const | - |
2209 | { | - |
2210 | if (!impl) | 0 |
2211 | return QDomNode(); never executed: return QDomNode(); | 0 |
2212 | return QDomNode(((QDomNamedNodeMapPrivate*)impl)->namedItemNS(nsURI, localName)); never executed: return QDomNode(((QDomNamedNodeMapPrivate*)impl)->namedItemNS(nsURI, localName)); | 0 |
2213 | } | - |
2214 | QDomNode QDomNamedNodeMap::setNamedItemNS(const QDomNode& newNode) | - |
2215 | { | - |
2216 | if (!impl) | 0 |
2217 | return QDomNode(); never executed: return QDomNode(); | 0 |
2218 | return QDomNode(((QDomNamedNodeMapPrivate*)impl)->setNamedItemNS((QDomNodePrivate*)newNode.impl)); never executed: return QDomNode(((QDomNamedNodeMapPrivate*)impl)->setNamedItemNS((QDomNodePrivate*)newNode.impl)); | 0 |
2219 | } | - |
2220 | QDomNode QDomNamedNodeMap::removeNamedItemNS(const QString& nsURI, const QString& localName) | - |
2221 | { | - |
2222 | if (!impl) | 0 |
2223 | return QDomNode(); never executed: return QDomNode(); | 0 |
2224 | QDomNodePrivate *n = ((QDomNamedNodeMapPrivate*)impl)->namedItemNS(nsURI, localName); | - |
2225 | if (!n) | 0 |
2226 | return QDomNode(); never executed: return QDomNode(); | 0 |
2227 | return QDomNode(((QDomNamedNodeMapPrivate*)impl)->removeNamedItem(n->name)); never executed: return QDomNode(((QDomNamedNodeMapPrivate*)impl)->removeNamedItem(n->name)); | 0 |
2228 | } | - |
2229 | | - |
2230 | | - |
2231 | | - |
2232 | | - |
2233 | | - |
2234 | | - |
2235 | int QDomNamedNodeMap::length() const | - |
2236 | { | - |
2237 | if (!impl) evaluated: !impl yes Evaluation Count:16 | yes Evaluation Count:11 |
| 11-16 |
2238 | return 0; executed: return 0; Execution Count:16 | 16 |
2239 | return ((QDomNamedNodeMapPrivate*)impl)->length(); executed: return ((QDomNamedNodeMapPrivate*)impl)->length(); Execution Count:11 | 11 |
2240 | } | - |
2241 | bool QDomNamedNodeMap::contains(const QString& name) const | - |
2242 | { | - |
2243 | if (!impl) | 0 |
2244 | return false; never executed: return false; | 0 |
2245 | return ((QDomNamedNodeMapPrivate*)impl)->contains(name); never executed: return ((QDomNamedNodeMapPrivate*)impl)->contains(name); | 0 |
2246 | } | - |
2247 | QDomDocumentTypePrivate::QDomDocumentTypePrivate(QDomDocumentPrivate* doc, QDomNodePrivate* parent) | - |
2248 | : QDomNodePrivate(doc, parent) | - |
2249 | { | - |
2250 | init(); | - |
2251 | } executed: } Execution Count:856 | 856 |
2252 | | - |
2253 | QDomDocumentTypePrivate::QDomDocumentTypePrivate(QDomDocumentTypePrivate* n, bool deep) | - |
2254 | : QDomNodePrivate(n, deep) | - |
2255 | { | - |
2256 | init(); | - |
2257 | | - |
2258 | QDomNodePrivate* p = first; | - |
2259 | while (p) { evaluated: p yes Evaluation Count:2 | yes Evaluation Count:1 |
| 1-2 |
2260 | if (p->isEntity()) partially evaluated: p->isEntity() yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
2261 | | - |
2262 | entities->map.insertMulti(p->nodeName(), p); executed: entities->map.insertMulti(p->nodeName(), p); Execution Count:2 | 2 |
2263 | if (p->isNotation()) partially evaluated: p->isNotation() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
2264 | | - |
2265 | notations->map.insertMulti(p->nodeName(), p); never executed: notations->map.insertMulti(p->nodeName(), p); | 0 |
2266 | p = p->next; | - |
2267 | } executed: } Execution Count:2 | 2 |
2268 | } executed: } Execution Count:1 | 1 |
2269 | | - |
2270 | QDomDocumentTypePrivate::~QDomDocumentTypePrivate() | - |
2271 | { | - |
2272 | if (!entities->ref.deref()) partially evaluated: !entities->ref.deref() yes Evaluation Count:857 | no Evaluation Count:0 |
| 0-857 |
2273 | delete entities; executed: delete entities; Execution Count:857 | 857 |
2274 | if (!notations->ref.deref()) partially evaluated: !notations->ref.deref() yes Evaluation Count:857 | no Evaluation Count:0 |
| 0-857 |
2275 | delete notations; executed: delete notations; Execution Count:857 | 857 |
2276 | } executed: } Execution Count:857 | 857 |
2277 | | - |
2278 | void QDomDocumentTypePrivate::init() | - |
2279 | { | - |
2280 | entities = new QDomNamedNodeMapPrivate(this); | - |
2281 | if (true) { partially evaluated: true yes Evaluation Count:857 | no Evaluation Count:0 |
| 0-857 |
2282 | notations = new QDomNamedNodeMapPrivate(this); | - |
2283 | publicId.clear(); | - |
2284 | systemId.clear(); | - |
2285 | internalSubset.clear(); | - |
2286 | | - |
2287 | entities->setAppendToParent(true); | - |
2288 | notations->setAppendToParent(true); | - |
2289 | } else { executed: } Execution Count:857 | 857 |
2290 | delete entities; | - |
2291 | qt_noop(); | - |
2292 | } | 0 |
2293 | } | - |
2294 | | - |
2295 | QDomNodePrivate* QDomDocumentTypePrivate::cloneNode(bool deep) | - |
2296 | { | - |
2297 | QDomNodePrivate* p = new QDomDocumentTypePrivate(this, deep); | - |
2298 | | - |
2299 | p->ref.deref(); | - |
2300 | return p; executed: return p; Execution Count:1 | 1 |
2301 | } | - |
2302 | | - |
2303 | QDomNodePrivate* QDomDocumentTypePrivate::insertBefore(QDomNodePrivate* newChild, QDomNodePrivate* refChild) | - |
2304 | { | - |
2305 | | - |
2306 | QDomNodePrivate* p = QDomNodePrivate::insertBefore(newChild, refChild); | - |
2307 | | - |
2308 | if (p && p->isEntity()) never evaluated: p->isEntity() | 0 |
2309 | entities->map.insertMulti(p->nodeName(), p); never executed: entities->map.insertMulti(p->nodeName(), p); | 0 |
2310 | else if (p && p->isNotation()) never evaluated: p->isNotation() | 0 |
2311 | notations->map.insertMulti(p->nodeName(), p); never executed: notations->map.insertMulti(p->nodeName(), p); | 0 |
2312 | | - |
2313 | return p; never executed: return p; | 0 |
2314 | } | - |
2315 | | - |
2316 | QDomNodePrivate* QDomDocumentTypePrivate::insertAfter(QDomNodePrivate* newChild, QDomNodePrivate* refChild) | - |
2317 | { | - |
2318 | | - |
2319 | QDomNodePrivate* p = QDomNodePrivate::insertAfter(newChild, refChild); | - |
2320 | | - |
2321 | if (p && p->isEntity()) partially evaluated: p yes Evaluation Count:8 | no Evaluation Count:0 |
evaluated: p->isEntity() yes Evaluation Count:6 | yes Evaluation Count:2 |
| 0-8 |
2322 | entities->map.insertMulti(p->nodeName(), p); executed: entities->map.insertMulti(p->nodeName(), p); Execution Count:6 | 6 |
2323 | else if (p && p->isNotation()) partially evaluated: p yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: p->isNotation() yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
2324 | notations->map.insertMulti(p->nodeName(), p); executed: notations->map.insertMulti(p->nodeName(), p); Execution Count:2 | 2 |
2325 | | - |
2326 | return p; executed: return p; Execution Count:8 | 8 |
2327 | } | - |
2328 | | - |
2329 | QDomNodePrivate* QDomDocumentTypePrivate::replaceChild(QDomNodePrivate* newChild, QDomNodePrivate* oldChild) | - |
2330 | { | - |
2331 | | - |
2332 | QDomNodePrivate* p = QDomNodePrivate::replaceChild(newChild, oldChild); | - |
2333 | | - |
2334 | if (p) { | 0 |
2335 | if (oldChild && oldChild->isEntity()) never evaluated: oldChild never evaluated: oldChild->isEntity() | 0 |
2336 | entities->map.remove(oldChild->nodeName()); never executed: entities->map.remove(oldChild->nodeName()); | 0 |
2337 | else if (oldChild && oldChild->isNotation()) never evaluated: oldChild never evaluated: oldChild->isNotation() | 0 |
2338 | notations->map.remove(oldChild->nodeName()); never executed: notations->map.remove(oldChild->nodeName()); | 0 |
2339 | | - |
2340 | if (p->isEntity()) never evaluated: p->isEntity() | 0 |
2341 | entities->map.insertMulti(p->nodeName(), p); never executed: entities->map.insertMulti(p->nodeName(), p); | 0 |
2342 | else if (p->isNotation()) never evaluated: p->isNotation() | 0 |
2343 | notations->map.insertMulti(p->nodeName(), p); never executed: notations->map.insertMulti(p->nodeName(), p); | 0 |
2344 | } | - |
2345 | | - |
2346 | return p; never executed: return p; | 0 |
2347 | } | - |
2348 | | - |
2349 | QDomNodePrivate* QDomDocumentTypePrivate::removeChild(QDomNodePrivate* oldChild) | - |
2350 | { | - |
2351 | | - |
2352 | QDomNodePrivate* p = QDomNodePrivate::removeChild( oldChild); | - |
2353 | | - |
2354 | if (p && p->isEntity()) never evaluated: p->isEntity() | 0 |
2355 | entities->map.remove(p->nodeName()); never executed: entities->map.remove(p->nodeName()); | 0 |
2356 | else if (p && p->isNotation()) never evaluated: p->isNotation() | 0 |
2357 | notations->map.remove(p ->nodeName()); never executed: notations->map.remove(p ->nodeName()); | 0 |
2358 | | - |
2359 | return p; never executed: return p; | 0 |
2360 | } | - |
2361 | | - |
2362 | QDomNodePrivate* QDomDocumentTypePrivate::appendChild(QDomNodePrivate* newChild) | - |
2363 | { | - |
2364 | return insertAfter(newChild, 0); executed: return insertAfter(newChild, 0); Execution Count:8 | 8 |
2365 | } | - |
2366 | | - |
2367 | static QString quotedValue(const QString &data) | - |
2368 | { | - |
2369 | QChar quote = data.indexOf(QLatin1Char('\'')) == -1 partially evaluated: data.indexOf(QLatin1Char('\'')) == -1 yes Evaluation Count:27 | no Evaluation Count:0 |
| 0-27 |
2370 | ? QLatin1Char('\'') | - |
2371 | : QLatin1Char('"'); | - |
2372 | return quote + data + quote; executed: return quote + data + quote; Execution Count:27 | 27 |
2373 | } | - |
2374 | | - |
2375 | void QDomDocumentTypePrivate::save(QTextStream& s, int, int indent) const | - |
2376 | { | - |
2377 | if (name.isEmpty()) evaluated: name.isEmpty() yes Evaluation Count:134 | yes Evaluation Count:32 |
| 32-134 |
2378 | return; executed: return; Execution Count:134 | 134 |
2379 | | - |
2380 | s << "<!DOCTYPE " << name; | - |
2381 | | - |
2382 | if (!publicId.isNull()) { partially evaluated: !publicId.isNull() no Evaluation Count:0 | yes Evaluation Count:32 |
| 0-32 |
2383 | s << " PUBLIC " << quotedValue(publicId); | - |
2384 | if (!systemId.isNull()) { never evaluated: !systemId.isNull() | 0 |
2385 | s << ' ' << quotedValue(systemId); | - |
2386 | } | 0 |
2387 | } else if (!systemId.isNull()) { evaluated: !systemId.isNull() yes Evaluation Count:25 | yes Evaluation Count:7 |
| 0-25 |
2388 | s << " SYSTEM " << quotedValue(systemId); | - |
2389 | } executed: } Execution Count:25 | 25 |
2390 | | - |
2391 | if (entities->length()>0 || notations->length()>0) { evaluated: entities->length()>0 yes Evaluation Count:3 | yes Evaluation Count:29 |
partially evaluated: notations->length()>0 no Evaluation Count:0 | yes Evaluation Count:29 |
| 0-29 |
2392 | s << " [" << endl; | - |
2393 | | - |
2394 | QHash<QString, QDomNodePrivate *>::const_iterator it2 = notations->map.constBegin(); | - |
2395 | for (; it2 != notations->map.constEnd(); ++it2) partially evaluated: it2 != notations->map.constEnd() no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
2396 | (*it2)->save(s, 0, indent); never executed: (*it2)->save(s, 0, indent); | 0 |
2397 | | - |
2398 | QHash<QString, QDomNodePrivate *>::const_iterator it = entities->map.constBegin(); | - |
2399 | for (; it != entities->map.constEnd(); ++it) evaluated: it != entities->map.constEnd() yes Evaluation Count:4 | yes Evaluation Count:3 |
| 3-4 |
2400 | (*it)->save(s, 0, indent); executed: (*it)->save(s, 0, indent); Execution Count:4 | 4 |
2401 | | - |
2402 | s << ']'; | - |
2403 | } executed: } Execution Count:3 | 3 |
2404 | | - |
2405 | s << '>' << endl; | - |
2406 | } executed: } Execution Count:32 | 32 |
2407 | QDomDocumentType::QDomDocumentType() : QDomNode() | - |
2408 | { | - |
2409 | } executed: } Execution Count:18 | 18 |
2410 | QDomDocumentType::QDomDocumentType(const QDomDocumentType& n) | - |
2411 | : QDomNode(n) | - |
2412 | { | - |
2413 | } | 0 |
2414 | | - |
2415 | QDomDocumentType::QDomDocumentType(QDomDocumentTypePrivate* n) | - |
2416 | : QDomNode(n) | - |
2417 | { | - |
2418 | } executed: } Execution Count:12 | 12 |
2419 | QDomDocumentType& QDomDocumentType::operator= (const QDomDocumentType& n) | - |
2420 | { | - |
2421 | return (QDomDocumentType&) QDomNode::operator=(n); never executed: return (QDomDocumentType&) QDomNode::operator=(n); | 0 |
2422 | } | - |
2423 | | - |
2424 | | - |
2425 | | - |
2426 | | - |
2427 | | - |
2428 | | - |
2429 | | - |
2430 | QString QDomDocumentType::name() const | - |
2431 | { | - |
2432 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:10 |
| 0-10 |
2433 | return QString(); never executed: return QString(); | 0 |
2434 | return ((QDomDocumentTypePrivate*)impl)->nodeName(); executed: return ((QDomDocumentTypePrivate*)impl)->nodeName(); Execution Count:10 | 10 |
2435 | } | - |
2436 | | - |
2437 | | - |
2438 | | - |
2439 | | - |
2440 | QDomNamedNodeMap QDomDocumentType::entities() const | - |
2441 | { | - |
2442 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2443 | return QDomNamedNodeMap(); never executed: return QDomNamedNodeMap(); | 0 |
2444 | return QDomNamedNodeMap(((QDomDocumentTypePrivate*)impl)->entities); executed: return QDomNamedNodeMap(((QDomDocumentTypePrivate*)impl)->entities); Execution Count:1 | 1 |
2445 | } | - |
2446 | | - |
2447 | | - |
2448 | | - |
2449 | | - |
2450 | QDomNamedNodeMap QDomDocumentType::notations() const | - |
2451 | { | - |
2452 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2453 | return QDomNamedNodeMap(); never executed: return QDomNamedNodeMap(); | 0 |
2454 | return QDomNamedNodeMap(((QDomDocumentTypePrivate*)impl)->notations); executed: return QDomNamedNodeMap(((QDomDocumentTypePrivate*)impl)->notations); Execution Count:1 | 1 |
2455 | } | - |
2456 | | - |
2457 | | - |
2458 | | - |
2459 | | - |
2460 | | - |
2461 | | - |
2462 | | - |
2463 | QString QDomDocumentType::publicId() const | - |
2464 | { | - |
2465 | if (!impl) | 0 |
2466 | return QString(); never executed: return QString(); | 0 |
2467 | return ((QDomDocumentTypePrivate*)impl)->publicId; never executed: return ((QDomDocumentTypePrivate*)impl)->publicId; | 0 |
2468 | } | - |
2469 | | - |
2470 | | - |
2471 | | - |
2472 | | - |
2473 | | - |
2474 | | - |
2475 | | - |
2476 | QString QDomDocumentType::systemId() const | - |
2477 | { | - |
2478 | if (!impl) | 0 |
2479 | return QString(); never executed: return QString(); | 0 |
2480 | return ((QDomDocumentTypePrivate*)impl)->systemId; never executed: return ((QDomDocumentTypePrivate*)impl)->systemId; | 0 |
2481 | } | - |
2482 | | - |
2483 | | - |
2484 | | - |
2485 | | - |
2486 | | - |
2487 | | - |
2488 | | - |
2489 | QString QDomDocumentType::internalSubset() const | - |
2490 | { | - |
2491 | if (!impl) | 0 |
2492 | return QString(); never executed: return QString(); | 0 |
2493 | return ((QDomDocumentTypePrivate*)impl)->internalSubset; never executed: return ((QDomDocumentTypePrivate*)impl)->internalSubset; | 0 |
2494 | } | - |
2495 | QDomDocumentFragmentPrivate::QDomDocumentFragmentPrivate(QDomDocumentPrivate* doc, QDomNodePrivate* parent) | - |
2496 | : QDomNodePrivate(doc, parent) | - |
2497 | { | - |
2498 | name = QLatin1String("#document-fragment"); | - |
2499 | } executed: } Execution Count:19 | 19 |
2500 | | - |
2501 | QDomDocumentFragmentPrivate::QDomDocumentFragmentPrivate(QDomNodePrivate* n, bool deep) | - |
2502 | : QDomNodePrivate(n, deep) | - |
2503 | { | - |
2504 | } executed: } Execution Count:6 | 6 |
2505 | | - |
2506 | QDomNodePrivate* QDomDocumentFragmentPrivate::cloneNode(bool deep) | - |
2507 | { | - |
2508 | QDomNodePrivate* p = new QDomDocumentFragmentPrivate(this, deep); | - |
2509 | | - |
2510 | p->ref.deref(); | - |
2511 | return p; never executed: return p; | 0 |
2512 | } | - |
2513 | QDomDocumentFragment::QDomDocumentFragment() | - |
2514 | { | - |
2515 | } | - |
2516 | | - |
2517 | QDomDocumentFragment::QDomDocumentFragment(QDomDocumentFragmentPrivate* n) | - |
2518 | : QDomNode(n) | - |
2519 | { | - |
2520 | } executed: } Execution Count:19 | 19 |
2521 | QDomDocumentFragment::QDomDocumentFragment(const QDomDocumentFragment& x) | - |
2522 | : QDomNode(x) | - |
2523 | { | - |
2524 | } | 0 |
2525 | QDomDocumentFragment& QDomDocumentFragment::operator= (const QDomDocumentFragment& x) | - |
2526 | { | - |
2527 | return (QDomDocumentFragment&) QDomNode::operator=(x); never executed: return (QDomDocumentFragment&) QDomNode::operator=(x); | 0 |
2528 | } | - |
2529 | QDomCharacterDataPrivate::QDomCharacterDataPrivate(QDomDocumentPrivate* d, QDomNodePrivate* p, | - |
2530 | const QString& data) | - |
2531 | : QDomNodePrivate(d, p) | - |
2532 | { | - |
2533 | value = data; | - |
2534 | name = QLatin1String("#character-data"); | - |
2535 | } executed: } Execution Count:55284 | 55284 |
2536 | | - |
2537 | QDomCharacterDataPrivate::QDomCharacterDataPrivate(QDomCharacterDataPrivate* n, bool deep) | - |
2538 | : QDomNodePrivate(n, deep) | - |
2539 | { | - |
2540 | } executed: } Execution Count:19 | 19 |
2541 | | - |
2542 | QDomNodePrivate* QDomCharacterDataPrivate::cloneNode(bool deep) | - |
2543 | { | - |
2544 | QDomNodePrivate* p = new QDomCharacterDataPrivate(this, deep); | - |
2545 | | - |
2546 | p->ref.deref(); | - |
2547 | return p; never executed: return p; | 0 |
2548 | } | - |
2549 | | - |
2550 | int QDomCharacterDataPrivate::dataLength() const | - |
2551 | { | - |
2552 | return value.length(); never executed: return value.length(); | 0 |
2553 | } | - |
2554 | | - |
2555 | QString QDomCharacterDataPrivate::substringData(unsigned long offset, unsigned long n) const | - |
2556 | { | - |
2557 | return value.mid(offset, n); never executed: return value.mid(offset, n); | 0 |
2558 | } | - |
2559 | | - |
2560 | void QDomCharacterDataPrivate::insertData(unsigned long offset, const QString& arg) | - |
2561 | { | - |
2562 | value.insert(offset, arg); | - |
2563 | } | 0 |
2564 | | - |
2565 | void QDomCharacterDataPrivate::deleteData(unsigned long offset, unsigned long n) | - |
2566 | { | - |
2567 | value.remove(offset, n); | - |
2568 | } | 0 |
2569 | | - |
2570 | void QDomCharacterDataPrivate::replaceData(unsigned long offset, unsigned long n, const QString& arg) | - |
2571 | { | - |
2572 | value.replace(offset, n, arg); | - |
2573 | } | 0 |
2574 | | - |
2575 | void QDomCharacterDataPrivate::appendData(const QString& arg) | - |
2576 | { | - |
2577 | value += arg; | - |
2578 | } | 0 |
2579 | QDomCharacterData::QDomCharacterData() | - |
2580 | { | - |
2581 | } | - |
2582 | QDomCharacterData::QDomCharacterData(const QDomCharacterData& x) | - |
2583 | : QDomNode(x) | - |
2584 | { | - |
2585 | } | 0 |
2586 | | - |
2587 | QDomCharacterData::QDomCharacterData(QDomCharacterDataPrivate* n) | - |
2588 | : QDomNode(n) | - |
2589 | { | - |
2590 | } executed: } Execution Count:87 | 87 |
2591 | QDomCharacterData& QDomCharacterData::operator= (const QDomCharacterData& x) | - |
2592 | { | - |
2593 | return (QDomCharacterData&) QDomNode::operator=(x); never executed: return (QDomCharacterData&) QDomNode::operator=(x); | 0 |
2594 | } | - |
2595 | | - |
2596 | | - |
2597 | | - |
2598 | | - |
2599 | | - |
2600 | | - |
2601 | | - |
2602 | QString QDomCharacterData::data() const | - |
2603 | { | - |
2604 | if (!impl) | 0 |
2605 | return QString(); never executed: return QString(); | 0 |
2606 | return impl->nodeValue(); never executed: return impl->nodeValue(); | 0 |
2607 | } | - |
2608 | | - |
2609 | | - |
2610 | | - |
2611 | | - |
2612 | void QDomCharacterData::setData(const QString& v) | - |
2613 | { | - |
2614 | if (impl) | 0 |
2615 | impl->setNodeValue(v); never executed: impl->setNodeValue(v); | 0 |
2616 | } | 0 |
2617 | | - |
2618 | | - |
2619 | | - |
2620 | | - |
2621 | int QDomCharacterData::length() const | - |
2622 | { | - |
2623 | if (impl) | 0 |
2624 | return ((QDomCharacterDataPrivate*)impl)->dataLength(); never executed: return ((QDomCharacterDataPrivate*)impl)->dataLength(); | 0 |
2625 | return 0; never executed: return 0; | 0 |
2626 | } | - |
2627 | | - |
2628 | | - |
2629 | | - |
2630 | | - |
2631 | QString QDomCharacterData::substringData(unsigned long offset, unsigned long count) | - |
2632 | { | - |
2633 | if (!impl) | 0 |
2634 | return QString(); never executed: return QString(); | 0 |
2635 | return ((QDomCharacterDataPrivate*)impl)->substringData(offset, count); never executed: return ((QDomCharacterDataPrivate*)impl)->substringData(offset, count); | 0 |
2636 | } | - |
2637 | | - |
2638 | | - |
2639 | | - |
2640 | | - |
2641 | void QDomCharacterData::appendData(const QString& arg) | - |
2642 | { | - |
2643 | if (impl) | 0 |
2644 | ((QDomCharacterDataPrivate*)impl)->appendData(arg); never executed: ((QDomCharacterDataPrivate*)impl)->appendData(arg); | 0 |
2645 | } | 0 |
2646 | | - |
2647 | | - |
2648 | | - |
2649 | | - |
2650 | void QDomCharacterData::insertData(unsigned long offset, const QString& arg) | - |
2651 | { | - |
2652 | if (impl) | 0 |
2653 | ((QDomCharacterDataPrivate*)impl)->insertData(offset, arg); never executed: ((QDomCharacterDataPrivate*)impl)->insertData(offset, arg); | 0 |
2654 | } | 0 |
2655 | | - |
2656 | | - |
2657 | | - |
2658 | | - |
2659 | void QDomCharacterData::deleteData(unsigned long offset, unsigned long count) | - |
2660 | { | - |
2661 | if (impl) | 0 |
2662 | ((QDomCharacterDataPrivate*)impl)->deleteData(offset, count); never executed: ((QDomCharacterDataPrivate*)impl)->deleteData(offset, count); | 0 |
2663 | } | 0 |
2664 | | - |
2665 | | - |
2666 | | - |
2667 | | - |
2668 | | - |
2669 | void QDomCharacterData::replaceData(unsigned long offset, unsigned long count, const QString& arg) | - |
2670 | { | - |
2671 | if (impl) | 0 |
2672 | ((QDomCharacterDataPrivate*)impl)->replaceData(offset, count, arg); never executed: ((QDomCharacterDataPrivate*)impl)->replaceData(offset, count, arg); | 0 |
2673 | } | 0 |
2674 | | - |
2675 | | - |
2676 | | - |
2677 | | - |
2678 | | - |
2679 | | - |
2680 | QDomNode::NodeType QDomCharacterData::nodeType() const | - |
2681 | { | - |
2682 | if (!impl) | 0 |
2683 | return CharacterDataNode; never executed: return CharacterDataNode; | 0 |
2684 | return QDomNode::nodeType(); never executed: return QDomNode::nodeType(); | 0 |
2685 | } | - |
2686 | QDomAttrPrivate::QDomAttrPrivate(QDomDocumentPrivate* d, QDomNodePrivate* parent, const QString& name_) | - |
2687 | : QDomNodePrivate(d, parent) | - |
2688 | { | - |
2689 | name = name_; | - |
2690 | m_specified = false; | - |
2691 | } executed: } Execution Count:16771 | 16771 |
2692 | | - |
2693 | QDomAttrPrivate::QDomAttrPrivate(QDomDocumentPrivate* d, QDomNodePrivate* p, const QString& nsURI, const QString& qName) | - |
2694 | : QDomNodePrivate(d, p) | - |
2695 | { | - |
2696 | qt_split_namespace(prefix, name, qName, !nsURI.isNull()); | - |
2697 | namespaceURI = nsURI; | - |
2698 | createdWithDom1Interface = false; | - |
2699 | m_specified = false; | - |
2700 | } executed: } Execution Count:54 | 54 |
2701 | | - |
2702 | QDomAttrPrivate::QDomAttrPrivate(QDomAttrPrivate* n, bool deep) | - |
2703 | : QDomNodePrivate(n, deep) | - |
2704 | { | - |
2705 | m_specified = n->specified(); | - |
2706 | } executed: } Execution Count:13 | 13 |
2707 | | - |
2708 | void QDomAttrPrivate::setNodeValue(const QString& v) | - |
2709 | { | - |
2710 | value = v; | - |
2711 | QDomTextPrivate *t = new QDomTextPrivate(0, this, v); | - |
2712 | | - |
2713 | t->ref.deref(); | - |
2714 | if (first) { evaluated: first yes Evaluation Count:3 | yes Evaluation Count:16752 |
| 3-16752 |
2715 | delete removeChild(first); | - |
2716 | } executed: } Execution Count:3 | 3 |
2717 | appendChild(t); | - |
2718 | } executed: } Execution Count:16755 | 16755 |
2719 | | - |
2720 | QDomNodePrivate* QDomAttrPrivate::cloneNode(bool deep) | - |
2721 | { | - |
2722 | QDomNodePrivate* p = new QDomAttrPrivate(this, deep); | - |
2723 | | - |
2724 | p->ref.deref(); | - |
2725 | return p; executed: return p; Execution Count:1 | 1 |
2726 | } | - |
2727 | | - |
2728 | bool QDomAttrPrivate::specified() const | - |
2729 | { | - |
2730 | return m_specified; executed: return m_specified; Execution Count:13 | 13 |
2731 | } | - |
2732 | static QString encodeText(const QString &str, | - |
2733 | QTextStream &s, | - |
2734 | const bool encodeQuotes = true, | - |
2735 | const bool performAVN = false, | - |
2736 | const bool encodeEOLs = false) | - |
2737 | { | - |
2738 | | - |
2739 | | - |
2740 | | - |
2741 | const QTextCodec *const codec = s.codec(); | - |
2742 | qt_noop(); | - |
2743 | | - |
2744 | QString retval(str); | - |
2745 | int len = retval.length(); | - |
2746 | int i = 0; | - |
2747 | | - |
2748 | while (i < len) { evaluated: i < len yes Evaluation Count:927050 | yes Evaluation Count:44443 |
| 44443-927050 |
2749 | const QChar ati(retval.at(i)); | - |
2750 | | - |
2751 | if (ati == QLatin1Char('<')) { evaluated: ati == QLatin1Char('<') yes Evaluation Count:904 | yes Evaluation Count:926146 |
| 904-926146 |
2752 | retval.replace(i, 1, QLatin1String("<")); | - |
2753 | len += 3; | - |
2754 | i += 4; | - |
2755 | } else if (encodeQuotes && (ati == QLatin1Char('"'))) { evaluated: encodeQuotes yes Evaluation Count:135279 | yes Evaluation Count:790867 |
partially evaluated: (ati == QLatin1Char('"')) no Evaluation Count:0 | yes Evaluation Count:135279 |
executed: } Execution Count:904 | 0-790867 |
2756 | retval.replace(i, 1, QLatin1String(""")); | - |
2757 | len += 5; | - |
2758 | i += 6; | - |
2759 | } else if (ati == QLatin1Char('&')) { evaluated: ati == QLatin1Char('&') yes Evaluation Count:466 | yes Evaluation Count:925680 |
| 0-925680 |
2760 | retval.replace(i, 1, QLatin1String("&")); | - |
2761 | len += 4; | - |
2762 | i += 5; | - |
2763 | } else if (ati == QLatin1Char('>') && i >= 2 && retval[i - 1] == QLatin1Char(']') && retval[i - 2] == QLatin1Char(']')) { evaluated: ati == QLatin1Char('>') yes Evaluation Count:821 | yes Evaluation Count:924859 |
evaluated: i >= 2 yes Evaluation Count:819 | yes Evaluation Count:2 |
evaluated: retval[i - 1] == QLatin1Char(']') yes Evaluation Count:144 | yes Evaluation Count:675 |
partially evaluated: retval[i - 2] == QLatin1Char(']') yes Evaluation Count:144 | no Evaluation Count:0 |
executed: } Execution Count:466 | 0-924859 |
2764 | retval.replace(i, 1, QLatin1String(">")); | - |
2765 | len += 3; | - |
2766 | i += 4; | - |
2767 | } else if (performAVN && evaluated: performAVN yes Evaluation Count:135177 | yes Evaluation Count:790359 |
executed: } Execution Count:144 | 144-790359 |
2768 | (ati == QChar(0xA) || evaluated: ati == QChar(0xA) yes Evaluation Count:12 | yes Evaluation Count:135165 |
| 12-135165 |
2769 | ati == QChar(0xD) || evaluated: ati == QChar(0xD) yes Evaluation Count:1 | yes Evaluation Count:135164 |
| 1-135164 |
2770 | ati == QChar(0x9))) { evaluated: ati == QChar(0x9) yes Evaluation Count:34 | yes Evaluation Count:135130 |
| 34-135130 |
2771 | const QString replacement(QLatin1String("&#x") + QString::number(ati.unicode(), 16) + QLatin1Char(';')); | - |
2772 | retval.replace(i, 1, replacement); | - |
2773 | i += replacement.length(); | - |
2774 | len += replacement.length() - 1; | - |
2775 | } else if (encodeEOLs && ati == QChar(0xD)) { evaluated: encodeEOLs yes Evaluation Count:790257 | yes Evaluation Count:135232 |
evaluated: ati == QChar(0xD) yes Evaluation Count:11794 | yes Evaluation Count:778463 |
executed: } Execution Count:47 | 47-790257 |
2776 | retval.replace(i, 1, QLatin1String("
")); | - |
2777 | len += 4; | - |
2778 | i += 5; | - |
2779 | } else { executed: } Execution Count:11794 | 11794 |
2780 | | - |
2781 | if(codec->canEncode(ati)) partially evaluated: codec->canEncode(ati) yes Evaluation Count:913695 | no Evaluation Count:0 |
| 0-913695 |
2782 | ++i; executed: ++i; Execution Count:913695 | 913695 |
2783 | else | - |
2784 | | - |
2785 | { | - |
2786 | | - |
2787 | const ushort codepoint(ati.unicode()); | - |
2788 | const QString replacement(QLatin1String("&#x") + QString::number(codepoint, 16) + QLatin1Char(';')); | - |
2789 | retval.replace(i, 1, replacement); | - |
2790 | i += replacement.length(); | - |
2791 | len += replacement.length() - 1; | - |
2792 | } | 0 |
2793 | } | - |
2794 | } | - |
2795 | | - |
2796 | return retval; executed: return retval; Execution Count:44443 | 44443 |
2797 | } | - |
2798 | | - |
2799 | void QDomAttrPrivate::save(QTextStream& s, int, int) const | - |
2800 | { | - |
2801 | if (namespaceURI.isNull()) { never evaluated: namespaceURI.isNull() | 0 |
2802 | s << name << "=\"" << encodeText(value, s, true, true) << '\"'; | - |
2803 | } else { | 0 |
2804 | s << prefix << ':' << name << "=\"" << encodeText(value, s, true, true) << '\"'; | - |
2805 | if(!ownerNode || never evaluated: !ownerNode | 0 |
2806 | ownerNode->prefix != prefix) { never evaluated: ownerNode->prefix != prefix | 0 |
2807 | s << " xmlns:" << prefix << "=\"" << encodeText(namespaceURI, s, true, true) << '\"'; | - |
2808 | } | 0 |
2809 | } | 0 |
2810 | } | - |
2811 | QDomAttr::QDomAttr() | - |
2812 | { | - |
2813 | } | - |
2814 | QDomAttr::QDomAttr(const QDomAttr& x) | - |
2815 | : QDomNode(x) | - |
2816 | { | - |
2817 | } | 0 |
2818 | | - |
2819 | QDomAttr::QDomAttr(QDomAttrPrivate* n) | - |
2820 | : QDomNode(n) | - |
2821 | { | - |
2822 | } executed: } Execution Count:107 | 107 |
2823 | QDomAttr& QDomAttr::operator= (const QDomAttr& x) | - |
2824 | { | - |
2825 | return (QDomAttr&) QDomNode::operator=(x); never executed: return (QDomAttr&) QDomNode::operator=(x); | 0 |
2826 | } | - |
2827 | | - |
2828 | | - |
2829 | | - |
2830 | | - |
2831 | QString QDomAttr::name() const | - |
2832 | { | - |
2833 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:24 |
| 0-24 |
2834 | return QString(); never executed: return QString(); | 0 |
2835 | return impl->nodeName(); executed: return impl->nodeName(); Execution Count:24 | 24 |
2836 | } | - |
2837 | | - |
2838 | | - |
2839 | | - |
2840 | | - |
2841 | | - |
2842 | | - |
2843 | | - |
2844 | bool QDomAttr::specified() const | - |
2845 | { | - |
2846 | if (!impl) | 0 |
2847 | return false; never executed: return false; | 0 |
2848 | return ((QDomAttrPrivate*)impl)->specified(); never executed: return ((QDomAttrPrivate*)impl)->specified(); | 0 |
2849 | } | - |
2850 | | - |
2851 | | - |
2852 | | - |
2853 | | - |
2854 | | - |
2855 | | - |
2856 | QDomElement QDomAttr::ownerElement() const | - |
2857 | { | - |
2858 | qt_noop(); | - |
2859 | if (!impl->parent()->isElement()) partially evaluated: !impl->parent()->isElement() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
2860 | return QDomElement(); never executed: return QDomElement(); | 0 |
2861 | return QDomElement((QDomElementPrivate*)(impl->parent())); executed: return QDomElement((QDomElementPrivate*)(impl->parent())); Execution Count:2 | 2 |
2862 | } | - |
2863 | | - |
2864 | | - |
2865 | | - |
2866 | | - |
2867 | | - |
2868 | | - |
2869 | | - |
2870 | QString QDomAttr::value() const | - |
2871 | { | - |
2872 | if (!impl) | 0 |
2873 | return QString(); never executed: return QString(); | 0 |
2874 | return impl->nodeValue(); never executed: return impl->nodeValue(); | 0 |
2875 | } | - |
2876 | | - |
2877 | | - |
2878 | | - |
2879 | | - |
2880 | | - |
2881 | | - |
2882 | void QDomAttr::setValue(const QString& v) | - |
2883 | { | - |
2884 | if (!impl) | 0 |
2885 | return; | 0 |
2886 | impl->setNodeValue(v); | - |
2887 | ((QDomAttrPrivate*)impl)->m_specified = true; | - |
2888 | } | 0 |
2889 | QDomElementPrivate::QDomElementPrivate(QDomDocumentPrivate* d, QDomNodePrivate* p, | - |
2890 | const QString& tagname) | - |
2891 | : QDomNodePrivate(d, p) | - |
2892 | { | - |
2893 | name = tagname; | - |
2894 | m_attr = new QDomNamedNodeMapPrivate(this); | - |
2895 | } executed: } Execution Count:37918 | 37918 |
2896 | | - |
2897 | QDomElementPrivate::QDomElementPrivate(QDomDocumentPrivate* d, QDomNodePrivate* p, | - |
2898 | const QString& nsURI, const QString& qName) | - |
2899 | : QDomNodePrivate(d, p) | - |
2900 | { | - |
2901 | qt_split_namespace(prefix, name, qName, !nsURI.isNull()); | - |
2902 | namespaceURI = nsURI; | - |
2903 | createdWithDom1Interface = false; | - |
2904 | m_attr = new QDomNamedNodeMapPrivate(this); | - |
2905 | } executed: } Execution Count:112 | 112 |
2906 | | - |
2907 | QDomElementPrivate::QDomElementPrivate(QDomElementPrivate* n, bool deep) : | - |
2908 | QDomNodePrivate(n, deep) | - |
2909 | { | - |
2910 | m_attr = n->m_attr->clone(this); | - |
2911 | | - |
2912 | m_attr->ref.ref(); | - |
2913 | } executed: } Execution Count:63 | 63 |
2914 | | - |
2915 | QDomElementPrivate::~QDomElementPrivate() | - |
2916 | { | - |
2917 | if (!m_attr->ref.deref()) partially evaluated: !m_attr->ref.deref() yes Evaluation Count:38093 | no Evaluation Count:0 |
| 0-38093 |
2918 | delete m_attr; executed: delete m_attr; Execution Count:38093 | 38093 |
2919 | } executed: } Execution Count:38093 | 38093 |
2920 | | - |
2921 | QDomNodePrivate* QDomElementPrivate::cloneNode(bool deep) | - |
2922 | { | - |
2923 | QDomNodePrivate* p = new QDomElementPrivate(this, deep); | - |
2924 | | - |
2925 | p->ref.deref(); | - |
2926 | return p; executed: return p; Execution Count:50 | 50 |
2927 | } | - |
2928 | | - |
2929 | QString QDomElementPrivate::attribute(const QString& name_, const QString& defValue) const | - |
2930 | { | - |
2931 | QDomNodePrivate* n = m_attr->namedItem(name_); | - |
2932 | if (!n) partially evaluated: !n no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
2933 | return defValue; never executed: return defValue; | 0 |
2934 | | - |
2935 | return n->nodeValue(); executed: return n->nodeValue(); Execution Count:1 | 1 |
2936 | } | - |
2937 | | - |
2938 | QString QDomElementPrivate::attributeNS(const QString& nsURI, const QString& localName, const QString& defValue) const | - |
2939 | { | - |
2940 | QDomNodePrivate* n = m_attr->namedItemNS(nsURI, localName); | - |
2941 | if (!n) | 0 |
2942 | return defValue; never executed: return defValue; | 0 |
2943 | | - |
2944 | return n->nodeValue(); never executed: return n->nodeValue(); | 0 |
2945 | } | - |
2946 | | - |
2947 | void QDomElementPrivate::setAttribute(const QString& aname, const QString& newValue) | - |
2948 | { | - |
2949 | QDomNodePrivate* n = m_attr->namedItem(aname); | - |
2950 | if (!n) { evaluated: !n yes Evaluation Count:16739 | yes Evaluation Count:3 |
| 3-16739 |
2951 | n = new QDomAttrPrivate(ownerDocument(), this, aname); | - |
2952 | n->setNodeValue(newValue); | - |
2953 | | - |
2954 | | - |
2955 | | - |
2956 | n->ref.deref(); | - |
2957 | m_attr->setNamedItem(n); | - |
2958 | } else { executed: } Execution Count:16739 | 16739 |
2959 | n->setNodeValue(newValue); | - |
2960 | } executed: } Execution Count:3 | 3 |
2961 | } | - |
2962 | | - |
2963 | void QDomElementPrivate::setAttributeNS(const QString& nsURI, const QString& qName, const QString& newValue) | - |
2964 | { | - |
2965 | QString prefix, localName; | - |
2966 | qt_split_namespace(prefix, localName, qName, true); | - |
2967 | QDomNodePrivate* n = m_attr->namedItemNS(nsURI, localName); | - |
2968 | if (!n) { partially evaluated: !n yes Evaluation Count:13 | no Evaluation Count:0 |
| 0-13 |
2969 | n = new QDomAttrPrivate(ownerDocument(), this, nsURI, qName); | - |
2970 | n->setNodeValue(newValue); | - |
2971 | | - |
2972 | | - |
2973 | | - |
2974 | n->ref.deref(); | - |
2975 | m_attr->setNamedItem(n); | - |
2976 | } else { executed: } Execution Count:13 | 13 |
2977 | n->setNodeValue(newValue); | - |
2978 | n->prefix = prefix; | - |
2979 | } | 0 |
2980 | } | - |
2981 | | - |
2982 | void QDomElementPrivate::removeAttribute(const QString& aname) | - |
2983 | { | - |
2984 | QDomNodePrivate* p = m_attr->removeNamedItem(aname); | - |
2985 | if (p && p->ref.load() == 0) never evaluated: p->ref.load() == 0 | 0 |
2986 | delete p; never executed: delete p; | 0 |
2987 | } | 0 |
2988 | | - |
2989 | QDomAttrPrivate* QDomElementPrivate::attributeNode(const QString& aname) | - |
2990 | { | - |
2991 | return (QDomAttrPrivate*)m_attr->namedItem(aname); never executed: return (QDomAttrPrivate*)m_attr->namedItem(aname); | 0 |
2992 | } | - |
2993 | | - |
2994 | QDomAttrPrivate* QDomElementPrivate::attributeNodeNS(const QString& nsURI, const QString& localName) | - |
2995 | { | - |
2996 | return (QDomAttrPrivate*)m_attr->namedItemNS(nsURI, localName); never executed: return (QDomAttrPrivate*)m_attr->namedItemNS(nsURI, localName); | 0 |
2997 | } | - |
2998 | | - |
2999 | QDomAttrPrivate* QDomElementPrivate::setAttributeNode(QDomAttrPrivate* newAttr) | - |
3000 | { | - |
3001 | QDomNodePrivate* n = m_attr->namedItem(newAttr->nodeName()); | - |
3002 | | - |
3003 | | - |
3004 | m_attr->setNamedItem(newAttr); | - |
3005 | | - |
3006 | newAttr->setParent(this); | - |
3007 | | - |
3008 | return (QDomAttrPrivate*)n; executed: return (QDomAttrPrivate*)n; Execution Count:1 | 1 |
3009 | } | - |
3010 | | - |
3011 | QDomAttrPrivate* QDomElementPrivate::setAttributeNodeNS(QDomAttrPrivate* newAttr) | - |
3012 | { | - |
3013 | QDomNodePrivate* n = 0; | - |
3014 | if (!newAttr->prefix.isNull()) never evaluated: !newAttr->prefix.isNull() | 0 |
3015 | n = m_attr->namedItemNS(newAttr->namespaceURI, newAttr->name); never executed: n = m_attr->namedItemNS(newAttr->namespaceURI, newAttr->name); | 0 |
3016 | | - |
3017 | | - |
3018 | m_attr->setNamedItem(newAttr); | - |
3019 | | - |
3020 | return (QDomAttrPrivate*)n; never executed: return (QDomAttrPrivate*)n; | 0 |
3021 | } | - |
3022 | | - |
3023 | QDomAttrPrivate* QDomElementPrivate::removeAttributeNode(QDomAttrPrivate* oldAttr) | - |
3024 | { | - |
3025 | return (QDomAttrPrivate*)m_attr->removeNamedItem(oldAttr->nodeName()); never executed: return (QDomAttrPrivate*)m_attr->removeNamedItem(oldAttr->nodeName()); | 0 |
3026 | } | - |
3027 | | - |
3028 | bool QDomElementPrivate::hasAttribute(const QString& aname) | - |
3029 | { | - |
3030 | return m_attr->contains(aname); never executed: return m_attr->contains(aname); | 0 |
3031 | } | - |
3032 | | - |
3033 | bool QDomElementPrivate::hasAttributeNS(const QString& nsURI, const QString& localName) | - |
3034 | { | - |
3035 | return m_attr->containsNS(nsURI, localName); never executed: return m_attr->containsNS(nsURI, localName); | 0 |
3036 | } | - |
3037 | | - |
3038 | QString QDomElementPrivate::text() | - |
3039 | { | - |
3040 | QString t(QLatin1String("")); | - |
3041 | | - |
3042 | QDomNodePrivate* p = first; | - |
3043 | while (p) { evaluated: p yes Evaluation Count:1 | yes Evaluation Count:1 |
| 1 |
3044 | if (p->isText() || p->isCDATASection()) partially evaluated: p->isText() yes Evaluation Count:1 | no Evaluation Count:0 |
never evaluated: p->isCDATASection() | 0-1 |
3045 | t += p->nodeValue(); executed: t += p->nodeValue(); Execution Count:1 | 1 |
3046 | else if (p->isElement()) never evaluated: p->isElement() | 0 |
3047 | t += ((QDomElementPrivate*)p)->text(); never executed: t += ((QDomElementPrivate*)p)->text(); | 0 |
3048 | p = p->next; | - |
3049 | } executed: } Execution Count:1 | 1 |
3050 | | - |
3051 | return t; executed: return t; Execution Count:1 | 1 |
3052 | } | - |
3053 | | - |
3054 | void QDomElementPrivate::save(QTextStream& s, int depth, int indent) const | - |
3055 | { | - |
3056 | if (!(prev && prev->isText())) evaluated: prev yes Evaluation Count:22096 | yes Evaluation Count:9362 |
evaluated: prev->isText() yes Evaluation Count:9268 | yes Evaluation Count:12828 |
| 9268-22096 |
3057 | s << QString(indent < 1 ? 0 : depth * indent, QLatin1Char(' ')); executed: s << QString(indent < 1 ? 0 : depth * indent, QLatin1Char(' ')); Execution Count:22190 | 22190 |
3058 | | - |
3059 | QString qName(name); | - |
3060 | QString nsDecl(QLatin1String("")); | - |
3061 | if (!namespaceURI.isNull()) { evaluated: !namespaceURI.isNull() yes Evaluation Count:6 | yes Evaluation Count:31452 |
| 6-31452 |
3062 | if (prefix.isEmpty()) { evaluated: prefix.isEmpty() yes Evaluation Count:3 | yes Evaluation Count:3 |
| 3 |
3063 | nsDecl = QLatin1String(" xmlns"); | - |
3064 | } else { executed: } Execution Count:3 | 3 |
3065 | qName = prefix + QLatin1Char(':') + name; | - |
3066 | nsDecl = QLatin1String(" xmlns:") + prefix; | - |
3067 | } executed: } Execution Count:3 | 3 |
3068 | nsDecl += QLatin1String("=\"") + encodeText(namespaceURI, s) + QLatin1Char('\"'); | - |
3069 | } executed: } Execution Count:6 | 6 |
3070 | s << '<' << qName << nsDecl; | - |
3071 | | - |
3072 | QSet<QString> outputtedPrefixes; | - |
3073 | | - |
3074 | | - |
3075 | if (!m_attr->map.isEmpty()) { evaluated: !m_attr->map.isEmpty() yes Evaluation Count:12068 | yes Evaluation Count:19390 |
| 12068-19390 |
3076 | QHash<QString, QDomNodePrivate *>::const_iterator it = m_attr->map.constBegin(); | - |
3077 | for (; it != m_attr->map.constEnd(); ++it) { evaluated: it != m_attr->map.constEnd() yes Evaluation Count:13845 | yes Evaluation Count:12068 |
| 12068-13845 |
3078 | s << ' '; | - |
3079 | if (it.value()->namespaceURI.isNull()) { evaluated: it.value()->namespaceURI.isNull() yes Evaluation Count:13838 | yes Evaluation Count:7 |
| 7-13838 |
3080 | s << it.value()->name << "=\"" << encodeText(it.value()->value, s, true, true) << '\"'; | - |
3081 | } else { executed: } Execution Count:13838 | 13838 |
3082 | s << it.value()->prefix << ':' << it.value()->name << "=\"" << encodeText(it.value()->value, s, true, true) << '\"'; | - |
3083 | if((!it.value()->ownerNode || partially evaluated: !it.value()->ownerNode no Evaluation Count:0 | yes Evaluation Count:7 |
| 0-7 |
3084 | it.value()->ownerNode->prefix != it.value()->prefix) && evaluated: it.value()->ownerNode->prefix != it.value()->prefix yes Evaluation Count:5 | yes Evaluation Count:2 |
| 2-5 |
3085 | !outputtedPrefixes.contains(it.value()->prefix)) { evaluated: !outputtedPrefixes.contains(it.value()->prefix) yes Evaluation Count:4 | yes Evaluation Count:1 |
| 1-4 |
3086 | s << " xmlns:" << it.value()->prefix << "=\"" << encodeText(it.value()->namespaceURI, s, true, true) << '\"'; | - |
3087 | outputtedPrefixes.insert(it.value()->prefix); | - |
3088 | } executed: } Execution Count:4 | 4 |
3089 | } executed: } Execution Count:7 | 7 |
3090 | } | - |
3091 | } executed: } Execution Count:12068 | 12068 |
3092 | | - |
3093 | if (last) { evaluated: last yes Evaluation Count:30172 | yes Evaluation Count:1286 |
| 1286-30172 |
3094 | | - |
3095 | if (first->isText()) evaluated: first->isText() yes Evaluation Count:20875 | yes Evaluation Count:9297 |
| 9297-20875 |
3096 | s << '>'; executed: s << '>'; Execution Count:20875 | 20875 |
3097 | else { | - |
3098 | s << '>'; | - |
3099 | | - |
3100 | | - |
3101 | if (indent != -1) evaluated: indent != -1 yes Evaluation Count:9296 | yes Evaluation Count:1 |
| 1-9296 |
3102 | s << endl; executed: s << endl; Execution Count:9296 | 9296 |
3103 | } executed: } Execution Count:9297 | 9297 |
3104 | QDomNodePrivate::save(s, depth + 1, indent); if (!last->isText()) evaluated: !last->isText() yes Evaluation Count:9120 | yes Evaluation Count:21052 |
| 9120-21052 |
3105 | s << QString(indent < 1 ? 0 : depth * indent, QLatin1Char(' ')); executed: s << QString(indent < 1 ? 0 : depth * indent, QLatin1Char(' ')); Execution Count:9120 | 9120 |
3106 | | - |
3107 | s << "</" << qName << '>'; | - |
3108 | } else { executed: } Execution Count:30172 | 30172 |
3109 | s << "/>"; | - |
3110 | } executed: } Execution Count:1286 | 1286 |
3111 | if (!(next && next->isText())) { evaluated: next yes Evaluation Count:22424 | yes Evaluation Count:9034 |
evaluated: next->isText() yes Evaluation Count:9533 | yes Evaluation Count:12891 |
| 9034-22424 |
3112 | | - |
3113 | if (indent != -1) evaluated: indent != -1 yes Evaluation Count:21923 | yes Evaluation Count:2 |
| 2-21923 |
3114 | s << endl; executed: s << endl; Execution Count:21923 | 21923 |
3115 | } executed: } Execution Count:21925 | 21925 |
3116 | } executed: } Execution Count:31458 | 31458 |
3117 | QDomElement::QDomElement() | - |
3118 | : QDomNode() | - |
3119 | { | - |
3120 | } executed: } Execution Count:10 | 10 |
3121 | QDomElement::QDomElement(const QDomElement& x) | - |
3122 | : QDomNode(x) | - |
3123 | { | - |
3124 | } executed: } Execution Count:12 | 12 |
3125 | | - |
3126 | QDomElement::QDomElement(QDomElementPrivate* n) | - |
3127 | : QDomNode(n) | - |
3128 | { | - |
3129 | } executed: } Execution Count:253 | 253 |
3130 | QDomElement& QDomElement::operator= (const QDomElement& x) | - |
3131 | { | - |
3132 | return (QDomElement&) QDomNode::operator=(x); never executed: return (QDomElement&) QDomNode::operator=(x); | 0 |
3133 | } | - |
3134 | void QDomElement::setTagName(const QString& name) | - |
3135 | { | - |
3136 | if (impl) | 0 |
3137 | impl->name = name; never executed: impl->name = name; | 0 |
3138 | } | 0 |
3139 | QString QDomElement::tagName() const | - |
3140 | { | - |
3141 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:45 |
| 0-45 |
3142 | return QString(); never executed: return QString(); | 0 |
3143 | return impl->nodeName(); executed: return impl->nodeName(); Execution Count:45 | 45 |
3144 | } | - |
3145 | | - |
3146 | | - |
3147 | | - |
3148 | | - |
3149 | | - |
3150 | | - |
3151 | | - |
3152 | QDomNamedNodeMap QDomElement::attributes() const | - |
3153 | { | - |
3154 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3155 | return QDomNamedNodeMap(); never executed: return QDomNamedNodeMap(); | 0 |
3156 | return QDomNamedNodeMap(((QDomElementPrivate*)impl)->attributes()); executed: return QDomNamedNodeMap(((QDomElementPrivate*)impl)->attributes()); Execution Count:1 | 1 |
3157 | } | - |
3158 | | - |
3159 | | - |
3160 | | - |
3161 | | - |
3162 | | - |
3163 | | - |
3164 | | - |
3165 | QString QDomElement::attribute(const QString& name, const QString& defValue) const | - |
3166 | { | - |
3167 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3168 | return defValue; never executed: return defValue; | 0 |
3169 | return ((QDomElementPrivate*)impl)->attribute(name, defValue); executed: return ((QDomElementPrivate*)impl)->attribute(name, defValue); Execution Count:1 | 1 |
3170 | } | - |
3171 | void QDomElement::setAttribute(const QString& name, const QString& value) | - |
3172 | { | - |
3173 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:3 |
| 0-3 |
3174 | return; | 0 |
3175 | ((QDomElementPrivate*)impl)->setAttribute(name, value); | - |
3176 | } executed: } Execution Count:3 | 3 |
3177 | void QDomElement::setAttribute(const QString& name, qlonglong value) | - |
3178 | { | - |
3179 | if (!impl) | 0 |
3180 | return; | 0 |
3181 | QString x; | - |
3182 | x.setNum(value); | - |
3183 | ((QDomElementPrivate*)impl)->setAttribute(name, x); | - |
3184 | } | 0 |
3185 | | - |
3186 | | - |
3187 | | - |
3188 | | - |
3189 | | - |
3190 | | - |
3191 | void QDomElement::setAttribute(const QString& name, qulonglong value) | - |
3192 | { | - |
3193 | if (!impl) | 0 |
3194 | return; | 0 |
3195 | QString x; | - |
3196 | x.setNum(value); | - |
3197 | ((QDomElementPrivate*)impl)->setAttribute(name, x); | - |
3198 | } | 0 |
3199 | | - |
3200 | | - |
3201 | | - |
3202 | | - |
3203 | | - |
3204 | | - |
3205 | void QDomElement::setAttribute(const QString& name, float value) | - |
3206 | { | - |
3207 | if (!impl) | 0 |
3208 | return; | 0 |
3209 | QString x; | - |
3210 | x.setNum(value); | - |
3211 | ((QDomElementPrivate*)impl)->setAttribute(name, x); | - |
3212 | } | 0 |
3213 | | - |
3214 | | - |
3215 | | - |
3216 | | - |
3217 | | - |
3218 | | - |
3219 | void QDomElement::setAttribute(const QString& name, double value) | - |
3220 | { | - |
3221 | if (!impl) | 0 |
3222 | return; | 0 |
3223 | QString x; | - |
3224 | char buf[256]; | - |
3225 | int count = qsnprintf(buf, sizeof(buf), "%.16g", value); | - |
3226 | if (count > 0) never evaluated: count > 0 | 0 |
3227 | x = QString::fromLatin1(buf, count); never executed: x = QString::fromLatin1(buf, count); | 0 |
3228 | else | - |
3229 | x.setNum(value); never executed: x.setNum(value); | 0 |
3230 | ((QDomElementPrivate*)impl)->setAttribute(name, x); | - |
3231 | } | 0 |
3232 | | - |
3233 | | - |
3234 | | - |
3235 | | - |
3236 | | - |
3237 | | - |
3238 | void QDomElement::removeAttribute(const QString& name) | - |
3239 | { | - |
3240 | if (!impl) | 0 |
3241 | return; | 0 |
3242 | ((QDomElementPrivate*)impl)->removeAttribute(name); | - |
3243 | } | 0 |
3244 | QDomAttr QDomElement::attributeNode(const QString& name) | - |
3245 | { | - |
3246 | if (!impl) | 0 |
3247 | return QDomAttr(); never executed: return QDomAttr(); | 0 |
3248 | return QDomAttr(((QDomElementPrivate*)impl)->attributeNode(name)); never executed: return QDomAttr(((QDomElementPrivate*)impl)->attributeNode(name)); | 0 |
3249 | } | - |
3250 | QDomAttr QDomElement::setAttributeNode(const QDomAttr& newAttr) | - |
3251 | { | - |
3252 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3253 | return QDomAttr(); never executed: return QDomAttr(); | 0 |
3254 | return QDomAttr(((QDomElementPrivate*)impl)->setAttributeNode(((QDomAttrPrivate*)newAttr.impl))); executed: return QDomAttr(((QDomElementPrivate*)impl)->setAttributeNode(((QDomAttrPrivate*)newAttr.impl))); Execution Count:1 | 1 |
3255 | } | - |
3256 | | - |
3257 | | - |
3258 | | - |
3259 | | - |
3260 | | - |
3261 | | - |
3262 | QDomAttr QDomElement::removeAttributeNode(const QDomAttr& oldAttr) | - |
3263 | { | - |
3264 | if (!impl) | 0 |
3265 | return QDomAttr(); never executed: return QDomAttr(); | 0 |
3266 | return QDomAttr(((QDomElementPrivate*)impl)->removeAttributeNode(((QDomAttrPrivate*)oldAttr.impl))); never executed: return QDomAttr(((QDomElementPrivate*)impl)->removeAttributeNode(((QDomAttrPrivate*)oldAttr.impl))); | 0 |
3267 | } | - |
3268 | QDomNodeList QDomElement::elementsByTagName(const QString& tagname) const | - |
3269 | { | - |
3270 | return QDomNodeList(new QDomNodeListPrivate(impl, tagname)); never executed: return QDomNodeList(new QDomNodeListPrivate(impl, tagname)); | 0 |
3271 | } | - |
3272 | bool QDomElement::hasAttribute(const QString& name) const | - |
3273 | { | - |
3274 | if (!impl) | 0 |
3275 | return false; never executed: return false; | 0 |
3276 | return ((QDomElementPrivate*)impl)->hasAttribute(name); never executed: return ((QDomElementPrivate*)impl)->hasAttribute(name); | 0 |
3277 | } | - |
3278 | QString QDomElement::attributeNS(const QString nsURI, const QString& localName, const QString& defValue) const | - |
3279 | { | - |
3280 | if (!impl) | 0 |
3281 | return defValue; never executed: return defValue; | 0 |
3282 | return ((QDomElementPrivate*)impl)->attributeNS(nsURI, localName, defValue); never executed: return ((QDomElementPrivate*)impl)->attributeNS(nsURI, localName, defValue); | 0 |
3283 | } | - |
3284 | void QDomElement::setAttributeNS(const QString nsURI, const QString& qName, const QString& value) | - |
3285 | { | - |
3286 | if (!impl) | 0 |
3287 | return; | 0 |
3288 | ((QDomElementPrivate*)impl)->setAttributeNS(nsURI, qName, value); | - |
3289 | } | 0 |
3290 | void QDomElement::setAttributeNS(const QString nsURI, const QString& qName, qlonglong value) | - |
3291 | { | - |
3292 | if (!impl) | 0 |
3293 | return; | 0 |
3294 | QString x; | - |
3295 | x.setNum(value); | - |
3296 | ((QDomElementPrivate*)impl)->setAttributeNS(nsURI, qName, x); | - |
3297 | } | 0 |
3298 | | - |
3299 | | - |
3300 | | - |
3301 | | - |
3302 | void QDomElement::setAttributeNS(const QString nsURI, const QString& qName, qulonglong value) | - |
3303 | { | - |
3304 | if (!impl) | 0 |
3305 | return; | 0 |
3306 | QString x; | - |
3307 | x.setNum(value); | - |
3308 | ((QDomElementPrivate*)impl)->setAttributeNS(nsURI, qName, x); | - |
3309 | } | 0 |
3310 | | - |
3311 | | - |
3312 | | - |
3313 | | - |
3314 | void QDomElement::setAttributeNS(const QString nsURI, const QString& qName, double value) | - |
3315 | { | - |
3316 | if (!impl) | 0 |
3317 | return; | 0 |
3318 | QString x; | - |
3319 | x.setNum(value); | - |
3320 | ((QDomElementPrivate*)impl)->setAttributeNS(nsURI, qName, x); | - |
3321 | } | 0 |
3322 | | - |
3323 | | - |
3324 | | - |
3325 | | - |
3326 | | - |
3327 | | - |
3328 | | - |
3329 | void QDomElement::removeAttributeNS(const QString& nsURI, const QString& localName) | - |
3330 | { | - |
3331 | if (!impl) | 0 |
3332 | return; | 0 |
3333 | QDomNodePrivate *n = ((QDomElementPrivate*)impl)->attributeNodeNS(nsURI, localName); | - |
3334 | if (!n) | 0 |
3335 | return; | 0 |
3336 | ((QDomElementPrivate*)impl)->removeAttribute(n->nodeName()); | - |
3337 | } | 0 |
3338 | QDomAttr QDomElement::attributeNodeNS(const QString& nsURI, const QString& localName) | - |
3339 | { | - |
3340 | if (!impl) | 0 |
3341 | return QDomAttr(); never executed: return QDomAttr(); | 0 |
3342 | return QDomAttr(((QDomElementPrivate*)impl)->attributeNodeNS(nsURI, localName)); never executed: return QDomAttr(((QDomElementPrivate*)impl)->attributeNodeNS(nsURI, localName)); | 0 |
3343 | } | - |
3344 | QDomAttr QDomElement::setAttributeNodeNS(const QDomAttr& newAttr) | - |
3345 | { | - |
3346 | if (!impl) | 0 |
3347 | return QDomAttr(); never executed: return QDomAttr(); | 0 |
3348 | return QDomAttr(((QDomElementPrivate*)impl)->setAttributeNodeNS(((QDomAttrPrivate*)newAttr.impl))); never executed: return QDomAttr(((QDomElementPrivate*)impl)->setAttributeNodeNS(((QDomAttrPrivate*)newAttr.impl))); | 0 |
3349 | } | - |
3350 | QDomNodeList QDomElement::elementsByTagNameNS(const QString& nsURI, const QString& localName) const | - |
3351 | { | - |
3352 | return QDomNodeList(new QDomNodeListPrivate(impl, nsURI, localName)); never executed: return QDomNodeList(new QDomNodeListPrivate(impl, nsURI, localName)); | 0 |
3353 | } | - |
3354 | | - |
3355 | | - |
3356 | | - |
3357 | | - |
3358 | | - |
3359 | | - |
3360 | bool QDomElement::hasAttributeNS(const QString& nsURI, const QString& localName) const | - |
3361 | { | - |
3362 | if (!impl) | 0 |
3363 | return false; never executed: return false; | 0 |
3364 | return ((QDomElementPrivate*)impl)->hasAttributeNS(nsURI, localName); never executed: return ((QDomElementPrivate*)impl)->hasAttributeNS(nsURI, localName); | 0 |
3365 | } | - |
3366 | QString QDomElement::text() const | - |
3367 | { | - |
3368 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
3369 | return QString(); never executed: return QString(); | 0 |
3370 | return ((QDomElementPrivate*)impl)->text(); executed: return ((QDomElementPrivate*)impl)->text(); Execution Count:1 | 1 |
3371 | } | - |
3372 | QDomTextPrivate::QDomTextPrivate(QDomDocumentPrivate* d, QDomNodePrivate* parent, const QString& val) | - |
3373 | : QDomCharacterDataPrivate(d, parent, val) | - |
3374 | { | - |
3375 | name = QLatin1String("#text"); | - |
3376 | } executed: } Execution Count:53322 | 53322 |
3377 | | - |
3378 | QDomTextPrivate::QDomTextPrivate(QDomTextPrivate* n, bool deep) | - |
3379 | : QDomCharacterDataPrivate(n, deep) | - |
3380 | { | - |
3381 | } executed: } Execution Count:13 | 13 |
3382 | | - |
3383 | QDomNodePrivate* QDomTextPrivate::cloneNode(bool deep) | - |
3384 | { | - |
3385 | QDomNodePrivate* p = new QDomTextPrivate(this, deep); | - |
3386 | | - |
3387 | p->ref.deref(); | - |
3388 | return p; executed: return p; Execution Count:1 | 1 |
3389 | } | - |
3390 | | - |
3391 | QDomTextPrivate* QDomTextPrivate::splitText(int offset) | - |
3392 | { | - |
3393 | if (!parent()) { never evaluated: !parent() | 0 |
3394 | QMessageLogger("dom/qdom.cpp", 5182, __PRETTY_FUNCTION__).warning("QDomText::splitText The node has no parent. So I can not split"); | - |
3395 | return 0; never executed: return 0; | 0 |
3396 | } | - |
3397 | | - |
3398 | QDomTextPrivate* t = new QDomTextPrivate(ownerDocument(), 0, value.mid(offset)); | - |
3399 | value.truncate(offset); | - |
3400 | | - |
3401 | parent()->insertAfter(t, this); | - |
3402 | | - |
3403 | return t; never executed: return t; | 0 |
3404 | } | - |
3405 | | - |
3406 | void QDomTextPrivate::save(QTextStream& s, int, int) const | - |
3407 | { | - |
3408 | QDomTextPrivate *that = const_cast<QDomTextPrivate*>(this); | - |
3409 | s << encodeText(value, s, !(that->parent() && that->parent()->isElement()), false, true); | - |
3410 | } executed: } Execution Count:30588 | 30588 |
3411 | QDomText::QDomText() | - |
3412 | : QDomCharacterData() | - |
3413 | { | - |
3414 | } | 0 |
3415 | QDomText::QDomText(const QDomText& x) | - |
3416 | : QDomCharacterData(x) | - |
3417 | { | - |
3418 | } | 0 |
3419 | | - |
3420 | QDomText::QDomText(QDomTextPrivate* n) | - |
3421 | : QDomCharacterData(n) | - |
3422 | { | - |
3423 | } executed: } Execution Count:68 | 68 |
3424 | QDomText& QDomText::operator= (const QDomText& x) | - |
3425 | { | - |
3426 | return (QDomText&) QDomNode::operator=(x); never executed: return (QDomText&) QDomNode::operator=(x); | 0 |
3427 | } | - |
3428 | QDomText QDomText::splitText(int offset) | - |
3429 | { | - |
3430 | if (!impl) | 0 |
3431 | return QDomText(); never executed: return QDomText(); | 0 |
3432 | return QDomText(((QDomTextPrivate*)impl)->splitText(offset)); never executed: return QDomText(((QDomTextPrivate*)impl)->splitText(offset)); | 0 |
3433 | } | - |
3434 | QDomCommentPrivate::QDomCommentPrivate(QDomDocumentPrivate* d, QDomNodePrivate* parent, const QString& val) | - |
3435 | : QDomCharacterDataPrivate(d, parent, val) | - |
3436 | { | - |
3437 | name = QLatin1String("#comment"); | - |
3438 | } executed: } Execution Count:1962 | 1962 |
3439 | | - |
3440 | QDomCommentPrivate::QDomCommentPrivate(QDomCommentPrivate* n, bool deep) | - |
3441 | : QDomCharacterDataPrivate(n, deep) | - |
3442 | { | - |
3443 | } executed: } Execution Count:6 | 6 |
3444 | | - |
3445 | | - |
3446 | QDomNodePrivate* QDomCommentPrivate::cloneNode(bool deep) | - |
3447 | { | - |
3448 | QDomNodePrivate* p = new QDomCommentPrivate(this, deep); | - |
3449 | | - |
3450 | p->ref.deref(); | - |
3451 | return p; never executed: return p; | 0 |
3452 | } | - |
3453 | | - |
3454 | void QDomCommentPrivate::save(QTextStream& s, int depth, int indent) const | - |
3455 | { | - |
3456 | | - |
3457 | if (!(prev && prev->isText())) evaluated: prev yes Evaluation Count:1553 | yes Evaluation Count:90 |
evaluated: prev->isText() yes Evaluation Count:408 | yes Evaluation Count:1145 |
| 90-1553 |
3458 | s << QString(indent < 1 ? 0 : depth * indent, QLatin1Char(' ')); executed: s << QString(indent < 1 ? 0 : depth * indent, QLatin1Char(' ')); Execution Count:1235 | 1235 |
3459 | | - |
3460 | s << "<!--" << value; | - |
3461 | if (value.endsWith(QLatin1Char('-'))) partially evaluated: value.endsWith(QLatin1Char('-')) no Evaluation Count:0 | yes Evaluation Count:1643 |
| 0-1643 |
3462 | s << ' '; never executed: s << ' '; | 0 |
3463 | s << "-->"; | - |
3464 | | - |
3465 | if (!(next && next->isText())) evaluated: next yes Evaluation Count:1323 | yes Evaluation Count:320 |
evaluated: next->isText() yes Evaluation Count:320 | yes Evaluation Count:1003 |
| 320-1323 |
3466 | s << endl; executed: s << endl; Execution Count:1323 | 1323 |
3467 | } executed: } Execution Count:1643 | 1643 |
3468 | QDomComment::QDomComment() | - |
3469 | : QDomCharacterData() | - |
3470 | { | - |
3471 | } | 0 |
3472 | QDomComment::QDomComment(const QDomComment& x) | - |
3473 | : QDomCharacterData(x) | - |
3474 | { | - |
3475 | } | 0 |
3476 | | - |
3477 | QDomComment::QDomComment(QDomCommentPrivate* n) | - |
3478 | : QDomCharacterData(n) | - |
3479 | { | - |
3480 | } executed: } Execution Count:19 | 19 |
3481 | QDomComment& QDomComment::operator= (const QDomComment& x) | - |
3482 | { | - |
3483 | return (QDomComment&) QDomNode::operator=(x); never executed: return (QDomComment&) QDomNode::operator=(x); | 0 |
3484 | } | - |
3485 | QDomCDATASectionPrivate::QDomCDATASectionPrivate(QDomDocumentPrivate* d, QDomNodePrivate* parent, | - |
3486 | const QString& val) | - |
3487 | : QDomTextPrivate(d, parent, val) | - |
3488 | { | - |
3489 | name = QLatin1String("#cdata-section"); | - |
3490 | } executed: } Execution Count:203 | 203 |
3491 | | - |
3492 | QDomCDATASectionPrivate::QDomCDATASectionPrivate(QDomCDATASectionPrivate* n, bool deep) | - |
3493 | : QDomTextPrivate(n, deep) | - |
3494 | { | - |
3495 | } executed: } Execution Count:6 | 6 |
3496 | | - |
3497 | QDomNodePrivate* QDomCDATASectionPrivate::cloneNode(bool deep) | - |
3498 | { | - |
3499 | QDomNodePrivate* p = new QDomCDATASectionPrivate(this, deep); | - |
3500 | | - |
3501 | p->ref.deref(); | - |
3502 | return p; never executed: return p; | 0 |
3503 | } | - |
3504 | | - |
3505 | void QDomCDATASectionPrivate::save(QTextStream& s, int, int) const | - |
3506 | { | - |
3507 | | - |
3508 | | - |
3509 | s << "<![CDATA[" << value << "]]>"; | - |
3510 | } executed: } Execution Count:155 | 155 |
3511 | QDomCDATASection::QDomCDATASection() | - |
3512 | : QDomText() | - |
3513 | { | - |
3514 | } | 0 |
3515 | QDomCDATASection::QDomCDATASection(const QDomCDATASection& x) | - |
3516 | : QDomText(x) | - |
3517 | { | - |
3518 | } | 0 |
3519 | | - |
3520 | QDomCDATASection::QDomCDATASection(QDomCDATASectionPrivate* n) | - |
3521 | : QDomText(n) | - |
3522 | { | - |
3523 | } executed: } Execution Count:19 | 19 |
3524 | QDomCDATASection& QDomCDATASection::operator= (const QDomCDATASection& x) | - |
3525 | { | - |
3526 | return (QDomCDATASection&) QDomNode::operator=(x); never executed: return (QDomCDATASection&) QDomNode::operator=(x); | 0 |
3527 | } | - |
3528 | QDomNotationPrivate::QDomNotationPrivate(QDomDocumentPrivate* d, QDomNodePrivate* parent, | - |
3529 | const QString& aname, | - |
3530 | const QString& pub, const QString& sys) | - |
3531 | : QDomNodePrivate(d, parent) | - |
3532 | { | - |
3533 | name = aname; | - |
3534 | m_pub = pub; | - |
3535 | m_sys = sys; | - |
3536 | } executed: } Execution Count:2 | 2 |
3537 | | - |
3538 | QDomNotationPrivate::QDomNotationPrivate(QDomNotationPrivate* n, bool deep) | - |
3539 | : QDomNodePrivate(n, deep) | - |
3540 | { | - |
3541 | m_sys = n->m_sys; | - |
3542 | m_pub = n->m_pub; | - |
3543 | } | 0 |
3544 | | - |
3545 | QDomNodePrivate* QDomNotationPrivate::cloneNode(bool deep) | - |
3546 | { | - |
3547 | QDomNodePrivate* p = new QDomNotationPrivate(this, deep); | - |
3548 | | - |
3549 | p->ref.deref(); | - |
3550 | return p; never executed: return p; | 0 |
3551 | } | - |
3552 | | - |
3553 | void QDomNotationPrivate::save(QTextStream& s, int, int) const | - |
3554 | { | - |
3555 | s << "<!NOTATION " << name << ' '; | - |
3556 | if (!m_pub.isNull()) { never evaluated: !m_pub.isNull() | 0 |
3557 | s << "PUBLIC " << quotedValue(m_pub); | - |
3558 | if (!m_sys.isNull()) never evaluated: !m_sys.isNull() | 0 |
3559 | s << ' ' << quotedValue(m_sys); never executed: s << ' ' << quotedValue(m_sys); | 0 |
3560 | } else { | 0 |
3561 | s << "SYSTEM " << quotedValue(m_sys); | - |
3562 | } | 0 |
3563 | s << '>' << endl; | - |
3564 | } | 0 |
3565 | QDomNotation::QDomNotation() | - |
3566 | : QDomNode() | - |
3567 | { | - |
3568 | } | 0 |
3569 | QDomNotation::QDomNotation(const QDomNotation& x) | - |
3570 | : QDomNode(x) | - |
3571 | { | - |
3572 | } | 0 |
3573 | | - |
3574 | QDomNotation::QDomNotation(QDomNotationPrivate* n) | - |
3575 | : QDomNode(n) | - |
3576 | { | - |
3577 | } executed: } Execution Count:2 | 2 |
3578 | QDomNotation& QDomNotation::operator= (const QDomNotation& x) | - |
3579 | { | - |
3580 | return (QDomNotation&) QDomNode::operator=(x); never executed: return (QDomNotation&) QDomNode::operator=(x); | 0 |
3581 | } | - |
3582 | QString QDomNotation::publicId() const | - |
3583 | { | - |
3584 | if (!impl) | 0 |
3585 | return QString(); never executed: return QString(); | 0 |
3586 | return ((QDomNotationPrivate*)impl)->m_pub; never executed: return ((QDomNotationPrivate*)impl)->m_pub; | 0 |
3587 | } | - |
3588 | | - |
3589 | | - |
3590 | | - |
3591 | | - |
3592 | QString QDomNotation::systemId() const | - |
3593 | { | - |
3594 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
3595 | return QString(); never executed: return QString(); | 0 |
3596 | return ((QDomNotationPrivate*)impl)->m_sys; executed: return ((QDomNotationPrivate*)impl)->m_sys; Execution Count:2 | 2 |
3597 | } | - |
3598 | QDomEntityPrivate::QDomEntityPrivate(QDomDocumentPrivate* d, QDomNodePrivate* parent, | - |
3599 | const QString& aname, | - |
3600 | const QString& pub, const QString& sys, const QString& notation) | - |
3601 | : QDomNodePrivate(d, parent) | - |
3602 | { | - |
3603 | name = aname; | - |
3604 | m_pub = pub; | - |
3605 | m_sys = sys; | - |
3606 | m_notationName = notation; | - |
3607 | } executed: } Execution Count:6 | 6 |
3608 | | - |
3609 | QDomEntityPrivate::QDomEntityPrivate(QDomEntityPrivate* n, bool deep) | - |
3610 | : QDomNodePrivate(n, deep) | - |
3611 | { | - |
3612 | m_sys = n->m_sys; | - |
3613 | m_pub = n->m_pub; | - |
3614 | m_notationName = n->m_notationName; | - |
3615 | } executed: } Execution Count:2 | 2 |
3616 | | - |
3617 | QDomNodePrivate* QDomEntityPrivate::cloneNode(bool deep) | - |
3618 | { | - |
3619 | QDomNodePrivate* p = new QDomEntityPrivate(this, deep); | - |
3620 | | - |
3621 | p->ref.deref(); | - |
3622 | return p; executed: return p; Execution Count:2 | 2 |
3623 | } | - |
3624 | | - |
3625 | | - |
3626 | | - |
3627 | | - |
3628 | static QByteArray encodeEntity(const QByteArray& str) | - |
3629 | { | - |
3630 | QByteArray tmp(str); | - |
3631 | int len = tmp.size(); | - |
3632 | int i = 0; | - |
3633 | const char* d = tmp.constData(); | - |
3634 | while (i < len) { evaluated: i < len yes Evaluation Count:6 | yes Evaluation Count:2 |
| 2-6 |
3635 | if (d[i] == '%'){ partially evaluated: d[i] == '%' no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
3636 | tmp.replace(i, 1, "<"); | - |
3637 | d = tmp.constData(); | - |
3638 | len += 4; | - |
3639 | i += 5; | - |
3640 | } | 0 |
3641 | else if (d[i] == '"') { partially evaluated: d[i] == '"' no Evaluation Count:0 | yes Evaluation Count:6 |
| 0-6 |
3642 | tmp.replace(i, 1, """); | - |
3643 | d = tmp.constData(); | - |
3644 | len += 4; | - |
3645 | i += 5; | - |
3646 | } else if (d[i] == '&' && i + 1 < len && d[i+1] == '#') { partially evaluated: d[i] == '&' no Evaluation Count:0 | yes Evaluation Count:6 |
never evaluated: i + 1 < len never evaluated: d[i+1] == '#' | 0-6 |
3647 | | - |
3648 | | - |
3649 | tmp.replace(i, 1, "&"); | - |
3650 | d = tmp.constData(); | - |
3651 | len += 4; | - |
3652 | i += 5; | - |
3653 | } else { | 0 |
3654 | ++i; | - |
3655 | } executed: } Execution Count:6 | 6 |
3656 | } | - |
3657 | | - |
3658 | return tmp; executed: return tmp; Execution Count:2 | 2 |
3659 | } | - |
3660 | | - |
3661 | void QDomEntityPrivate::save(QTextStream& s, int, int) const | - |
3662 | { | - |
3663 | QString _name = name; | - |
3664 | if (_name.startsWith(QLatin1Char('%'))) partially evaluated: _name.startsWith(QLatin1Char('%')) no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-4 |
3665 | _name = QLatin1String("% ") + _name.mid(1); never executed: _name = QLatin1String("% ") + _name.mid(1); | 0 |
3666 | | - |
3667 | if (m_sys.isNull() && m_pub.isNull()) { evaluated: m_sys.isNull() yes Evaluation Count:2 | yes Evaluation Count:2 |
partially evaluated: m_pub.isNull() yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
3668 | s << "<!ENTITY " << _name << " \"" << encodeEntity(value.toUtf8()) << "\">" << endl; | - |
3669 | } else { executed: } Execution Count:2 | 2 |
3670 | s << "<!ENTITY " << _name << ' '; | - |
3671 | if (m_pub.isNull()) { partially evaluated: m_pub.isNull() yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
3672 | s << "SYSTEM " << quotedValue(m_sys); | - |
3673 | } else { executed: } Execution Count:2 | 2 |
3674 | s << "PUBLIC " << quotedValue(m_pub) << ' ' << quotedValue(m_sys); | - |
3675 | } | 0 |
3676 | if (! m_notationName.isNull()) { partially evaluated: ! m_notationName.isNull() no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
3677 | s << " NDATA " << m_notationName; | - |
3678 | } | 0 |
3679 | s << '>' << endl; | - |
3680 | } executed: } Execution Count:2 | 2 |
3681 | } | - |
3682 | QDomEntity::QDomEntity() | - |
3683 | : QDomNode() | - |
3684 | { | - |
3685 | } | 0 |
3686 | QDomEntity::QDomEntity(const QDomEntity& x) | - |
3687 | : QDomNode(x) | - |
3688 | { | - |
3689 | } | 0 |
3690 | | - |
3691 | QDomEntity::QDomEntity(QDomEntityPrivate* n) | - |
3692 | : QDomNode(n) | - |
3693 | { | - |
3694 | } executed: } Execution Count:4 | 4 |
3695 | QDomEntity& QDomEntity::operator= (const QDomEntity& x) | - |
3696 | { | - |
3697 | return (QDomEntity&) QDomNode::operator=(x); never executed: return (QDomEntity&) QDomNode::operator=(x); | 0 |
3698 | } | - |
3699 | QString QDomEntity::publicId() const | - |
3700 | { | - |
3701 | if (!impl) | 0 |
3702 | return QString(); never executed: return QString(); | 0 |
3703 | return ((QDomEntityPrivate*)impl)->m_pub; never executed: return ((QDomEntityPrivate*)impl)->m_pub; | 0 |
3704 | } | - |
3705 | | - |
3706 | | - |
3707 | | - |
3708 | | - |
3709 | | - |
3710 | QString QDomEntity::systemId() const | - |
3711 | { | - |
3712 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
3713 | return QString(); never executed: return QString(); | 0 |
3714 | return ((QDomEntityPrivate*)impl)->m_sys; executed: return ((QDomEntityPrivate*)impl)->m_sys; Execution Count:2 | 2 |
3715 | } | - |
3716 | | - |
3717 | | - |
3718 | | - |
3719 | | - |
3720 | | - |
3721 | | - |
3722 | QString QDomEntity::notationName() const | - |
3723 | { | - |
3724 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
3725 | return QString(); never executed: return QString(); | 0 |
3726 | return ((QDomEntityPrivate*)impl)->m_notationName; executed: return ((QDomEntityPrivate*)impl)->m_notationName; Execution Count:2 | 2 |
3727 | } | - |
3728 | QDomEntityReferencePrivate::QDomEntityReferencePrivate(QDomDocumentPrivate* d, QDomNodePrivate* parent, const QString& aname) | - |
3729 | : QDomNodePrivate(d, parent) | - |
3730 | { | - |
3731 | name = aname; | - |
3732 | } executed: } Execution Count:33 | 33 |
3733 | | - |
3734 | QDomEntityReferencePrivate::QDomEntityReferencePrivate(QDomNodePrivate* n, bool deep) | - |
3735 | : QDomNodePrivate(n, deep) | - |
3736 | { | - |
3737 | } executed: } Execution Count:6 | 6 |
3738 | | - |
3739 | QDomNodePrivate* QDomEntityReferencePrivate::cloneNode(bool deep) | - |
3740 | { | - |
3741 | QDomNodePrivate* p = new QDomEntityReferencePrivate(this, deep); | - |
3742 | | - |
3743 | p->ref.deref(); | - |
3744 | return p; never executed: return p; | 0 |
3745 | } | - |
3746 | | - |
3747 | void QDomEntityReferencePrivate::save(QTextStream& s, int, int) const | - |
3748 | { | - |
3749 | s << '&' << name << ';'; | - |
3750 | } executed: } Execution Count:2 | 2 |
3751 | QDomEntityReference::QDomEntityReference() | - |
3752 | : QDomNode() | - |
3753 | { | - |
3754 | } | 0 |
3755 | QDomEntityReference::QDomEntityReference(const QDomEntityReference& x) | - |
3756 | : QDomNode(x) | - |
3757 | { | - |
3758 | } | 0 |
3759 | | - |
3760 | QDomEntityReference::QDomEntityReference(QDomEntityReferencePrivate* n) | - |
3761 | : QDomNode(n) | - |
3762 | { | - |
3763 | } executed: } Execution Count:40 | 40 |
3764 | QDomEntityReference& QDomEntityReference::operator= (const QDomEntityReference& x) | - |
3765 | { | - |
3766 | return (QDomEntityReference&) QDomNode::operator=(x); never executed: return (QDomEntityReference&) QDomNode::operator=(x); | 0 |
3767 | } | - |
3768 | QDomProcessingInstructionPrivate::QDomProcessingInstructionPrivate(QDomDocumentPrivate* d, | - |
3769 | QDomNodePrivate* parent, const QString& target, const QString& data) | - |
3770 | : QDomNodePrivate(d, parent) | - |
3771 | { | - |
3772 | name = target; | - |
3773 | value = data; | - |
3774 | } executed: } Execution Count:151 | 151 |
3775 | | - |
3776 | QDomProcessingInstructionPrivate::QDomProcessingInstructionPrivate(QDomProcessingInstructionPrivate* n, bool deep) | - |
3777 | : QDomNodePrivate(n, deep) | - |
3778 | { | - |
3779 | } executed: } Execution Count:7 | 7 |
3780 | | - |
3781 | | - |
3782 | QDomNodePrivate* QDomProcessingInstructionPrivate::cloneNode(bool deep) | - |
3783 | { | - |
3784 | QDomNodePrivate* p = new QDomProcessingInstructionPrivate(this, deep); | - |
3785 | | - |
3786 | p->ref.deref(); | - |
3787 | return p; executed: return p; Execution Count:1 | 1 |
3788 | } | - |
3789 | | - |
3790 | void QDomProcessingInstructionPrivate::save(QTextStream& s, int, int) const | - |
3791 | { | - |
3792 | s << "<?" << name << ' ' << value << "?>" << endl; | - |
3793 | } executed: } Execution Count:49 | 49 |
3794 | QDomProcessingInstruction::QDomProcessingInstruction() | - |
3795 | : QDomNode() | - |
3796 | { | - |
3797 | } | 0 |
3798 | QDomProcessingInstruction::QDomProcessingInstruction(const QDomProcessingInstruction& x) | - |
3799 | : QDomNode(x) | - |
3800 | { | - |
3801 | } | 0 |
3802 | | - |
3803 | QDomProcessingInstruction::QDomProcessingInstruction(QDomProcessingInstructionPrivate* n) | - |
3804 | : QDomNode(n) | - |
3805 | { | - |
3806 | } executed: } Execution Count:19 | 19 |
3807 | QDomProcessingInstruction& QDomProcessingInstruction::operator= (const QDomProcessingInstruction& x) | - |
3808 | { | - |
3809 | return (QDomProcessingInstruction&) QDomNode::operator=(x); never executed: return (QDomProcessingInstruction&) QDomNode::operator=(x); | 0 |
3810 | } | - |
3811 | QString QDomProcessingInstruction::target() const | - |
3812 | { | - |
3813 | if (!impl) | 0 |
3814 | return QString(); never executed: return QString(); | 0 |
3815 | return impl->nodeName(); never executed: return impl->nodeName(); | 0 |
3816 | } | - |
3817 | | - |
3818 | | - |
3819 | | - |
3820 | | - |
3821 | | - |
3822 | | - |
3823 | QString QDomProcessingInstruction::data() const | - |
3824 | { | - |
3825 | if (!impl) | 0 |
3826 | return QString(); never executed: return QString(); | 0 |
3827 | return impl->nodeValue(); never executed: return impl->nodeValue(); | 0 |
3828 | } | - |
3829 | | - |
3830 | | - |
3831 | | - |
3832 | | - |
3833 | | - |
3834 | | - |
3835 | void QDomProcessingInstruction::setData(const QString& d) | - |
3836 | { | - |
3837 | if (!impl) | 0 |
3838 | return; | 0 |
3839 | impl->setNodeValue(d); | - |
3840 | } | 0 |
3841 | | - |
3842 | | - |
3843 | | - |
3844 | | - |
3845 | | - |
3846 | | - |
3847 | | - |
3848 | QDomDocumentPrivate::QDomDocumentPrivate() | - |
3849 | : QDomNodePrivate(0), | - |
3850 | impl(new QDomImplementationPrivate), | - |
3851 | nodeListTime(1) | - |
3852 | { | - |
3853 | type = new QDomDocumentTypePrivate(this, this); | - |
3854 | type->ref.deref(); | - |
3855 | | - |
3856 | name = QLatin1String("#document"); | - |
3857 | } executed: } Execution Count:422 | 422 |
3858 | | - |
3859 | QDomDocumentPrivate::QDomDocumentPrivate(const QString& aname) | - |
3860 | : QDomNodePrivate(0), | - |
3861 | impl(new QDomImplementationPrivate), | - |
3862 | nodeListTime(1) | - |
3863 | { | - |
3864 | type = new QDomDocumentTypePrivate(this, this); | - |
3865 | type->ref.deref(); | - |
3866 | type->name = aname; | - |
3867 | | - |
3868 | name = QLatin1String("#document"); | - |
3869 | } executed: } Execution Count:21 | 21 |
3870 | | - |
3871 | QDomDocumentPrivate::QDomDocumentPrivate(QDomDocumentTypePrivate* dt) | - |
3872 | : QDomNodePrivate(0), | - |
3873 | impl(new QDomImplementationPrivate), | - |
3874 | nodeListTime(1) | - |
3875 | { | - |
3876 | if (dt != 0) { evaluated: dt != 0 yes Evaluation Count:10 | yes Evaluation Count:18 |
| 10-18 |
3877 | type = dt; | - |
3878 | } else { executed: } Execution Count:10 | 10 |
3879 | type = new QDomDocumentTypePrivate(this, this); | - |
3880 | type->ref.deref(); | - |
3881 | } executed: } Execution Count:18 | 18 |
3882 | | - |
3883 | name = QLatin1String("#document"); | - |
3884 | } executed: } Execution Count:28 | 28 |
3885 | | - |
3886 | QDomDocumentPrivate::QDomDocumentPrivate(QDomDocumentPrivate* n, bool deep) | - |
3887 | : QDomNodePrivate(n, deep), | - |
3888 | impl(n->impl->clone()), | - |
3889 | nodeListTime(1) | - |
3890 | { | - |
3891 | type = static_cast<QDomDocumentTypePrivate*>(n->type->cloneNode()); | - |
3892 | type->setParent(this); | - |
3893 | } executed: } Execution Count:1 | 1 |
3894 | | - |
3895 | QDomDocumentPrivate::~QDomDocumentPrivate() | - |
3896 | { | - |
3897 | } | - |
3898 | | - |
3899 | void QDomDocumentPrivate::clear() | - |
3900 | { | - |
3901 | impl.reset(); | - |
3902 | type.reset(); | - |
3903 | QDomNodePrivate::clear(); | - |
3904 | } executed: } Execution Count:385 | 385 |
3905 | | - |
3906 | static void initializeReader(QXmlSimpleReader &reader, bool namespaceProcessing) | - |
3907 | { | - |
3908 | reader.setFeature(QLatin1String("http://xml.org/sax/features/namespaces"), namespaceProcessing); | - |
3909 | reader.setFeature(QLatin1String("http://xml.org/sax/features/namespace-prefixes"), !namespaceProcessing); | - |
3910 | reader.setFeature(QLatin1String("http://trolltech.com/xml/features/report-whitespace-only-CharData"), false); | - |
3911 | } executed: } Execution Count:377 | 377 |
3912 | | - |
3913 | bool QDomDocumentPrivate::setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn) | - |
3914 | { | - |
3915 | QXmlSimpleReader reader; | - |
3916 | initializeReader(reader, namespaceProcessing); | - |
3917 | return setContent(source, &reader, errorMsg, errorLine, errorColumn); executed: return setContent(source, &reader, errorMsg, errorLine, errorColumn); Execution Count:376 | 376 |
3918 | } | - |
3919 | | - |
3920 | bool QDomDocumentPrivate::setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg, int *errorLine, int *errorColumn) | - |
3921 | { | - |
3922 | clear(); | - |
3923 | impl = new QDomImplementationPrivate; | - |
3924 | type = new QDomDocumentTypePrivate(this, this); | - |
3925 | type->ref.deref(); | - |
3926 | | - |
3927 | bool namespaceProcessing = reader->feature(QLatin1String("http://xml.org/sax/features/namespaces")) evaluated: reader->feature(QLatin1String("http://xml.org/sax/features/namespaces")) yes Evaluation Count:18 | yes Evaluation Count:367 |
| 18-367 |
3928 | && !reader->feature(QLatin1String("http://xml.org/sax/features/namespace-prefixes")); partially evaluated: !reader->feature(QLatin1String("http://xml.org/sax/features/namespace-prefixes")) yes Evaluation Count:18 | no Evaluation Count:0 |
| 0-18 |
3929 | | - |
3930 | QDomHandler hnd(this, namespaceProcessing); | - |
3931 | reader->setContentHandler(&hnd); | - |
3932 | reader->setErrorHandler(&hnd); | - |
3933 | reader->setLexicalHandler(&hnd); | - |
3934 | reader->setDeclHandler(&hnd); | - |
3935 | reader->setDTDHandler(&hnd); | - |
3936 | | - |
3937 | if (!reader->parse(source)) { evaluated: !reader->parse(source) yes Evaluation Count:14 | yes Evaluation Count:371 |
| 14-371 |
3938 | if (errorMsg) partially evaluated: errorMsg no Evaluation Count:0 | yes Evaluation Count:14 |
| 0-14 |
3939 | *errorMsg = hnd.errorMsg; never executed: *errorMsg = hnd.errorMsg; | 0 |
3940 | if (errorLine) partially evaluated: errorLine no Evaluation Count:0 | yes Evaluation Count:14 |
| 0-14 |
3941 | *errorLine = hnd.errorLine; never executed: *errorLine = hnd.errorLine; | 0 |
3942 | if (errorColumn) partially evaluated: errorColumn no Evaluation Count:0 | yes Evaluation Count:14 |
| 0-14 |
3943 | *errorColumn = hnd.errorColumn; never executed: *errorColumn = hnd.errorColumn; | 0 |
3944 | return false; executed: return false; Execution Count:14 | 14 |
3945 | } | - |
3946 | | - |
3947 | return true; executed: return true; Execution Count:371 | 371 |
3948 | } | - |
3949 | | - |
3950 | QDomNodePrivate* QDomDocumentPrivate::cloneNode(bool deep) | - |
3951 | { | - |
3952 | QDomNodePrivate *p = new QDomDocumentPrivate(this, deep); | - |
3953 | | - |
3954 | p->ref.deref(); | - |
3955 | return p; executed: return p; Execution Count:1 | 1 |
3956 | } | - |
3957 | | - |
3958 | QDomElementPrivate* QDomDocumentPrivate::documentElement() | - |
3959 | { | - |
3960 | QDomNodePrivate *p = first; | - |
3961 | while (p && !p->isElement()) partially evaluated: p yes Evaluation Count:36 | no Evaluation Count:0 |
evaluated: !p->isElement() yes Evaluation Count:1 | yes Evaluation Count:35 |
| 0-36 |
3962 | p = p->next; executed: p = p->next; Execution Count:1 | 1 |
3963 | | - |
3964 | return static_cast<QDomElementPrivate *>(p); executed: return static_cast<QDomElementPrivate *>(p); Execution Count:35 | 35 |
3965 | } | - |
3966 | | - |
3967 | QDomElementPrivate* QDomDocumentPrivate::createElement(const QString &tagName) | - |
3968 | { | - |
3969 | bool ok; | - |
3970 | QString fixedName = fixedXmlName(tagName, &ok); | - |
3971 | if (!ok) evaluated: !ok yes Evaluation Count:10 | yes Evaluation Count:37918 |
| 10-37918 |
3972 | return 0; executed: return 0; Execution Count:10 | 10 |
3973 | | - |
3974 | QDomElementPrivate *e = new QDomElementPrivate(this, 0, fixedName); | - |
3975 | e->ref.deref(); | - |
3976 | return e; executed: return e; Execution Count:37918 | 37918 |
3977 | } | - |
3978 | | - |
3979 | QDomElementPrivate* QDomDocumentPrivate::createElementNS(const QString &nsURI, const QString &qName) | - |
3980 | { | - |
3981 | bool ok; | - |
3982 | QString fixedName = fixedXmlName(qName, &ok, true); | - |
3983 | if (!ok) evaluated: !ok yes Evaluation Count:38 | yes Evaluation Count:112 |
| 38-112 |
3984 | return 0; executed: return 0; Execution Count:38 | 38 |
3985 | | - |
3986 | QDomElementPrivate *e = new QDomElementPrivate(this, 0, nsURI, fixedName); | - |
3987 | e->ref.deref(); | - |
3988 | return e; executed: return e; Execution Count:112 | 112 |
3989 | } | - |
3990 | | - |
3991 | QDomDocumentFragmentPrivate* QDomDocumentPrivate::createDocumentFragment() | - |
3992 | { | - |
3993 | QDomDocumentFragmentPrivate *f = new QDomDocumentFragmentPrivate(this, (QDomNodePrivate*)0); | - |
3994 | f->ref.deref(); | - |
3995 | return f; executed: return f; Execution Count:19 | 19 |
3996 | } | - |
3997 | | - |
3998 | QDomTextPrivate* QDomDocumentPrivate::createTextNode(const QString &data) | - |
3999 | { | - |
4000 | bool ok; | - |
4001 | QString fixedData = fixedCharData(data, &ok); | - |
4002 | if (!ok) evaluated: !ok yes Evaluation Count:1 | yes Evaluation Count:36364 |
| 1-36364 |
4003 | return 0; executed: return 0; Execution Count:1 | 1 |
4004 | | - |
4005 | QDomTextPrivate *t = new QDomTextPrivate(this, 0, fixedData); | - |
4006 | t->ref.deref(); | - |
4007 | return t; executed: return t; Execution Count:36364 | 36364 |
4008 | } | - |
4009 | | - |
4010 | QDomCommentPrivate* QDomDocumentPrivate::createComment(const QString &data) | - |
4011 | { | - |
4012 | bool ok; | - |
4013 | QString fixedData = fixedComment(data, &ok); | - |
4014 | if (!ok) partially evaluated: !ok no Evaluation Count:0 | yes Evaluation Count:1962 |
| 0-1962 |
4015 | return 0; never executed: return 0; | 0 |
4016 | | - |
4017 | QDomCommentPrivate *c = new QDomCommentPrivate(this, 0, fixedData); | - |
4018 | c->ref.deref(); | - |
4019 | return c; executed: return c; Execution Count:1962 | 1962 |
4020 | } | - |
4021 | | - |
4022 | QDomCDATASectionPrivate* QDomDocumentPrivate::createCDATASection(const QString &data) | - |
4023 | { | - |
4024 | bool ok; | - |
4025 | QString fixedData = fixedCDataSection(data, &ok); | - |
4026 | if (!ok) partially evaluated: !ok no Evaluation Count:0 | yes Evaluation Count:203 |
| 0-203 |
4027 | return 0; never executed: return 0; | 0 |
4028 | | - |
4029 | QDomCDATASectionPrivate *c = new QDomCDATASectionPrivate(this, 0, fixedData); | - |
4030 | c->ref.deref(); | - |
4031 | return c; executed: return c; Execution Count:203 | 203 |
4032 | } | - |
4033 | | - |
4034 | QDomProcessingInstructionPrivate* QDomDocumentPrivate::createProcessingInstruction(const QString &target, | - |
4035 | const QString &data) | - |
4036 | { | - |
4037 | bool ok; | - |
4038 | QString fixedData = fixedPIData(data, &ok); | - |
4039 | if (!ok) partially evaluated: !ok no Evaluation Count:0 | yes Evaluation Count:151 |
| 0-151 |
4040 | return 0; never executed: return 0; | 0 |
4041 | | - |
4042 | QString fixedTarget = fixedXmlName(target, &ok); | - |
4043 | if (!ok) partially evaluated: !ok no Evaluation Count:0 | yes Evaluation Count:151 |
| 0-151 |
4044 | return 0; never executed: return 0; | 0 |
4045 | | - |
4046 | QDomProcessingInstructionPrivate *p = new QDomProcessingInstructionPrivate(this, 0, fixedTarget, fixedData); | - |
4047 | p->ref.deref(); | - |
4048 | return p; executed: return p; Execution Count:151 | 151 |
4049 | } | - |
4050 | QDomAttrPrivate* QDomDocumentPrivate::createAttribute(const QString &aname) | - |
4051 | { | - |
4052 | bool ok; | - |
4053 | QString fixedName = fixedXmlName(aname, &ok); | - |
4054 | if (!ok) evaluated: !ok yes Evaluation Count:9 | yes Evaluation Count:32 |
| 9-32 |
4055 | return 0; executed: return 0; Execution Count:9 | 9 |
4056 | | - |
4057 | QDomAttrPrivate *a = new QDomAttrPrivate(this, 0, fixedName); | - |
4058 | a->ref.deref(); | - |
4059 | return a; executed: return a; Execution Count:32 | 32 |
4060 | } | - |
4061 | | - |
4062 | QDomAttrPrivate* QDomDocumentPrivate::createAttributeNS(const QString &nsURI, const QString &qName) | - |
4063 | { | - |
4064 | bool ok; | - |
4065 | QString fixedName = fixedXmlName(qName, &ok, true); | - |
4066 | if (!ok) evaluated: !ok yes Evaluation Count:23 | yes Evaluation Count:41 |
| 23-41 |
4067 | return 0; executed: return 0; Execution Count:23 | 23 |
4068 | | - |
4069 | QDomAttrPrivate *a = new QDomAttrPrivate(this, 0, nsURI, fixedName); | - |
4070 | a->ref.deref(); | - |
4071 | return a; executed: return a; Execution Count:41 | 41 |
4072 | } | - |
4073 | | - |
4074 | QDomEntityReferencePrivate* QDomDocumentPrivate::createEntityReference(const QString &aname) | - |
4075 | { | - |
4076 | bool ok; | - |
4077 | QString fixedName = fixedXmlName(aname, &ok); | - |
4078 | if (!ok) evaluated: !ok yes Evaluation Count:9 | yes Evaluation Count:33 |
| 9-33 |
4079 | return 0; executed: return 0; Execution Count:9 | 9 |
4080 | | - |
4081 | QDomEntityReferencePrivate *e = new QDomEntityReferencePrivate(this, 0, fixedName); | - |
4082 | e->ref.deref(); | - |
4083 | return e; executed: return e; Execution Count:33 | 33 |
4084 | } | - |
4085 | | - |
4086 | QDomNodePrivate* QDomDocumentPrivate::importNode(const QDomNodePrivate *importedNode, bool deep) | - |
4087 | { | - |
4088 | QDomNodePrivate *node = 0; | - |
4089 | switch (importedNode->nodeType()) { | - |
4090 | case QDomNode::AttributeNode: | - |
4091 | node = new QDomAttrPrivate((QDomAttrPrivate*)importedNode, true); | - |
4092 | break; executed: break; Execution Count:12 | 12 |
4093 | case QDomNode::DocumentFragmentNode: | - |
4094 | node = new QDomDocumentFragmentPrivate((QDomDocumentFragmentPrivate*)importedNode, deep); | - |
4095 | break; executed: break; Execution Count:6 | 6 |
4096 | case QDomNode::ElementNode: | - |
4097 | node = new QDomElementPrivate((QDomElementPrivate*)importedNode, deep); | - |
4098 | break; executed: break; Execution Count:13 | 13 |
4099 | case QDomNode::EntityNode: | - |
4100 | node = new QDomEntityPrivate((QDomEntityPrivate*)importedNode, deep); | - |
4101 | break; | 0 |
4102 | case QDomNode::EntityReferenceNode: | - |
4103 | node = new QDomEntityReferencePrivate((QDomEntityReferencePrivate*)importedNode, false); | - |
4104 | break; executed: break; Execution Count:6 | 6 |
4105 | case QDomNode::NotationNode: | - |
4106 | node = new QDomNotationPrivate((QDomNotationPrivate*)importedNode, deep); | - |
4107 | break; | 0 |
4108 | case QDomNode::ProcessingInstructionNode: | - |
4109 | node = new QDomProcessingInstructionPrivate((QDomProcessingInstructionPrivate*)importedNode, deep); | - |
4110 | break; executed: break; Execution Count:6 | 6 |
4111 | case QDomNode::TextNode: | - |
4112 | node = new QDomTextPrivate((QDomTextPrivate*)importedNode, deep); | - |
4113 | break; executed: break; Execution Count:6 | 6 |
4114 | case QDomNode::CDATASectionNode: | - |
4115 | node = new QDomCDATASectionPrivate((QDomCDATASectionPrivate*)importedNode, deep); | - |
4116 | break; executed: break; Execution Count:6 | 6 |
4117 | case QDomNode::CommentNode: | - |
4118 | node = new QDomCommentPrivate((QDomCommentPrivate*)importedNode, deep); | - |
4119 | break; executed: break; Execution Count:6 | 6 |
4120 | default: | - |
4121 | break; | 0 |
4122 | } | - |
4123 | if (node) { partially evaluated: node yes Evaluation Count:61 | no Evaluation Count:0 |
| 0-61 |
4124 | node->setOwnerDocument(this); | - |
4125 | | - |
4126 | | - |
4127 | node->ref.deref(); | - |
4128 | } executed: } Execution Count:61 | 61 |
4129 | return node; executed: return node; Execution Count:61 | 61 |
4130 | } | - |
4131 | | - |
4132 | void QDomDocumentPrivate::saveDocument(QTextStream& s, const int indent, QDomNode::EncodingPolicy encUsed) const | - |
4133 | { | - |
4134 | const QDomNodePrivate* n = first; | - |
4135 | | - |
4136 | if(encUsed == QDomNode::EncodingFromDocument) { evaluated: encUsed == QDomNode::EncodingFromDocument yes Evaluation Count:166 | yes Evaluation Count:60 |
| 60-166 |
4137 | | - |
4138 | const QDomNodePrivate* n = first; | - |
4139 | | - |
4140 | QTextCodec *codec = 0; | - |
4141 | | - |
4142 | if (n && n->isProcessingInstruction() && n->nodeName() == QLatin1String("xml")) { partially evaluated: n yes Evaluation Count:166 | no Evaluation Count:0 |
evaluated: n->isProcessingInstruction() yes Evaluation Count:38 | yes Evaluation Count:128 |
partially evaluated: n->nodeName() == QLatin1String("xml") yes Evaluation Count:38 | no Evaluation Count:0 |
| 0-166 |
4143 | | - |
4144 | QString data = n->nodeValue(); | - |
4145 | QRegExp encoding(QString::fromLatin1("encoding\\s*=\\s*((\"([^\"]*)\")|('([^']*)'))")); | - |
4146 | encoding.indexIn(data); | - |
4147 | QString enc = encoding.cap(3); | - |
4148 | if (enc.isEmpty()) partially evaluated: enc.isEmpty() yes Evaluation Count:38 | no Evaluation Count:0 |
| 0-38 |
4149 | enc = encoding.cap(5); executed: enc = encoding.cap(5); Execution Count:38 | 38 |
4150 | if (!enc.isEmpty()) evaluated: !enc.isEmpty() yes Evaluation Count:13 | yes Evaluation Count:25 |
| 13-25 |
4151 | codec = QTextCodec::codecForName(enc.toLatin1().data()); executed: codec = QTextCodec::codecForName(enc.toLatin1().data()); Execution Count:13 | 13 |
4152 | } executed: } Execution Count:38 | 38 |
4153 | if (!codec) evaluated: !codec yes Evaluation Count:154 | yes Evaluation Count:12 |
| 12-154 |
4154 | codec = QTextCodec::codecForName("UTF-8"); executed: codec = QTextCodec::codecForName("UTF-8"); Execution Count:154 | 154 |
4155 | if (codec) partially evaluated: codec yes Evaluation Count:166 | no Evaluation Count:0 |
| 0-166 |
4156 | s.setCodec(codec); executed: s.setCodec(codec); Execution Count:166 | 166 |
4157 | | - |
4158 | bool doc = false; | - |
4159 | | - |
4160 | while (n) { evaluated: n yes Evaluation Count:359 | yes Evaluation Count:166 |
| 166-359 |
4161 | if (!doc && !(n->isProcessingInstruction() && n->nodeName() == QLatin1String("xml"))) { evaluated: !doc yes Evaluation Count:204 | yes Evaluation Count:155 |
evaluated: n->isProcessingInstruction() yes Evaluation Count:38 | yes Evaluation Count:166 |
partially evaluated: n->nodeName() == QLatin1String("xml") yes Evaluation Count:38 | no Evaluation Count:0 |
| 0-204 |
4162 | | - |
4163 | type->save(s, 0, indent); | - |
4164 | doc = true; | - |
4165 | } executed: } Execution Count:166 | 166 |
4166 | n->save(s, 0, indent); | - |
4167 | n = n->next; | - |
4168 | } executed: } Execution Count:359 | 359 |
4169 | } executed: } Execution Count:166 | 166 |
4170 | else { | - |
4171 | | - |
4172 | | - |
4173 | | - |
4174 | | - |
4175 | | - |
4176 | const QTextCodec *const codec = s.codec(); | - |
4177 | qt_noop(); | - |
4178 | const QByteArray codecName = codec->name(); | - |
4179 | | - |
4180 | | - |
4181 | s << "<?xml version=\"1.0\" encoding=\"" | - |
4182 | << codecName | - |
4183 | << "\"?>\n"; | - |
4184 | | - |
4185 | | - |
4186 | const QDomNodePrivate* startNode = n; | - |
4187 | | - |
4188 | | - |
4189 | while (n) { evaluated: n yes Evaluation Count:60 | yes Evaluation Count:18 |
| 18-60 |
4190 | if(n->isProcessingInstruction() && n->nodeName() == QLatin1String("xml")) { evaluated: n->isProcessingInstruction() yes Evaluation Count:42 | yes Evaluation Count:18 |
partially evaluated: n->nodeName() == QLatin1String("xml") yes Evaluation Count:42 | no Evaluation Count:0 |
| 0-42 |
4191 | startNode = n->next; | - |
4192 | break; executed: break; Execution Count:42 | 42 |
4193 | } | - |
4194 | else | - |
4195 | n = n->next; executed: n = n->next; Execution Count:18 | 18 |
4196 | } | - |
4197 | | - |
4198 | | - |
4199 | while(startNode) { evaluated: startNode yes Evaluation Count:246 | yes Evaluation Count:60 |
| 60-246 |
4200 | startNode->save(s, 0, indent); | - |
4201 | startNode = startNode->next; | - |
4202 | } executed: } Execution Count:246 | 246 |
4203 | } executed: } Execution Count:60 | 60 |
4204 | } | - |
4205 | QDomDocument::QDomDocument() | - |
4206 | { | - |
4207 | impl = 0; | - |
4208 | } executed: } Execution Count:436 | 436 |
4209 | | - |
4210 | | - |
4211 | | - |
4212 | | - |
4213 | | - |
4214 | QDomDocument::QDomDocument(const QString& name) | - |
4215 | { | - |
4216 | | - |
4217 | impl = new QDomDocumentPrivate(name); | - |
4218 | } executed: } Execution Count:21 | 21 |
4219 | | - |
4220 | | - |
4221 | | - |
4222 | | - |
4223 | | - |
4224 | | - |
4225 | QDomDocument::QDomDocument(const QDomDocumentType& doctype) | - |
4226 | { | - |
4227 | impl = new QDomDocumentPrivate((QDomDocumentTypePrivate*)(doctype.impl)); | - |
4228 | } executed: } Execution Count:28 | 28 |
4229 | QDomDocument::QDomDocument(const QDomDocument& x) | - |
4230 | : QDomNode(x) | - |
4231 | { | - |
4232 | } executed: } Execution Count:14 | 14 |
4233 | | - |
4234 | QDomDocument::QDomDocument(QDomDocumentPrivate* x) | - |
4235 | : QDomNode(x) | - |
4236 | { | - |
4237 | } executed: } Execution Count:479 | 479 |
4238 | QDomDocument& QDomDocument::operator= (const QDomDocument& x) | - |
4239 | { | - |
4240 | return (QDomDocument&) QDomNode::operator=(x); never executed: return (QDomDocument&) QDomNode::operator=(x); | 0 |
4241 | } | - |
4242 | | - |
4243 | | - |
4244 | | - |
4245 | | - |
4246 | QDomDocument::~QDomDocument() | - |
4247 | { | - |
4248 | } | - |
4249 | bool QDomDocument::setContent(const QString& text, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn) | - |
4250 | { | - |
4251 | if (!impl) evaluated: !impl yes Evaluation Count:281 | yes Evaluation Count:2 |
| 2-281 |
4252 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:281 | 281 |
4253 | QXmlInputSource source; | - |
4254 | source.setData(text); | - |
4255 | return ((QDomDocumentPrivate*)impl)->setContent(&source, namespaceProcessing, errorMsg, errorLine, errorColumn); executed: return ((QDomDocumentPrivate*)impl)->setContent(&source, namespaceProcessing, errorMsg, errorLine, errorColumn); Execution Count:283 | 283 |
4256 | } | - |
4257 | bool QDomDocument::setContent(const QByteArray &data, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn) | - |
4258 | { | - |
4259 | if (!impl) evaluated: !impl yes Evaluation Count:6 | yes Evaluation Count:4 |
| 4-6 |
4260 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:6 | 6 |
4261 | QBuffer buf; | - |
4262 | buf.setData(data); | - |
4263 | QXmlInputSource source(&buf); | - |
4264 | return ((QDomDocumentPrivate*)impl)->setContent(&source, namespaceProcessing, errorMsg, errorLine, errorColumn); executed: return ((QDomDocumentPrivate*)impl)->setContent(&source, namespaceProcessing, errorMsg, errorLine, errorColumn); Execution Count:10 | 10 |
4265 | } | - |
4266 | | - |
4267 | | - |
4268 | | - |
4269 | | - |
4270 | | - |
4271 | | - |
4272 | | - |
4273 | bool QDomDocument::setContent(QIODevice* dev, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn) | - |
4274 | { | - |
4275 | if (!impl) partially evaluated: !impl yes Evaluation Count:83 | no Evaluation Count:0 |
| 0-83 |
4276 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:83 | 83 |
4277 | QXmlInputSource source(dev); | - |
4278 | return ((QDomDocumentPrivate*)impl)->setContent(&source, namespaceProcessing, errorMsg, errorLine, errorColumn); executed: return ((QDomDocumentPrivate*)impl)->setContent(&source, namespaceProcessing, errorMsg, errorLine, errorColumn); Execution Count:83 | 83 |
4279 | } | - |
4280 | bool QDomDocument::setContent(QXmlInputSource *source, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn ) | - |
4281 | { | - |
4282 | if (!impl) partially evaluated: !impl yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
4283 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:1 | 1 |
4284 | QXmlSimpleReader reader; | - |
4285 | initializeReader(reader, namespaceProcessing); | - |
4286 | return ((QDomDocumentPrivate*)impl)->setContent(source, &reader, errorMsg, errorLine, errorColumn); executed: return ((QDomDocumentPrivate*)impl)->setContent(source, &reader, errorMsg, errorLine, errorColumn); Execution Count:1 | 1 |
4287 | } | - |
4288 | bool QDomDocument::setContent(const QString& text, QString *errorMsg, int *errorLine, int *errorColumn) | - |
4289 | { | - |
4290 | return setContent(text, false, errorMsg, errorLine, errorColumn); executed: return setContent(text, false, errorMsg, errorLine, errorColumn); Execution Count:280 | 280 |
4291 | } | - |
4292 | bool QDomDocument::setContent(const QByteArray& buffer, QString *errorMsg, int *errorLine, int *errorColumn ) | - |
4293 | { | - |
4294 | return setContent(buffer, false, errorMsg, errorLine, errorColumn); executed: return setContent(buffer, false, errorMsg, errorLine, errorColumn); Execution Count:6 | 6 |
4295 | } | - |
4296 | bool QDomDocument::setContent(QIODevice* dev, QString *errorMsg, int *errorLine, int *errorColumn ) | - |
4297 | { | - |
4298 | return setContent(dev, false, errorMsg, errorLine, errorColumn); executed: return setContent(dev, false, errorMsg, errorLine, errorColumn); Execution Count:81 | 81 |
4299 | } | - |
4300 | bool QDomDocument::setContent(QXmlInputSource *source, QXmlReader *reader, QString *errorMsg, int *errorLine, int *errorColumn ) | - |
4301 | { | - |
4302 | if (!impl) partially evaluated: !impl yes Evaluation Count:8 | no Evaluation Count:0 |
| 0-8 |
4303 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:8 | 8 |
4304 | return ((QDomDocumentPrivate*)impl)->setContent(source, reader, errorMsg, errorLine, errorColumn); executed: return ((QDomDocumentPrivate*)impl)->setContent(source, reader, errorMsg, errorLine, errorColumn); Execution Count:8 | 8 |
4305 | } | - |
4306 | QString QDomDocument::toString(int indent) const | - |
4307 | { | - |
4308 | QString str; | - |
4309 | QTextStream s(&str, QIODevice::WriteOnly); | - |
4310 | save(s, indent); | - |
4311 | return str; executed: return str; Execution Count:154 | 154 |
4312 | } | - |
4313 | QByteArray QDomDocument::toByteArray(int indent) const | - |
4314 | { | - |
4315 | | - |
4316 | | - |
4317 | return toString(indent).toUtf8(); executed: return toString(indent).toUtf8(); Execution Count:4 | 4 |
4318 | } | - |
4319 | | - |
4320 | | - |
4321 | | - |
4322 | | - |
4323 | | - |
4324 | QDomDocumentType QDomDocument::doctype() const | - |
4325 | { | - |
4326 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
4327 | return QDomDocumentType(); never executed: return QDomDocumentType(); | 0 |
4328 | return QDomDocumentType(((QDomDocumentPrivate*)impl)->doctype()); executed: return QDomDocumentType(((QDomDocumentPrivate*)impl)->doctype()); Execution Count:2 | 2 |
4329 | } | - |
4330 | | - |
4331 | | - |
4332 | | - |
4333 | | - |
4334 | QDomImplementation QDomDocument::implementation() const | - |
4335 | { | - |
4336 | if (!impl) | 0 |
4337 | return QDomImplementation(); never executed: return QDomImplementation(); | 0 |
4338 | return QDomImplementation(((QDomDocumentPrivate*)impl)->implementation()); never executed: return QDomImplementation(((QDomDocumentPrivate*)impl)->implementation()); | 0 |
4339 | } | - |
4340 | | - |
4341 | | - |
4342 | | - |
4343 | | - |
4344 | QDomElement QDomDocument::documentElement() const | - |
4345 | { | - |
4346 | if (!impl) partially evaluated: !impl no Evaluation Count:0 | yes Evaluation Count:35 |
| 0-35 |
4347 | return QDomElement(); never executed: return QDomElement(); | 0 |
4348 | return QDomElement(((QDomDocumentPrivate*)impl)->documentElement()); executed: return QDomElement(((QDomDocumentPrivate*)impl)->documentElement()); Execution Count:35 | 35 |
4349 | } | - |
4350 | QDomElement QDomDocument::createElement(const QString& tagName) | - |
4351 | { | - |
4352 | if (!impl) evaluated: !impl yes Evaluation Count:15 | yes Evaluation Count:87 |
| 15-87 |
4353 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:15 | 15 |
4354 | return QDomElement(((QDomDocumentPrivate*)impl)->createElement(tagName)); executed: return QDomElement(((QDomDocumentPrivate*)impl)->createElement(tagName)); Execution Count:102 | 102 |
4355 | } | - |
4356 | | - |
4357 | | - |
4358 | | - |
4359 | | - |
4360 | | - |
4361 | | - |
4362 | QDomDocumentFragment QDomDocument::createDocumentFragment() | - |
4363 | { | - |
4364 | if (!impl) evaluated: !impl yes Evaluation Count:1 | yes Evaluation Count:18 |
| 1-18 |
4365 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:1 | 1 |
4366 | return QDomDocumentFragment(((QDomDocumentPrivate*)impl)->createDocumentFragment()); executed: return QDomDocumentFragment(((QDomDocumentPrivate*)impl)->createDocumentFragment()); Execution Count:19 | 19 |
4367 | } | - |
4368 | QDomText QDomDocument::createTextNode(const QString& value) | - |
4369 | { | - |
4370 | if (!impl) evaluated: !impl yes Evaluation Count:5 | yes Evaluation Count:44 |
| 5-44 |
4371 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:5 | 5 |
4372 | return QDomText(((QDomDocumentPrivate*)impl)->createTextNode(value)); executed: return QDomText(((QDomDocumentPrivate*)impl)->createTextNode(value)); Execution Count:49 | 49 |
4373 | } | - |
4374 | QDomComment QDomDocument::createComment(const QString& value) | - |
4375 | { | - |
4376 | if (!impl) evaluated: !impl yes Evaluation Count:1 | yes Evaluation Count:18 |
| 1-18 |
4377 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:1 | 1 |
4378 | return QDomComment(((QDomDocumentPrivate*)impl)->createComment(value)); executed: return QDomComment(((QDomDocumentPrivate*)impl)->createComment(value)); Execution Count:19 | 19 |
4379 | } | - |
4380 | QDomCDATASection QDomDocument::createCDATASection(const QString& value) | - |
4381 | { | - |
4382 | if (!impl) evaluated: !impl yes Evaluation Count:1 | yes Evaluation Count:18 |
| 1-18 |
4383 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:1 | 1 |
4384 | return QDomCDATASection(((QDomDocumentPrivate*)impl)->createCDATASection(value)); executed: return QDomCDATASection(((QDomDocumentPrivate*)impl)->createCDATASection(value)); Execution Count:19 | 19 |
4385 | } | - |
4386 | QDomProcessingInstruction QDomDocument::createProcessingInstruction(const QString& target, | - |
4387 | const QString& data) | - |
4388 | { | - |
4389 | if (!impl) evaluated: !impl yes Evaluation Count:1 | yes Evaluation Count:18 |
| 1-18 |
4390 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:1 | 1 |
4391 | return QDomProcessingInstruction(((QDomDocumentPrivate*)impl)->createProcessingInstruction(target, data)); executed: return QDomProcessingInstruction(((QDomDocumentPrivate*)impl)->createProcessingInstruction(target, data)); Execution Count:19 | 19 |
4392 | } | - |
4393 | QDomAttr QDomDocument::createAttribute(const QString& name) | - |
4394 | { | - |
4395 | if (!impl) evaluated: !impl yes Evaluation Count:7 | yes Evaluation Count:34 |
| 7-34 |
4396 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:7 | 7 |
4397 | return QDomAttr(((QDomDocumentPrivate*)impl)->createAttribute(name)); executed: return QDomAttr(((QDomDocumentPrivate*)impl)->createAttribute(name)); Execution Count:41 | 41 |
4398 | } | - |
4399 | QDomEntityReference QDomDocument::createEntityReference(const QString& name) | - |
4400 | { | - |
4401 | if (!impl) evaluated: !impl yes Evaluation Count:1 | yes Evaluation Count:39 |
| 1-39 |
4402 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:1 | 1 |
4403 | return QDomEntityReference(((QDomDocumentPrivate*)impl)->createEntityReference(name)); executed: return QDomEntityReference(((QDomDocumentPrivate*)impl)->createEntityReference(name)); Execution Count:40 | 40 |
4404 | } | - |
4405 | QDomNodeList QDomDocument::elementsByTagName(const QString& tagname) const | - |
4406 | { | - |
4407 | return QDomNodeList(new QDomNodeListPrivate(impl, tagname)); executed: return QDomNodeList(new QDomNodeListPrivate(impl, tagname)); Execution Count:1 | 1 |
4408 | } | - |
4409 | QDomNode QDomDocument::importNode(const QDomNode& importedNode, bool deep) | - |
4410 | { | - |
4411 | if (!impl) evaluated: !impl yes Evaluation Count:1 | yes Evaluation Count:60 |
| 1-60 |
4412 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:1 | 1 |
4413 | return QDomNode(((QDomDocumentPrivate*)impl)->importNode(importedNode.impl, deep)); executed: return QDomNode(((QDomDocumentPrivate*)impl)->importNode(importedNode.impl, deep)); Execution Count:61 | 61 |
4414 | } | - |
4415 | QDomElement QDomDocument::createElementNS(const QString& nsURI, const QString& qName) | - |
4416 | { | - |
4417 | if (!impl) evaluated: !impl yes Evaluation Count:9 | yes Evaluation Count:83 |
| 9-83 |
4418 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:9 | 9 |
4419 | return QDomElement(((QDomDocumentPrivate*)impl)->createElementNS(nsURI, qName)); executed: return QDomElement(((QDomDocumentPrivate*)impl)->createElementNS(nsURI, qName)); Execution Count:92 | 92 |
4420 | } | - |
4421 | QDomAttr QDomDocument::createAttributeNS(const QString& nsURI, const QString& qName) | - |
4422 | { | - |
4423 | if (!impl) evaluated: !impl yes Evaluation Count:1 | yes Evaluation Count:63 |
| 1-63 |
4424 | impl = new QDomDocumentPrivate(); executed: impl = new QDomDocumentPrivate(); Execution Count:1 | 1 |
4425 | return QDomAttr(((QDomDocumentPrivate*)impl)->createAttributeNS(nsURI, qName)); executed: return QDomAttr(((QDomDocumentPrivate*)impl)->createAttributeNS(nsURI, qName)); Execution Count:64 | 64 |
4426 | } | - |
4427 | QDomNodeList QDomDocument::elementsByTagNameNS(const QString& nsURI, const QString& localName) | - |
4428 | { | - |
4429 | return QDomNodeList(new QDomNodeListPrivate(impl, nsURI, localName)); never executed: return QDomNodeList(new QDomNodeListPrivate(impl, nsURI, localName)); | 0 |
4430 | } | - |
4431 | QDomElement QDomDocument::elementById(const QString& ) | - |
4432 | { | - |
4433 | QMessageLogger("dom/qdom.cpp", 7170, __PRETTY_FUNCTION__).warning("elementById() is not implemented and will always return a null node."); | - |
4434 | return QDomElement(); never executed: return QDomElement(); | 0 |
4435 | } | - |
4436 | QDomAttr QDomNode::toAttr() const | - |
4437 | { | - |
4438 | if (impl && impl->isAttr()) partially evaluated: impl yes Evaluation Count:1 | no Evaluation Count:0 |
partially evaluated: impl->isAttr() yes Evaluation Count:1 | no Evaluation Count:0 |
| 0-1 |
4439 | return QDomAttr(((QDomAttrPrivate*)impl)); executed: return QDomAttr(((QDomAttrPrivate*)impl)); Execution Count:1 | 1 |
4440 | return QDomAttr(); never executed: return QDomAttr(); | 0 |
4441 | } | - |
4442 | | - |
4443 | | - |
4444 | | - |
4445 | | - |
4446 | | - |
4447 | | - |
4448 | | - |
4449 | QDomCDATASection QDomNode::toCDATASection() const | - |
4450 | { | - |
4451 | if (impl && impl->isCDATASection()) never evaluated: impl->isCDATASection() | 0 |
4452 | return QDomCDATASection(((QDomCDATASectionPrivate*)impl)); never executed: return QDomCDATASection(((QDomCDATASectionPrivate*)impl)); | 0 |
4453 | return QDomCDATASection(); never executed: return QDomCDATASection(); | 0 |
4454 | } | - |
4455 | | - |
4456 | | - |
4457 | | - |
4458 | | - |
4459 | | - |
4460 | | - |
4461 | | - |
4462 | QDomDocumentFragment QDomNode::toDocumentFragment() const | - |
4463 | { | - |
4464 | if (impl && impl->isDocumentFragment()) never evaluated: impl->isDocumentFragment() | 0 |
4465 | return QDomDocumentFragment(((QDomDocumentFragmentPrivate*)impl)); never executed: return QDomDocumentFragment(((QDomDocumentFragmentPrivate*)impl)); | 0 |
4466 | return QDomDocumentFragment(); never executed: return QDomDocumentFragment(); | 0 |
4467 | } | - |
4468 | | - |
4469 | | - |
4470 | | - |
4471 | | - |
4472 | | - |
4473 | | - |
4474 | | - |
4475 | QDomDocument QDomNode::toDocument() const | - |
4476 | { | - |
4477 | if (impl && impl->isDocument()) partially evaluated: impl yes Evaluation Count:2 | no Evaluation Count:0 |
evaluated: impl->isDocument() yes Evaluation Count:1 | yes Evaluation Count:1 |
| 0-2 |
4478 | return QDomDocument(((QDomDocumentPrivate*)impl)); executed: return QDomDocument(((QDomDocumentPrivate*)impl)); Execution Count:1 | 1 |
4479 | return QDomDocument(); executed: return QDomDocument(); Execution Count:1 | 1 |
4480 | } | - |
4481 | | - |
4482 | | - |
4483 | | - |
4484 | | - |
4485 | | - |
4486 | | - |
4487 | | - |
4488 | QDomDocumentType QDomNode::toDocumentType() const | - |
4489 | { | - |
4490 | if (impl && impl->isDocumentType()) never evaluated: impl->isDocumentType() | 0 |
4491 | return QDomDocumentType(((QDomDocumentTypePrivate*)impl)); never executed: return QDomDocumentType(((QDomDocumentTypePrivate*)impl)); | 0 |
4492 | return QDomDocumentType(); never executed: return QDomDocumentType(); | 0 |
4493 | } | - |
4494 | | - |
4495 | | - |
4496 | | - |
4497 | | - |
4498 | | - |
4499 | | - |
4500 | | - |
4501 | QDomElement QDomNode::toElement() const | - |
4502 | { | - |
4503 | if (impl && impl->isElement()) partially evaluated: impl yes Evaluation Count:23 | no Evaluation Count:0 |
evaluated: impl->isElement() yes Evaluation Count:22 | yes Evaluation Count:1 |
| 0-23 |
4504 | return QDomElement(((QDomElementPrivate*)impl)); executed: return QDomElement(((QDomElementPrivate*)impl)); Execution Count:22 | 22 |
4505 | return QDomElement(); executed: return QDomElement(); Execution Count:1 | 1 |
4506 | } | - |
4507 | | - |
4508 | | - |
4509 | | - |
4510 | | - |
4511 | | - |
4512 | | - |
4513 | | - |
4514 | QDomEntityReference QDomNode::toEntityReference() const | - |
4515 | { | - |
4516 | if (impl && impl->isEntityReference()) never evaluated: impl->isEntityReference() | 0 |
4517 | return QDomEntityReference(((QDomEntityReferencePrivate*)impl)); never executed: return QDomEntityReference(((QDomEntityReferencePrivate*)impl)); | 0 |
4518 | return QDomEntityReference(); never executed: return QDomEntityReference(); | 0 |
4519 | } | - |
4520 | | - |
4521 | | - |
4522 | | - |
4523 | | - |
4524 | | - |
4525 | | - |
4526 | | - |
4527 | QDomText QDomNode::toText() const | - |
4528 | { | - |
4529 | if (impl && impl->isText()) never evaluated: impl->isText() | 0 |
4530 | return QDomText(((QDomTextPrivate*)impl)); never executed: return QDomText(((QDomTextPrivate*)impl)); | 0 |
4531 | return QDomText(); never executed: return QDomText(); | 0 |
4532 | } | - |
4533 | | - |
4534 | | - |
4535 | | - |
4536 | | - |
4537 | | - |
4538 | | - |
4539 | | - |
4540 | QDomEntity QDomNode::toEntity() const | - |
4541 | { | - |
4542 | if (impl && impl->isEntity()) partially evaluated: impl yes Evaluation Count:4 | no Evaluation Count:0 |
partially evaluated: impl->isEntity() yes Evaluation Count:4 | no Evaluation Count:0 |
| 0-4 |
4543 | return QDomEntity(((QDomEntityPrivate*)impl)); executed: return QDomEntity(((QDomEntityPrivate*)impl)); Execution Count:4 | 4 |
4544 | return QDomEntity(); never executed: return QDomEntity(); | 0 |
4545 | } | - |
4546 | | - |
4547 | | - |
4548 | | - |
4549 | | - |
4550 | | - |
4551 | | - |
4552 | | - |
4553 | QDomNotation QDomNode::toNotation() const | - |
4554 | { | - |
4555 | if (impl && impl->isNotation()) partially evaluated: impl yes Evaluation Count:2 | no Evaluation Count:0 |
partially evaluated: impl->isNotation() yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
4556 | return QDomNotation(((QDomNotationPrivate*)impl)); executed: return QDomNotation(((QDomNotationPrivate*)impl)); Execution Count:2 | 2 |
4557 | return QDomNotation(); never executed: return QDomNotation(); | 0 |
4558 | } | - |
4559 | | - |
4560 | | - |
4561 | | - |
4562 | | - |
4563 | | - |
4564 | | - |
4565 | | - |
4566 | QDomProcessingInstruction QDomNode::toProcessingInstruction() const | - |
4567 | { | - |
4568 | if (impl && impl->isProcessingInstruction()) never evaluated: impl->isProcessingInstruction() | 0 |
4569 | return QDomProcessingInstruction(((QDomProcessingInstructionPrivate*)impl)); never executed: return QDomProcessingInstruction(((QDomProcessingInstructionPrivate*)impl)); | 0 |
4570 | return QDomProcessingInstruction(); never executed: return QDomProcessingInstruction(); | 0 |
4571 | } | - |
4572 | | - |
4573 | | - |
4574 | | - |
4575 | | - |
4576 | | - |
4577 | | - |
4578 | | - |
4579 | QDomCharacterData QDomNode::toCharacterData() const | - |
4580 | { | - |
4581 | if (impl && impl->isCharacterData()) never evaluated: impl->isCharacterData() | 0 |
4582 | return QDomCharacterData(((QDomCharacterDataPrivate*)impl)); never executed: return QDomCharacterData(((QDomCharacterDataPrivate*)impl)); | 0 |
4583 | return QDomCharacterData(); never executed: return QDomCharacterData(); | 0 |
4584 | } | - |
4585 | | - |
4586 | | - |
4587 | | - |
4588 | | - |
4589 | | - |
4590 | | - |
4591 | | - |
4592 | QDomComment QDomNode::toComment() const | - |
4593 | { | - |
4594 | if (impl && impl->isComment()) never evaluated: impl->isComment() | 0 |
4595 | return QDomComment(((QDomCommentPrivate*)impl)); never executed: return QDomComment(((QDomCommentPrivate*)impl)); | 0 |
4596 | return QDomComment(); never executed: return QDomComment(); | 0 |
4597 | } | - |
4598 | | - |
4599 | | - |
4600 | | - |
4601 | | - |
4602 | | - |
4603 | | - |
4604 | | - |
4605 | QDomHandler::QDomHandler(QDomDocumentPrivate* adoc, bool namespaceProcessing) | - |
4606 | : errorLine(0), errorColumn(0), doc(adoc), node(adoc), cdata(false), | - |
4607 | nsProcessing(namespaceProcessing), locator(0) | - |
4608 | { | - |
4609 | } executed: } Execution Count:385 | 385 |
4610 | | - |
4611 | QDomHandler::~QDomHandler() | - |
4612 | { | - |
4613 | } | - |
4614 | | - |
4615 | bool QDomHandler::endDocument() | - |
4616 | { | - |
4617 | | - |
4618 | if (node != doc) partially evaluated: node != doc no Evaluation Count:0 | yes Evaluation Count:371 |
| 0-371 |
4619 | return false; never executed: return false; | 0 |
4620 | return true; executed: return true; Execution Count:371 | 371 |
4621 | } | - |
4622 | | - |
4623 | bool QDomHandler::startDTD(const QString& name, const QString& publicId, const QString& systemId) | - |
4624 | { | - |
4625 | doc->doctype()->name = name; | - |
4626 | doc->doctype()->publicId = publicId; | - |
4627 | doc->doctype()->systemId = systemId; | - |
4628 | return true; executed: return true; Execution Count:124 | 124 |
4629 | } | - |
4630 | | - |
4631 | bool QDomHandler::startElement(const QString& nsURI, const QString&, const QString& qName, const QXmlAttributes& atts) | - |
4632 | { | - |
4633 | | - |
4634 | QDomNodePrivate* n; | - |
4635 | if (nsProcessing) { evaluated: nsProcessing yes Evaluation Count:58 | yes Evaluation Count:37826 |
| 58-37826 |
4636 | n = doc->createElementNS(nsURI, qName); | - |
4637 | } else { executed: } Execution Count:58 | 58 |
4638 | n = doc->createElement(qName); | - |
4639 | } executed: } Execution Count:37826 | 37826 |
4640 | | - |
4641 | if (!n) evaluated: !n yes Evaluation Count:1 | yes Evaluation Count:37883 |
| 1-37883 |
4642 | return false; executed: return false; Execution Count:1 | 1 |
4643 | | - |
4644 | n->setLocation(locator->lineNumber(), locator->columnNumber()); | - |
4645 | | - |
4646 | node->appendChild(n); | - |
4647 | node = n; | - |
4648 | | - |
4649 | | - |
4650 | for (int i=0; i<atts.length(); i++) evaluated: i<atts.length() yes Evaluation Count:16752 | yes Evaluation Count:37883 |
| 16752-37883 |
4651 | { | - |
4652 | if (nsProcessing) { evaluated: nsProcessing yes Evaluation Count:13 | yes Evaluation Count:16739 |
| 13-16739 |
4653 | ((QDomElementPrivate*)node)->setAttributeNS(atts.uri(i), atts.qName(i), atts.value(i)); | - |
4654 | } else { executed: } Execution Count:13 | 13 |
4655 | ((QDomElementPrivate*)node)->setAttribute(atts.qName(i), atts.value(i)); | - |
4656 | } executed: } Execution Count:16739 | 16739 |
4657 | } | - |
4658 | | - |
4659 | return true; executed: return true; Execution Count:37883 | 37883 |
4660 | } | - |
4661 | | - |
4662 | bool QDomHandler::endElement(const QString&, const QString&, const QString&) | - |
4663 | { | - |
4664 | if (!node || node == doc) partially evaluated: !node no Evaluation Count:0 | yes Evaluation Count:37883 |
partially evaluated: node == doc no Evaluation Count:0 | yes Evaluation Count:37883 |
| 0-37883 |
4665 | return false; never executed: return false; | 0 |
4666 | node = node->parent(); | - |
4667 | | - |
4668 | return true; executed: return true; Execution Count:37883 | 37883 |
4669 | } | - |
4670 | | - |
4671 | bool QDomHandler::characters(const QString& ch) | - |
4672 | { | - |
4673 | | - |
4674 | if (node == doc) partially evaluated: node == doc no Evaluation Count:0 | yes Evaluation Count:36502 |
| 0-36502 |
4675 | return false; never executed: return false; | 0 |
4676 | | - |
4677 | QScopedPointer<QDomNodePrivate> n; | - |
4678 | if (cdata) { evaluated: cdata yes Evaluation Count:184 | yes Evaluation Count:36318 |
| 184-36318 |
4679 | n.reset(doc->createCDATASection(ch)); | - |
4680 | } else if (!entityName.isEmpty()) { evaluated: !entityName.isEmpty() yes Evaluation Count:2 | yes Evaluation Count:36316 |
executed: } Execution Count:184 | 2-36316 |
4681 | QScopedPointer<QDomEntityPrivate> e(new QDomEntityPrivate(doc, 0, entityName, | - |
4682 | QString(), QString(), QString())); | - |
4683 | e->value = ch; | - |
4684 | e->ref.deref(); | - |
4685 | doc->doctype()->appendChild(e.data()); | - |
4686 | e.take(); | - |
4687 | n.reset(doc->createEntityReference(entityName)); | - |
4688 | } else { executed: } Execution Count:2 | 2 |
4689 | n.reset(doc->createTextNode(ch)); | - |
4690 | } executed: } Execution Count:36316 | 36316 |
4691 | n->setLocation(locator->lineNumber(), locator->columnNumber()); | - |
4692 | node->appendChild(n.data()); | - |
4693 | n.take(); | - |
4694 | | - |
4695 | return true; executed: return true; Execution Count:36502 | 36502 |
4696 | } | - |
4697 | | - |
4698 | bool QDomHandler::processingInstruction(const QString& target, const QString& data) | - |
4699 | { | - |
4700 | QDomNodePrivate *n; | - |
4701 | n = doc->createProcessingInstruction(target, data); | - |
4702 | if (n) { partially evaluated: n yes Evaluation Count:132 | no Evaluation Count:0 |
| 0-132 |
4703 | n->setLocation(locator->lineNumber(), locator->columnNumber()); | - |
4704 | node->appendChild(n); | - |
4705 | return true; executed: return true; Execution Count:132 | 132 |
4706 | } | - |
4707 | else | - |
4708 | return false; never executed: return false; | 0 |
4709 | } | - |
4710 | | - |
4711 | extern bool qt_xml_skipped_entity_in_content; | - |
4712 | bool QDomHandler::skippedEntity(const QString& name) | - |
4713 | { | - |
4714 | | - |
4715 | if (!qt_xml_skipped_entity_in_content) never evaluated: !qt_xml_skipped_entity_in_content | 0 |
4716 | return true; never executed: return true; | 0 |
4717 | | - |
4718 | QDomNodePrivate *n = doc->createEntityReference(name); | - |
4719 | n->setLocation(locator->lineNumber(), locator->columnNumber()); | - |
4720 | node->appendChild(n); | - |
4721 | return true; never executed: return true; | 0 |
4722 | } | - |
4723 | | - |
4724 | bool QDomHandler::fatalError(const QXmlParseException& exception) | - |
4725 | { | - |
4726 | errorMsg = exception.message(); | - |
4727 | errorLine = exception.lineNumber(); | - |
4728 | errorColumn = exception.columnNumber(); | - |
4729 | return QXmlDefaultHandler::fatalError(exception); executed: return QXmlDefaultHandler::fatalError(exception); Execution Count:14 | 14 |
4730 | } | - |
4731 | | - |
4732 | bool QDomHandler::startCDATA() | - |
4733 | { | - |
4734 | cdata = true; | - |
4735 | return true; executed: return true; Execution Count:184 | 184 |
4736 | } | - |
4737 | | - |
4738 | bool QDomHandler::endCDATA() | - |
4739 | { | - |
4740 | cdata = false; | - |
4741 | return true; executed: return true; Execution Count:184 | 184 |
4742 | } | - |
4743 | | - |
4744 | bool QDomHandler::startEntity(const QString &name) | - |
4745 | { | - |
4746 | entityName = name; | - |
4747 | return true; executed: return true; Execution Count:2 | 2 |
4748 | } | - |
4749 | | - |
4750 | bool QDomHandler::endEntity(const QString &) | - |
4751 | { | - |
4752 | entityName.clear(); | - |
4753 | return true; executed: return true; Execution Count:2 | 2 |
4754 | } | - |
4755 | | - |
4756 | bool QDomHandler::comment(const QString& ch) | - |
4757 | { | - |
4758 | QDomNodePrivate *n; | - |
4759 | n = doc->createComment(ch); | - |
4760 | n->setLocation(locator->lineNumber(), locator->columnNumber()); | - |
4761 | node->appendChild(n); | - |
4762 | return true; executed: return true; Execution Count:1943 | 1943 |
4763 | } | - |
4764 | | - |
4765 | bool QDomHandler::unparsedEntityDecl(const QString &name, const QString &publicId, const QString &systemId, const QString ¬ationName) | - |
4766 | { | - |
4767 | QDomEntityPrivate* e = new QDomEntityPrivate(doc, 0, name, | - |
4768 | publicId, systemId, notationName); | - |
4769 | | - |
4770 | e->ref.deref(); | - |
4771 | doc->doctype()->appendChild(e); | - |
4772 | return true; executed: return true; Execution Count:4 | 4 |
4773 | } | - |
4774 | | - |
4775 | bool QDomHandler::externalEntityDecl(const QString &name, const QString &publicId, const QString &systemId) | - |
4776 | { | - |
4777 | return unparsedEntityDecl(name, publicId, systemId, QString()); executed: return unparsedEntityDecl(name, publicId, systemId, QString()); Execution Count:3 | 3 |
4778 | } | - |
4779 | | - |
4780 | bool QDomHandler::notationDecl(const QString & name, const QString & publicId, const QString & systemId) | - |
4781 | { | - |
4782 | QDomNotationPrivate* n = new QDomNotationPrivate(doc, 0, name, publicId, systemId); | - |
4783 | | - |
4784 | n->ref.deref(); | - |
4785 | doc->doctype()->appendChild(n); | - |
4786 | return true; executed: return true; Execution Count:2 | 2 |
4787 | } | - |
4788 | | - |
4789 | void QDomHandler::setDocumentLocator(QXmlLocator *locator) | - |
4790 | { | - |
4791 | this->locator = locator; | - |
4792 | } executed: } Execution Count:385 | 385 |
4793 | | - |
4794 | | - |
4795 | | - |
| | |