Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Spreadsheet.cfc
  • Loading branch information
cfsimplicity committed Mar 23, 2020
2 parents 9fb56dc + fc35ef5 commit 6886f1e
Show file tree
Hide file tree
Showing 11 changed files with 221 additions and 149 deletions.
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
## 2.7.0 - 17 February 2020
## 2.8.0 - 23 March 2020

- Enhancements
- \#181 Add "INT" to query column formats cast as numeric
- \#179 Provide a list of all predefined colours available to formatting methods

- Fixes
- \#182 addInfo() not working with Streaming XLSX
- \#178 Color index lookup is using a deprecated enum class

## 2.7.0 - 17 February 2020

- \#175 Upgrade POI to 4.1.2
- \#176 Upgrade Apache Commons CSV to 1.8
Expand Down
2 changes: 1 addition & 1 deletion ModuleConfig.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ component{
this.author = "Julian Halliwell";
this.webURL = "https://github.com/cfsimplicity/lucee-spreadsheet";
this.description = "Spreadsheet Library for Lucee";
this.version = "2.7.0";
this.version = "2.8.0";
this.autoMapModels = false;

function configure(){
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ You will probably want to place the spreadsheet library files in a central locat
* [getCellType](https://github.com/cfsimplicity/lucee-spreadsheet/wiki/getCellType)
* [getColumnWidth](https://github.com/cfsimplicity/lucee-spreadsheet/wiki/getColumnWidth)
* [getColumnWidthInPixels](https://github.com/cfsimplicity/lucee-spreadsheet/wiki/getColumnWidthInPixels)
* [getPresetColorNames](https://github.com/cfsimplicity/lucee-spreadsheet/wiki/getPresetColorNames)
* [getRowCount](https://github.com/cfsimplicity/lucee-spreadsheet/wiki/getRowCount)
* [hideColumn](https://github.com/cfsimplicity/lucee-spreadsheet/wiki/hideColumn)
* [hideRow](https://github.com/cfsimplicity/lucee-spreadsheet/wiki/hideRow)
Expand Down
303 changes: 167 additions & 136 deletions Spreadsheet.cfc

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name" : "LuceeSpreadsheet",
"slug" : "lucee-spreadsheet",
"version" : "2.7.0",
"version" : "2.8.0",
"shortDescription" : "Spreadsheet Library for Lucee",
"author" : "Julian Halliwell",
"location" : "https://github.com/cfsimplicity/lucee-spreadsheet/archive/v2.7.0.zip",
"location" : "https://github.com/cfsimplicity/lucee-spreadsheet/archive/v2.8.0.zip",
"homepage" : "https://github.com/cfsimplicity/lucee-spreadsheet",
"projectURL" : "https://github.com/cfsimplicity/lucee-spreadsheet",
"documentation" : "https://github.com/cfsimplicity/lucee-spreadsheet/blob/master/README.md",
Expand Down
2 changes: 1 addition & 1 deletion test/specs/addRow.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ describe( "addRow", function(){
it( "Can insert more than 4009 rows containing dates without triggering an exception", function(){
for( var i=1; i LTE 4010; i++ ){
s.addRow( workbook, "2016-07-14" );
variables.s.addRow( workbook, "2016-07-14" );
}
});
Expand Down
4 changes: 2 additions & 2 deletions test/specs/addRows.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ describe( "addRows",function(){
xit( "adding more than 65536 rows to a binary spreadsheet",function() {
expect( function(){
var rows=[];
for( i=1; i <= 65537; i++ ){
for( var i=1; i <= 65537; i++ ){
rows.append( [ i ] );
}
var data=QueryNew( "ID","Integer",rows );
s.addRows( workbook,data );
variables.s.addRows( workbook,data );
}).toThrow( regex="Too many rows" );
});
Expand Down
11 changes: 10 additions & 1 deletion test/specs/formatCell.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ describe( "formatCell", function(){
expect( cellFormat.indent ).toBe( 17 );
});
it( "treats indents of 15+ as the maxiumn 15 on XLS", function(){
it( "treats indents of 15+ as the maximum 15 on XLS", function(){
var format = { indent: 17 };
var cellFormat = setAndGetFormat( xls, format );
expect( cellFormat.indent ).toBe( 15 );
Expand Down Expand Up @@ -285,6 +285,15 @@ describe( "formatCell", function(){
expect( cellFormat.underline ).toBe( "double accounting" );
});
it( "will map 9 deprecated colour names ending in 1 to the corresponding valid value", function(){
// include numbers either side of 127 which might throw ACF
var deprecatedName = "RED1";
var format = { color: deprecatedName, bottombordercolor: deprecatedName };
var cellFormat = setAndGetFormat( xlsx, format );
expect( cellFormat.color ).toBe( "255,0,0" ); //font color
expect( cellFormat.bottombordercolor ).toBe( "255,0,0" ); //style color
});
it( "can set a non preset RGB triplet color on an XLSX workbook cell", function(){
// include numbers either side of 127 which might throw ACF
var triplet = "64,255,128";
Expand Down
11 changes: 11 additions & 0 deletions test/specs/getPresetColorNames.cfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<cfscript>
describe( "getPresetColorNames", function(){
it( "returns an alphabetical array of preset color names available for use in color formatting options", function() {
expect( s.getPresetColorNames() ).toHaveLength( 48 );
expect( s.getPresetColorNames()[ 1 ] ).toBe( "AQUA" );
expect( s.getPresetColorNames()[ 48 ] ).toBe( "YELLOW" );
});
});
</cfscript>
10 changes: 10 additions & 0 deletions test/specs/info.cfm
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ describe( "info", function(){
expect( actual ).toBe( expected );
});
it( "Adds and can get back info from a streaming xlsx", function() {
workbook = s.newStreamingXlsx();
s.addInfo( workbook, infoToAdd );
infoToBeReturned.spreadSheetType = "Excel (2007)";
expected = infoToBeReturned;
actual = s.info( workbook );
actual.creationDate = DateFormat( actual.creationDate, "yyyymmdd" ); // Doesn't return this value so mock
expect( actual ).toBe( expected );
});
it( "Handles missing lastAuthor value in an xlsx", function(){
infoToAdd.delete( "lastAuthor" );
infoToBeReturned.delete( "lastAuthor" );
Expand Down
10 changes: 5 additions & 5 deletions test/suite.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ component extends="testbox.system.BaseSpec"{
}

function getTestFilePath( required string filename ){
return filesDirectoryPath & filename;
return variables.filesDirectoryPath & arguments.filename;
}

function afterAll(){
Expand All @@ -30,10 +30,10 @@ component extends="testbox.system.BaseSpec"{
/* beforeEach( function( currentSpec ) {}); */

afterEach(function( currentSpec ) {
if( FileExists( tempXlsPath ) )
FileDelete( tempXlsPath );
if( FileExists( tempXlsxPath ) )
FileDelete( tempXlsxPath );
if( FileExists( variables.tempXlsPath ) )
FileDelete( variables.tempXlsPath );
if( FileExists( variables.tempXlsxPath ) )
FileDelete( variables.tempXlsxPath );
});

var specs = DirectoryList( ExpandPath( "specs" ), false, "name", "*.cfm" );
Expand Down

0 comments on commit 6886f1e

Please sign in to comment.