Issue 105612 - Provide a RICHTEXT() function for dynamic text formatting of formula output in cells
Summary: Provide a RICHTEXT() function for dynamic text formatting of formula output i...
Alias: None
Product: Calc
Classification: Application
Component: editing (show other issues)
Version: DEV300m55
Hardware: Unknown Linux, all
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Depends on:
Reported: 2009-10-05 12:38 UTC by smls
Modified: 2017-05-20 09:56 UTC (History)
2 users (show)

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


Note You need to log in before you can comment on or make changes to this issue.
Description smls 2009-10-05 12:38:19 UTC
Provide a function called 'RICHTEXT()' for use in cell formulas in OOo Calc ,
that will take one string argument possibly containing html-like tags, and
return the plain text stripped of all the tags  --  and, when used as a
top-level function in a cell formula, will cause the returned text to be
formatted inside the cell according to those HTML-like tags. For example, a cell
with the following cell formula would then show the text "Title (subtitle)" with
nice bold/italic formatting:
		=RICHTEXT("<b>Title</b> (<i>subtitle</i>)")
The internal value of the cell, for example when referenced by another formula,
would however just be the plain string "Title (subtitle)".
At a minimum, the tags <b>, <i>, <u>, <color> and <size> (or however you wish to
name them) should be supported.
This would allow for much much greater flexibility and convenience for designing
visually pleasing dynamic spreadsheets, compared to the rather limited and
really cumbersome to use 'STYLE()' function and 'conditional formatting' feature.
(Note: Maybe it would then make sense to also introduce a 'MASK()' function,
that will augment a given string in such a way that 'RICHTEXT()' won't interpret
any part of it as formatting tags -- for example, by making the replacements
	"&"  -->  "&amp;"
	"<"  -->  "&lt;"
	">"  -->  "&gt;"
which 'RICHTEXT()' would then convert back to the original characters in it's
plain text output. This would then allow to safely write, for example:
		=RICHTEXT("<b>For bold text use the tag:</b> " & MASK("<b>")
which would display the string "For bold text use the tag: <b>" inside the cell,
with partially bold formatting of course.)
Comment 1 discoleo 2009-10-06 17:34:42 UTC
I would probably suggest something like:

1.) HTMLSTYLE(string)
Format using html-tags

2.) HTMLENCODE(string)
eencode the string as valid html text

3.) HTMLDECODE(string)
decode html-encoded string to plain text

4.) ODFSTYLE(string)
Format string, interpreting it as an ODF-stream
Comment 2 Edwin Sharp 2013-11-26 15:07:17 UTC
Moved to page: