How to set Right to Left (RTL) orientation of text (hebrew style) via macro

Dear Sirs,

those may be bugs, but I have two related problems.

A) I cannot put LTR and RTL text orientation to any button on a toolbar.

B) If I record macro with LTR to RTL change, it does not work after has been recorded.

Do you have any hint where the problem can be?

I already know a bit of my problem. I have to switch on the complex text support in
/tools/options/langauges/complex text suport (just for current document)

https://help.libreoffice.org/latest/de/text/shared/guide/ctl.html?DbPAR=SHARED#bm_id3153662

Thanks

Xerostomus

Libreoffice Version: 6.0.7.3
Build-ID: 1:6.0.7-0ubuntu0.18.04.10
CPU-Threads: 4; BS: Linux 5.4; UI-Render: Standard; VCL: gtk3;
Gebietsschema: cs-CZ (de_DE.UTF-8); Calc: group

Don’t check For the current document only in Tools/Options/Langauges/Complex text layout, then RTL/LTR buttons will be functional and macros too (tested in Libre 7.1.3.2 Win10).

ctl-no-for-current-doc.png

The macros from the macro recorder:

sub RTL
	dim document as object
	dim dispatcher as object
	document = ThisComponent.CurrentController.Frame
	dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
	dim args1(0) as new com.sun.star.beans.PropertyValue
	args1(0).Name = "ParaRightToLeft"
	args1(0).Value = true
	dispatcher.executeDispatch(document, ".uno:ParaRightToLeft", "", 0, args1())
end sub

sub LTR
	dim document as object
	dim dispatcher as object
	document = ThisComponent.CurrentController.Frame
	dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
	dim args1(0) as new com.sun.star.beans.PropertyValue
	args1(0).Name = "ParaLeftToRight"
	args1(0).Value = true
	dispatcher.executeDispatch(document, ".uno:ParaLeftToRight", "", 0, args1())
end sub

Dear Kamlan,

thank you a lot for you smart answer!!!

תודה רבה! :slight_smile:

By the way where can you find this property: ParaRightToLeft
Where is it documented?

Xerostomus

The dispatch commands are documented very bad, or more precisely - the parameters for ones (args1(0).Name = “ParaRightToLeft” : args1(0).Value = true …). List of the dispatch commands you can find here:

https://wiki.documentfoundation.org/Development/DispatchCommands

*I need documentation of oDispatcher.executeDispatch

But there aren’t the parameters. Sometimes it is possible to get parameters from the macro record, sometimes to find some examples via google with the concrete name of the dispatch command (or search the concrete forums - Ask.libreoffice, libre nabble forums, forum for openoffice), sometimes in A. Pitonyak book, but sometimes it is unsuccessful.

Some parameters for some commands are also here: 0: The Table of Contents of the Series, 'Information Tables'|T.B.P. - it is the longest list with dispatch commands and parameters I saw.