with
http://cgit.freedesktop.org/libreoffice/core/commit/?id=1720641bf36306fc296635925e571556ced8a302
a long standing wrinkle with modifying nested structs in basic should be
eliminated
before this change the following macro snippet would not work.
Dim b0 as new "com.sun.star.table.TableBorder"
MsgBox b0.HorizontalLine.OuterLineWidth 'HorizontalLine member is
itself a "com.sun.star.table.BorderLine" struct
b0.HorizontalLine.OuterLineWidth = 9
'the following line unexpectedly displays '0' because
'b0.HorizontalLine' returns a new but temporary copy of
"com.sun.star.table.BorderLine"
MsgBox b0.HorizontalLine.OuterLineWidth
the unfortunate non obvious workaround to modify the contents of
'b0.HorizontalLine.OuterLineWidth' is....
a) create a new "com.sun.star.table.BorderLine" instance
b) clone it with the contents of 'b0.HorizontalLine'
c) modify the 'OuterLineWidth' member of the new
"com.sun.star.table.BorderLine" instance
d) set the value b0.HorizontalLine' with the newly modified
"com.sun.star.table.BorderLine" instance
Although I have test this pretty well [*] ( and fixed lots of issues
already before committing ) changes to the basic runtime are always
perilous ;-) so.. please please be on the lookout for any strange
behaviour regarding handling of uno structs in basic
Noel
[*] have to admit I only tested one level of indirection. I didn't find
a suitable structure that contains a structure that contains a structure
to test, if you know of one off hand let me know :-) Also I have yet to
write some unit tests for this ( but will do )
Context
- New way to modify nested uno structs in LibreOffice BASIC · Noel Power
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.