Closed Bug 10325 Opened 25 years ago Closed 25 years ago

Copy to clipboard (and maybe Paste?) doesn't work

Categories

(Core :: Layout, defect, P3)

All
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: cmanske, Assigned: rods)

References

Details

Select some text from any source page in apprunner or editor.
The debug window outputs indicate that appropriate formats (xif, text,
and AOLMAIL) are being obtained.
We should be able to paste plain text into any app that accepts it, such as
Notepad or Wordpad in Windows, but nothing pasted if you try to do that.
Pasting into the editor inserts just "<#text>" instead of the contents of the
clipboard. The prepending of "<#text>" is a known problem (bug 7933) but
it is still supposed to insert the contents after that, which it is not.
(You can insert raw HTML in the editor from the menu (Insert | HTML Source) to
demonstrate that inserting into the editor is not the problem.
[I'm not sure what is the best component to use, I used layout since that is
where rod works now.]
Blocks: 7933
Severity: blocker → critical
Summary: Copy/Paste is busted → Copy to clipboard (and maybe Paste?) doesn't work
backing out rods's last change fixes this
so what was that change? what did it break exactly?
It's one of two things:
It's either the double byte character support or it was the new file cache work
that includes you have having to delete the memory. I noticed I had a change in
my tree for nsTextEditor.cpp that isn't checked in. That may be culprit. I can't
test that until tomorrow.
No longer blocks: 7933
Just talked to Pav -- the file to revert in widget/src/xpwidgets is
cvs update -r1.24 nsTransferable.cpp
Reverting this file solves the problem and I can paste to an external app on
linux again.  Charley, does this solve the problem on Windows?  My windows build
isn't finished yet.
No, unfortunately it doesn't fix it on Windows. I get no pasted text.
In the Editor, the Debug menu item Test Selection still doesn't show content
in the debug window.
OOPS! I goofed and didn't get Akkana's nsRangeList update before I tried it.
Reverting to v1.24 for nsTransferable.cpp fixes everything in Windows.
Test Selection show correct output and pasting into an external editor or
pasting HTML within the editor all work again.
Blocks: 6271
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Just checked in changes to nsPresShell.cpp and nsXIFFOrmatConverter.cpp
The problem was I assumed nsString.Length() returned the length in bytes instead
of chars. This means on the way in I needed to multiple by two and then when I
get the data off the clipboard I needed to divide the length by two before
putting it into the nsString as multi-byte.

Please try this on Mac and Linux, to make sure it works. I am marking as fixed
for now.

This probably really all started when I changed the nsPresShell over to
multi-byte, nsTransferable 1.24 was probably working  more by luck than
anything.
Status: RESOLVED → REOPENED
This fixes it on linux -- for the first copy/paste.  If I copy/paste again, I
get nothing.  Here's how to reproduce this:

Bring up an editor window (apprunner -editor).  Select a small block of text in
the first paragraph, e.g. "a good place", do a Copy, then paste into an app that
takes plaintext.  The paste works fine.  Now make a bigger selection, e.g. from
"not use latin" in the first paragraph down to "Here is some" in the third
paragraph.  Copy again, and paste again.  Nothing comes through.  Test Selection
(in the debug menu) still gets the whole selection in all formats, so I think
the XIF stuff is still working okay.

This may be a linux-only problem.  I can't test on Windows since the VC5 build
is broken again.  Maybe Rod or Charley can test this on Windows with Rod's
latest changes, and see if it happens on Windows too?
I works on multiple copies and pastes on windows Atleast it did last night. I
won't be able to look at it until monday. So I am thinking that is a Linux only
problem, but more testing should be done.
this is a seperate bug that is mine.  i'm aware of it.  this bug is fixed.. so
um.. mark it resolved and file another one against me
Status: REOPENED → RESOLVED
Closed: 25 years ago25 years ago
Okay, I've filed bug 10428 on the linux problem.  Re-closing this one.
Status: RESOLVED → VERIFIED
Fixed in the July 26th Build (1999072698).
You need to log in before you can comment on or make changes to this bug.