Page 1 of 1

[Solved] Two Styles on the same line

Posted: Fri Oct 20, 2023 12:49 pm
by ScoobyAalo
Hi,

I have a bunch of documents(Swedish) in ODT-format that I distribrute to others and they use it as
base for composing letters.

At the start of the document, not in the header of page, there are a couple of lines with headers.
I present it as I want it to look when text is filled in by the others. When i distribute the documents there is
no text after the colon character.

Errandnumber: 123456
Name: Peter Parker
Phonenumber: 070-12345678


When the others fill in this part of the document the Style is remembered, in this case Bold, and
continues to write characters with this style

Errandnumber: 123456
Name: Peter Parker
Phonenumber: 070-12345678

I would like something like a styleseparator as in MS Word. I've tried with character styles but couldnt get it to work
the way I wanted it.
The only way I found is to make it a table with diffenrent styles in different cells.

As these documents are used by older people that are not used to computers I am after an easy solution without macros, templates
and such.

Is there another way to do this?

Thankful for any comments

Re: Two Styles on the same line

Posted: Fri Oct 20, 2023 1:24 pm
by Lupp
(Assuming LTR writing direction, no explicit Char-settings in advance of typing.)
If you type a piece of text anywhere, or append it at the end of a paragraph, or overwrite a selected portion, the characters of this piece always get assigned the attributes (including the CharStyle name) taken from the character left of the insertion position. In case of an empty paragraph the character properties set for the paragraph are assumed.
This also holds if you Ctrl+Shift+V something in Unformatted text mode, and if you use the method insertString by user code.

Thus:
Append behind the colon a space (or a tab or some different whitespace?) formatted the way you want to be applied to the added text.
Tell users they must not delete it.

Re: Two Styles on the same line

Posted: Fri Oct 20, 2023 1:57 pm
by ScoobyAalo
Thank you,

I tried that but the users manage to mess up anyway and delete the whitespace.

Maybe I cannot make this as foolproof as I want it but now I found the feature
from menu Table->Convert->Text to Table and assign it to a shortcut it's pretty
quick to insert a table for each row and have different paragraphs in each cell.

This way I get no problems with text alignment. When I contructed the tables manually
The text was not aligned beween cells or to much space between rows and required
a lot of fiddling to look as before.

Now I need to research if I can lock the table cells as not to allow users to edit them :D

Re: Two Styles on the same line

Posted: Fri Oct 20, 2023 2:08 pm
by ScoobyAalo
T'was easy to lock a cell by placing cursor in that cell
and choose menu Table-->Protect Cell

Now I want to lock/disable resizing of the table i.e. to not let the user
drag and resize the column width.

I am not sure this is possible?

Re: Two Styles on the same line

Posted: Fri Oct 20, 2023 2:30 pm
by ScoobyAalo
As far as I have found out there is currently no way to lock the resizing
of columns.

I found this
https://design.blog.documentfoundation. ... ce-writer/
which is a discussion on a future possible dialog layout where you
can lock column widths

Have I missed a way to protect resizing of column widths?

Re: Two Styles on the same line

Posted: Fri Oct 20, 2023 2:56 pm
by Lupp
Why does it seem to be necessary to make things "foolproof" everywhere nowadays?

Where you really need to get things foolproof on a professional level, you do use thoroughly designed databases and professionally designed enduser forms.

(Well, my bank also fails with it currently. Are there still professionals?)
Fools are much too inventive to be discouraged by ordinary "foolproofness"!

Re: Two Styles on the same line

Posted: Fri Oct 20, 2023 3:09 pm
by Lupp
ScoobyAalo wrote: Fri Oct 20, 2023 2:30 pm As far as I have found out there is currently no way to lock the resizing
of columns.
TextTable objects are a crutch. They simply aren't made for the kind of task, imo.

What might best suit your intentions, without the need to develop a database, could perhaps be a spreadsheet application. Textual parts requiring special attributing or "prettyview/prettyprint" appearance can there be inserted as OLE objects e.g. In addition some basic functionality of DB can be implemented with the help of FormControl objects in sheets.

Of course, this would still require to transfer everything manually (or based on user code) to the actual data-keeping target file.

Re: Two Styles on the same line

Posted: Fri Oct 20, 2023 11:01 pm
by JeJe
Normally you would use a form textbox for user input like this.

Alternatively though you could use a form control label for text frame or drawing textbox for the label instead as in the attached document.

Note: form control labels don't always redraw properly in OO.

Re: Two Styles on the same line

Posted: Sat Oct 21, 2023 11:35 am
by JeJe
In the attached, I've changed the anchoring of the drawing textboxes to page and adjusted the left paragraph indent to their width to make space for each of them. They then can't be inadvertently deleted when editing the document text.

This has to be done once everthing before it in the document has been finalised or changes could mess it up by moving those paragraphs with the appropriate indents.


Edit:
You can do the same thing without indenting paragraphs by changing the wrap to After but I get problems with the textboxes need not to be vertically overlapping or this won't work properly. As you want bold in those they have a greater height than the non-bold text to be added The textboxes have a bigger height because of the border, so paragraph height has to be increased such as by adding space after - which becomes a faff on and the advantage of just using wrap is lost unless you want all your paragraphs to have that extra space.

Re: Two Styles on the same line

Posted: Sun Oct 22, 2023 2:11 am
by JeJe
setting "fixed height to text" unticked for the textbox text, solves above mentioned problem.

Re: Two Styles on the same line

Posted: Sun Oct 22, 2023 9:51 am
by erbsenzahl
I often used protected sections for fillable forms (form controls).
To copy a protected section you have to additonally select the guiding and the trailing paragraph (outside the section).


Check my sample file.
 
 
FoolproofForms.odt
(13.2 KiB) Downloaded 475 times

Re: Two Styles on the same line

Posted: Mon Oct 23, 2023 8:25 am
by ScoobyAalo
Thank you everybody for thoughts and comments. :bravo:

I am a little swamped right now but maybe at the
end of the week I can find some time to experiment.

Re: Two Styles on the same line

Posted: Mon Oct 30, 2023 10:37 am
by ScoobyAalo
I have checked out your sample files that you so kindly provided and played around with them a bit.

For me I liked the solution with tables where you lock the first cell the most.
Looks good and its quick an dirty to apply.

Now I will release it into the wild and see how it holds up when the users gets a hold of them.

Thanks for comments.