projects
/
m17n
/
m17n-lib-cs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cce76c7
)
*** empty log message ***
author
handa
<handa>
Fri, 16 Jan 2009 09:23:41 +0000
(09:23 +0000)
committer
handa
<handa>
Fri, 16 Jan 2009 09:23:41 +0000
(09:23 +0000)
MText.cs
patch
|
blob
|
history
diff --git
a/MText.cs
b/MText.cs
index
836c4f4
..
1fbb3f0
100644
(file)
--- a/
MText.cs
+++ b/
MText.cs
@@
-313,14
+313,27
@@
namespace M17N.Core
this.depth = 1;
}
this.depth = 1;
}
- public MInterval Copy (int start, int end, MInterval interval)
+ private MInterval find (int pos)
{
{
- MInterval new_interval;
+ if (pos < total_start || total_end < pos)
+ return null;
+ if (pos < Start)
+ return left.find (pos);
+ if (End < pos)
+ return right.find (pos);
+ return this;
+ }
+
+ public MInterval Copy (int start, int end)
+ {
+ MInterval interval_start = find (start);
+ MInterval interval_end = find (end);
+ MInterval interval;
start = adjust_position (start, true);
end = adjust_position (end, true);
start = adjust_position (start, true);
end = adjust_position (end, true);
- new_interval = new MInterval (start, end, interval.stack);
- return new_interval;
+ interval = new MInterval (start, end, stack);
+ return interval;
}
private MInterval Copy ()
}
private MInterval Copy ()