When moving across document hierarchy, sometimes it's needed to determine whether 2 objects are the same thing *(not in terms of properties/values, but as in, really refer to the same thing)*. For example, when you have some cell1 and cell2, there's no need to waste energy comparing all properties with cell1 == cell2, when one can just do id(cell1) == id(cell2) (btw, the == operator doesn't work either). But for some reason for every access to any UNO object the object id changes. It doesn't sound right even in terms of performance (like, why to create every time a different instance?). # Steps to reproduce 1. Run python shell 2. In python shell execute the following commands >>> import uno >>> localContext = uno.getComponentContext() >>> list_of_same_objects = [localContext.ServiceManager for i in range(0,10)] >>> [id(obj) for obj in list_of_same_objects] [139769180615904, 139769180615928, 139769180615952, 139769180615976, 139769180616000, 139769180616024, 139769180616048, 139769180616072, 139769180616096, 139769180616120] ## Expected The last command should've returned list of the same numbers. ## Actual All numbers in the last command are different # Additional information See also: https://ask.libreoffice.org/en/question/201705/uno-determine-if-2-objects-refer-to-the-same-thing/
This is a smart blog. I mean it. You have so much knowledge about this issue, and so much passion. You also know how to make people rally behind it, obviously from the responses. https://www.business-stepbystep.com
Those are different objects (in the python sense) which is why they return different id() values. There is no way to fix that, id() cannot be overridden. However, it might be possible to make == work, by checking the underlying remote object identity, if that is exposed by the UNO bridge, I'm not sure. Code pointers for anyone who is interested on working on this: That would require changes to the code in /pyuno I suspect we need the equivalent of m_oid from bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java implemented in the pyuno bridge.
NEW per comment 2
I hope your issue was resolved and that if you have any more problems, you ask for help. Thanks for your post. -Burt | https://selltohouseguys.com/
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
(In reply to QA Administrators from comment #5) > Test to see if the bug is still present with the latest version of > LibreOffice from https://www.libreoffice.org/download/ Still reproducible with LibreOffice 7.3.4.2 30(Build:2)
Still reproducible with LibreOffice 24.8.0.3 480(Build:3)