diff options
Diffstat (limited to 'src/CellBuffer.cxx')
-rw-r--r-- | src/CellBuffer.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index c05060865..0c56c9e92 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -413,25 +413,24 @@ const char *CellBuffer::InsertString(int position, const char *s, int insertLeng return data; } -bool CellBuffer::SetStyleAt(int position, char styleValue, char mask) { - styleValue &= mask; +bool CellBuffer::SetStyleAt(int position, char styleValue) { char curVal = style.ValueAt(position); - if ((curVal & mask) != styleValue) { - style.SetValueAt(position, static_cast<char>((curVal & ~mask) | styleValue)); + if (curVal != styleValue) { + style.SetValueAt(position, styleValue); return true; } else { return false; } } -bool CellBuffer::SetStyleFor(int position, int lengthStyle, char styleValue, char mask) { +bool CellBuffer::SetStyleFor(int position, int lengthStyle, char styleValue) { bool changed = false; PLATFORM_ASSERT(lengthStyle == 0 || (lengthStyle > 0 && lengthStyle + position <= style.Length())); while (lengthStyle--) { char curVal = style.ValueAt(position); - if ((curVal & mask) != styleValue) { - style.SetValueAt(position, static_cast<char>((curVal & ~mask) | styleValue)); + if (curVal != styleValue) { + style.SetValueAt(position, styleValue); changed = true; } position++; |