Tk Source Code

View Ticket
Login
Ticket UUID: 3476698
Title: Patch for failing test text-31.11
Type: Patch Version: None
Submitter: fvogel Created on: 2012-01-20 17:13:12
Subsystem: 18. [text] Assigned To: fvogel
Priority: 7 High Severity: Minor
Status: Closed Last Modified: 2014-02-19 21:42:30
Resolution: Fixed Closed By: fvogel
    Closed on: 2013-09-23 21:40:55
Description:
The attached patch fixes item 3475627:

https://sourceforge.net/tracker/index.php?func=detail&aid=3475627&group_id=12997&atid=112997

The patch is against the latest core-8-5-branch.
User Comments: fvogelnew1 added on 2012-01-26 03:20:04:

allow_comments - 1

Patch has been applied today to core-8-5-branch and trunk.
Closing now.

fvogelnew1 added on 2012-01-24 04:42:04:
>Those patch files contain CR-LF line endings,
>I didn't have that problem with other patches before.

I have created all my patches using  fossil diff > xxx.patch  and then uploaded the xxx.patch file to SF. All patches were generated on Windows. It is possible that some patches were created on Vista and some on Seven, but should that make any difference?
Is there any other recommended method for producing patch files?

> Patch 3477449 fixes test text-31.11 as well, does that make
> patch 3476698 unnecessary?

I have answered that one here:
https://sourceforge.net/tracker/?func=detail&aid=1630271&group_id=12997&atid=112997

nijtmans added on 2012-01-24 04:33:43:
> Strange that you could not download the patch, I have just downloaded it
> successfully again.
If I try to download it directly from the link, it doesn't work, but if I first save
it to a directory then it works. Those patch files contain CR-LF line endings,
maybe that's causing the trouble that firefox doesn't recognize them
as text files and refuses to open gedit (Ubuntu 11.11). I didn't have
that problem with other patches before.

Patch 3477449 fixes test text-31.11 as well, does that make
patch 3476698 unnecessary?

fvogelnew1 added on 2012-01-23 02:04:50:
You're right, it's not needed for every configure.
Indeed in my patch I had added the epoch increase at the very end of the
    if (mask & TK_TEXT_LINE_RANGE) {
so that it is only executed when changing -startline and/or -endline, and not for any other configuration of the text widget since it's not needed in the latter case.
Besides I had added comments for tkText.h in the patch.

Strange that you could not download the patch, I have just downloaded it successfully again.
Here it is in textual copy/paste form, if it makes sense. I guess it will be awfully wrapped when published, but anyway:

Index: generic/tkText.c
==================================================================
--- generic/tkText.c
+++ generic/tkText.c
@@ -2096,10 +2096,11 @@
 
 TkTextSelectionEvent(textPtr);
 textPtr->abortSelections = 1;
     }
 }
+        textPtr->sharedTextPtr->stateEpoch++;
     }
 
     /*
      * Don't allow negative spacings.
      */

Index: generic/tkText.h
==================================================================
--- generic/tkText.h
+++ generic/tkText.h
@@ -559,13 +559,14 @@
  * this widget. NULL means that no bindings
  * exist, so the table hasn't been created.
  * Each "object" used for this table is the
  * name of a tag. */
     int stateEpoch;/* This is incremented each time the B-tree's
- * contents change structurally, and means
- * that any cached TkTextIndex objects are no
- * longer valid. */
+ * contents change structurally, or when the
+ * start/end limits change, and means that any
+ * cached TkTextIndex objects are no longer
+ * valid. */
 
     /*
      * Information related to the undo/redo functionality.
      */

nijtmans added on 2012-01-22 23:59:00:
I cannot extract text-31.11-fix_V1.patch, but from you
description I tried to get the idea and applied that.

Committed to branch bug-3475627. It helps: text-31.11
succeeds now, but I have some questions:

- Is this the right place to increment the epoch?
- Is is really necessary to update the epoch on
  EVERY configure? If it is possitlbe to update the
  epoch only on certain configure options, that
  would be preferable. I don't have any clue
  on how this could affect preformance.

François, any ideas on this. Jeff, Vince, how do
you think about that?

fvogelnew1 added on 2012-01-21 00:14:03:
Jan, could you help with this one again?

fvogelnew1 added on 2012-01-21 00:13:16:

File Added - 433555: text-31.11-fix_V1.patch

Attachments: