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/wxArtProvider.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/wxArtProvider.erl')
-rw-r--r-- | lib/wx/src/gen/wxArtProvider.erl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/wx/src/gen/wxArtProvider.erl b/lib/wx/src/gen/wxArtProvider.erl index da220a90c8..b52c141b1f 100644 --- a/lib/wx/src/gen/wxArtProvider.erl +++ b/lib/wx/src/gen/wxArtProvider.erl @@ -40,7 +40,7 @@ parent_class(_Class) -> erlang:error({badtype, ?MODULE}). Id::unicode:chardata(). getBitmap(Id) - when is_list(Id) -> + when ?is_chardata(Id) -> getBitmap(Id, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxartprovider.html#wxartprovidergetbitmap">external documentation</a>. @@ -49,7 +49,7 @@ getBitmap(Id) Option :: {'client', unicode:chardata()} | {'size', {W::integer(), H::integer()}}. getBitmap(Id, Options) - when is_list(Id),is_list(Options) -> + when ?is_chardata(Id),is_list(Options) -> Id_UC = unicode:characters_to_binary([Id,0]), MOpts = fun({client, Client}, Acc) -> Client_UC = unicode:characters_to_binary([Client, $_, $C,0]),[<<1:32/?UI,(byte_size(Client_UC)):32/?UI,(Client_UC)/binary, 0:(((8- ((0+byte_size(Client_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; ({size, {SizeW,SizeH}}, Acc) -> [<<2:32/?UI,SizeW:32/?UI,SizeH:32/?UI,0:32>>|Acc]; @@ -63,7 +63,7 @@ getBitmap(Id, Options) Id::unicode:chardata(). getIcon(Id) - when is_list(Id) -> + when ?is_chardata(Id) -> getIcon(Id, []). %% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxartprovider.html#wxartprovidergeticon">external documentation</a>. @@ -72,7 +72,7 @@ getIcon(Id) Option :: {'client', unicode:chardata()} | {'size', {W::integer(), H::integer()}}. getIcon(Id, Options) - when is_list(Id),is_list(Options) -> + when ?is_chardata(Id),is_list(Options) -> Id_UC = unicode:characters_to_binary([Id,0]), MOpts = fun({client, Client}, Acc) -> Client_UC = unicode:characters_to_binary([Client, $_, $C,0]),[<<1:32/?UI,(byte_size(Client_UC)):32/?UI,(Client_UC)/binary, 0:(((8- ((0+byte_size(Client_UC)) band 16#7)) band 16#7))/unit:8>>|Acc]; ({size, {SizeW,SizeH}}, Acc) -> [<<2:32/?UI,SizeW:32/?UI,SizeH:32/?UI,0:32>>|Acc]; |