diff options
author | Dan Gudmundsson <[email protected]> | 2016-10-05 16:25:59 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2016-10-05 16:25:59 +0200 |
commit | 097cc3f6679a7c3769111cdb15a630186218d015 (patch) | |
tree | c92a39384d8989695e4318fc16edef10faf7da19 /lib/wx/src/gen/wx_misc.erl | |
parent | 1de609cb262ff34216dce8fbefdb9a153bdd2c93 (diff) | |
download | otp-097cc3f6679a7c3769111cdb15a630186218d015.tar.gz otp-097cc3f6679a7c3769111cdb15a630186218d015.tar.bz2 otp-097cc3f6679a7c3769111cdb15a630186218d015.zip |
Fix guard test for chardata
Previously only accepted lists tough a call is made to
unicode:characters_to_binary/1, and the functions where specified to
handle chardata.
Diffstat (limited to 'lib/wx/src/gen/wx_misc.erl')
-rw-r--r-- | lib/wx/src/gen/wx_misc.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/wx/src/gen/wx_misc.erl b/lib/wx/src/gen/wx_misc.erl index ce5d917136..66b1756a2f 100644 --- a/lib/wx/src/gen/wx_misc.erl +++ b/lib/wx/src/gen/wx_misc.erl @@ -72,7 +72,7 @@ bell() -> -spec findMenuItemId(Frame, MenuString, ItemString) -> integer() when Frame::wxFrame:wxFrame(), MenuString::unicode:chardata(), ItemString::unicode:chardata(). findMenuItemId(#wx_ref{type=FrameT,ref=FrameRef},MenuString,ItemString) - when is_list(MenuString),is_list(ItemString) -> + when ?is_chardata(MenuString),?is_chardata(ItemString) -> ?CLASS(FrameT,wxFrame), MenuString_UC = unicode:characters_to_binary([MenuString,0]), ItemString_UC = unicode:characters_to_binary([ItemString,0]), @@ -155,7 +155,7 @@ shell(Options) Url::unicode:chardata(). launchDefaultBrowser(Url) - when is_list(Url) -> + when ?is_chardata(Url) -> launchDefaultBrowser(Url, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_miscellany.html#wxlaunchdefaultbrowser">external documentation</a>. @@ -163,7 +163,7 @@ launchDefaultBrowser(Url) Url::unicode:chardata(), Option :: {'flags', integer()}. launchDefaultBrowser(Url, Options) - when is_list(Url),is_list(Options) -> + when ?is_chardata(Url),is_list(Options) -> Url_UC = unicode:characters_to_binary([Url,0]), MOpts = fun({flags, Flags}, Acc) -> [<<1:32/?UI,Flags:32/?UI>>|Acc]; (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, |