Apache OpenOffice (AOO) Bugzilla – Full Text Issue Listing |
Summary: | basic: specify how to pass strings as any to declared subroutines | ||||||
---|---|---|---|---|---|---|---|
Product: | General | Reporter: | Stephan Bergmann <stephan.bergmann.secondary> | ||||
Component: | code | Assignee: | b.osi.ooo | ||||
Status: | CLOSED FIXED | QA Contact: | issues@framework <issues> | ||||
Severity: | Trivial | ||||||
Priority: | P2 | CC: | cno, issues, mechtilde, oliver.brinzing, tobias.schankweiler | ||||
Version: | DEV300m94 | Keywords: | regression | ||||
Target Milestone: | 3.4.0 | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Issue Type: | DEFECT | Latest Confirmation in: | --- | ||||
Developer Difficulty: | --- | ||||||
Attachments: |
|
Description
Stephan Bergmann
2010-11-26 12:37:47 UTC
add to CC STARTED @ab: A related problem (related to how Basic generally passes ByRef strings with "external DLL" calls, and how that changed for OOo 3.3) has come up in the mail thread at <http://extensions.openoffice.org/servlets/ReadMsg?list=dev&msgNo=2031>: In the ImportWizard.API module that is part of the standard OpenOffice.org Macros, RegQueryValueExString is declared as an alias for RegQueryValueExA with (implicitly ByRef) "lpData As String" parameter. This causes code that uses that function to fail (e.g., as explained in the mail, 'MsgBox ImportWizard.API.QueryValue(HKEY_CURRENT_USER, "Software\Microsoft\Notepad","szTrailer")' displays an empty string). If the relevant ImportWizard.API module code is changed to "ByVal lpData As String" the given test would succeed. The assumption might turn out wrong after all that OOo 3.2's handling ByRef string parameters in "external DLL" calls the same as ByVal was erroneous. (I was not aware that the Basic "external DLL" feature was used in the standard OpenOffice.org Macros, and apparently neither were the QA people for issue 115716 and the original Hamburg-internal issue #162141#, or else this would have been tested.) . What this issue describes in a somewhat obscure way is a total block for all calls via OOBasic to the Windows registry, which ask for string values. Our large extension for teachers and schools relies on the functionality in the standard module "ImportWizard.API" and now is effectively rendered useless with OOo 3.3RC10 and presumably the final release. A lot of other extensions will be affected. Why has this issue priority P3, a nebulous target milestone "OOo 3.x", why is keyword "regression" missing though Oliver Brinzing and Stephan Bergmann have both called this a regression in a discussion on the dev@extensions.openoffice.org mailing list? The solution given by Stephan Bergmann >If the relevant ImportWizard.API module code is changed to "ByVal lpData As >String" the given test would succeed." does not work, at least not for OOo 3.3RC10. In RC10, the following simple Basic test lines still produce an empty message box, though the registry value is "Seite &s" (in a German Windows, it's language specific). Sub TestAPICall MsgBox ImportWizard.API.QueryValue(HKEY_CURRENT_USER, "Software\Microsoft\Notepad","szTrailer") End Sub Hans Zybura @hansz: the workaround also requires the fix for issue 115716, which has only been fixed on DEV300_m98 towards OOo 3.4 . FIXED reviewed change A LoadLibrary call should be added to the test sub: Sub TestAPICall BasicLibraries.LoadLibrary( "ImportWizard" ) MsgBox ImportWizard.API.QueryValue(HKEY_CURRENT_USER,"Software\Microsoft\Notepad","szTrailer") End Sub Created attachment 75904 [details]
Test script to check vbaoption related behavior
ab->tbo: Please verify by using TestAPICall (should display something reasonable like "page &p") and by using the attached i115795_RegSetValueEx.bas macro. The latter is to test assure that in vba mode the new behavior is still used as in this con- text it's correct. |