[softwarelist] Re: problem with holding format during copy/paste

On 21 Jul, Martin Devon  wrote in message
  <1248177307.8700.0@PC-Ubuntu>:

> On 21/07/09 12:24:30, Martin Wuerthner wrote:
> > In message <1248174819.6622.0@PC-Ubuntu>
> >           Martin Devon <martin.devon@xxxxxxxxxxxxxx> wrote:
> >
> > > Progress. Deselecting global clipboard in choices allows text
> > > effects to be pasted. Howerver I do not know of anything installed
> > > which might change the clipboard contents.
> >
> > The Clipboard utility (current version maintained by Steve Fryatt)
> > shows you which program is currently holding the clipboard. After you
> > copy in OP it should show OP as the clipboard owner.
>
> Interesting results. With global clipboard enabled and !Clipboard
> loaded, cutting from OPro produces an error "unexpected data save
> packet" but this seems not to be fatal. !Clipboard always shows the
> owner as OvationPro and the type as text - which may be significant?

I've just had a play: a short piece of text with formatting in O-Pro, copy,
and paste back.  On RISC OS 5, it works as expected and the formatting is
retained.  On RISC OS 4.37, I see exactly what Martin describes (ie. the
formatting is lost).  A quick look at the Wimp messages flying around gives
some clues as to what might be happening (and I'm fairly sure we've been here
before on this list -- if not, it was with another WP/DTP app).

As far as I can tell, the problem is as follows.  On RISC OS 5, which is
'primitive' enough to still use the Global Clipboard Protocol as devised by
Acorn, when the text is copied in O-Pro, O-Pro retains it on its own internal
clipboard and advises all the other applications that it now 'owns' the
clipboard.  When the text is pasted back into O-Pro, O-Pro knows about the
formatting (I assume), and so it is retained.

On RISC OS 4.37, however, we have the Clipboard Holder.  When O-Pro announces
that it now 'owns' the clipboard contents, the Clipboard Holder (part of ROL's
Select versions of the OS) immediately requests a copy of the contents and on
receipt, claims ownership of the clipboard for itself.  The logic is that if
O-Pro is quit, the cut text will still be safe, held in the OS.

The problem is that the Clipboard Holder seems to always take the lowest
common denominator format: plain text, with no formatting.  When O-Pro comes
to paste in the text from the clipboard, it has to ask the Clipboard Holder
for it as it no longer 'owns' the clipboard for itself.  What it gets back is
plain text, with no formatting.

As to the "Unexpected Data Save packet" error, from a very quick look at the
problem, I /think/ the issue is that Clipboard tries to play the same game as
the Clipboard Holder: watch for apps claiming the clipboard, and then take it
away from them.  I'm not 100% sure, but it looks a bit as if Clipboard asks
O-Pro for the clipboard after the Clipboard Holder does, but before O-Pro has
chance to reply to the first request.  Things then seem to get confused, both
with Clipboard and O-Pro (I think -- apologies to David if the latter is
unfair on O-Pro).

In addition, I think Clipboard then reports O-Pro holds the clipboard contents
when in fact, according to the underlying Wimp messages, it no longer does.  I
presume this is a result of the error.

Does anyone use Clipboard (the app) enough to want me to investigate this
latter bug further? The fact that I've not had a report thus far suggests
not...

> Also, if some text containing odd words with bold effect is cut/copied,
> it always appears correctly on the clipboard but, on pasting, while
> usually the effect is removed, I have seen occasions where the effect
> is applied to all the text.

See above.  As to it being a new problem, I suspect that it came in when you
upgraded to a version of RISC OS that contained the Clipboard Holder.

> Meanwhile, global clipboard is disabled...

Another fix is to kill the Clipboard Holder: if I press Ctrl-F12 on the RISC
OS 4 machine and do "*RMKill ClipboardHolder", then return to O-Pro and do the
same copy and paste, the formatting is now retained.  Unfortunately, anything
that uses the Clipboard Holder for clipboard facilities (such as Draw and
Edit), will now no longer do Copy, Cut and Paste.

In other words, there isn't really a quick fix as far as I can tell -- as I
say, I think we've been here before.  If you can live without global clipboard
support in O-Pro, turning support off in its Choices may be the best bet.

:-(

-- 
Steve Fryatt - Leeds, England

http://www.stevefryatt.org.uk/

To unsubscribe or subscribe goto: http://www.freelists.org/list/davidpilling

Other related posts: