?

Log in

No account? Create an account
 
 
07 December 2009 @ 08:43 pm
AKICILJ: Open Office, copy/paste weirdness  
Received from a friend; posted with permission. Open Office running on Windows 7.

Using the Ctrl-C and Ctrl-V shortcuts to cut and paste from Open Office to (for specific instance) Semagic results in all of the formatting commands and (possibly) HTML codes to appear in the pasted text.


I know nothing about Open Office, so I don't have a clue where to start with this one. Any ideas?
 
 
 
A Wandering Hobbitredbird on December 8th, 2009 02:05 am (UTC)
Given that Semagic tends to eat spaces when I copy/paste from an LJ comment field (in Firefox) to Semagic, I suspect the problem of being at the Semagic end, not the Open Office end. (I realize this may not be helpful.)
aedifica: Girl at computeraedifica on December 8th, 2009 02:12 am (UTC)
I was wondering too if it might be Semagic. Janet, does your friend have any similar word-processing programs they could try, to see if it acts the same?

But also, Semagic has multiple input modes. You might ask your friend to check whether HTML, WYSIWIG, or something else is selected, and whether it's the same setting they normally use. (It's on the lower edge of the Semagic window, toward the right side.)
Shadow/Brookekengr on December 8th, 2009 02:49 am (UTC)
You get the same sort of thing when pasting from the MS Word Viewer utility.

The "problem" is that cutting is "correctly" copying the formatting of the text.

See my solution below.
Stephen Harrissweh on December 8th, 2009 02:35 am (UTC)
As I understand it, the program being requested to "copy" is meant to present the data to the buffer in the fully formatted version, which includes all relevant markup. The application you paste into is meant to interpret it and present it relevantly.

So, for example, if you copy a series of cells from a spreadsheet and paste it into a word processor, the results may become an embedded table. If you copy from a web page then any embedded hyperlinks will remain as links etc.

The pasting application may provide alternate methods of pasting (in Microsoft office this is called "paste special", and allows pasting as plain text, for example).

So, to me, this sounds like "Semagic" not being sufficiently smart. But I'm not a windows expert, so I could easily be wrong! What sort of results are seen if the friend pastes into notepad? into wordpad?
Shadow/Brookekengr on December 8th, 2009 02:51 am (UTC)
It's actually "works as designed". Semagic accepts the formatting because it accepts HTML tags as part of the text entry.

The "fix" if you don't want that is to paste into NotePad or some other text only editor.

Stephen Harrissweh on December 8th, 2009 02:59 am (UTC)
I thought the buffer contained a MIME type associated with it; Is so then if the MIME type was "text/html" then presenting the html markup in the pasted results is of questionable design (indeed, mis-designed because it'd go against expected normal windows behaviour).

If the buffer doesn't contain any associated MIME type then ignore me; I did say I wasn't a windows expert :-)
Shadow/Brookekengr on December 8th, 2009 03:22 am (UTC)
I dunno about that, but from a number of programs dealing with "formatted" text, pasting into programs that allow formatting results in the formatting carrying over.

I'd call that the "expected" result.

I do note that a few programs (Firfox 3.5, IIRC) will ask you whether you want the plain text or the HTML when you tell them to copy a block of text
Stephen Harrissweh on December 8th, 2009 03:30 am (UTC)
The _formatted results_ is what I'd expect; Janet's original question suggested that the formatting markup was visible ("all of the formatting commands and (possibly) HTML codes to appear"). That's unformatted results.

Maybe I misunderstood what Janet (or her friend) was asking.

If Semagic is formatting the results as close to the original as possible then Semagic is doing the right thing; if it's displaying the markup then it's doing the wrong thing,
Shadow/Brookekengr on December 8th, 2009 04:00 am (UTC)
That's because Semagic *always* displays the formatting codes you enter or paste.

Markup is visible in Semagic. It's not WYSIWYG. You have to switch to the preview screen to noyt see the markup.

Like I said "works as designed"
gh4acws on December 8th, 2009 01:09 pm (UTC)
depends on
what mode semagic is in. if it is in HTML it shows the markup - however there is the wysiwyg mode ( switches bottom right )

Shadow/Brookekengr on December 8th, 2009 02:47 am (UTC)
That happens with a *lot* of programs, not just Open Office. And as far back as Win2k.

My simple workaround is to paste the text into a text editor (I use TextPad, but NotePad will work) and then cut it from there and paste that into Semagic.

ETA: Semagic is working *correctly* in doing this. Because the HTML formatting commands are valid inputs. The problem is ones you don't want (like all the paragraph tags.

Edited at 2009-12-08 02:53 am (UTC)
Raoul Dukedrjeff on December 8th, 2009 03:21 am (UTC)
Semagic has a right-click "paste as text" option, but I don't know what the keyboard equivalent would be.
My Yuki's Fan Clubakcipitrokulo on December 8th, 2009 07:29 am (UTC)
Not open-office specific, but if I have copy-paste weirdness I usually solve it by copying to a plain text program (like notepad) and then copy from there to the final destination.
kightp on December 10th, 2009 01:07 am (UTC)
Coming in late: I'm using Semagic 1.7, so this may not apply to newer versions, but choosing "paste special" from the Edit menu and selecting "text" strips off all formatting except paragraph returns.

If you also check the "set as default" box when doing this, then the next time you need to paste from a formatted document, you can use Ctrl-V and it will paste it as unformatted text.
Janet Miles, CAP-OM: wisdomjanetmiles on December 10th, 2009 02:26 pm (UTC)
I think the problem is that she wants to retain the formatting, but not see all the markup codes (e.g., she's copying a formatted poem or essay from the Open Office word processor into Semagic to post to LJ). However, I'll mention this as another option.

Thanks!