*** empty log message ***
authorhanda <handa>
Mon, 15 Jun 2009 12:03:56 +0000 (12:03 +0000)
committerhanda <handa>
Mon, 15 Jun 2009 12:03:56 +0000 (12:03 +0000)
MText.cs

index 52d1943..986bad0 100644 (file)
--- a/MText.cs
+++ b/MText.cs
@@ -956,6 +956,7 @@ namespace M17N.Core
            tail = copy.find_tail (copy.Length);
            tail.Stack.Clear ();
          }
+       M17n.DebugPrint ("Copied: {0}\n", copy);
        return copy;
       }
 
@@ -1161,7 +1162,8 @@ namespace M17N.Core
 
            if (interval != null)
              interval = interval.Copy (mtext, start, end,
-                                       front_grafted || prev == null,
+                                       (front_grafted
+                                        || (prev == null && start == 0)),
                                        rear_grafted);
            else
              interval = new MInterval (Key, mtext, end - start, null);
@@ -1264,7 +1266,8 @@ namespace M17N.Core
            if (interval != null)
              interval = interval.Copy (mtext, start, end,
                                        front_grafted,
-                                       rear_grafted || next == null);
+                                       (rear_grafted
+                                        || (next == null && end < interval.mtext.Length)));
            else
              interval = new MInterval (Key, mtext, end - start, null);
 
@@ -1366,16 +1369,18 @@ namespace M17N.Core
            end = To;
            rear_checked = true;
          }
+       if (start == From
+           && ! front_checked
+           && start > 0
+           && isRearSensitive)
+         Prev.Stack.Clear ();
+       if (end == To
+           && ! rear_checked
+           && Next != null
+           && isFrontSensitive)
+         Next.Stack.Clear ();
        if (start == From && end == To)
          {
-           if (! front_checked
-               && start > 0
-               && isRearSensitive)
-             Prev.Stack.Clear ();
-           if (! rear_checked
-               && end < mtext.Length
-               && isFrontSensitive)
-             Next.Stack.Clear ();
            if (Right == null)
              {
                vacate_node (Left);