Huditsch, Roman (LNG-VIE) wrote:
> 
> I got the following requirement from our others:
> When they cut (or copy) text and paste it in somewhere else in XMLMind, 
> they want that to happen with some kind of whitespace adjustment or
> balancing.
> So if the text before the caret doesn't end with a whitespace, then the
> pasted text
> should be filled in with a leading space. The same applies to the text
> after the caret - 
> just the other way around.
> 
> Example 1: 
> 
>       Text in clipboard: "warranty"
>       Text before caret in text: "subject to the Limited"
>       Text after the caret:  "on Optical Storage Products"
>       Text after pasting: "subject to the Limited warranty on Optical
> Storage Products"
> 
> 
> Example 2:
> 
>       Text in clipboard: "warranty"
>       Text before caret in text: "subject to the Limited "
>       Text after the caret:  " on Optical Storage Products"
>       Text after pasting: "subject to the Limited warranty on Optical
> Storage Products"
> 
> Example 3:
> 
>       Text in clipboard: " warranty "
>       Text before caret in text: "subject to the Limited"
>       Text after the caret:  "on Optical Storage Products"
>       Text after pasting: "subject to the Limited warranty on Optical
> Storage Products"
> 

I understand this requirement.



> 
> Is there any way in XMLMind to do this? 
> 

There is no easy and safe way to implement this feature in XMLmind XML
Editor.

Of course, it is always possible to specialize the standard Paste
command (
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmledit/cmd/edit/Paste.html
) after reading its source code and to rebind your specialization to
Ctrl-V.

However, you need to be an experienced Java[tm] programmer to do this
and, even in this case,  it is not that simple to do it and you can
easily break things.

Note that having too much whitespace around pasted text is not really a
problem as whitespace is automatically normalized each time a document
is opened.



Reply via email to