Skip to content

use shared strings for streamed writes #233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 2, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/stream/xlsx/workbook-writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ var WorkbookWriter = module.exports = function(options) {

// using shared strings creates a smaller xlsx file but may use more memory
this.useSharedStrings = options.useSharedStrings || false;
this.streamedValues = new SharedStrings();
this.sharedStrings = new SharedStrings();

// style manager
this.styles = options.useStyles ? new StylesXform(true) : new StylesXform.Mock(true);
Expand Down Expand Up @@ -259,7 +259,7 @@ WorkbookWriter.prototype = {
},
addSharedStrings: function() {
var self = this;
if (this.streamedValues.count) {
if (this.sharedStrings.count) {
return new Bluebird(function(resolve) {
var sharedStringsXform = new SharedStringsXform();
var xml = sharedStringsXform.toXml(self.sharedStrings);
Expand All @@ -277,7 +277,7 @@ WorkbookWriter.prototype = {
{rId: 'rId' + (count++), type: RelType.Styles, target: 'styles.xml'},
{rId: 'rId' + (count++), type: RelType.Theme, target: 'theme/theme1.xml'}
];
if (this.streamedValues.count) {
if (this.sharedStrings.count) {
relationships.push(
{rId: 'rId' + (count++), type: RelType.SharedStrings, target: 'sharedStrings.xml'}
);
Expand Down