merging in multiple spaces

merging in multiple spaces

In a merge I am doing I need to merge in a variable containing multiple leading spaces but when I look at the output and the opentbs_debug_output I see that they have been collapsed into 1 space.
How can I preserve multiple leading spaces ? I am constructing the field to be merged in so I could use another character, if it looked like a space on the output.

By: william

Date: 2011-04-02

Time: 13:56

Re: merging in multiple spaces

I tried using non-printing ascii chars as the first char in the string and OO complained that there was a format error.
I tried using a printing character and TBS was fine with that and debug_output shows the appropriate spaces, but OO then condenses them to 1 even though I have all autocorrect options turned off. There must be a way to coding a non-breaking space in php to build my string.

By: Skrol29

Date: 2011-04-02

Time: 23:52

Re: merging in multiple spaces

Hi Willima,

It is an XML specification to display only one space when they are several in the source. You have the same behavior in HTML.
So, in order to display several spaces, OpenOffice inserts a special entity:

<text:s text:c="3"/>

This entity displays 3 collapsed spaces in a text.

Here is an "onformat" TBS function that should replace multiple spaces in a text with the <text:s> entity
Use it like this: [my_text_field;onformat=f_frm_spaces]

Re: merging in multiple spaces

because the blanks represented by $nbr have been removed, so do not need to be counted.

If you have a string like (spaces are represented by dots)
...X....q
then the 2nd replacement leaves a space after the "X", eg:
<text:s text:c="3"/>.<text:s text:c="3"/> // note the one space remaining after the X.
This is not a problem as the single space is printed.

New message

Name:

Email:

ignore this line

Email:

-> No email accessible on Web pages.

Send replies notifications by email

Readers can contact you by Anti-Spam System (*)

Subject:

Message:

Special part in message: enter text between [code] and [/code] tags.

(*) Anti-Spam System: A reader can ask for 3 emails a day, no more ; and the reader must have a valid email to ask for emails.