changeset 12246:b83ec8ae2335 octave-forge

Style fixes
author prnienhuis
date Sat, 28 Dec 2013 16:12:36 +0000
parents c5e19e295357
children 7756b7d01203
files main/io/inst/private/__JXL_oct2spsh__.m main/io/inst/private/__JXL_spsh_open__.m main/io/inst/private/__OTK_getusedrange__.m main/io/inst/private/__OXS_oct2spsh__.m main/io/inst/private/__OXS_spsh_open__.m
diffstat 5 files changed, 23 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/main/io/inst/private/__JXL_oct2spsh__.m	Sat Dec 28 16:12:05 2013 +0000
+++ b/main/io/inst/private/__JXL_oct2spsh__.m	Sat Dec 28 16:12:36 2013 +0000
@@ -62,13 +62,14 @@
 ## 2012-10-12 Renamed & moved into ./private
 ## 2012-10-24 Style fixes
 ## 2013-01-20 Adapted to ML-compatible Java calls
-## 2013-12-01 Style fixes, copyright string updates
+## 2013-12-01 Style fixes, copyright string updates
+## 2013-12-27 Style fixes
 
 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
-		error ("JXL interface can only write to Excel .xls files")
+	if (strcmpi (xls.filename(end-4:end-1), ".xls"))	## No OOXML in JXL
+		error ("JXL interface can only process Excel .xls files")
 	endif
 
 	persistent ctype;
--- a/main/io/inst/private/__JXL_spsh_open__.m	Sat Dec 28 16:12:05 2013 +0000
+++ b/main/io/inst/private/__JXL_spsh_open__.m	Sat Dec 28 16:12:36 2013 +0000
@@ -22,12 +22,14 @@
 ## 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-12-01 Style fixes, opyright string updates
+## 2013-12-01 Style fixes, opyright string updates
+## 2013-12-27 Use one variable for processed file type
+##     ''     Clarify error message about unrecognized file type
 
-function [ xls, xlssupport, lastintf ] = __JXL_spsh_open__ (xls, xwrite, filename, xlssupport, chk1)
+function [ xls, xlssupport, lastintf ] = __JXL_spsh_open__ (xls, xwrite, filename, xlssupport, ftype)
 
-    if (! chk1)
-      error ("JXL can only read reliably from .xls files")
+    if (ftype != 1)
+      error ("xlsopen: JXL can only read .xls (BIFF5 - Excel95 or BIFF8 - Excel97-2003) files")
     endif
     try
       xlsin = javaObject ("java.io.File", filename);
--- a/main/io/inst/private/__OTK_getusedrange__.m	Sat Dec 28 16:12:05 2013 +0000
+++ b/main/io/inst/private/__OTK_getusedrange__.m	Sat Dec 28 16:12:36 2013 +0000
@@ -30,7 +30,8 @@
 ## 2012-06-08 Support for odsfdom-0.8.8-incubator
 ## 2012-10-12 Renamed & moved into ./private
 ## 2012-10-24 Style fixes
-## 2013-12-01 Style fixes, copyright string updates
+## 2013-12-01 Style fixes, copyright string updates
+## 2013-12-27 Style fixes
 
 function [ trow, lrow, lcol, rcol ] = __OTK_getusedrange__ (ods, ii)
 
@@ -88,7 +89,7 @@
       endif
 
       ## if rcol is already 1024 no more exploring for rightmost column is needed
-      if (! (rcol == 1024))
+      if (rcol != 1024)
         ## Get rightmost cell column number by counting....
         rc = 0;
         for kk=1:row.getLength()
@@ -116,7 +117,7 @@
     lrow = trow + drows - 1;
   else
     ## Empty sheet
-    lrow = 0; lcol = 0; rcol = 0;
+    lrow = lcol = rcol = 0;
   endif
 
 endfunction
--- a/main/io/inst/private/__OXS_oct2spsh__.m	Sat Dec 28 16:12:05 2013 +0000
+++ b/main/io/inst/private/__OXS_oct2spsh__.m	Sat Dec 28 16:12:36 2013 +0000
@@ -34,12 +34,13 @@
 ## Updates:
 ## 2012-10-12 Renamed & moved into ./private
 ## 2012-10-24 Style fixes
-## 2013-12-06 Updated copyright strings; style fixes
+## 2013-12-06 Updated copyright strings; style fixes
+## 2013-12-27 Style fixes
 
 function [ xls, rstatus ] = __OXS_oct2spsh__ (obj, xls, wsh, crange, spsh_opts)
 
   ## Preliminary sanity checks
-  if (! isempty (strcmpi (xls.filename(end-4:end-1)), ".xls"))  
+  if (strcmpi (xls.filename(end-4:end-1)), ".xls")  
     ## No OOXML in OXS
     error ("OXS interface can only write to Excel 97-2003 .xls files")
   endif
@@ -52,7 +53,8 @@
     ctype = [1, 2, 3, 4, 5];
   endif
   ## scratch vars
-  rstatus = 0; f_errs = 0;
+  rstatus = 0; 
+  f_errs = 0;
   
   ## Prepare workbook pointer if needed
   wb = xls.workbook;
@@ -119,7 +121,7 @@
         changed = 1;
       catch
         ## Cell not existent. Add cell
-        if (! typearr(jj, ii) == 5)
+        if (typearr(jj, ii) != 5)
           sh.add (obj{jj, ii}, jj+trow-2, ii+lcol-2);
           changed = 1;
         endif
--- a/main/io/inst/private/__OXS_spsh_open__.m	Sat Dec 28 16:12:05 2013 +0000
+++ b/main/io/inst/private/__OXS_spsh_open__.m	Sat Dec 28 16:12:36 2013 +0000
@@ -22,10 +22,10 @@
 ## 2012-10-24 Style fixes
 ## 2013-12-06 Updated copyright string; style fixes
 
-function [ xls, xlssupport, lastintf ] = __OXS_spsh_open__ (xls, xwrite, filename, xlssupport, chk1)
+function [ xls, xlssupport, lastintf ] = __OXS_spsh_open__ (xls, xwrite, filename, xlssupport, ftype)
 
-    if (! chk1)
-      error ("OXS can only read from .xls files")
+    if (ftype != 1)
+      error ("OXS can only read from .xls (BIFF8; Excel'97-2003) files")
     endif
     try
       wb = javaObject ("com.extentech.ExtenXLS.WorkBookHandle", filename);