insertControlCharacter - nControlCharacter parameter optional?

I assumed the nControlCharacter parameter was required, but apparently you can execute insertControlCharacter (in Basic) without nControlCharacter and you don’t get an error. On the other hand, I can’t see if it’s doing anything. (LibreOffice: XSimpleText Interface Reference)
.
Is the parameter required (and if so, shouldn’t I get an error if I don’t provide it)?
.
Or is it optional (in which case, what does the method do if the parameter is omitted)?

No, you can’t execute it, it’s a required argument.

image

Except I actually can. Video here: https://nextcloud.culp.de/index.php/s/ACWaSm2N7NTgHAy
.
On the bright side, at least I know now it’s bug, not a feature.
.
On second thought, what if my LibreOffice is working correctly and yours is experiencing the bug? :thinking: Just kidding.

The reason that you are not mistaken is that by adding the remaining parameters, the argument takes the default value I suppose will be zero.

.
Yes, this was my first thought also, so I tested every value from 0 to 5 to see what it does, and then tested without the parameter. Every value inserts something. Omitting the parameter does not appear to do anything at all, but it also does not raise an error - at least on my machine.
.
So ok, I guess I have discovered a bug. The next step would be to open an issue on Gitlab, I suppose?

Maybe first search in the source code.

I’m afraid I sincerely have no idea what you mean by this. I wouldn’t have a clue what to look for or what good it would do. I don’t program C++.

We don’t use Gitlab.

Ah ok, well, whatever it is we use.

I opened an issue on Bugzilla here: 162431 – Executing method insertControlCharacter in Basic without parameter nControlCharacter does not throw error