diff options
author | gcramer <remarcg@gmx.net> | 2017-05-06 14:45:39 (GMT) |
---|---|---|
committer | gcramer <remarcg@gmx.net> | 2017-05-06 14:45:39 (GMT) |
commit | eae03e6044965acb03dac272693a753d667b13c2 (patch) | |
tree | 29be7f9539346282973b75ac8b347bcbc603bd32 /generic/tkTextPriv.h | |
parent | 2eddfdf8cbc905c4e4a4732144ad8aae63403422 (diff) | |
download | tk-eae03e6044965acb03dac272693a753d667b13c2.zip tk-eae03e6044965acb03dac272693a753d667b13c2.tar.gz tk-eae03e6044965acb03dac272693a753d667b13c2.tar.bz2 |
(1) Refactorization of deleteProc, inspectProc, needed because tree (previously the argument) might be invalid when cleaning up.
(2) Fix in undo of deletion.
(3) Hardening of MarkDeleteProc().
(4) Fix in TkTextFreeMarks().
(5) Additional check of mark table when debug=on (but only if compiled with TK_TEXT_NDEBUG=1).
(6) Review of index handling, resulting in fix of bug [3f1d48e263].
(7) TkTextIndexSetEpoch() now clears cached variables unconditionally.
Diffstat (limited to 'generic/tkTextPriv.h')
-rw-r--r-- | generic/tkTextPriv.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/generic/tkTextPriv.h b/generic/tkTextPriv.h index c1faacf..fede75b 100644 --- a/generic/tkTextPriv.h +++ b/generic/tkTextPriv.h @@ -944,8 +944,7 @@ TkTextIndexInvalidate( * * TkTextIndexSetEpoch -- * - * Set epoch of given index, and clear the segment pointer if - * the new epoch is different from last epoch. + * Set epoch of given index, and clear the cached values. * * Results: * None. @@ -965,13 +964,13 @@ TkTextIndexSetEpoch( assert(indexPtr->priv.linePtr); assert(indexPtr->priv.linePtr->parentPtr); /* expired? */ - if (indexPtr->stateEpoch != epoch) { - assert(indexPtr->priv.byteIndex >= 0); - indexPtr->stateEpoch = epoch; - indexPtr->priv.lineNo = -1; - indexPtr->priv.lineNoRel = -1; - indexPtr->priv.segPtr = NULL; - } + assert(indexPtr->priv.byteIndex >= 0); + indexPtr->stateEpoch = epoch; + + /* clear the cached values in any case */ + indexPtr->priv.lineNo = -1; + indexPtr->priv.lineNoRel = -1; + indexPtr->priv.segPtr = NULL; } /* |