function h = makeTempCanvas
%MAKETEMPCANVAS Returns a handle to a temporary HG figure
%   H = RPTGEN_HG.MAKETEMPCANVAS

%   Copyright 1997-2010 The MathWorks, Inc.

hTag = 'RPTGEN_TEMP_CANVAS';
%Note that this tag is declared safe in
%rptgen_hg.appdata_hg.getSafeTags

h = findall(0,'type','figure','tag',hTag);
if isempty(h)
    h = figure('HandleVisibility','off',...
        'IntegerHandle','off',...
        'Tag',hTag,...
        'Visible','off',...
        'CloseRequestFcn','set(gcbf,''Visible'',''off'')',...
        'NumberTitle','off',...
        'Name','Report Generator Temporary Drawing Canvas');
else
    h = h(1);
    delete(allchild(h));  % calling delete to destroy figure content. No stable in HG2 (g617398)
end

