Copy and pasting fragments injecting NULL characters in applet

Oxygen general issues.
neon096
Posts: 45
Joined: Wed May 23, 2012 11:20 am

Copy and pasting fragments injecting NULL characters in applet

Post by neon096 »

I've come across an issue whereby the Author is selecting a mixture of text and the full element and pasting it into a new paragraph. An example of the selection is

Code: Select all

Paragraph text <citation>Enter citation here</citation>
When the Author then pastes this into another paragraph it is displayed in the Author applet as

Code: Select all

<citation/>aragraph text Enter citation here
.

We are using a DocumentFilter to make sure the paste doesn't have more than 2000 characters but if it doesn't we are passing it on to the AuthorDocumentFilterBypass to insert the fragment.

Code: Select all


if (paraText.length() + size <= CHARACTER_LENGTH) {
bypass.insertFragment(offset, fragment);
} else {
access.getWorkspaceAccess().showInformationMessage("Unable to insert fragment into para because the fragment would breach " + CHARACTER_LENGTH + " character threshold.");
}
Do you have any suggestions as to why the paste is failing?
Radu
Posts: 9445
Joined: Fri Jul 09, 2004 5:18 pm

Re: Copy and pasting fragments injecting NULL characters in applet

Post by Radu »

Hi Neil,

So the user copies from the component some content and then pastes it back in another place.
Does this happen on the first or on subsequent paste operations?
By NULL characters do you mean characters which have the integer value as 0?

Maybe you have another customization which influences this behavior. Do you alter the AuthorDocumentFragment in any way? Maybe you could send me some of your customization code to support@oxygenxml.com

Could you try to reproduce the situation with one of our demo DITA samples?
http://www.oxygenxml.com/demo/AuthorDem ... ments.html

Rgards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
neon096
Posts: 45
Joined: Wed May 23, 2012 11:20 am

Re: Copy and pasting fragments injecting NULL characters in applet

Post by neon096 »

Thanks Radu,

I'm changing the Content object underneath the AuthorDocumentFragment and replacing non ASCII characters that are pasted from Word (i.e Left and Right double quotes).
Radu
Posts: 9445
Joined: Fri Jul 09, 2004 5:18 pm

Re: Copy and pasting fragments injecting NULL characters in applet

Post by Radu »

Hi Neil,

You could try to disable that code and see if it fixes the problem.
If the problem is in the code, maybe you could send me or post some fragments from it, maybe I can give you a better way to perform the replace.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply