wiki:RTF_IMPORT_R0
Last modified 3 years ago Last modified on 10/28/09 12:05:33

Pages linking to RTF_IMPORT_R0:

Ticket Summary Owner Status Type Component Priority Effort Importance
#2128 RTF_IMPORT_R0 diana closed unplanned_task uncategorized major

Reported by deyan, 3 years ago.

Description

RTF_IMPORT_R0

Analysis_owners

deyan, diana

Analysis_reviewers

dido

Analysis_score

3

Design_owners

diana

Design_reviewers

meddle

Design_score

3

Imp._reviewers

deyan, meddle, todor

Imp._score

3.5

Test_score

0

Analysis

Overview

Improve RTF import so it supports text with style

Task requirements

  • Preserve the following things when importing RTF
    • Font (if present, else a default font
    • Font style
      • size
      • foreground color
  • Do not import other content (other than text)
  • Optional - preserve paragraph options if possible

Task result

Code.

Implementation idea

Use the attached rtf-s to ensure the style is preserved.

Use javax.swing.text.rtf.RTFEditorKit class in order to read the document and to "translate" the rtf document to styled document. Not all of the styles saved in rtf are translated in the document and that's why the background color and the strike-through won't be preserved.

TEXT_RESOURCE_RTF_R0
GROUP_PLAIN_AND_RTF_RESOURCES_R0

How to demo

Create an empty book and insert a rtf with text styling.

Design

In ApplyRtfStylesUtility class add ImmMap<String, HotAttr<?>> rtfMap in order to hodld all the rtf tags and the corresponding CommonAttributes to them. Add some new tags in order to have a better importing of the rtf documents(space below,space above). Fix the logic of the applyStyles function to work with the ImmHotText(the previous text was mutable - now it is immutable).

The new test can be found here: [7828][7829]

Implementation

Done according to the design. source code:[7828][7829][7869]

Testing

(Place the testing results here.)

Comments

(Write comments for this or later revisions here.)

Attachments