diff --git a/CHANGELOG.md b/CHANGELOG.md index fabc0bc..b28d17c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.2.4 - 28 December 2021 + +- \#280 Fix: formatRows() errors if range specified is a single row + ## 3.2.3 - 18 December 2021 - Security Update @@ -6,8 +10,8 @@ ## 3.2.2 - 17 December 2021 - Fixes - -\#277 Date format initialization doesn't work in Lucee with full null support - -\#278 Adding header/footer images throws error with null support enabled + - \#277 Date format initialization doesn't work in Lucee with full null support + - \#278 Adding header/footer images throws error with null support enabled ## 3.2.1 - 15 December 2021 @@ -24,7 +28,7 @@ - \#274 Allow flushOsgiBundle() to flush a specified version - Fixes - -\#272 Read() not importing trailing empty columns + - \#272 Read() not importing trailing empty columns ## 3.1.0 - 2 November 2021 @@ -40,6 +44,7 @@ - \#265 read( format="query" ) should auto-generate column names where too few column names are specified ## 3.0.0 - 17 September 2021 + - Breaking changes - Rename project "spreadsheet-cfml" @@ -290,7 +295,7 @@ ## 1.6.1 - 7 September 2017 - Fixes - -\#130 JavaLoader should not need `loadColdFusionClassPath` setting (add commons-codec jar to lib) + - \#130 JavaLoader should not need `loadColdFusionClassPath` setting (add commons-codec jar to lib) ## 1.6.0 - 5 September 2017 diff --git a/ModuleConfig.cfc b/ModuleConfig.cfc index 71547c5..6bd144c 100644 --- a/ModuleConfig.cfc +++ b/ModuleConfig.cfc @@ -4,7 +4,7 @@ component{ this.author = "Julian Halliwell"; this.webURL = "https://github.com/cfsimplicity/spreadsheet-cfml"; this.description = "CFML Spreadsheet Library"; - this.version = "3.2.3"; + this.version = "3.2.4"; this.autoMapModels = false; function configure(){ diff --git a/Spreadsheet.cfc b/Spreadsheet.cfc index a35e9ef..9da78c2 100644 --- a/Spreadsheet.cfc +++ b/Spreadsheet.cfc @@ -1,7 +1,7 @@ component accessors="true"{ //"static" - property name="version" default="3.2.3" setter="false"; + property name="version" default="3.2.4" setter="false"; property name="osgiLibBundleVersion" default="5.1.0.3" setter="false"; //first 3 octets = POI version; increment 4th with other jar updates property name="osgiLibBundleSymbolicName" default="spreadsheet-cfml" setter="false"; property name="exceptionType" default="cfsimplicity.spreadsheet" setter="false"; @@ -914,12 +914,9 @@ component accessors="true"{ }; getFormatHelper().addCellStyleToFormatMethodArgsIfStyleOverwriteAllowed( argumentCollection=arguments, formatMethodArgs=formatColumnArgs ); for( var thisRange in allRanges ){ - if( thisRange.startAt == thisRange.endAt ){ // Just one column - formatColumn( argumentCollection=formatColumnArgs, column=thisRange.startAt ); - continue; - } - for( var columnNumber = thisRange.startAt; columnNumber <= thisRange.endAt; columnNumber++ ) + for( var columnNumber = thisRange.startAt; columnNumber <= thisRange.endAt; columnNumber++ ){ formatColumn( argumentCollection=formatColumnArgs, column=columnNumber ); + } } return this; } @@ -967,12 +964,9 @@ component accessors="true"{ }; getFormatHelper().addCellStyleToFormatMethodArgsIfStyleOverwriteAllowed( argumentCollection=arguments, formatMethodArgs=formatRowArgs ); for( var thisRange in allRanges ){ - if( thisRange.startAt == thisRange.endAt ){ // Just one row - formatRow( arguments.workbook, arguments.format, thisRange.startAt, arguments.overwriteCurrentStyle, style ); - continue; - } - for( var rowNumber = thisRange.startAt; rowNumber <= thisRange.endAt; rowNumber++ ) + for( var rowNumber = thisRange.startAt; rowNumber <= thisRange.endAt; rowNumber++ ){ formatRow( argumentCollection=formatRowArgs, row=rowNumber ); + } } return this; } diff --git a/box.json b/box.json index 03cd160..9ccd795 100644 --- a/box.json +++ b/box.json @@ -1,10 +1,10 @@ { "name" : "Spreadsheet CFML", "slug" : "spreadsheet-cfml", - "version" : "3.2.3", + "version" : "3.2.4", "shortDescription" : "CFML spreadsheet library", "author" : "Julian Halliwell", - "location" : "https://github.com/cfsimplicity/spreadsheet-cfml/archive/v3.2.3.zip", + "location" : "https://github.com/cfsimplicity/spreadsheet-cfml/archive/v3.2.4.zip", "homepage" : "https://github.com/cfsimplicity/spreadsheet-cfml", "projectURL" : "https://github.com/cfsimplicity/spreadsheet-cfml", "documentation" : "https://github.com/cfsimplicity/spreadsheet-cfml/blob/main/README.md", diff --git a/test/specs/formatColumns.cfm b/test/specs/formatColumns.cfm index 4d6e171..6cea983 100644 --- a/test/specs/formatColumns.cfm +++ b/test/specs/formatColumns.cfm @@ -43,6 +43,13 @@ describe( "formatColumns", function(){ }); }); + it( "works when the range is just a single column", function(){ + workbooks.Each( function( wb ){ + s.formatColumns( wb, { italic: true }, "2" ); + expect( s.getCellFormat( wb, 2, 2 ).italic ).toBeTrue(); + }); + }); + describe( "formatColumns throws an exception if ", function(){ it( "the range is invalid", function(){ diff --git a/test/specs/formatRows.cfm b/test/specs/formatRows.cfm index d7cfbb4..8c00101 100644 --- a/test/specs/formatRows.cfm +++ b/test/specs/formatRows.cfm @@ -30,6 +30,13 @@ describe( "formatRows", function(){ }); }); + it( "works when the range is just a single row", function(){ + workbooks.Each( function( wb ){ + s.formatRows( wb, { italic: true }, "2" ); + expect( s.getCellFormat( wb, 2, 2 ).italic ).toBeTrue(); + }); + }); + describe( "formatRows throws an exception if", function(){ it( "the range is invalid", function(){