Mercurial > forge
changeset 12210:d8b4fe55bf97 octave-forge
Copyright string updates, style fixes
author | prnienhuis |
---|---|
date | Fri, 20 Dec 2013 12:54:14 +0000 |
parents | b94b6ab47179 |
children | 9fa9a8e81cb9 |
files | main/io/inst/private/__JOD_spsh2oct__.m main/io/inst/private/__JOD_spsh_close__.m main/io/inst/private/__JOD_spsh_info__.m main/io/inst/private/__JOD_spsh_open__.m |
diffstat | 4 files changed, 28 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/main/io/inst/private/__JOD_spsh2oct__.m Fri Dec 20 12:52:40 2013 +0000 +++ b/main/io/inst/private/__JOD_spsh2oct__.m Fri Dec 20 12:54:14 2013 +0000 @@ -1,4 +1,4 @@ -## Copyright (C) 2009,2010,2011,2012 Philip Nienhuis <pr.nienhuis at users.sf.net> +## Copyright (C) 2009,2010,2011,2012,2013 Philip Nienhuis ## ## This program is free software; you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free Software @@ -17,7 +17,7 @@ ## Watch out, no error checks, and spreadsheet formula error results ## are conveyed as 0 (zero). ## -## Author: Philip Nienhuis +## Author: Philip Nienhuis <prnienhuis@users.sf.net> ## Created: 2009-12-13 ## Last updates: ## 2010-12-31 Moved into subfunc of ods2oct @@ -32,7 +32,8 @@ ## the cntents could be BOOLEAN as well (JOD doesn't write OffVal attr either) ## 2012-02-26 Further workaround for reading strings (actually: cells w/o OfficeValueAttr) ## 2012-10-12 Renamed & moved into ./private -## 2012-10-24 Style fixes +## 2012-10-24 Style fixes +## 2013-12-01 Style fixes, copyright string updates function [ rawarr, ods] = __JOD_spsh2oct__ (ods, wsh, crange) @@ -57,9 +58,12 @@ ## else ## ## 1.2b2 has not ## ver = 2; - endif + endif - if (isnumeric (wsh)); wsh = wsh - 1; endif ## Sheet INDEX starts at 0 + ## Sheet INDEX starts at 0 + if (isnumeric (wsh)); + --wsh; + endif ## Check if sheet exists. If wsh = numeric, nonexistent sheets throw errors. try sh = ods.workbook.getSheet (wsh); @@ -78,8 +82,8 @@ else if (isnumeric (wsh)); wsh = wsh + 1; endif [ trow, brow, lcol, rcol ] = getusedrange (ods, wsh); - nrows = brow - trow + 1; ## Number of rows to be read - ncols = rcol - lcol + 1; ## Number of columns to be read + nrows = brow - trow + 1; ## Number of rows to be read + ncols = rcol - lcol + 1; ## Number of columns to be read endif else [dummy, nrows, ncols, trow, lcol] = parse_sp_range (crange); @@ -105,7 +109,7 @@ sctype = char (scell.getValueType ()); switch sctype case { FLOAT, CURRENCY, PERCENTAGE } - rawarr{ii, jj} = scell.getValue ().doubleValue (); + rawarr{ii, jj} = scell.getValue (); case BOOLEAN rawarr {ii, jj} = scell.getValue () == 1; case STRING @@ -127,7 +131,7 @@ rawarr {ii, jj} = hh + mi + ss; otherwise ## Workaround for sheets written by jOpenDocument (no value-type attrb): - if (~isempty (scell.getValue) ) + if (! isempty (scell.getValue) ) ## FIXME Assume cell contains string if there's a text attr. ## But it could be BOOLEAN too... if (findstr ("<text:", char (scell))), sctype = STRING; endif @@ -153,13 +157,17 @@ ## No panic, probably a merged cell val = {}; end_try_catch - if (~isempty (val)) + if (! isempty (val)) if (ischar (val)) ## Text string rawarr(ii, jj) = val; elseif (isnumeric (val)) ## Boolean - if (val) rawarr(ii, jj) = true; else; rawarr(ii, jj) = false; endif + if (val) + rawarr(ii, jj) = true; + else; + rawarr(ii, jj) = false; + endif else try val = sh.getCellAt (celladdress).getValue ().doubleValue ();
--- a/main/io/inst/private/__JOD_spsh_close__.m Fri Dec 20 12:52:40 2013 +0000 +++ b/main/io/inst/private/__JOD_spsh_close__.m Fri Dec 20 12:54:14 2013 +0000 @@ -1,4 +1,4 @@ -## Copyright (C) 2012 Philip Nienhuis <prnienhuis@users.sf.net> +## Copyright (C) 2012,2013 Philip Nienhuis ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -20,7 +20,8 @@ ## Created: 2012-10-12 ## Updates: ## 2012-10-23 Style fixes -## 2013-01-20 Adapted to ML-compatible Java calls +## 2013-01-20 Adapted to ML-compatible Java calls +## 2013-12-01 Copyright string updates function [ ods ] = __JOD_spsh_close__ (ods)
--- a/main/io/inst/private/__JOD_spsh_info__.m Fri Dec 20 12:52:40 2013 +0000 +++ b/main/io/inst/private/__JOD_spsh_info__.m Fri Dec 20 12:54:14 2013 +0000 @@ -1,4 +1,4 @@ -## Copyright (C) 2012 Philip Nienhuis <prnienhuis@users.sf.net> +## Copyright (C) 2012,2013 Philip Nienhuis ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -21,7 +21,8 @@ ## Updates: ## 2012-10-12 Moved into ./private ## Updates: -## 2012-10-24 Style fixes +## 2012-10-24 Style fixes +## 2013-12-01 Copyright string updates function [sh_names] = __JOD_spsh_info__ (ods)
--- a/main/io/inst/private/__JOD_spsh_open__.m Fri Dec 20 12:52:40 2013 +0000 +++ b/main/io/inst/private/__JOD_spsh_open__.m Fri Dec 20 12:54:14 2013 +0000 @@ -1,4 +1,4 @@ -## Copyright (C) 2012 Philip Nienhuis <prnienhuis@users.sf.net> +## Copyright (C) 2012,2013 Philip Nienhuis ## ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by @@ -20,7 +20,8 @@ ## Created: 2012-10-12 ## Updates: ## 2012-10-24 Style fixes -## 2013-01-20 Adapted to ML-compatible Java calls +## 2013-01-20 Adapted to ML-compatible Java calls +## 2013-12-01 Copyright string updates function [ ods, odssupport, lastintf ] = __JOD_spsh_open__ (ods, rw, filename, odssupport)