Bug 127009 - "Selection" property is empty when selecting a slide in Slides pane using PyUNO
Summary: "Selection" property is empty when selecting a slide in Slides pane using PyUNO
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
6.2.5.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-18 13:37 UTC by Konstantin Kharlamov
Modified: 2022-06-19 03:29 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Connect to LO server, and print `CurrentComponent.CurrentSelection` (584 bytes, text/x-python)
2019-08-18 13:37 UTC, Konstantin Kharlamov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Kharlamov 2019-08-18 13:37:59 UTC
Created attachment 153473 [details]
Connect to LO server, and print `CurrentComponent.CurrentSelection`

I need to programmatically focus a slide in Slides pane, so I could copy the slide. However, it seems like selection of the slide does not influence the Selection property.

# Steps to reproduce

1. Run `soffice --impress --accept="socket,host=localhost,port=2002;urp;StarOffice.ServiceManager"`, and dismiss "Select a Template" window.
2. There should be a pane titled "Slides" on the left with a single slide. Click it. (note, how Edit → Copy menu was grayed out before, and became available afterwards, which means you succeeded in selecting the slide)
3. Execute attached `test.py` script, which prints the currently selected object.

## Expected

Something different from `None`

## Actual

It prints:

    None


# Additional information

For background see also:
    https://ask.libreoffice.org/en/question/205218/uno-how-to-focus-a-slide/
    https://ask.libreoffice.org/en/question/204747/uno-copy-a-slide-between-2-impress-documents/
Comment 1 Buovjaga 2019-12-06 15:07:17 UTC
I get
Traceback (most recent call last):
  File "test.py", line 14, in <module>
    print(desktop.CurrentComponent.CurrentSelection)
__main__.RuntimeException: Binary URP bridge disposed during call

Arch Linux 64-bit
Version: 6.5.0.0.alpha0+
Build ID: 7e403195e574be5174815a51cf5c42f06f76a87a
CPU threads: 8; OS: Linux 5.3; UI render: default; VCL: kf5; 
Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
Calc: threaded
Built on 1 December 2019
Comment 2 Konstantin Kharlamov 2019-12-08 19:01:41 UTC
(In reply to Buovjaga from comment #1)
> I get
> Traceback (most recent call last):
>   File "test.py", line 14, in <module>
>     print(desktop.CurrentComponent.CurrentSelection)
> __main__.RuntimeException: Binary URP bridge disposed during call
> 
> Arch Linux 64-bit
> Version: 6.5.0.0.alpha0+
> Build ID: 7e403195e574be5174815a51cf5c42f06f76a87a
> CPU threads: 8; OS: Linux 5.3; UI render: default; VCL: kf5; 
> Locale: fi-FI (fi_FI.UTF-8); UI-Language: en-US
> Calc: threaded
> Built on 1 December 2019

Apparently, this is a separate regression in 6.5. I looked at the script, it's pretty short, and it doesn't seem to do anything invalid.

On 6.3.3 I currently have the script prints "None".
Comment 3 Xisco Faulí 2020-06-18 10:33:27 UTC
Hi Konstantin,
is this issue still reproducible with a daily build from http://dev-builds.libreoffice.org/daily/master/ ?
You can install it alongside the standard version.
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the master build
Comment 4 Konstantin Kharlamov 2020-06-18 10:42:29 UTC
(In reply to Xisco Faulí from comment #3)
> Hi Konstantin,
> is this issue still reproducible with a daily build from
> http://dev-builds.libreoffice.org/daily/master/ ?
> You can install it alongside the standard version.
> I have set the bug's status to 'NEEDINFO'. Please change it back to
> 'UNCONFIRMED' if the bug is still present in the master build

Hi! Hmm, this would be a bit hard to test, because I'm on Arch and your link has no Archlinux package. I could unpack rpm or deb package, and then run the unpacked binary, will it work? I'm unsure as I'd guess it may use the system LO libraries instead of the unpacked ones. But if yes, I could try it.

I wonder, are you asking out of pure curiosity, or do you have some reason to believe it may have been fixed?
Comment 5 Buovjaga 2020-06-18 10:48:50 UTC
You could try an appimage of 7.0 beta: https://libreoffice.soluzioniopen.com/index.php/7-0-pre-releases/
You only set it to be executable and then run the file.
Comment 6 Konstantin Kharlamov 2020-06-18 11:01:29 UTC
(In reply to Buovjaga from comment #5)
> You could try an appimage of 7.0 beta:
> https://libreoffice.soluzioniopen.com/index.php/7-0-pre-releases/
> You only set it to be executable and then run the file.

Thanks! I tested it, I get the same output `Binary URP bridge disposed during call` as in comment 1. So I don't think we can check whether it's been fixed as there's still that.
Comment 7 Buovjaga 2020-06-18 12:11:50 UTC
Ok, I confirmed the printed None with older commits while I was bibisecting the regression. Regression filed as bug 134106
Comment 8 QA Administrators 2022-06-19 03:29:02 UTC
Dear Konstantin Kharlamov,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug