-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LCID for ProxyObject is hardcoded and inconsistent #659
Comments
Your suggestion seems fine to me. On 16 May 2016 at 21:16, matthiasblaesing notifications@github.com wrote:
|
The system/user default LCID is not always the best/correct value to use for COM invocations. One example is excel, if the default user LCID is used, formulas need to be coded in the language of the user. This commit moves the LCID handling into the factory, so LCID can be overridden per instantiated factory. A unittest was added, but marked as ignored, as the test is depending on the installed excel locale and only usable on non-english locales. (test was run on a german excel version) In addition to the unittest the msoffice sample was adjusted to be usable on non-english locales (manually tested on same german excel version specified above). Closes: java-native-access#659
The system/user default LCID is not always the best/correct value to use for COM invocations. One example is excel, if the default user LCID is used, formulas need to be coded in the language of the user. This commit moves the LCID handling into the factory, so LCID can be overridden per instantiated factory. A unittest was added, but marked as ignored, as the test is depending on the installed excel locale and only usable on non-english locales. (test was run on a german excel version) In addition to the unittest the msoffice sample was adjusted to be usable on non-english locales (manually tested on same german excel version specified above). Closes: java-native-access#659
@dhakehurst I implemented it as described. I pushed a sample branch: https://github.com/matthiasblaesing/jna/tree/simple_com_thread_2 this branch holds the reintroduction of the simplified threading factory and the LCID change. I'd appreciate it, if you could have a look at it. |
I will look when I can, am in the middle of a different project at present, Many thanks for this. On 23 May 2016 at 20:21, matthiasblaesing notifications@github.com wrote:
|
Motivation: We can cleanup our code a bit by moving the instanceof check into the codec Modifications: - Move QuicheQuicChannelAddress out of QuicheQuicChannel - Move instanceof check into QuicheQuicClientCodec - Remove static helper method Result: Code cleanup
@dhakehurst while working with excel I noted, that I'd need to change th used LCID for the COM invocations. Excel formulas are interpreted locale dependent and here unifying to the english locale helps development. I already overrid the LCID manually and got the expected locale (I'm on german locale, and could now send english formulas).
While looking through the ProxyObject code, I noticed, that you decided to use different default LCIDs:
GetIDsOfNames is using LOCALE_USER_DEFAULT
Invoke is called with LOCALE_SYSTEM_DEFAULT
From my perspective this looks inconsistent. Is there a reason for this?
I'd like to make the locale configurable, my idea:
The big question: would this be enough and workable or are more complex methods needed? Instead of a fixed LCID I could imaging an LCIDMapper, that takes a target object and java.lang.reflect.Method and returns the LCID to use.
The text was updated successfully, but these errors were encountered: