incubator-ooo-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Regina Henschel <rb.hensc...@t-online.de>
Subject Re: Display text if condition is true
Date Sat, 08 Sep 2012 11:07:01 GMT
Hi Hemant,

Hemant Kumar schrieb:
> Hello,
>
> On 08-Sep-2012, at 3:41 PM, Rory O'Farrell <ofarrwrk@iol.ie> wrote:
>> There is a Conditional text mechanism.  The Help file says
>>
>> "Conditional Text You can set up fields in your document that
>> display text when a condition that you define is met. For example,
>> you can define the conditional text that is displayed in a series
>> of reminder letters. Setting up conditional text in this example is
>> a two-part process. First you create a variable, and then you
>> create the condition."
>
>
> Sure, but there is a problem with Conditional texts, which is - it
> requires a else condition. Now, I don't want a else condition. To
> explain things further, I am building a OpenOffice extension that
> allows switch case conditional text. For example:
>
> if editor EQ "emacs" "Saint Ignatious" elsif editor EQ "vim" "ahoy
> vim" elsif editor EQ "blah" "blah
>
>
> Now, before I can build such an extension, Openoffice XML spec much
> support such a field. The closest I found was, Conditional Text and
> hidden text. The problem with, Conditional text is - it requires a
> else condition and problem with hidden field is, it does opposite of
> what I want.
>
> For example, if Hidden text behaved such that, if condition specified
> is true, then show the text else hide the text, my OpenOffice
> extension can generate following XML in the document:
>
> <text:hidden-text text:condition="ooow:editor EQ "emacs""
> text:string-value="Sait emacs" text:is-hidden="true">Wow
> man</text:hidden-text> <text:hidden-text text:condition="ooow:editor
> EQ "vim"" text:string-value="Saint vim" text:is-hidden="true">Wow
> man</text:hidden-text>
>
> Now, obviously this is not possible because - hidden text actually
> hides the text, rather than displaying it.

So you want to show either "emacs" or "vim"? Then set up a text, which 
has both in it. With one condition you hide "emacs" and with the 
opposite condition you hide "vim". (To be honest, I've not tried it yet.)

Kind regards
Regina

---------------------------------------------------------------------
To unsubscribe, e-mail: ooo-users-unsubscribe@incubator.apache.org
For additional commands, e-mail: ooo-users-help@incubator.apache.org


Mime
View raw message