Skip to content
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

Fix DefaultColumnStyle #1340

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion OpenXmlFormats/Spreadsheet/Sheet/CT_Cell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public bool IsSetT()
}
public bool IsSetS()
{
return sField != 0;
return sField != null && sField != 0;
}
public bool IsSetF()
{
Expand Down
5 changes: 4 additions & 1 deletion ooxml/XSSF/Model/StylesTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,11 @@ public XSSFCellStyle GetStyleAt(int idx)
{
int styleXfId = 0;

if (xfs.Count == 0) //in case there is no default style
if (idx < 0 || idx >= xfs.Count)
{
//BUG-60343
return null;
}

// 0 is the empty default
if (xfs[idx].xfId > 0)
Expand Down
10 changes: 9 additions & 1 deletion ooxml/XSSF/Streaming/GZIPSheetDataWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ public GZIPSheetDataWriter(SharedStringsTable sharedStringsTable) : base(sharedS
{
}

/**
* @param sharedStringsTable the shared strings table, or null if inline text is used
* @param ignoreCellStyle whether to use cell style
*/
public GZIPSheetDataWriter(SharedStringsTable sharedStringsTable, bool ignoreCellStyle) :
base(sharedStringsTable, ignoreCellStyle)
{ }

/**
* @return temp file to write sheet data
*/
Expand All @@ -43,7 +51,7 @@ public override FileInfo CreateTempFile()
{
return TempFile.CreateTempFile("poi-sxssf-sheet-xml", ".gz");
}

protected override Stream DecorateInputStream(Stream fis)
{
return new GZipInputStream(fis);
Expand Down
Loading
Loading