Project: Eclipse_Platform_UI
Bug 335704 [Forms] Copying text from a FormText copies to much in some cases.
Reported: 2011-01-28 11:52:14 | Status: resolved fixed

Build Identifier: 3.6.1.v3659 In TextForms that use HTML tags for formatting the text is split up in segments of the same formatting. If a line consists of more than one segment, selecting and copying text from this line causes all segments preceding the selected text to be copied as well. PATCH: I think the bug is in TextSegment.computeSelection. The first if-condition in the method should be "(firstRow && bounds.x < leftOffset)" instead of "(firstRow && bounds.x + swidth > leftOffset)". This way sstart would be set to s.length and no text would be added to the selection. I am not set up to build Eclipse or SWT right now so I could not test the code. Could this also be nominated for inclusion in 3.6.2? We are planning to releasing an RCP app based on 3.6.2. Unfortunately, I am unable to wait to the release of 3.7.0. Reproducible: Always Steps to Reproduce: 1. Create a new Plug-in project in eclipse. Use the 'RCP Application with a view' as template. 2. Replace the code in view.java with the attached file and adjust the package 3. Run the application 4. Copy the word 'normal' form the TextForm 5. Paste it to any text editor. 6. The copied text is 'Boldnormal'

Files changed in fix:
bundles/org.eclipse.ui.forms/src/org/eclipse/ui/internal/forms/widgets/TextSegment.java