The TOC builder in OpenOffice and LibreOffice is one of its worst assets. Worst about it is how the tab settings in the dialog box (second tab) override the settings in the paragraph style. If you want right aligned page numbers, you can’t insert more tabs, if you do, the page number will move to its own line.
So here is a workaround, you will have to figure out a way to mimic right aligned page numbering: on the
Entries tab, insert a second tab just before the one inserted by default. With that tab selected, edit its properties, set
Tab stop position to whatever you like, but don’t tick
Align right. Next click the second tab button, remove the tick mark in
Align right and set a value for
Tab stop position just lower that the text width. In the
Type tab, remove the tick mark in
Protected against manual changes. You have to enter the tabs manually every time you rebuild the TOC.