Apache OpenOffice (AOO) Bugzilla – Issue 79739
Bad behaviour of hint “Invalid number†in data table Dialog
Last modified: 2013-02-24 21:21:36 UTC
follow up issue for i73171 Message-Box appears when inserting letters and leaving the cell with tab or enter or clicking in a different cell, the wrong entry is not removed. But Message-Box does not appear, when I insert a letter and click in one of the columm labels - the wrong letter is removed without a hint. If I insert a letter and click after that on "Move row down" or on a row header, the message box appears several times - box should appear only once. The Message-Box should appear once and the wrong entry should be removed.
->Björn, please take over as you implemented the data table and the warning.
In the old chart the behavior was a bit strange. First of all, on second try an illegal entry was always overwritten by the old value, and the swap, remove etc. functions worked while restoring the old value. What we should do in the new chart when an entry is illegal: * When clicking outside or going outside with tab, bring up the message and set the cursor back to the cell, leaving the wrong entry untouched (imagine you entered "3.14159265x" and because of the x the value is illegal, you wouldn't want the field to be emptied, but be given the chance to just remove the "x") This works already, except when you go to the headers. -> must be fixed * When clicking on an action button, the message should appear and the action should not take place! If possible, remove could be allowed without the message box, because the illegal entry will be removed anyway. * If it is possible to check the validity while typing, the buttons could be disabled, so the actions can not be executed beforehand.
Hi bm, The final attachment is the patch for this issue. :-) Regards, Weizhao
Created attachment 47831 [details] the patch
The patch does not compile on Linux due to warnings. Also, have you made sure that the changes in svtools don't break other usages of the EditBrowseBox? You commented-out code that was introduced to fix a bug. I won't just remove that. The class is not only used in the chart.
weiz: The fix does not work. When you enter "-" you get immediately the message box, so if you want to enter a negative number you get the dialog after the first character. The controls can be disabled at this moment, but the dialog should only appear when the changes in the field should be committed. Also, enter "x", say "OK" in the message box, click into a header edit field -> the "x" is replaced by the old value.
move to target 3.x according http://wiki.services.openoffice.org/wiki/Target_3x
Hi bm, This is the new patch for the issue. I did not use the "m_bWarningWasShown" to make the warning box come up only once per error according to your suggestion in IRC meeting, I found it was not a good design.:-) So I added several funtions to do that. Please let me know if you have any suggestion. Thanks a lot.
Created attachment 48387 [details] patch_070921
->weiz: Thanks for the patch. First, there are two warnings. As warnings are now treated as errors, please remove them. One of the warnings is in fact an error: BOOL DataEditor::Close() { if( ApplyChangesToModel() ) return ModalDialog::Close(); } Nothing is returned if the call to ApplyChangesToModel() returns FALSE. What should be returned then, I suppose TRUE? The other warning can be fixed by adding using BrowseBox::MouseButtonDown; in DataBrowser.hxx in the class declaration. The behavior is still not like expected. What works and is good: * enter "-", the buttons are disabled, but you can continue typing * click somewhere else in the table -> message box What does not work like expected: * Enter "x", press Tab, nothing happens. Correct: open the warning dialog * Enter "x", click into a series header, nothing happens, Correct: open the warning dialog * Enter "x", click into another cell -> the warning comes up. Sometimes (haven't found out when exactly) the string is not visible but the former number, and no cell is active. Clicking into the cell does not activate it but bring up the dialog again. What I also mentioned: when you entered an invalid entry in a cell, you can not close the dialog until you have entered a number in that cell again. My suggestion would be instead of the button "OK", offer two buttons: "OK", "Cancel" or "Correct", "Ignore", or "Continue", "Abort". Where the first button lets you correct the input, and the second one just ignores the incorrect input so leaves the old value in the model. ->MMP: What do you think about the suggestion in the last paragraph? Which button combination would you prefer, in case you like the idea in general?
->bm: The new patch is finished, according to your requirements, please check the final attachment. But I am not sure whether it is the most suitable way to fix them. So I need your suggestion on this patch.
Created attachment 49987 [details] new patch
->bm: The new patch is finished. I have added a new function "ShowQueryBox()" to let user can make a choice when they close the dialog with the invalid data. It's a "QueryBox", so I think it's better to use "Yes/No" buttons instead of "OK/Cancel". Do you have any suggestion? I hope it's the last patch for this issue. :-)
Created attachment 50170 [details] patch_071207
Removing fs from CC, as the svtools bas class is no longer affected by this fix.
weiz: I applied the patch to CWS chart19. Thanks for your patch! Two little changes: 1. I made the member m_bShowWarning in the SeriesEdit class private and added a "set"-method. 2. Renamed the identifier for the warning-string to STR_DATA_EDITOR_INCORRECT_INPUT, to make it clear that it is for this dialog. 2'. Changed the "next is 267" comment to "next is 268" :-)
->kla: please verify in CWS chart19
Works fine in cws chart19 -> verified
Seen ok in current master -> closed