From 37d3d30561e4bb5740aac4977a8191a7bb29959a Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 25 Sep 2010 18:02:59 +1000 Subject: Optimization of line layout by minimizing calls in Editor::LayoutLine and avoiding case force processing unless at least one style uses a case force option. --- src/CellBuffer.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/CellBuffer.cxx') diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index de1605837..19f6670f6 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -358,6 +358,19 @@ char CellBuffer::StyleAt(int position) const { return style.ValueAt(position); } +void CellBuffer::GetStyleRange(unsigned char *buffer, int position, int lengthRetrieve) const { + if (lengthRetrieve < 0) + return; + if (position < 0) + return; + if ((position + lengthRetrieve) > style.Length()) { + Platform::DebugPrintf("Bad GetStyleRange %d for %d of %d\n", position, + lengthRetrieve, style.Length()); + return; + } + style.GetRange(reinterpret_cast(buffer), position, lengthRetrieve); +} + const char *CellBuffer::BufferPointer() { return substance.BufferPointer(); } -- cgit v1.2.3