Mercurial > forge
changeset 12212:da72c2f558b4 octave-forge
Style fixes, copyright string updates
author | prnienhuis |
---|---|
date | Fri, 20 Dec 2013 12:55:45 +0000 |
parents | 9fa9a8e81cb9 |
children | 77e3ab62e97d |
files | main/io/inst/private/__JXL_getusedrange__.m main/io/inst/private/__JXL_oct2spsh__.m main/io/inst/private/__JXL_spsh2oct__.m main/io/inst/private/__JXL_spsh_close__.m main/io/inst/private/__JXL_spsh_info__.m main/io/inst/private/__JXL_spsh_open__.m |
diffstat | 6 files changed, 43 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/main/io/inst/private/__JXL_getusedrange__.m Fri Dec 20 12:54:43 2013 +0000 +++ b/main/io/inst/private/__JXL_getusedrange__.m Fri Dec 20 12:55:45 2013 +0000 @@ -1,4 +1,4 @@ -## Copyright (C) 2010,2011,2012 Philip Nienhuis, prnienhuis at users.sf.net +## Copyright (C) 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 @@ -16,11 +16,12 @@ ## __JXL_getusedrange__ - get occupied data cell range from Excel sheet ## using java/JExcelAPI -## Author: Philip <Philip@DESKPRN> +## Author: Philip Nienhuis <prnienhuis at users.sf.net> ## Created: 2010-03-20 ## Updates: ## 2012-10-12 Renamed & moved into ./private ## 2012-10-24 Style fixes +## 2013-12-01 Style fixes, copyright string updates function [ trow, brow, lcol, rcol ] = __JXL_getusedrange__ (xls, wsh) @@ -44,13 +45,15 @@ ## While loop => only til first non-empty cell while (jj < rcol && emptyrow) cell = sh.getCell (jj, ii); - if ~(strcmp (char (cell.getType ()), emptycell)) + if (! strcmp (char (cell.getType ()), emptycell)) lcol = min (lcol, jj + 1); emptyrow = 0; endif ++jj; endwhile - if ~(emptyrow); trow = min (trow, ii + 1); endif + if (! emptyrow) + trow = min (trow, ii + 1); + endif endfor endif
--- a/main/io/inst/private/__JXL_oct2spsh__.m Fri Dec 20 12:54:43 2013 +0000 +++ b/main/io/inst/private/__JXL_oct2spsh__.m Fri Dec 20 12:55:45 2013 +0000 @@ -1,4 +1,4 @@ -## Copyright (C) 2009,2010,2011,2012 Philip Nienhuis <prnienhuis 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 @@ -37,7 +37,7 @@ ## ## @end deftypefn -## Author: Philip Nienhuis +## Author: Philip Nienhuis <prnienhuis at users.sf.net> ## Created: 2009-12-04 ## Updates: ## 2009-12-11 @@ -61,12 +61,13 @@ ## 2012-05-21 "Double" cast moved into main func oct2xls ## 2012-10-12 Renamed & moved into ./private ## 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 Style fixes, copyright string updates function [ xls, rstatus ] = __JXL_oct2spsh__ (obj, xls, wsh, crange, spsh_opts) ## Preliminary sanity checks - if (~strmatch (tolower (xls.filename(end-4:end-1)), ".xls")) ## No OOXML in JXL + if (! strmatch (tolower (xls.filename(end-4:end-1)), ".xls")) ## No OOXML in JXL error ("JXL interface can only write to Excel .xls files") endif @@ -132,9 +133,9 @@ ## Prepare type array typearr = spsh_prstype (obj, nrows, ncols, ctype, spsh_opts); - if ~(spsh_opts.formulas_as_text) + if (! spsh_opts.formulas_as_text) ## Remove leading '=' from formula strings - fptr = ~(4 * (ones (size (typearr))) .- typearr); + fptr = ! (4 * (ones (size (typearr))) .- typearr); obj(fptr) = cellfun (@(x) x(2:end), obj(fptr), "Uniformoutput", false); endif clear fptr
--- a/main/io/inst/private/__JXL_spsh2oct__.m Fri Dec 20 12:54:43 2013 +0000 +++ b/main/io/inst/private/__JXL_spsh2oct__.m Fri Dec 20 12:55:45 2013 +0000 @@ -1,4 +1,4 @@ -## Copyright (C) 2009,2010,2011,2012 Philip Nienhuis <prnienhuis 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 @@ -35,7 +35,7 @@ ## ## @end deftypefn -## Author: Philip Nienhuis +## Author: Philip Nienhuis <prnienhuis at users.sf.net> ## Created: 2009-12-04 ## Updates: ## 2009-12-11 ??? some bug fix @@ -51,6 +51,7 @@ ## 2012-01-26 Fixed "seealso" help string ## 2012-10-12 Renamed & moved into ./private ## 2012-10-24 Style fixes +## 2013-12-01 Style fixes, copyright string updates function [ rawarr, xls, rstatus ] = __JXL_spsh2oct__ (xls, wsh, cellrange, spsh_opts) @@ -131,16 +132,16 @@ for ii = firstrow:lastrow scell = sh.getCell (jj-1, ii-1); switch char (scell.getType ()) - case ctype {1} ## Boolean + case ctype{1} ## Boolean rawarr {ii+1-firstrow, jj+1-lcol} = scell.getValue (); - case ctype {2} ## Boolean formula + case ctype{2} ## Boolean formula if (spsh_opts.formulas_as_text) tmp = scell.getFormula (); rawarr {ii+1-firstrow, jj+1-lcol} = ["=" tmp]; else rawarr {ii+1-firstrow, jj+1-lcol} = scell.getValue (); endif - case ctype {3} ## Date + case ctype{3} ## Date try % Older JXL.JAR, returns float rawarr {ii+1-firstrow, jj+1-lcol} = scell.getValue (); @@ -158,7 +159,7 @@ endif rawarr {ii+1-firstrow, jj+1-lcol} = datenum (yy, mo, dd, hh, mi, ss); end_try_catch - case ctype {4} ## Date formula + case ctype{4} ## Date formula if (spsh_opts.formulas_as_text) tmp = scell.getFormula (); rawarr {ii+1-firstrow, jj+1-lcol} = ["=" tmp]; @@ -168,7 +169,7 @@ tmp = scell.getValue (); % if we get here, we got a float (old JXL). % Check if it is time - if (~scell.isTime ()) + if (! scell.isTime ()) % Reset rawarr <> so it can be processed below as date string rawarr {ii+1-firstrow, jj+1-lcol} = []; else @@ -191,20 +192,20 @@ endif end_unwind_protect endif - case { ctype {5}, ctype {6}, ctype {7} } + case { ctype{5}, ctype{6}, ctype{7} } ## Empty, Error or Formula error. Nothing to do here - case ctype {8} ## Number + case ctype{8} ## Number rawarr {ii+1-firstrow, jj+1-lcol} = scell.getValue (); - case ctype {9} ## String + case ctype{9} ## String rawarr {ii+1-firstrow, jj+1-lcol} = scell.getString (); - case ctype {10} ## Numerical formula + case ctype{10} ## Numerical formula if (spsh_opts.formulas_as_text) tmp = scell.getFormula (); rawarr {ii+1-firstrow, jj+1-lcol} = ["=" tmp]; else rawarr {ii+1-firstrow, jj+1-lcol} = scell.getValue (); endif - case ctype {11} ## String formula + case ctype{11} ## String formula if (spsh_opts.formulas_as_text) tmp = scell.getFormula (); rawarr {ii+1-firstrow, jj+1-lcol} = ["=" tmp];
--- a/main/io/inst/private/__JXL_spsh_close__.m Fri Dec 20 12:54:43 2013 +0000 +++ b/main/io/inst/private/__JXL_spsh_close__.m Fri Dec 20 12:55:45 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 @@ -19,7 +19,8 @@ ## Author: Philip Nienhuis <prnienhuis@users.sf.net> ## Created: 2012-10-12 ## Updates: -## 2012-10-24 Style fixes +## 2012-10-24 Style fixes +## 2013-12-01 Style fixes, copyright string updates function [ xls ] = __JXL_spsh_close__ (xls)
--- a/main/io/inst/private/__JXL_spsh_info__.m Fri Dec 20 12:54:43 2013 +0000 +++ b/main/io/inst/private/__JXL_spsh_info__.m Fri Dec 20 12:55:45 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-12 Moved into ./private -## 2012-10-24 Style fixes +## 2012-10-24 Style fixes +## 2013-12-01 Style fixes, copyright string updates function [sh_names, fformat] = __JXL_spsh_info__ (xls) @@ -36,6 +37,10 @@ sh_names(ii, 2) = "Empty"; endif endfor - if (sh_cnt > 0); fformat = "xlWorkbookNormal"; else, fformat = ''; endif + if (sh_cnt > 0) + fformat = "xlWorkbookNormal"; + else + fformat = ''; + endif endfunction
--- a/main/io/inst/private/__JXL_spsh_open__.m Fri Dec 20 12:54:43 2013 +0000 +++ b/main/io/inst/private/__JXL_spsh_open__.m Fri Dec 20 12:55:45 2013 +0000 @@ -1,4 +1,4 @@ -## Copyright (C) 2012 Philip +## 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 @@ -16,16 +16,17 @@ ## __JXL_xlsopen__ - Internal function for opening an xls file using Java / JExcelAPI -## Author: Philip <Philip@DESKPRN> +## Author: Philip Nienhuis <prnienhuis@users.sf.net> ## Created: 2012-10-07 ## Updates (possibly from xlsopen): ## 2010-11-05 Bug fix: JXL fallback from POI for BIFF5 is only useful for reading ## 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 Style fixes, opyright string updates function [ xls, xlssupport, lastintf ] = __JXL_spsh_open__ (xls, xwrite, filename, xlssupport, chk1) - if (~chk1) + if (! chk1) error ("JXL can only read reliably from .xls files") endif try