diff options
| author | Bob Jamison <ishmalius@gmail.com> | 2006-04-27 09:53:08 +0000 |
|---|---|---|
| committer | ishmal <ishmal@users.sourceforge.net> | 2006-04-27 09:53:08 +0000 |
| commit | e47e9be6fd9f99acfa9e46c660b7c885a9141380 (patch) | |
| tree | c86a604bd52a1392f4da84350578218c4600b42e /src | |
| parent | fixing conditional attribute evaluation on load (if conditional attributes we... (diff) | |
| download | inkscape-e47e9be6fd9f99acfa9e46c660b7c885a9141380.tar.gz inkscape-e47e9be6fd9f99acfa9e46c660b7c885a9141380.zip | |
interim cleanup commit
(bzr r597)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dom/dom.h | 57 | ||||
| -rw-r--r-- | src/dom/domimpl.cpp | 18 | ||||
| -rw-r--r-- | src/dom/domimpl.h | 10 | ||||
| -rw-r--r-- | src/dom/xpathparser.cpp | 8 | ||||
| -rw-r--r-- | src/dom/xpathparser.h | 5 | ||||
| -rw-r--r-- | src/dom/xpathtoken.cpp | 49 | ||||
| -rw-r--r-- | src/dom/xpathtoken.h | 42 |
7 files changed, 182 insertions, 7 deletions
diff --git a/src/dom/dom.h b/src/dom/dom.h index 4117f91b7..ab82c4298 100644 --- a/src/dom/dom.h +++ b/src/dom/dom.h @@ -262,6 +262,15 @@ public: /** * */ + DOMStringList &operator=(const DOMStringList &other) + { + strings = other.strings; + return *this; + } + + /** + * + */ virtual ~DOMStringList() {} @@ -297,6 +306,12 @@ public: namespaceURI = other.namespaceURI; name = other.name; } + NamePair &operator=(const NamePair &other) + { + namespaceURI = other.namespaceURI; + name = other.name; + return *this; + } virtual ~NamePair() {} DOMString namespaceURI; @@ -385,6 +400,15 @@ public: /** * */ + NameList &operator=(const NameList &other) + { + namePairs = other.namePairs; + return *this; + } + + /** + * + */ virtual ~NameList() {} protected: @@ -442,6 +466,15 @@ public: /** * */ + DOMImplementationList &operator=(const DOMImplementationList &other) + { + implementations = other.implementations; + return *this; + } + + /** + * + */ virtual ~DOMImplementationList() {} protected: @@ -888,13 +921,22 @@ public: } NamedNodeMapEntry(const NamedNodeMapEntry &other) { - namespaceURI = other.namespaceURI; - name = other.name; - node = other.node; + assign(other); + } + NamedNodeMapEntry &operator=(const NamedNodeMapEntry &other) + { + assign(other); + return *this; } virtual ~NamedNodeMapEntry() { } + void assign(const NamedNodeMapEntry &other) + { + namespaceURI = other.namespaceURI; + name = other.name; + node = other.node; + } DOMString namespaceURI; DOMString name; Node *node; @@ -1065,6 +1107,15 @@ public: entries = other.entries; } + /** + * + */ + NamedNodeMap &operator=(const NamedNodeMap &other) + { + entries = other.entries; + return *this; + } + /** * diff --git a/src/dom/domimpl.cpp b/src/dom/domimpl.cpp index e9da6291f..644c6567c 100644 --- a/src/dom/domimpl.cpp +++ b/src/dom/domimpl.cpp @@ -933,6 +933,24 @@ NodeImpl::NodeImpl() } +/** + * + */ +NodeImpl::NodeImpl(const NodeImpl &other) +{ + init(); + assign(other); +} + +/** + * + */ +NodeImpl &NodeImpl::operator=(const NodeImpl &other) +{ + init(); + assign(other); + return *this; +} /** diff --git a/src/dom/domimpl.h b/src/dom/domimpl.h index 677f5eb8c..bbd1693ef 100644 --- a/src/dom/domimpl.h +++ b/src/dom/domimpl.h @@ -443,6 +443,16 @@ public: /** * */ + NodeImpl(const NodeImpl &other); + + /** + * + */ + NodeImpl &operator=(const NodeImpl &other); + + /** + * + */ NodeImpl(DocumentImpl *owner); /** diff --git a/src/dom/xpathparser.cpp b/src/dom/xpathparser.cpp index f3c57f6f5..18d62d40a 100644 --- a/src/dom/xpathparser.cpp +++ b/src/dom/xpathparser.cpp @@ -618,6 +618,12 @@ int XPathParser::lexicalScan() //# X P A T H G R A M M A R P A R S I N G
//#########################################################################
+
+void XPathParser::tokAdd(Token *tok)
+{
+ tokens.add(tok);
+}
+
/**
* [1] LocationPath ::=
* RelativeLocationPath
@@ -873,7 +879,7 @@ int XPathParser::getNodeTest(int p0, int depth) if (t.getType() == NAME_TEST)
{
p++;
- printf("xxx\n");
+ tokAdd(new TokNameTest(t.getStringValue()));
return p;
}
if (t.getType() == NODE_TYPE)
diff --git a/src/dom/xpathparser.h b/src/dom/xpathparser.h index 32127f89b..4b4e79fcc 100644 --- a/src/dom/xpathparser.h +++ b/src/dom/xpathparser.h @@ -513,6 +513,11 @@ private: //#################################
/**
+ * Add a newly derived token to the token list;
+ */
+ void tokAdd(Token *token);
+
+ /**
* The grammar definitions marked [1]-[39] are directly
* from the W3C XPath grammar spacification.
*/
diff --git a/src/dom/xpathtoken.cpp b/src/dom/xpathtoken.cpp index 0254266d0..bed022943 100644 --- a/src/dom/xpathtoken.cpp +++ b/src/dom/xpathtoken.cpp @@ -62,9 +62,7 @@ StackItem::StackItem() */
StackItem::StackItem(const StackItem &other)
{
- sval = other.sval;
- ival = other.ival;
- dval = other.dval;
+ assign(other);
}
@@ -76,6 +74,26 @@ StackItem::~StackItem() }
+/**
+ *
+ */
+StackItem &StackItem::operator=(const StackItem &other)
+{
+ assign(other);
+ return *this;
+}
+
+/**
+ *
+ */
+void StackItem::assign(const StackItem &other)
+{
+ sval = other.sval;
+ ival = other.ival;
+ dval = other.dval;
+}
+
+
//########################################################################
//# X P A T H S T A C K
//########################################################################
@@ -191,6 +209,31 @@ TokenList::TokenList() /**
*
*/
+TokenList::TokenList(const TokenList &other)
+{
+ assign(other);
+}
+
+/**
+ *
+ */
+TokenList &TokenList::operator=(const TokenList &other)
+{
+ assign(other);
+ return *this;
+}
+
+/**
+ *
+ */
+void TokenList::assign(const TokenList &other)
+{
+ tokens = other.tokens;
+}
+
+/**
+ *
+ */
TokenList::~TokenList()
{
clear();
diff --git a/src/dom/xpathtoken.h b/src/dom/xpathtoken.h index 9b9259e06..f551bee3c 100644 --- a/src/dom/xpathtoken.h +++ b/src/dom/xpathtoken.h @@ -70,6 +70,17 @@ public: */
virtual ~StackItem();
+ /**
+ *
+ */
+ StackItem &operator=(const StackItem &other);
+
+ /**
+ *
+ */
+ void assign(const StackItem &other);
+
+
//treat the stack item like an union of string, integer, and double
/**
@@ -200,6 +211,7 @@ public: TOK_ABSOLUTE,
TOK_RELATIVE,
TOK_STEP,
+ TOK_NAME_TEST,
TOK_EXPR,
TOK_UNION,
//function types
@@ -653,6 +665,21 @@ public: }
};
+class TokNameTest : public Token
+{
+public:
+ TokNameTest(const DOMString &name)
+ {
+ type = TOK_NAME_TEST;
+ stype = "step";
+ sval = name;
+ }
+ virtual bool execute(Stack &stack)
+ {
+ return true;
+ }
+};
+
class TokExpr : public Token
{
public:
@@ -722,6 +749,21 @@ public: /**
*
*/
+ TokenList(const TokenList &other);
+
+ /**
+ *
+ */
+ TokenList &operator=(const TokenList &other);
+
+ /**
+ *
+ */
+ void assign(const TokenList &other);
+
+ /**
+ *
+ */
virtual ~TokenList();
/**
|
