Copy paste strips xml:id
Posted: Tue Jun 28, 2011 7:51 pm
When I copy/paste from one file to other in Author view it strips the xml:id. How do I modify that behavior?
Code: Select all
@Override
public ClipboardFragmentProcessor getClipboardFragmentProcessor() {
final ClipboardFragmentProcessor originalImplementation = super.getClipboardFragmentProcessor();
return new Docbook5UniqueAttributesRecognizer()
{
/**
* @see ro.sync.ecss.extensions.api.content.ClipboardFragmentProcessor#process(ro.sync.ecss.extensions.api.content.ClipboardFragmentInformation)
*/
@Override
public void process(ClipboardFragmentInformation fragmentInformation) {
if(!fragmentInformation.getFragment().isEmpty() &&
fragmentInformation.getFragment().getContentNodes().size() > 0 &&
fragmentInformation.getFragment().getContentNodes().get(0).getName() == "table") {
// do not strip ids for tables
}
else
originalImplementation.process(fragmentInformation);
}
};
}
Code: Select all
.................
if(fragmentInformation.getFragmentOriginalLocation() != null
&& ! fragmentInformation.getFragmentOriginalLocation().equals(authorAccess.getEditorAccess().getEditorLocation().toString())) {
//Paste from another document. Remove the IDs
removeUniqueIDs = true;
}
................
Code: Select all
fragmentInformation.getFragmentOriginalLocation().equals(authorAccess.getEditorAccess().getEditorLocation().toString())
Code: Select all
.................
if(fragmentInformation.getFragmentOriginalLocation() != null
&& ! fragmentInformation.getFragmentOriginalLocation().equals(authorAccess.getEditorAccess().getEditorLocation().toString())) {
//Paste from another document. Do not remove the IDs
removeUniqueIDs = false;
}
................