Cut() does not invoke MODIFYATTEMPTREADONLY

View: New views
3 Messages — Rating Filter:   Alert me  

Cut() does not invoke MODIFYATTEMPTREADONLY

by Chris Jones-34 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I've been having a problem with scintilla.

If you open up a read-only document, and then attempt to cut some text out
of it, nothing happens.
If you try to paste, or just type text in, it correctly fires off the
SCN_MODIFYATTEMPTRO notification

My quick and dirty solution was to change the Document's CheckReadOnly()
method to public, and then add this line in at the start of the
Editor::Cut() method:

pdoc->CheckReadOnly();

That fixes the problem (whether it's in keeping with scintilla's design I'm
not sure); if you could include something similar in the next release of
Scintilla that'd be great.

Cheers
Chris

_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Re: Cut() does not invoke MODIFYATTEMPTREADONLY

by Neil Hodgson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chris Jones:

> My quick and dirty solution was to change the Document's CheckReadOnly()
> method to public, and then add this line in at the start of the
> Editor::Cut() method:
>
> pdoc->CheckReadOnly();

    Something like this is probably correct but I'm trying to remember
all the history around this issue - the mail archive includes a claim
that Cut works in read-only mode and I can't now see how that could
have been true.

   Neil
_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Re: Cut() does not invoke MODIFYATTEMPTREADONLY

by Neil Hodgson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Chris Jones:

> My quick and dirty solution was to change the Document's CheckReadOnly()
> method to public, and then add this line in at the start of the
> Editor::Cut() method:
>
> pdoc->CheckReadOnly();

    OK, committed.

   Neil
_______________________________________________
Scintilla-interest mailing list
Scintilla-interest@...
http://mailman.lyra.org/mailman/listinfo/scintilla-interest