Issue 79739 - Bad behaviour of hint “Invalid number†in data table Dialog
Summary: Bad behaviour of hint “Invalid number†in data table Dialog
Status: CLOSED FIXED
Alias: None
Product: General
Classification: Code
Component: chart (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: kla
QA Contact: issues@graphics
URL:
Keywords:
Depends on:
Blocks: 72764
  Show dependency tree
 
Reported: 2007-07-18 09:22 UTC by kla
Modified: 2013-02-24 21:21 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
the patch (9.15 KB, text/plain)
2007-08-29 06:42 UTC, weiz
no flags Details
patch_070921 (7.60 KB, text/plain)
2007-09-21 04:12 UTC, weiz
no flags Details
new patch (19.37 KB, text/plain)
2007-11-29 03:35 UTC, weiz
no flags Details
patch_071207 (12.56 KB, text/plain)
2007-12-07 08:21 UTC, weiz
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description kla 2007-07-18 09:22:19 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.
Comment 1 IngridvdM 2007-07-18 10:42:16 UTC
->Björn, please take over as you implemented the data table and the warning.
Comment 2 bjoern.milcke 2007-08-23 11:07:24 UTC
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.
Comment 3 weiz 2007-08-29 06:41:02 UTC
Hi bm,

The final attachment is the patch for this issue. :-)

Regards,
Weizhao
Comment 4 weiz 2007-08-29 06:42:21 UTC
Created attachment 47831 [details]
the patch
Comment 5 bjoern.milcke 2007-08-31 16:00:05 UTC
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.
Comment 6 bjoern.milcke 2007-08-31 16:22:54 UTC
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.
Comment 7 Martin Hollmichel 2007-09-12 13:13:40 UTC
move to target 3.x according http://wiki.services.openoffice.org/wiki/Target_3x
Comment 8 weiz 2007-09-21 04:11:33 UTC
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.
Comment 9 weiz 2007-09-21 04:12:27 UTC
Created attachment 48387 [details]
patch_070921
Comment 10 bjoern.milcke 2007-10-30 14:20:32 UTC
->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?
Comment 11 weiz 2007-11-29 03:34:21 UTC
->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.
Comment 12 weiz 2007-11-29 03:35:39 UTC
Created attachment 49987 [details]
new patch
Comment 13 weiz 2007-12-07 08:21:10 UTC
->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. :-)
Comment 14 weiz 2007-12-07 08:21:55 UTC
Created attachment 50170 [details]
patch_071207
Comment 15 bjoern.milcke 2007-12-10 09:55:40 UTC
Removing fs from CC, as the svtools bas class is no longer affected by this fix.
Comment 16 bjoern.milcke 2007-12-10 11:46:16 UTC
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" :-)
Comment 17 bjoern.milcke 2008-01-15 15:32:03 UTC
->kla: please verify in CWS chart19
Comment 18 kla 2008-02-15 14:14:21 UTC
Works fine in cws chart19 -> verified
Comment 19 kla 2008-07-01 14:02:42 UTC
Seen ok in current master -> closed