summaryrefslogtreecommitdiffstats
path: root/scintilla/src/CellBuffer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'scintilla/src/CellBuffer.cxx')
-rw-r--r--scintilla/src/CellBuffer.cxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/scintilla/src/CellBuffer.cxx b/scintilla/src/CellBuffer.cxx
index 079d00a..9fb25c2 100644
--- a/scintilla/src/CellBuffer.cxx
+++ b/scintilla/src/CellBuffer.cxx
@@ -351,16 +351,26 @@ void CellBuffer::GetCharRange(char *buffer, int position, int lengthRetrieve) co
lengthRetrieve, substance.Length());
return;
}
-
- for (int i=0; i<lengthRetrieve; i++) {
- *buffer++ = substance.ValueAt(position + i);
- }
+ substance.GetRange(buffer, position, lengthRetrieve);
}
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<char *>(buffer), position, lengthRetrieve);
+}
+
const char *CellBuffer::BufferPointer() {
return substance.BufferPointer();
}