summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 795ffce)
raw | patch | inline | side by side (parent: 795ffce)
author | daleharvey <daleharvey@users.sourceforge.net> | |
Mon, 4 Sep 2006 17:54:25 +0000 (17:54 +0000) | ||
committer | daleharvey <daleharvey@users.sourceforge.net> | |
Mon, 4 Sep 2006 17:54:25 +0000 (17:54 +0000) |
index 5f40e38088991561d984766643860713939b305f..a2919315fd741e8c18423cdca44a4b4d9e0c6b3d 100644 (file)
XML::Node *node = this->tracker->get(target);
unsigned int elementVersion = this->tracker->getVersion(node);
- if(node && version == (elementVersion + 1))
+ if(node)// && version == (elementVersion + 1))
{
this->tracker->incrementVersion(node);
this->tracker->addHistory(node, "text", text);
XML::Node *node = this->tracker->get(target);
unsigned int elementVersion = this->tracker->getVersion(node);
- if(node && version == (elementVersion + 1))
+ g_warning("got version %d",elementVersion);
+
+ if(node && attribute != "transform")// && version == (elementVersion + 1))
{
+ //g_warning("adding history %s %s",attribute.c_str(),value.c_str());
this->tracker->incrementVersion(node);
- this->tracker->addHistory(node, attribute, node->attribute(attribute.c_str()));
+ this->tracker->addHistory(node, attribute, value.c_str());
node->setAttribute(attribute.c_str(),value.c_str());
}
}
diff --git a/src/jabber_whiteboard/inkboard-session.cpp b/src/jabber_whiteboard/inkboard-session.cpp
index b52b9bd44303f205feec37a6dea8d08b2f943cce..498e31d0f166609b1574a8b1f2e1beee6b962cc4 100644 (file)
Glib::ustring value(new_value.pointer());
Glib::ustring attribute(g_quark_to_string(name));
- Configure change = this->doc->tracker->getLastHistory(element);
+ Glib::ustring change = this->doc->tracker->getLastHistory(element,attribute);
- if(change.first == attribute && change.second == value)
+ g_warning("change %s %s to %s",attribute.c_str(), change.c_str(), value.c_str());
+
+ if(change.size() > 0 && change == value)
return;
if(name && new_value.pointer())
index c60bd782734fb9a458e33251adc272d489adbc76..60acf0ae932e1e032c9ce286dd22ac2b6ae4831f 100644 (file)
@@ -124,15 +124,27 @@ void KeyNodeTable::addHistory(XML::Node *node, Glib::ustring attribute, Glib::us
}
}
-Configure KeyNodeTable::getLastHistory(XML::Node *node)
+Glib::ustring KeyNodeTable::getLastHistory(XML::Node *node, Glib::ustring att)
{
+ std::list<Configure> hist;
+
std::vector<KeyNodePair>::iterator iter;
for (iter = items.begin() ; iter != items.end() ; iter++)
{
if (node == iter->node)
- break;
+ hist = iter->history;
+ }
+
+ std::list<Configure>::iterator it;
+ for(it = hist.end() ; it != hist.begin() ; it--)
+ {
+ if(it->first == att)
+ {
+ //g_warning("hist %s %s",it->first,it->second);
+ return it->second;
+ }
}
- return iter->history.back();
+ return "";
}
void KeyNodeTable::remove(XML::Node *node)
index 9b8ae8394a63fb1d7c88e4b837af8b73b1eae3f4..64c8207329b6aaa35499dc7a8e6736d32a47acb1 100644 (file)
virtual void addHistory(XML::Node *node, Glib::ustring attribute, Glib::ustring value);
- virtual Configure getLastHistory(XML::Node *node);
+ virtual Glib::ustring getLastHistory(XML::Node *node, Glib::ustring attribute);
private: