Mercurial > forge
changeset 12488:f58870850192 octave-forge
More robust strrep parts in core.xml modify access time code
author | prnienhuis |
---|---|
date | Wed, 21 May 2014 19:06:49 +0000 |
parents | 62e51a5413b2 |
children | b99d868f36cb |
files | main/io/inst/private/__OCT_oct2xlsx__.m |
diffstat | 1 files changed, 3 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/main/io/inst/private/__OCT_oct2xlsx__.m Wed May 21 19:05:43 2014 +0000 +++ b/main/io/inst/private/__OCT_oct2xlsx__.m Wed May 21 19:06:49 2014 +0000 @@ -316,14 +316,14 @@ cxml = fread (cid, Inf, "char=>char").'; fclose (cid); cxml = regexprep (cxml, 'dBy>(\w+)</cp:lastM', 'dBy>GNU Octave</cp:lastM'); - modtime = datevec (now); + modtime = int32 (datevec (now)); modtime = sprintf ("%4d-%2d-%2dT%2d:%2d:%2dZ", modtime(1), modtime(2), modtime(3), ... modtime(4), modtime(5), modtime(6)); modtime = strrep (modtime, " ", "0"); [modf, ia, ib] = getxmlnode (cxml, "dcterms:created", [], 1); - cxml(ia:ib) = strrep (cxml(ia:ib), modf, modtime); + cxml = [cxml(1:ia-1) strrep(cxml(ia:ib), modf, modtime) cxml(ib+1:end)]; [modf, ia, ib] = getxmlnode (cxml, "dcterms:modified", [], 1); - cxml(ia:ib) = strrep (cxml(ia:ib), modf, modtime); + cxml = [cxml(1:ia-1) strrep(cxml(ia:ib), modf, modtime) cxml(ib+1:end)]; cid = fopen ([xls.workbook filesep "docProps" filesep "core.xml"], "w+"); fprintf (cid, "%s", cxml); fclose (cid);