I am trying to find a way in LibreOffice Basic to determine whether two
object variables are referencing the same instance of a user-defined type.
The "EqualUnoObjects" function seemed plausible but the following code does
not work as expected:I expected a response of "var1.field1 = var2" followed
by "Done," but I only got "Done." Any ideas?
[original problem]
klaten wrote
I am trying to find a way in LibreOffice Basic to determine whether two
object variables are referencing the same instance of a user-defined type.
The "EqualUnoObjects" function seemed plausible but . . . does
not work as expected:I expected a response of "var1.field1 = var2"
followed
by "Done," but I only got "Done."
[makeshift solution]
OK, so apparently there is no such function in the runtime of LibreOffice
Basic. To complete my macro, I chose the following workaround: assign a
unique object ID to each user-defined type object, and to check their
equivalence, check the equivalence of the object IDs. Here is what my test
code looked like with this solution applied.