}
int start = req.Range.StartCaretPosition;
- int length = req.Range.EndCaretPosition - req.Range.StartCaretPosition;
- if (length > this.Document.Length)
- length = this.Document.Length;
+ int end = req.Range.EndCaretPosition;
+ if (end > this.Document.Length)
+ end = this.Document.Length;
+
+ int length = end - start;
System.Diagnostics.Debug.WriteLine("req text start:{0} length:{1}", start, length);
//キャレット位置も含むので+1する必要はない
- req.Text = this.Document.ToString(start, length);
+ req.Text = this.Document.ToString(start,length);
}
private void TextEditContext_LayoutRequested(CoreTextEditContext sender, CoreTextLayoutRequestedEventArgs args)