[Zorba-coders] [Merge] lp:~fcavalieri/zorba/setsatundo into lp:zorba

2011-10-12 Thread noreply
The proposal to merge lp:~fcavalieri/zorba/setsatundo into lp:zorba has been 
updated.

Status: Approved => Merged

For more details, see:
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
-- 
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~fcavalieri/zorba/setsatundo into lp:zorba

2011-10-12 Thread Zorba Build Bot
Validation queue job setsatundo-2011-10-12T14-51-59.701Z is finished. The final 
status was:

All tests succeeded!
-- 
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~fcavalieri/zorba/setsatundo into lp:zorba

2011-10-12 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/setsatundo-2011-10-12T14-51-59.701Z/log.html
-- 
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~fcavalieri/zorba/setsatundo into lp:zorba

2011-10-12 Thread Federico Cavalieri
The proposal to merge lp:~fcavalieri/zorba/setsatundo into lp:zorba has been 
updated.

Status: Needs review => Approved

For more details, see:
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
-- 
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~fcavalieri/zorba/setsatundo into lp:zorba

2011-10-12 Thread Federico Cavalieri
Review: Approve


-- 
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~fcavalieri/zorba/setsatundo into lp:zorba

2011-10-12 Thread Markos Zaharioudakis
Review: Approve


-- 
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~fcavalieri/zorba/setsatundo into lp:zorba

2011-10-12 Thread Zorba Build Bot
The proposal to merge lp:~fcavalieri/zorba/setsatundo into lp:zorba has been 
updated.

Status: Approved => Needs review

For more details, see:
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
-- 
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~fcavalieri/zorba/setsatundo into lp:zorba

2011-10-12 Thread Zorba Build Bot
Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1. 
Got: 2 Pending.
-- 
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~fcavalieri/zorba/setsatundo into lp:zorba

2011-10-12 Thread Zorba Build Bot
Validation queue job setsatundo-2011-10-12T10-10-16.743Z is finished. The final 
status was:

All tests succeeded!
-- 
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~fcavalieri/zorba/setsatundo into lp:zorba

2011-10-12 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/setsatundo-2011-10-12T10-10-16.743Z/log.html
-- 
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~fcavalieri/zorba/setsatundo into lp:zorba

2011-10-12 Thread Federico Cavalieri
Federico Cavalieri has proposed merging lp:~fcavalieri/zorba/setsatundo into 
lp:zorba.

Requested reviews:
  Federico Cavalieri (fcavalieri)
  Markos Zaharioudakis (markos-za)

For more details, see:
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093

Implemented undo for SetElementType and SetAttributeType.
-- 
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
Your team Zorba Coders is subscribed to branch lp:zorba.
=== modified file 'ChangeLog'
--- ChangeLog	2011-10-12 09:20:36 +
+++ ChangeLog	2011-10-12 10:04:34 +
@@ -49,6 +49,7 @@
   * New node-reference module. References can be obtained for any node, and
 	different nodes cannot have the same identifier.
   * Fixed bug #872697  (segmentation fault with validation of NMTOKENS)
+  * Added undo for node revalidation
 
 version 2.0.1
 

=== modified file 'src/store/naive/pul_primitives.cpp'
--- src/store/naive/pul_primitives.cpp	2011-10-12 09:20:36 +
+++ src/store/naive/pul_primitives.cpp	2011-10-12 10:04:34 +
@@ -465,12 +465,20 @@
 {
   ElementNode* target = ELEM_NODE(theTarget);
 
+  theOldTypeName=target->getType();
+  theOldHaveTypedValue=target->haveTypedValue();
+  if (theOldHaveTypedValue)
+theOldHaveEmptyTypedValue=target->haveEmptyTypedValue();
+  theOldIsInSubstitutionGroup=target->isInSubstitutionGroup();
+
   target->setType(theTypeName);
 
   TextNode* textChild;
-
-  if (target->haveTypedTypedValue(textChild))
+  theOldHaveTypedTypedValue=target->haveTypedTypedValue(textChild);
+  if (theOldHaveTypedTypedValue)
   {
+theOldHaveListTypedValue= textChild->haveListValue();
+theOldTypedValue=textChild->getValue();
 zstring textValue;
 textChild->getStringValue2(textValue);
 
@@ -491,7 +499,7 @@
 
 if (theHaveTypedTypedValue)
 {
-  TextNode* textChild = target->getUniqueTextChild();
+  textChild = target->getUniqueTextChild();
 
   textChild->setTypedValue(theTypedValue);
   if (theHaveListTypedValue)
@@ -509,8 +517,57 @@
 target->setInSubstGroup();
   else
 target->resetInSubstGroup();
-}
-
+
+  theIsApplied=true;
+}
+
+void UpdSetElementType::undo()
+{
+  if (theIsApplied)
+  {
+ElementNode* target = ELEM_NODE(theTarget);
+
+target->setType(theOldTypeName);
+
+if (theHaveTypedTypedValue)
+{
+  TextNode* textChild = target->getUniqueTextChild();
+  textChild->revertToTextContent();
+}
+
+if (theOldHaveTypedValue)
+{
+  target->setHaveTypedValue();
+
+  if (theOldHaveEmptyTypedValue)
+target->setHaveEmptyTypedValue();
+  else
+target->resetHaveEmptyTypedValue();
+
+  if (theOldHaveTypedTypedValue)
+  {
+TextNode* textChild = target->getUniqueTextChild();
+
+textChild->setTypedValue(theOldTypedValue);
+if (theOldHaveListTypedValue)
+  textChild->setHaveListValue();
+else
+  textChild->resetHaveListValue();
+  }
+}
+else
+{
+  target->resetHaveTypedValue();
+}
+
+if (theOldIsInSubstitutionGroup)
+  target->setInSubstGroup();
+else
+  target->resetInSubstGroup();
+
+theIsApplied=false;
+  }
+}
 
 /***
 
@@ -570,6 +627,10 @@
 {
   AttributeNode* target = ATTR_NODE(theTarget);
 
+  theOldTypeName=target->getType();
+  theOldTypedValue.transfer(target->theTypedValue);
+  theOldHaveListValue=target->haveListValue();
+
   target->setType(theTypeName);
   target->theTypedValue.transfer(theTypedValue);
 
@@ -577,8 +638,26 @@
 target->setHaveListValue();
   else
 target->resetHaveListValue();
-}
-
+
+  theIsApplied=true;
+}
+
+void UpdSetAttributeType::undo()
+{
+  if (theIsApplied)
+  {
+AttributeNode* target = ATTR_NODE(theTarget);
+target->setType(theOldTypeName);
+target->theTypedValue.transfer(theOldTypedValue);
+
+if (theOldHaveListValue)
+  target->setHaveListValue();
+else
+  target->resetHaveListValue();
+
+theIsApplied=false;
+  }
+}
 
 /***
 

=== modified file 'src/store/naive/pul_primitives.h'
--- src/store/naive/pul_primitives.h	2011-10-10 12:12:00 +
+++ src/store/naive/pul_primitives.h	2011-10-12 10:04:34 +
@@ -712,16 +712,24 @@
 
 protected:
   store::Item_ttheTypeName;
-
   store::Item_ttheTypedValue;
 
   bool theHaveTypedValue;
   bool theHaveEmptyTypedValue;
   bool theHaveTypedTypedValue;
   bool theHaveListTypedValue;
-
   bool theIsInSubstitutionGroup;
 
+  store::Item_ttheOldTypeName;
+  store::Item_ttheOldTypedValue;
+
+  bool theOldHaveTypedValue;
+  bool theOldHaveEmptyTypedValue;
+  bool theOldHaveTypedTypedValue;
+  bool theOldHaveListType

[Zorba-coders] [Merge] lp:~fcavalieri/zorba/setsatundo into lp:zorba

2011-10-12 Thread Federico Cavalieri
The proposal to merge lp:~fcavalieri/zorba/setsatundo into lp:zorba has been 
updated.

Status: Needs review => Approved

For more details, see:
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
-- 
https://code.launchpad.net/~fcavalieri/zorba/setsatundo/+merge/79093
Your team Zorba Coders is subscribed to branch lp:zorba.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp