Closed Bug 10423 Opened 27 years ago Closed 27 years ago

Pop-up dialogs are truncated.

Categories

(Core :: Internationalization, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: morse, Assigned: tao)

References

Details

Recently the pop-up dialogs for wallet created from davidm's dialog code is coming up as follows: question! Do you want to put the values ..... q Never save ..A where the word "question" and the dots are in the actual message. The message is supposed to be Do you want to put the values on this form into your wallet? Never save this form This is a recent regression.
*** Bug 10626 has been marked as a duplicate of this bug. ***
Assignee: davidm → tao
Component: HTML Dialogs → Internationalization
OK, I know what the problem is. It isn't the dialog that's failing, it's the StringBundle module that gets the localization of the string. So I'm changing the assignement from davidm to tao and the component from html-dialog to i18n. But I have the fix. The GetStringFromName routine in nsStringBundle.cpp is computing a length which is the number of characters in the string and alocates that many bytes. But it needs to alocate twice that amount because each character in a unicode string takes up two bytes. And there was a second bug beside. The string was copied into a memory area but was never zero-terminated. I'll be checking in this fix just as soon as the tree goes green.
Good catch! I found similar problem in this COM interface's JS reflection. I suspect the wstring version of the apis wasn't correctly passing the data to the JS side but haven't go as far as you had. Yes, please check them in. I'll verify them in JS functions on NT and Linux. Thanks a million.
Status: NEW → RESOLVED
Closed: 27 years ago
Resolution: --- → FIXED
Fix checked in.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Hi, steve: I tested the patch and found that the retrieved texts are not null terminated in eihter C++ or JS code. It seems to me we shall either PR_Calloc the buffer with an extra unichar or append '\0' (instead of setting it to 0) at the end of the buffer. Let me know if you'd like me to fix it. Thanks.
I'm not sure why you reopened this. The fix certainly cleared up the dialogs. But if you feel you have a better fix and would like to make it, then by all means do so.
Hi, Steve: There is test proram, StringBundleTest(.exe), in dist/bin. Run the test and you'll find that the strings retrieved from the properties file are not displayed correctly in the console window. It does not render correctly from JS function either. That's why I reopened the bug. Would you please let me know how to get the dialog pops up in Seamonkey so I can see if my patch break your fix. Thanks.
Sorry, I guess I never did give a step-by-step procedure for reproducing the problem. So here goes: 1. Select edit/wallet/samples 2. Click on the word "here" 3. Go down to bottom of screen and click on the "save" button The pop-up described at the beginning of this report will appear.
*** Bug 10626 has been marked as a duplicate of this bug. ***
Status: REOPENED → RESOLVED
Closed: 27 years ago27 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
Using the steps-to-reproduce in this report, it seems OK on the 1999082016 (M9) build. However, the dialog itself looks 'wrong' (it's about twice as big as it needs to be to contain its text). Marking this bug as verified fixed.
You need to log in before you can comment on or make changes to this bug.