-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathhandleFileName.m
More file actions
26 lines (24 loc) · 920 Bytes
/
handleFileName.m
File metadata and controls
26 lines (24 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
function handleFileName(obj)
%--IF EMPTY FILENAME, CHECK FOR PLOT TITLES--%
try
if isempty(obj.PlotOptions.FileName)
for t = 1:obj.State.Figure.NumTexts
if obj.State.Text(t).Title
str = obj.State.Text(t).Handle.String;
interp = obj.State.Text(t).Handle.Interpreter;
obj.PlotOptions.FileName = parseString(str, interp);
% untitle.html if \text exist (special chars)
if ~isempty(strfind(obj.PlotOptions.FileName, '\text'))
obj.PlotOptions.FileName = 'untitled';
end
end
end
end
catch
obj.PlotOptions.FileName = 'untitled';
end
%--IF FILENAME IS STILL EMPTY SET TO UNTITLED--%
if isempty(obj.PlotOptions.FileName)
obj.PlotOptions.FileName = 'untitled';
end
end