summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2013-02-02 11:29:34 +0000
committerKris <Kris.De.Gussem@hotmail.com>2013-02-02 11:29:34 +0000
commit36dd99ae68825bb28b7428f8018fbfdfb003bf36 (patch)
tree75847e9f59e50375696f5a5e2dc0a408dcdc2fef /src
parentWin32. Adding libcdr (Corel Draw) support. (diff)
downloadinkscape-36dd99ae68825bb28b7428f8018fbfdfb003bf36.tar.gz
inkscape-36dd99ae68825bb28b7428f8018fbfdfb003bf36.zip
cppcheck
(bzr r12092)
Diffstat (limited to 'src')
-rw-r--r--src/dom/domimpl.cpp34
-rw-r--r--src/dom/domimpl.h14
-rw-r--r--src/dom/events.h48
-rw-r--r--src/dom/io/domstream.h11
-rw-r--r--src/dom/io/gzipstream.cpp2
-rw-r--r--src/dom/lsimpl.cpp2
-rw-r--r--src/dom/odf/odfdocument.cpp16
-rw-r--r--src/dom/smil.h28
-rw-r--r--src/dom/traversal.h18
9 files changed, 113 insertions, 60 deletions
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/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/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;
}
/**