From 828a9b0127163b684a5f30638690655d3fb64df1 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 17 Jul 2001 01:21:37 +0000 Subject: Changed caret to start in off and inactive state. Removed extraneous tests in EnsureUndoRoom. --- src/CellBuffer.cxx | 29 +++++++++++++---------------- src/Editor.cxx | 2 +- 2 files changed, 14 insertions(+), 17 deletions(-) (limited to 'src') diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index 10e0a1859..8bdb3d104 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -418,22 +418,19 @@ UndoHistory::~UndoHistory() { } void UndoHistory::EnsureUndoRoom() { - //Platform::DebugPrintf("%% %d action %d %d %d\n", at, position, length, currentAction); - if (currentAction >= 2) { - // Have to test that there is room for 2 more actions in the array - // as two actions may be created by this function - if (currentAction >= (lenActions - 2)) { - // Run out of undo nodes so extend the array - int lenActionsNew = lenActions * 2; - Action *actionsNew = new Action[lenActionsNew]; - if (!actionsNew) - return ; - for (int act = 0; act <= currentAction; act++) - actionsNew[act].Grab(&actions[act]); - delete []actions; - lenActions = lenActionsNew; - actions = actionsNew; - } + // Have to test that there is room for 2 more actions in the array + // as two actions may be created by the calling function + if (currentAction >= (lenActions - 2)) { + // Run out of undo nodes so extend the array + int lenActionsNew = lenActions * 2; + Action *actionsNew = new Action[lenActionsNew]; + if (!actionsNew) + return ; + for (int act = 0; act <= currentAction; act++) + actionsNew[act].Grab(&actions[act]); + delete []actions; + lenActions = lenActionsNew; + actions = actionsNew; } } diff --git a/src/Editor.cxx b/src/Editor.cxx index f2bac993b..bf53de224 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -30,7 +30,7 @@ #include "Editor.h" Caret::Caret() : -active(true), on(true), period(500) {} +active(false), on(false), period(500) {} Timer::Timer() : ticking(false), ticksToWait(0), tickerID(0) {} -- cgit v1.2.3