aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ViewStyle.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2003-02-09 00:38:33 +0000
committernyamatongwe <devnull@localhost>2003-02-09 00:38:33 +0000
commit50fe4c1dedae94692f95ffaf79c60bb122616d37 (patch)
tree82ffd94e035f1a5480c84087a8ceaa955945b581 /src/ViewStyle.cxx
parenta5a640ae4418d378429a2b07147ce33a6b79fe69 (diff)
downloadscintilla-mirror-50fe4c1dedae94692f95ffaf79c60bb122616d37.tar.gz
Protected style fixed in several ways.
Method to determine cheaply if protection turned on at all. Caret movement doesn't skip over text outside protected range. Methods for deciding if a range or the selection contains protected text. Several deletion commands perform no action if they would delete protected text. Two phase drawing no longer draws invisible text.
Diffstat (limited to 'src/ViewStyle.cxx')
-rw-r--r--src/ViewStyle.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx
index 91f2d2d2f..ea1b3e955 100644
--- a/src/ViewStyle.cxx
+++ b/src/ViewStyle.cxx
@@ -139,6 +139,7 @@ void ViewStyle::Init() {
edgecolour.desired = ColourDesired(0xc0, 0xc0, 0xc0);
edgeState = EDGE_NONE;
caretWidth = 1;
+ someStylesProtected = false;
leftMarginWidth = 1;
rightMarginWidth = 1;
@@ -197,6 +198,7 @@ void ViewStyle::Refresh(Surface &surface) {
styles[STYLE_DEFAULT].Realise(surface, zoomLevel);
maxAscent = styles[STYLE_DEFAULT].ascent;
maxDescent = styles[STYLE_DEFAULT].descent;
+ someStylesProtected = false;
for (unsigned int i=0;i<(sizeof(styles)/sizeof(styles[0]));i++) {
if (i != STYLE_DEFAULT) {
styles[i].Realise(surface, zoomLevel, &styles[STYLE_DEFAULT]);
@@ -205,6 +207,9 @@ void ViewStyle::Refresh(Surface &surface) {
if (maxDescent < styles[i].descent)
maxDescent = styles[i].descent;
}
+ if (styles[i].IsProtected()) {
+ someStylesProtected = true;
+ }
}
lineHeight = maxAscent + maxDescent;
@@ -243,3 +248,7 @@ void ViewStyle::ClearStyles() {
void ViewStyle::SetStyleFontName(int styleIndex, const char *name) {
styles[styleIndex].fontName = fontNames.Save(name);
}
+
+bool ViewStyle::ProtectionActive() const {
+ return someStylesProtected;
+}