Different/Inconsistent Copy-Paste behavior (JChemBase 5.2.4)

User ea9d262ecb

06-01-2010 17:07:22

Context:


This is from users of SEURAT, our Java application where a Marvin pane is embedded in cells of a JTable. Users occasionally want to copy a structure and paste the image into MS Office products. They use WinXP and MS Office 2003 and typically do not have Marvin or other Chemaxon products installed.


Since the latest upgrade from JChemBase 5.1.4 to JChemBase 5.2.4, the copy-paste behavior is odd. 


Observed:


First Copy: 



  1. A JTable cell is selected containing a structure and Cnt-C is done. 

  2. ** The clipboard viewer (clipbrd.exe) shows vector graphics textual content (V200 data, not the image)

  3. ** Pasting into Word or Excel shows the vector graphics Text (not the image)

  4. Pasting into PowerPoint shows the image


Second and subsequent copies



  1. Select another structure and Control-C

  2. the clipboard viewer shows the image

  3. Pasting into Word, Excel and Powerpoint shows the image


Other oddity


A quote from a user:


When repeatedly highlighting
a structure then using Ctrl+C to copy on my machine the clipboard viewer shows
either the V2000 data, the XML, or the structure as a picture. Strange!
Regardless of the clipboard content, I seem to get an image of the structure
when pasting into most applications except ChemDraw and ISIS/Draw (where I get
a live structure)


 


We did advise users that they can use the "Copy As" option, but they are unhappy that they have to do more clicks to get what they could get before with a simple Cntrl-C.



ChemAxon 5433b8e56b

08-01-2010 05:08:34

Hi,


in 5.2.1 the whole copy/paste related code has been refactored and the basis of a new infrastucture was introduced in Marvin to handle clipboard. After that version there are some changes in the behaviour, but mostly they are issues.


One of the biggest problems until 5.2.1 release is the OLE initialization time. On certain environments sometimes the OLE server need 1-2 or even more seconds to initialize itself, and we have not realy find any cause. In 5.2.1 the OLE server remains in the memory after the first use, and run in the background. The first problem might caused by this initialization issue, and disappear after OLE once initialized, because it remains running in the background.


The oddity what the user experienced is because of the followings. Marvin has settings, to specify the clipboard data type policy. By default Marvin places OLE, EMF image, and chemical structure data to clipboard on windows platforms. The sturcture placed into the clipboard in every environment with textual and native formats (native formats may be textual also, but their type is native). The host application where the data will be pasted can choose from these data types, and should import the format which contains the most information to itself. In ChemDraw the sturcture data contains the most information, but Office applications will use OLE data(Word), Unicode String(Excel), and DIB Bitmap(PowerPoint). This inconsitency inside office applications caused by the amount of formats used to export data into the clipboard from Marvin. This will be changed in 5.3 and every Office application will paste OLE by default. Until that time the required format can be pasted by Paste special functionality inside Office applications.


The 5.3 release will contain more features, and a cleaner extendable API for clipboard handling. The new version will also preload the required libraries and also the OLE server, and therefore after initialization it will work much faster, and reliable.


The copy as formats will also be more specific, and will finally give the opportunity to copy in a specific format.


I really hope that you can change to 5.3 versions soon, and forget these inconveniences.


Best regards,
Istvan