Browse Source

improve compatibility for phonetic hint and sheet tab color

xuri 5 năm trước cách đây
mục cha
commit
1111de2fdb
3 tập tin đã thay đổi với 15 bổ sung8 xóa
  1. 1 1
      xmlComments.go
  2. 4 2
      xmlSharedStrings.go
  3. 10 5
      xmlWorksheet.go

+ 1 - 1
xmlComments.go

@@ -69,7 +69,7 @@ type xlsxText struct {
 type xlsxPhoneticRun struct {
 	Sb uint32 `xml:"sb,attr"`
 	Eb uint32 `xml:"eb,attr"`
-	T  string `xml:"t,attr"`
+	T  string `xml:"t"`
 }
 
 // formatComment directly maps the format settings of the comment.

+ 4 - 2
xmlSharedStrings.go

@@ -38,8 +38,10 @@ type xlsxSST struct {
 // level - then the string item shall consist of multiple rich text runs which
 // collectively are used to express the string.
 type xlsxSI struct {
-	T *xlsxT  `xml:"t,omitempty"`
-	R []xlsxR `xml:"r"`
+	T          *xlsxT             `xml:"t,omitempty"`
+	R          []xlsxR            `xml:"r"`
+	RPh        []*xlsxPhoneticRun `xml:"rPh"`
+	PhoneticPr *xlsxPhoneticPr    `xml:"phoneticPr"`
 }
 
 // String extracts characters from a string item.

+ 10 - 5
xmlWorksheet.go

@@ -234,11 +234,11 @@ type xlsxSheetPr struct {
 	SyncVertical                      bool             `xml:"syncVertical,attr,omitempty"`
 	SyncRef                           string           `xml:"syncRef,attr,omitempty"`
 	TransitionEvaluation              bool             `xml:"transitionEvaluation,attr,omitempty"`
+	TransitionEntry                   bool             `xml:"transitionEntry,attr,omitempty"`
 	Published                         *bool            `xml:"published,attr"`
 	CodeName                          string           `xml:"codeName,attr,omitempty"`
 	FilterMode                        bool             `xml:"filterMode,attr,omitempty"`
 	EnableFormatConditionsCalculation *bool            `xml:"enableFormatConditionsCalculation,attr"`
-	TransitionEntry                   bool             `xml:"transitionEntry,attr,omitempty"`
 	TabColor                          *xlsxTabColor    `xml:"tabColor,omitempty"`
 	OutlinePr                         *xlsxOutlinePr   `xml:"outlinePr,omitempty"`
 	PageSetUpPr                       *xlsxPageSetUpPr `xml:"pageSetUpPr,omitempty"`
@@ -247,7 +247,10 @@ type xlsxSheetPr struct {
 // xlsxOutlinePr maps to the outlinePr element. SummaryBelow allows you to
 // adjust the direction of grouper controls.
 type xlsxOutlinePr struct {
-	SummaryBelow bool `xml:"summaryBelow,attr"`
+	ApplyStyles        *bool `xml:"applyStyles,attr"`
+	SummaryBelow       bool  `xml:"summaryBelow,attr,omitempty"`
+	SummaryRight       bool  `xml:"summaryRight,attr,omitempty"`
+	ShowOutlineSymbols bool  `xml:"showOutlineSymbols,attr,omitempty"`
 }
 
 // xlsxPageSetUpPr expresses page setup properties of the worksheet.
@@ -258,9 +261,11 @@ type xlsxPageSetUpPr struct {
 
 // xlsxTabColor represents background color of the sheet tab.
 type xlsxTabColor struct {
-	RGB   string  `xml:"rgb,attr,omitempty"`
-	Theme int     `xml:"theme,attr,omitempty"`
-	Tint  float64 `xml:"tint,attr,omitempty"`
+	Auto    bool    `xml:"auto,attr,omitempty"`
+	Indexed int     `xml:"indexed,attr,omitempty"`
+	RGB     string  `xml:"rgb,attr,omitempty"`
+	Theme   int     `xml:"theme,attr,omitempty"`
+	Tint    float64 `xml:"tint,attr,omitempty"`
 }
 
 // xlsxCols defines column width and column formatting for one or more columns