comparison scripts/plot/util/print.m @ 20778:8513c84a13cb

Use parser string concatenation rather than strcat() for performance in m-files. * __file_filter__.m, __get_funcname__.m, uigetfile.m, uiputfile.m, __makeinfo__.m, print_usage.m, fix_version.m, axis.m, __add_datasource__.m, print.m, __gnuplot_draw_axes__.m, __gnuplot_print__.m, __opengl_print__.m, __print_parse_opts__.m, saveas.m, html_compare_plot_demos.m: Use parser string concatenation rather than strcat() for performance in m-files.
author Rik <rik@octave.org>
date Mon, 30 Nov 2015 08:20:08 -0800
parents 2469d78a1d8b
children 516bb87ea72e
comparison
equal deleted inserted replaced
20777:29861f5f28c5 20778:8513c84a13cb
501 else 501 else
502 cleanup = sprintf ("; rm %s ", filein); 502 cleanup = sprintf ("; rm %s ", filein);
503 endif 503 endif
504 else 504 else
505 pipein = false; 505 pipein = false;
506 filein = strcat ("'", strtrim (filein), "'"); 506 filein = ["'" strtrim(filein) "'"];
507 endif 507 endif
508 if (strcmp (fileout, "-")) 508 if (strcmp (fileout, "-"))
509 pipeout = true; 509 pipeout = true;
510 fileout = [tempname() ".eps"]; 510 fileout = [tempname() ".eps"];
511 if (dos_shell) 511 if (dos_shell)
513 else 513 else
514 cleanup = [cleanup, sprintf("; rm %s ", fileout)]; 514 cleanup = [cleanup, sprintf("; rm %s ", fileout)];
515 endif 515 endif
516 else 516 else
517 pipeout = false; 517 pipeout = false;
518 fileout = strcat ("'", strtrim (fileout), "'"); 518 fileout = ["'" strtrim(fileout) "'"];
519 endif 519 endif
520 520
521 if (! isempty (opts.preview) && opts.tight_flag) 521 if (! isempty (opts.preview) && opts.tight_flag)
522 warning ("print:previewandtight", 522 warning ("print:previewandtight",
523 "print.m: eps preview may not be combined with -tight"); 523 "print.m: eps preview may not be combined with -tight");
646 function latex_standalone (opts) 646 function latex_standalone (opts)
647 n = find (opts.name == ".", 1, "last"); 647 n = find (opts.name == ".", 1, "last");
648 if (! isempty (n)) 648 if (! isempty (n))
649 opts.name = opts.name(1:n-1); 649 opts.name = opts.name(1:n-1);
650 endif 650 endif
651 latexfile = strcat (opts.name, ".tex"); 651 latexfile = [opts.name ".tex"];
652 switch (opts.devopt) 652 switch (opts.devopt)
653 case {"pdflatexstandalone"} 653 case {"pdflatexstandalone"}
654 packages = "\\usepackage{graphicx,color}"; 654 packages = "\\usepackage{graphicx,color}";
655 graphicsfile = strcat (opts.name, "-inc.pdf"); 655 graphicsfile = [opts.name "-inc.pdf"];
656 case {"pslatexstandalone"} 656 case {"pslatexstandalone"}
657 packages = "\\usepackage{epsfig,color}"; 657 packages = "\\usepackage{epsfig,color}";
658 graphicsfile = strcat (opts.name, "-inc.ps"); 658 graphicsfile = [opts.name "-inc.ps"];
659 otherwise 659 otherwise
660 packages = "\\usepackage{epsfig,color}"; 660 packages = "\\usepackage{epsfig,color}";
661 graphicsfile = strcat (opts.name, "-inc.eps"); 661 graphicsfile = [opts.name "-inc.eps"];
662 endswitch 662 endswitch
663 papersize = sprintf ("\\usepackage[papersize={%.2fbp,%.2fbp},text={%.2fbp,%.2fbp}]{geometry}", 663 papersize = sprintf ("\\usepackage[papersize={%.2fbp,%.2fbp},text={%.2fbp,%.2fbp}]{geometry}",
664 fix (opts.canvas_size), fix (opts.canvas_size)); 664 fix (opts.canvas_size), fix (opts.canvas_size));
665 prepend = {"\\documentclass{minimal}"; 665 prepend = {"\\documentclass{minimal}";
666 packages; 666 packages;