reporting: preserve case when assigning method options while allowing user to enter any case
parent
aad042ec27
commit
7e0c50421e
|
@ -73,13 +73,15 @@ elseif nargin > 1
|
|||
'pairs.']);
|
||||
end
|
||||
|
||||
optNames = lower(fieldnames(o));
|
||||
optNames = fieldnames(o);
|
||||
|
||||
% overwrite default values
|
||||
for pair = reshape(varargin, 2, [])
|
||||
field = lower(pair{1});
|
||||
if any(strmatch(field, optNames, 'exact'))
|
||||
o.(field) = pair{2};
|
||||
ind = strmatch(field, lower(optNames), 'exact');
|
||||
assert(isempty(ind) || length(ind) == 1);
|
||||
if ~isempty(ind)
|
||||
o.(optNames{ind}) = pair{2};
|
||||
else
|
||||
error('@graph.graph: %s is not a recognized option.', field);
|
||||
end
|
||||
|
|
|
@ -48,13 +48,15 @@ elseif nargin > 1
|
|||
'pairs.']);
|
||||
end
|
||||
|
||||
optNames = lower(fieldnames(o));
|
||||
optNames = fieldnames(o);
|
||||
|
||||
% overwrite default values
|
||||
for pair = reshape(varargin, 2, [])
|
||||
field = lower(pair{1});
|
||||
if any(strmatch(field, optNames, 'exact'))
|
||||
o.(field) = pair{2};
|
||||
ind = strmatch(field, lower(optNames), 'exact');
|
||||
assert(isempty(ind) || length(ind) == 1);
|
||||
if ~isempty(ind)
|
||||
o.(optNames{ind}) = pair{2};
|
||||
else
|
||||
error('@page.page: %s is not a recognized option.', field);
|
||||
end
|
||||
|
|
|
@ -54,13 +54,15 @@ elseif nargin > 1
|
|||
'pairs']);
|
||||
end
|
||||
|
||||
optNames = lower(fieldnames(o));
|
||||
optNames = fieldnames(o);
|
||||
|
||||
% overwrite default values
|
||||
for pair = reshape(varargin, 2, [])
|
||||
field = lower(pair{1});
|
||||
if any(strmatch(field, optNames, 'exact'))
|
||||
o.(field) = pair{2};
|
||||
ind = strmatch(field, lower(optNames), 'exact');
|
||||
assert(isempty(ind) || length(ind) == 1);
|
||||
if ~isempty(ind)
|
||||
o.(optNames{ind}) = pair{2};
|
||||
else
|
||||
error('@report.report: %s is not a recognized option.', ...
|
||||
field);
|
||||
|
|
|
@ -36,13 +36,15 @@ elseif nargin > 1
|
|||
'pairs.']);
|
||||
end
|
||||
|
||||
optNames = lower(fieldnames(o));
|
||||
optNames = fieldnames(o);
|
||||
|
||||
% overwrite default values
|
||||
for pair = reshape(varargin, 2, [])
|
||||
field = lower(pair{1});
|
||||
if any(strmatch(field, optNames, 'exact'))
|
||||
o.(field) = pair{2};
|
||||
ind = strmatch(field, lower(optNames), 'exact');
|
||||
assert(isempty(ind) || length(ind) == 1);
|
||||
if ~isempty(ind)
|
||||
o.(optNames{ind}) = pair{2};
|
||||
else
|
||||
error('@section.section: %s is not a recognized option.', ...
|
||||
field);
|
||||
|
|
|
@ -61,13 +61,15 @@ elseif nargin > 1
|
|||
'pairs.']);
|
||||
end
|
||||
|
||||
optNames = lower(fieldnames(o));
|
||||
optNames = fieldnames(o);
|
||||
|
||||
% overwrite default values
|
||||
for pair = reshape(varargin, 2, [])
|
||||
field = lower(pair{1});
|
||||
if any(strmatch(field, optNames, 'exact'))
|
||||
o.(field) = pair{2};
|
||||
ind = strmatch(field, lower(optNames), 'exact');
|
||||
assert(isempty(ind) || length(ind) == 1);
|
||||
if ~isempty(ind)
|
||||
o.(optNames{ind}) = pair{2};
|
||||
else
|
||||
error('@series.series: %s is not a recognized option.', field);
|
||||
end
|
||||
|
|
|
@ -58,13 +58,15 @@ elseif nargin > 1
|
|||
'pairs.']);
|
||||
end
|
||||
|
||||
optNames = lower(fieldnames(o));
|
||||
optNames = fieldnames(o);
|
||||
|
||||
% overwrite default values
|
||||
for pair = reshape(varargin, 2, [])
|
||||
field = lower(pair{1});
|
||||
if any(strmatch(field, optNames, 'exact'))
|
||||
o.(field) = pair{2};
|
||||
ind = strmatch(field, lower(optNames), 'exact');
|
||||
assert(isempty(ind) || length(ind) == 1);
|
||||
if ~isempty(ind)
|
||||
o.(optNames{ind}) = pair{2};
|
||||
else
|
||||
error('%s is not a recognized option to the Table constructor.', ...
|
||||
field);
|
||||
|
|
|
@ -44,13 +44,15 @@ elseif nargin > 1
|
|||
'pairs.']);
|
||||
end
|
||||
|
||||
optNames = lower(fieldnames(o));
|
||||
optNames = fieldnames(o);
|
||||
|
||||
% overwrite default values
|
||||
for pair = reshape(varargin, 2, [])
|
||||
field = lower(pair{1});
|
||||
if any(strmatch(field, optNames, 'exact'))
|
||||
o.(field) = pair{2};
|
||||
ind = strmatch(field, lower(optNames), 'exact');
|
||||
assert(isempty(ind) || length(ind) == 1);
|
||||
if ~isempty(ind)
|
||||
o.(optNames{ind}) = pair{2};
|
||||
else
|
||||
error('@vspace.vspace: %s is not a recognized option.', field);
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue