diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2013-02-06 08:19:53 +0000 |
|---|---|---|
| committer | Jabiertxo Arraiza Cenoz <jtx@jtx.marker.es> | 2013-02-06 08:19:53 +0000 |
| commit | 549a79b5367ffd259a23fbd18e93199d1c0149b7 (patch) | |
| tree | 9c4ce4a0217afa63b59f32d02a60b848f43a9520 /src/dom | |
| parent | Merge from branch (diff) | |
| parent | Supress Pango error message. (diff) | |
| download | inkscape-549a79b5367ffd259a23fbd18e93199d1c0149b7.tar.gz inkscape-549a79b5367ffd259a23fbd18e93199d1c0149b7.zip | |
Merge from branch
(bzr r11950.1.19)
Diffstat (limited to 'src/dom')
| -rw-r--r-- | src/dom/css.h | 14 | ||||
| -rw-r--r-- | src/dom/dom.h | 27 | ||||
| -rw-r--r-- | src/dom/domimpl.cpp | 34 | ||||
| -rw-r--r-- | src/dom/domimpl.h | 14 | ||||
| -rw-r--r-- | src/dom/domptr.h | 2 | ||||
| -rw-r--r-- | src/dom/events.h | 48 | ||||
| -rw-r--r-- | src/dom/io/domstream.h | 11 | ||||
| -rw-r--r-- | src/dom/io/gzipstream.cpp | 2 | ||||
| -rw-r--r-- | src/dom/lsimpl.cpp | 2 | ||||
| -rw-r--r-- | src/dom/odf/odfdocument.cpp | 16 | ||||
| -rw-r--r-- | src/dom/smil.h | 28 | ||||
| -rw-r--r-- | src/dom/stylesheets.h | 19 | ||||
| -rw-r--r-- | src/dom/traversal.h | 18 |
13 files changed, 146 insertions, 89 deletions
diff --git a/src/dom/css.h b/src/dom/css.h index 2776b6d20..f270b99eb 100644 --- a/src/dom/css.h +++ b/src/dom/css.h @@ -269,8 +269,8 @@ public: * */ CSSRuleList(const CSSRuleList &other) + : rules (other.rules) { - rules = other.rules; } /** @@ -1012,9 +1012,10 @@ public: /** * */ - CSSFontFaceRule(const CSSFontFaceRule &other) : CSSRule(other) + CSSFontFaceRule(const CSSFontFaceRule &other) + : CSSRule(other), + style (other.style) { - style = other.style; } /** @@ -1433,9 +1434,10 @@ public: /** * */ - CSSValueList(const CSSValueList &other) : CSSValue(other) + CSSValueList(const CSSValueList &other) + : CSSValue(other), + items (other.items) { - items = other.items; } /** @@ -2014,8 +2016,8 @@ public: * */ ElementCSSInlineStyle(const ElementCSSInlineStyle &other) + : style (other.style) { - style = other.style; } /** diff --git a/src/dom/dom.h b/src/dom/dom.h index c12c02869..22fd09ebf 100644 --- a/src/dom/dom.h +++ b/src/dom/dom.h @@ -224,7 +224,8 @@ public: DOMException(const DOMString &reasonMsg) - { msg = reasonMsg; } + : msg (reasonMsg) + { } DOMException(short theCode) { @@ -318,8 +319,8 @@ public: * */ DOMStringList(const DOMStringList &other) + : strings (other.strings) { - strings = other.strings; } /** @@ -369,14 +370,14 @@ private: { public: NamePair(const DOMString &theNamespaceURI, const DOMString &theName) + : namespaceURI (theNamespaceURI), + name (theName) { - namespaceURI = theNamespaceURI; - name = theName; } NamePair(const NamePair &other) + : namespaceURI (other.namespaceURI), + name (other.name) { - namespaceURI = other.namespaceURI; - name = other.name; } NamePair &operator=(const NamePair &other) { @@ -463,8 +464,8 @@ public: * */ NameList(const NameList &other) + : namePairs (other.namePairs) { - namePairs = other.namePairs; } /** @@ -533,8 +534,8 @@ public: * */ DOMImplementationList(const DOMImplementationList &other) + : implementations (other.implementations) { - implementations = other.implementations; } /** @@ -1018,8 +1019,8 @@ public: * */ NodeList(const NodeList &other) + : nodes (other.nodes) { - nodes = other.nodes; } /** @@ -1087,10 +1088,10 @@ private: NamedNodeMapEntry(const DOMString &theNamespaceURI, const DOMString &theName, const NodePtr theNode) + : namespaceURI (theNamespaceURI), + name (theName), + node (theNode) { - namespaceURI = theNamespaceURI; - name = theName; - node = theNode; } NamedNodeMapEntry(const NamedNodeMapEntry &other) { @@ -1277,8 +1278,8 @@ public: * */ NamedNodeMap(const NamedNodeMap &other) + : entries (other.entries) { - entries = other.entries; } /** diff --git a/src/dom/domimpl.cpp b/src/dom/domimpl.cpp index 9f25cb3be..3d9a29592 100644 --- a/src/dom/domimpl.cpp +++ b/src/dom/domimpl.cpp @@ -1701,7 +1701,6 @@ void ElementImpl::normalizeNamespaces() if (attrNode->getNodeType() != Node::ATTRIBUTE_NODE) continue; AttrImplPtr attr = reinterpret_cast<AttrImpl *>(attrNode.get()); - DOMString attrNS = attr->getNamespaceURI(); DOMString attrName = attr->getLocalName(); DOMString attrPrefix = attr->getPrefix(); DOMString attrValue = attr->getNodeValue(); @@ -1826,7 +1825,6 @@ void ElementImpl::normalizeNamespaces() AttrPtr attr = reinterpret_cast<Attr *>(attrNode.get()); DOMString attrNS = attr->getNamespaceURI(); DOMString attrPrefix = attr->getPrefix(); - DOMString attrValue = attr->getNodeValue(); if (attrNS == XMLNSNAME) continue; @@ -2360,12 +2358,15 @@ CDATASectionImpl::~CDATASectionImpl() DocumentTypeImpl::DocumentTypeImpl(const DOMString& theName, const DOMString& thePublicId, const DOMString& theSystemId) - : NodeImpl() + : NodeImpl(), + name(), //what with this variable? + publicId(thePublicId), + systemId(theSystemId), + entities(), + notations() { - nodeType = DOCUMENT_TYPE_NODE; - nodeName = theName; - publicId = thePublicId; - systemId = theSystemId; + nodeType = DOCUMENT_TYPE_NODE;//of class NodeImpl + nodeName = theName;//of class NodeImpl } /** @@ -3017,19 +3018,22 @@ NodePtr DocumentImpl::renameNode(const NodePtr node, DocumentImpl::DocumentImpl(const DOMImplementation *domImpl, const DOMString &/*theNamespaceURI*/, const DOMString &theQualifiedName, - const DocumentTypePtr theDoctype) : NodeImpl() -{ - nodeType = DOCUMENT_NODE; - nodeName = "#document"; - parent = const_cast<DOMImplementation *>(domImpl); - //documentURI = stringCache(theNamespaceURI); - qualifiedName = theQualifiedName; + const DocumentTypePtr theDoctype) + : NodeImpl(), + namespaceIndex(0), + parent(const_cast<DOMImplementation *>(domImpl)), + qualifiedName(theQualifiedName), + xmlStandalone(false), + strictErrorChecking(false), + domConfig(NULL) +{ + nodeType = DOCUMENT_NODE;//of class NodeImpl + nodeName = "#document";//of class NodeImpl if (theDoctype.get()) //only assign if not null. doctype = theDoctype; else doctype = new DocumentTypeImpl("", "", ""); documentElement = new ElementImpl(this, "root"); - namespaceIndex = 0; } diff --git a/src/dom/domimpl.h b/src/dom/domimpl.h index 5fe508076..df586f35e 100644 --- a/src/dom/domimpl.h +++ b/src/dom/domimpl.h @@ -526,11 +526,11 @@ protected: UserDataEntry(const DOMString &theKey, const DOMUserData *theData, const UserDataHandler *theHandler) + : next(NULL), + key(theKey), + data(const_cast<DOMUserData *>(theData)), + handler(const_cast<UserDataHandler *>(theHandler)) { - next = NULL; - key = theKey; - data = const_cast<DOMUserData *>(theData); - handler = const_cast<UserDataHandler *>(theHandler); } virtual ~UserDataEntry() @@ -1967,10 +1967,10 @@ protected: next = NULL; } NamedElementItem(const DOMString &nameArg, ElementPtr elemArg) + : next (NULL), + name (nameArg), + elem (elemArg) { - next = NULL; - name = nameArg; - elem = elemArg; } ~NamedElementItem() { diff --git a/src/dom/domptr.h b/src/dom/domptr.h index 5a1299867..aa9d4c208 100644 --- a/src/dom/domptr.h +++ b/src/dom/domptr.h @@ -153,7 +153,7 @@ public: template<class Y> Ptr &operator=(const Y * ref) { decrementRefCount(_ref); - _ref = (Y *) ref; + _ref = const_cast<Y *>(ref); incrementRefCount(_ref); return *this; } diff --git a/src/dom/events.h b/src/dom/events.h index 9f44fe591..59d83afcf 100644 --- a/src/dom/events.h +++ b/src/dom/events.h @@ -643,8 +643,8 @@ public: * */ EventTarget(const EventTarget &other) + : listeners (other.listeners) { - listeners = other.listeners; } /** @@ -704,7 +704,9 @@ public: /** * */ - DocumentEvent() {} + DocumentEvent() + : dispatchable(false) + {} /** * @@ -791,7 +793,10 @@ public: /** * */ - CustomEvent() {} + CustomEvent() + : propagationStopped(false), + immediatePropagationStopped(false) + {} /** * @@ -884,15 +889,19 @@ public: /** * */ - UIEvent() {} + UIEvent() + : view(), + detail(0) + {} /** * */ - UIEvent(const UIEvent &other) : Event(other) + UIEvent(const UIEvent &other) + : Event(other), + view(other.view), + detail(other.detail) { - view = other.view; - detail = other.detail; } /** @@ -1152,7 +1161,18 @@ public: /** * */ - MouseEvent() {} + MouseEvent() + : screenX(0), + screenY(0), + clientX(0), + clientY(0), + ctrlKey(false), + shiftKey(false), + altKey(false), + metaKey(false), + button(0), + relatedTarget(NULL) + {} /** * @@ -1322,7 +1342,14 @@ public: /** * */ - KeyboardEvent() {} + KeyboardEvent() + : keyIdentifier(), + keyLocation(0), + ctrlKey(false), + shiftKey(false), + altKey(false), + metaKey(false) + {} /** * @@ -1472,8 +1499,9 @@ public: * */ MutationEvent() + : relatedNodePtr (NULL), + attrChange(0) { - relatedNodePtr = NULL; } /** diff --git a/src/dom/io/domstream.h b/src/dom/io/domstream.h index b2e308653..1a93e73b2 100644 --- a/src/dom/io/domstream.h +++ b/src/dom/io/domstream.h @@ -51,7 +51,8 @@ class StreamException public: StreamException(const DOMString &theReason) throw() - { reason = theReason; } + : reason(theReason) + {} virtual ~StreamException() throw() { } char const *what() @@ -576,7 +577,13 @@ protected: Writer *destination; BasicWriter() - { destination = NULL; } + { + destination = NULL; + for(int k=0;k<2048;++k) + { + formatBuf[k]=0; + } + } //Used for printf() or other things that might //require formatting before sending down the stream diff --git a/src/dom/io/gzipstream.cpp b/src/dom/io/gzipstream.cpp index e1f9f9a60..2a2f8a5b5 100644 --- a/src/dom/io/gzipstream.cpp +++ b/src/dom/io/gzipstream.cpp @@ -188,7 +188,7 @@ void GzipOutputStream::close() */ void GzipOutputStream::flush() { - if (closed || buffer.size()<1) + if (closed || buffer.empty()) return; std::vector<unsigned char> compBuf; diff --git a/src/dom/lsimpl.cpp b/src/dom/lsimpl.cpp index 94b0adeb7..d4da0d5ce 100644 --- a/src/dom/lsimpl.cpp +++ b/src/dom/lsimpl.cpp @@ -227,7 +227,7 @@ bool LSSerializerImpl::writeToURI(const NodePtr nodeArg, DOMString uri = uriArg; char *fileName = (char *) uri.c_str(); //temporary hack - FILE *f = fopen(fileName, "rb"); + FILE *f = fopen(fileName, "wb"); if (!f) return false; for (unsigned int i=0 ; i<outbuf.size() ; i++) diff --git a/src/dom/odf/odfdocument.cpp b/src/dom/odf/odfdocument.cpp index 1e7a61e4e..cf460c964 100644 --- a/src/dom/odf/odfdocument.cpp +++ b/src/dom/odf/odfdocument.cpp @@ -44,18 +44,20 @@ namespace odf */ ImageData::ImageData(const std::string &fname, const std::vector<unsigned char> &buf) + : fileName (fname), + data (buf) + { - fileName = fname; - data = buf; } /** * */ ImageData::ImageData(const ImageData &other) + : fileName (other.fileName), + data (other.data) + { - fileName = other.fileName; - data = other.data; } /** @@ -120,10 +122,10 @@ OdfDocument::OdfDocument() : /** * */ -OdfDocument::OdfDocument(const OdfDocument &other) +OdfDocument::OdfDocument(const OdfDocument &other) : + content (other.content), + images (other.images) { - content = other.content; - images = other.images; } diff --git a/src/dom/smil.h b/src/dom/smil.h index 15bc361ac..14870a4e4 100644 --- a/src/dom/smil.h +++ b/src/dom/smil.h @@ -193,7 +193,12 @@ public: /** * */ - ElementLayout() {} + ElementLayout() : + title(), + backgroundColor(), + height(0), + width(0) + {} /** * @@ -274,8 +279,9 @@ public: /** * */ - SMILRegionInterface(const SMILRegionInterface &other) - { regionElement = other.regionElement; } + SMILRegionInterface(const SMILRegionInterface &other) : + regionElement (other.regionElement) + {} /** * @@ -542,9 +548,9 @@ public: /** * */ - TimeList(const TimeList &other) + TimeList(const TimeList &other) : + items (other.items) { - items = other.items; } /** @@ -1586,7 +1592,15 @@ public: /** * */ - ElementTest() + ElementTest() : + systemBitrate (0), + systemCaptions (false), + systemLanguage (), + systemRequired (false), + systemScreenSize (false), + systemScreenDepth (false), + systemOverdubOrSubtitle (), + systemAudioDesc (false) { } @@ -1629,8 +1643,6 @@ public: protected: - - long systemBitrate; bool systemCaptions; DOMString systemLanguage; diff --git a/src/dom/stylesheets.h b/src/dom/stylesheets.h index fc1bc9d88..2903b96d9 100644 --- a/src/dom/stylesheets.h +++ b/src/dom/stylesheets.h @@ -308,13 +308,14 @@ public: * */ StyleSheet() + : type(""), + disabled (false), + ownerNode (NULL), + parentStylesheet (NULL), + href (""), + title (""), + mediaList () { - type = ""; - disabled = false; - ownerNode = NULL; - parentStylesheet = NULL; - href = ""; - title = ""; } @@ -422,8 +423,8 @@ public: * */ StyleSheetList(const StyleSheetList &other) + : sheets (other.sheets) { - sheets = other.sheets; } /** @@ -489,8 +490,8 @@ public: * */ LinkStyle(const LinkStyle &other) + : sheet (other.sheet) { - sheet = other.sheet; } /** @@ -556,8 +557,8 @@ public: * */ DocumentStyle(const DocumentStyle &other) + : styleSheets (other.styleSheets) { - styleSheets = other.styleSheets; } /** diff --git a/src/dom/traversal.h b/src/dom/traversal.h index 13850f78e..302ac2b1f 100644 --- a/src/dom/traversal.h +++ b/src/dom/traversal.h @@ -295,11 +295,11 @@ public: /** * */ - NodeIterator(const NodeIterator &other) + NodeIterator(const NodeIterator &other) : + whatToShow (other.whatToShow), + filter (other.filter), + expandEntityReferences (other.expandEntityReferences) { - whatToShow = other.whatToShow; - filter = other.filter; - expandEntityReferences = other.expandEntityReferences; } /** @@ -499,12 +499,12 @@ public: /** * */ - TreeWalker(const TreeWalker &other) + TreeWalker(const TreeWalker &other) : + whatToShow (other.whatToShow), + filter (other.filter), + expandEntityReferences (other.expandEntityReferences), + currentNode (other.currentNode) { - whatToShow = other.whatToShow; - filter = other.filter; - expandEntityReferences = other.expandEntityReferences; - currentNode = other.currentNode; } /** |
