Issue 10298 - paste button disabled incorrectly
Summary: paste button disabled incorrectly
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: ui
Classification: Code
Component: ui (show other issues)
Version: 641
Hardware: Sun Solaris
: P3 Trivial with 1 vote (vote)
Target Milestone: ---
Assignee: stefan.baltzer
QA Contact: issues@ui
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2002-12-24 14:18 UTC by Unknown
Modified: 2003-11-30 10:15 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Do we talk about that paste button? (4.18 KB, image/png)
2003-10-10 07:09 UTC, Rainer Bielefeld
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Unknown 2002-12-24 14:18:21 UTC
Launch OpenOffice. Copy to the clipboard an image from 
some application. The paste button on OpenOffice's 
toolbar will be disabled. That's correct behavoiur, 
since an image can't be pasted into a text document.
Then copy some text from the same application. The 
paste button will remain disabled in spite of the 
text could be pasted into OpenOffice's editor with keys.

If you need more information, let me know.
Comment 1 utomo99 2003-09-17 08:54:26 UTC
Please try using the latest OOo 1.1 Rc4, 
Your version already old enough, and many bug fixes since your version 
and 1.1 RC4. If the problem still happend in 1.1 RC4 please report back 
Comment 2 utomo99 2003-10-07 08:14:28 UTC
Please try using the latest OpenOffice 1.1 Final , you can download it
from www.openoffice.org
many bug fixes and enhancements since your version and 1.1 Final . If
the problem still happend in 1.1 please report back 
Comment 3 Rainer Bielefeld 2003-10-10 07:08:09 UTC
Hi Reporter,

if you are talking about the paste-button directly at the left from
the UNDO- button (my OOo has no other one): I can not see such
behaviour with 1.1.0 German version WIN98SE: 645m19(Build8693) and I
do not remeber that I saw this ever before.

UTOMO, this can be tested easiliy by QA (what is our job), it does not
make any sense to request more "User-Tests" again and again.

If I will not get the requested information concerning the
"paste-button" or see any further action as votes, attachments or
confirmations in this issue, I will have to close this issue
2003-10-31 as WFM.

Rainer
Comment 4 Rainer Bielefeld 2003-10-10 07:08:47 UTC
Added Utonmo to CC

Rainer
Comment 5 Rainer Bielefeld 2003-10-10 07:09:37 UTC
Created attachment 10171 [details]
Do we talk about that paste button?
Comment 6 Unknown 2003-10-10 08:57:47 UTC
Yes, we do talk about the paste button.

I'm sorry, I did not specify that this bug was reproduced
under Linux and Solaris. If you need an application that
copies into the clipboard some text and an image, let me
know.
Comment 7 m.webermann 2003-11-02 14:55:57 UTC
I'm not able to reproduce this issue with OOo1.1.0 (Linux).   
Comment 8 alex.thurgood 2003-11-02 18:19:36 UTC
I have just tried this on a Linux MDK 9.1 with OOo 1.1 RC5. I opened
Acrobat Reader and loaded a document containing images and text. I
tried copying just a graphic, and then selected some graphics and text
and tried copying that, into a Writer.

The graphic copied into Writer just fine with the Paste button. A long
click on this button showed that a bitmap was in the clipboard.

When text and graphic was selected, only text was pasted into OOo.

The button worked fine both times.

My conclusion, WORKSFORME.

Alex
Comment 9 Unknown 2003-11-03 10:22:23 UTC
Could you please try to reproduce the issue using the following Java
application? To copy an image in the clipboard, press the "copy 
image" button; to copy some text, press the "copy text" button.
To run the application, use the latest available JDK - 1.4.2.

The procedure to reproduce the bug remains the same.
Launch OpenOffice and ensure that a text document (which doesn't
allow images within itself) is opened. Copy to the clipboard 
an image from the application. The paste button on OpenOffice's 
toolbar will be disabled. That's correct behavoiur, 
since an image can't be pasted into a text document.
Then copy some text from the same application. The 
paste button will remain disabled in spite of the 
text could be pasted into OpenOffice's editor with keys.

=====================================================================
import java.awt.*;
import java.awt.datatransfer.*;
import java.awt.event.*;


public class CopyTextAndImage {

    public CopyTextAndImage() {
        final Frame frame = new Frame();
        final ImageCanvas canvas = new ImageCanvas();
        frame.add(canvas, BorderLayout.CENTER);

        final String text = "abcdefgh";
        final Label label = new Label(text);
        frame.add(label, BorderLayout.EAST);

        final Clipboard clipboard = frame.getToolkit
().getSystemClipboard();

        Panel ps = new Panel();
        Button copyText = new Button("copy text");
        Button copyImage = new Button("copy image");
        copyText.addActionListener(new ActionListener() {
            public void actionPerformed (ActionEvent event) {
                clipboard.setContents(new StringSelection(text), 
null);
            }
        });
        copyImage.addActionListener(new ActionListener() {
            public void actionPerformed (ActionEvent event) {
                clipboard.setContents(new ImageSelection
(canvas.getImage()), null);
            }
        });
        ps.add(copyImage);
        ps.add(copyText);
        frame.add(ps, BorderLayout.SOUTH);
        frame.setSize(200, 200);
        frame.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent e) {
                System.exit(0);
            }
        });

        // create image and set it into canvas
        int w = 100;
        int h = 100;
        int[] pix = new int[w * h];
        int index = 0;
        for (int y = 0; y < h; y++) {
            for (int x = 0; x < w; x++) {
                  int red = 127;
                  int blue = 127;
                  if (x<10 && y <10)
                      pix[index++] = (0 << 24) | blue;
                  else
                  pix[index++] = (255 << 24) | (red << 16) | blue;
            }
        }
        Image img = frame.getToolkit().createImage(new 
java.awt.image.MemoryImageSource(w, h, pix, 0, w));
        canvas.setImage(img);

        frame.setVisible(true);
    }

    public static void main(String[] args) {
        new CopyTextAndImage();
    }
}


class ImageCanvas extends Canvas {
    private Image image;

    public ImageCanvas() {}

    public ImageCanvas(Image im) {
        image = im;
    }

    public void paint(Graphics g) {
        if (image != null) g.drawImage(image, 0, 0, this);
        else g.drawString("no image", 30, 30);
    }

    public void setImage(Image im) {
        image = im;
        repaint();
    }

    public Image getImage() {
        return image;
    }
}


class ImageSelection implements Transferable {

    private static final int IMAGE = 0;

    private static final DataFlavor[] flavors = { 
DataFlavor.imageFlavor };

    private Image data;

    public ImageSelection(Image data) {
        this.data = data;
    }

    public DataFlavor[] getTransferDataFlavors() {
        return (DataFlavor[])flavors.clone();
    }

    public boolean isDataFlavorSupported(DataFlavor flavor) {
        for (int i = 0; i < flavors.length; i++) {
            if (flavor.equals(flavors[i])) {
                return true;
            }
        }
        return false;
    }

    public Object getTransferData(DataFlavor flavor)
        throws UnsupportedFlavorException, java.io.IOException
    {
        if (flavor.equals(flavors[IMAGE])) {
            return (Object)data;
        } else {
            throw new UnsupportedFlavorException(flavor);
        }
    }
}
Comment 10 Rainer Bielefeld 2003-11-07 06:59:06 UTC
Hi gas2000, 

thanks for your Java application. Unfortunately this will not be
enough to reproduce your problem. What we need is y possibility that
it is an OOo problem with the yctual OOo Version. So we need:
- Your result with an actual OOo version (we will not check with 
  obsolete "641") 
- Your SOLARIS- version
- a complete testkit

I have several problems to understand how to reproduce the problem:
What is a "text document (which doesn't allow images within itself)"?
Please attach the document.
Please also attach some PDF document or similar (containing graphic
elements).
And please also Supply an absolute clear step by step instruction to
reproduce the problem. Please mintion every keypress and mouseclick,
so that even a  chimpanzee should be able to reproduce the problem  by
following your instruction - if he has a SUN - SOLARIS - system ;-)

Rainer
Comment 11 Rainer Bielefeld 2003-11-13 16:27:42 UTC
Closed because not reproducible for other SOLARIS users (discussed in
[qa-dev]

Rainer
Comment 12 Rainer Bielefeld 2003-11-30 10:15:23 UTC
.