diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Document.cxx | 16 | ||||
-rw-r--r-- | src/Document.h | 2 |
2 files changed, 14 insertions, 4 deletions
diff --git a/src/Document.cxx b/src/Document.cxx index 046a72683..c55c4ca8a 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -380,6 +380,9 @@ bool Document::DeleteChars(int pos, int len) { return !cb.IsReadOnly(); } +/** + * Insert a styled string (char/style pairs) with a length. + */ bool Document::InsertStyledString(int position, char *s, int insertLength) { if (cb.IsReadOnly() && enteredReadOnlyCount == 0) { enteredReadOnlyCount++; @@ -499,6 +502,9 @@ int Document::Redo() { return newPos; } +/** + * Insert a single character. + */ bool Document::InsertChar(int pos, char ch) { char chs[2]; chs[0] = ch; @@ -506,12 +512,16 @@ bool Document::InsertChar(int pos, char ch) { return InsertStyledString(pos*2, chs, 2); } -// Insert a null terminated string +/** + * Insert a null terminated string. + */ bool Document::InsertString(int position, const char *s) { return InsertString(position, s, strlen(s)); } -// Insert a string with a length +/** + * Insert a string with a length. + */ bool Document::InsertString(int position, const char *s, size_t insertLength) { bool changed = false; char *sWithStyle = new char[insertLength * 2]; @@ -1178,7 +1188,7 @@ void Document::SetDefaultCharClasses() { } } -void Document::SetCharClasses(unsigned char *chars, charClassification newCharClass) { +void Document::SetCharClasses(const unsigned char *chars, charClassification newCharClass) { // Apply the newCharClass to the specifed chars if (chars) { while (*chars) { diff --git a/src/Document.h b/src/Document.h index e31f8e324..6cba0260f 100644 --- a/src/Document.h +++ b/src/Document.h @@ -204,7 +204,7 @@ public: void ChangeCase(Range r, bool makeUpperCase); void SetDefaultCharClasses(); - void SetCharClasses(unsigned char *chars, charClassification newCharClass); + void SetCharClasses(const unsigned char *chars, charClassification newCharClass); void SetStylingBits(int bits); void StartStyling(int position, char mask); bool SetStyleFor(int length, char style); |