}
}
+ /// <summary>
+ /// 再描写を要求しているなら真
+ /// </summary>
+ public bool IsRequestRedraw { get; internal set; }
+
+ /// <summary>
+ /// 再描写を要求する
+ /// </summary>
+ public void RequestRedraw()
+ {
+ this.IsRequestRedraw = true;
+ }
+
public event EventHandler PerformLayouted;
/// <summary>
/// レイアウト行をすべて破棄し、再度レイアウトを行う
else
return pattern;
});
- this.Lock();
- this.buf.RemoveRange(lineHeadIndex, lineLength);
+ this.Lock();
+ //空行は削除する必要はない
+ if(lineHeadIndex < this.buf.Count )
+ this.buf.RemoveRange(lineHeadIndex, lineLength);
this.buf.InsertRange(lineHeadIndex, output, output.Length);
this.UnLock();
}
[TestMethod]
- public void ReplaceRegexAllTest()
+ public void ReplaceNonRegexAllTest()
{
DummyRender render = new DummyRender();
Document doc = new Document();
doc.LayoutLines.Render = render;
- doc.Append("this is a pen");
+ doc.Append("this is a pen\n");
+ doc.Append("this is a pen\n");
doc.SetFindParam("is", false, RegexOptions.None);
doc.ReplaceAll("aaa", false);
- Assert.IsTrue(doc.ToString(0) == "thaaa aaa a pen");
+ Assert.IsTrue(doc.ToString(0) == "thaaa aaa a pen\nthaaa aaa a pen\n");
+ }
+
+ [TestMethod]
+ public void ReplaceRegexAllTest()
+ {
+ DummyRender render = new DummyRender();
+ Document doc = new Document();
+ doc.LayoutLines.Render = render;
+ doc.Append("this is a pen\n");
+ doc.Append("this is a pen\n");
+ doc.SetFindParam("[a-z]+", true, RegexOptions.None);
+ doc.ReplaceAll("aaa", false);
+ Assert.IsTrue(doc.ToString(0) == "aaa aaa aaa aaa\naaa aaa aaa aaa\n");
}
[TestMethod]