Kaynağa Gözat

Default border style is "none".

Geoffrey J. Teale 9 yıl önce
ebeveyn
işleme
7ffa59c7ac
5 değiştirilmiş dosya ile 9 ekleme ve 3 silme
  1. 1 1
      file_test.go
  2. 0 0
      sheet_test.go
  3. 1 1
      style.go
  4. BIN
      testdocs/original.xlsx
  5. 7 1
      xmlStyle.go

+ 1 - 1
file_test.go

@@ -695,7 +695,7 @@ func (l *FileSuite) TestMarshalFile(c *C) {
 	// For now we only allow simple string data in the
 	// spreadsheet.  Style support will follow.
 	expectedStyles := `<?xml version="1.0" encoding="UTF-8"?>
-<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><fonts count="1"><font><sz val="12"/><name val="Verdana"/><family val="0"/><charset val="0"/></font></fonts><fills count="2"><fill><patternFill patternType="none"><fgColor rgb="FFFFFFFF"/><bgColor rgb="00000000"/></patternFill></fill><fill><patternFill patternType="lightGray"/></fill></fills><borders count="1"><border><left style=""></left><right style=""></right><top style=""></top><bottom style=""></bottom></border></borders><cellXfs count="2"><xf applyAlignment="0" applyBorder="0" applyFont="0" applyFill="0" applyNumberFormat="0" applyProtection="0" borderId="0" fillId="0" fontId="0" numFmtId="0"><alignment horizontal="general" indent="0" shrinkToFit="0" textRotation="0" vertical="bottom" wrapText="0"/></xf><xf applyAlignment="0" applyBorder="0" applyFont="0" applyFill="0" applyNumberFormat="0" applyProtection="0" borderId="0" fillId="0" fontId="0" numFmtId="0"><alignment horizontal="general" indent="0" shrinkToFit="0" textRotation="0" vertical="bottom" wrapText="0"/></xf></cellXfs></styleSheet>`
+<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"><fonts count="1"><font><sz val="12"/><name val="Verdana"/><family val="0"/><charset val="0"/></font></fonts><fills count="2"><fill><patternFill patternType="none"><fgColor rgb="FFFFFFFF"/><bgColor rgb="00000000"/></patternFill></fill><fill><patternFill patternType="lightGray"/></fill></fills><borders count="1"><border><left style="none"></left><right style="none"></right><top style="none"></top><bottom style="none"></bottom></border></borders><cellXfs count="2"><xf applyAlignment="0" applyBorder="0" applyFont="0" applyFill="0" applyNumberFormat="0" applyProtection="0" borderId="0" fillId="0" fontId="0" numFmtId="0"><alignment horizontal="general" indent="0" shrinkToFit="0" textRotation="0" vertical="bottom" wrapText="0"/></xf><xf applyAlignment="0" applyBorder="0" applyFont="0" applyFill="0" applyNumberFormat="0" applyProtection="0" borderId="0" fillId="0" fontId="0" numFmtId="0"><alignment horizontal="general" indent="0" shrinkToFit="0" textRotation="0" vertical="bottom" wrapText="0"/></xf></cellXfs></styleSheet>`
 
 	c.Assert(parts["xl/styles.xml"], Equals, expectedStyles)
 }

Dosya farkı çok büyük olduğundan ihmal edildi
+ 0 - 0
sheet_test.go


+ 1 - 1
style.go

@@ -174,7 +174,7 @@ func DefaultFill() *Fill {
 }
 
 func DefaultBorder() *Border {
-	return NewBorder("", "", "", "")
+	return NewBorder("none", "none", "none", "none")
 }
 
 func DefaultAlignment() *Alignment {

BIN
testdocs/original.xlsx


+ 7 - 1
xmlStyle.go

@@ -100,7 +100,13 @@ func (styles *xlsxStyleSheet) reset() {
 	styles.Borders = xlsxBorders{}
 
 	// Microsoft seems to want an emtpy border to start with
-	styles.addBorder(xlsxBorder{})
+	styles.addBorder(
+		xlsxBorder{
+			Left:   xlsxLine{Style: "none"},
+			Right:  xlsxLine{Style: "none"},
+			Top:    xlsxLine{Style: "none"},
+			Bottom: xlsxLine{Style: "none"},
+		})
 
 	styles.CellStyleXfs = &xlsxCellStyleXfs{}
 

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor