Repost: https://ask.libreoffice.org/t/text-high ... blem/66965
Please help to solve the problem of resetting attributes and highlighting the entire text when using a formula (UDF) on the same sheet. It looks like a bug.
The attached example is specially designed for the problem being solved and is presented in a simplified form.
[Calc] Text highlighting problem
[Calc] Text highlighting problem
- Attachments
-
- bug-highlight-substrings.ods
- (19.6 KiB) Downloaded 175 times
Ubuntu 18.04 LTS • LibreOffice 7.5.3.2 Community
Re: [Calc] Text highlighting problem
IMHO, this is not a bug. It is a misconception about how Calc is supposed to work. Cell functions deal with values and nothing but values*. Your user defined function is supposed to calculate a return value and nothing else. During this calculation process (which may be part of a huge calculation cascade) everything is locked against changes.
* except built-in STYLE and HYPERLINK which have some side effect on the same formula cell.
* except built-in STYLE and HYPERLINK which have some side effect on the same formula cell.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
- JohnSUN-Pensioner
- Volunteer
- Posts: 876
- Joined: Fri Jan 14, 2011 1:21 pm
- Location: Kyiv, Ukraine
Re: Text highlighting problem
During the execution of the function, the sheet in which it is located, is blocked from any changes. This avoids many potential errors - for example, computational loops or office crashes due to memory overflows. This restriction does not apply to procedures, for example, to the "Selection changed" event handler, with the help of procedures you can do your trick. Basically, there are some dirty hacks that will allow you to change something on the current sheet using ... uh-uh ... probably not worth writing about this. Just don't try to break this part of Calc, the program is already having a hard time.
I may not have a lot to give but what I got I'll give to you...
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
Apache OpenOffice 4.1.5, LibreOffice 6.4.4.2 (x64) on Windows 7
If you think that I did not answer your question, make allowances for my imperfect English
Re: [Calc] Text highlighting problem
Ubuntu 18.04 LTS • LibreOffice 7.5.3.2 Community