summaryrefslogtreecommitdiffstats
path: root/src/dom
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2013-01-23 18:45:08 +0000
committerKris <Kris.De.Gussem@hotmail.com>2013-01-23 18:45:08 +0000
commit4d368c0ed0441dfd9e0cda7fa1c0f370180fa4ae (patch)
treeacea66c8bca4772a4d23a508cbab679bb678616f /src/dom
parentClean up more GObject type definitions (diff)
downloadinkscape-4d368c0ed0441dfd9e0cda7fa1c0f370180fa4ae.tar.gz
inkscape-4d368c0ed0441dfd9e0cda7fa1c0f370180fa4ae.zip
cppcheck: style and performance
(bzr r12056)
Diffstat (limited to 'src/dom')
-rw-r--r--src/dom/css.h14
-rw-r--r--src/dom/dom.h27
-rw-r--r--src/dom/domptr.h2
-rw-r--r--src/dom/stylesheets.h19
4 files changed, 33 insertions, 29 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/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/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;
}
/**