Opened 11 years ago

Closed 11 years ago

#11318 closed defect (fixed)

SetBellOnError (true) disable the bell

Reported by: spectrum Owned by:
Priority: normal Milestone:
Component: base Version: stable-latest
Keywords: SetBellOnError Cc:
Blocked By: Blocking:
Patch: yes

Description

Hi All,

i invalidated and reposted the ticket in a more regular way.

As read in the documentation, SetBellOnError seems to have now an inverted meaning: setting to true disable the bell.
This is the suggested patch:

68c68
<
static void SetBellOnError(bool doIt = true) { ms_isSilent = doIt; }
---
static void SetBellOnError(bool doIt = true) { ms_isSilent = !doIt; }

Angelo Dureghello

Change History (2)

comment:1 Changed 11 years ago by vadz

  • Status changed from new to confirmed

Thanks for reporting this!

Unfortunately it seems that this function always behaved like this, ever since it was added in r1791 (that's 10.5 years ago...). And even though apparently nobody really used it much since then if an error like this one went unnoticed. Still, I guess people might be using it by inverting the parameter value so instead of changing it like this I'm going to add a new function with correct parameter meaning and deprecate this one, it should be the safest thing to do.

comment:2 Changed 11 years ago by VZ

  • Resolution set to fixed
  • Status changed from confirmed to closed

(In [62414]) Replace wxValidator::SetBellOnError() with SuppressBellOnError().

SetBellOnError() erroneously inversed the value of its parameter. Fixing it to
behave correctly could silently break the existing code which might work
around this bug already because it always behaved like this (ever since it was
added 10.5 years ago). So instead simply deprecate this function and add a new
SuppressBellOnError() one which behaves as expected.

Closes #11318.

Note: See TracTickets for help on using tickets.