1
0
mirror of https://github.com/fumiama/go-docx.git synced 2026-06-06 16:20:24 +08:00

优化完善 table canvas

This commit is contained in:
源文雨
2023-03-02 18:07:53 +08:00
parent fa6f03aaff
commit 64b3464cbf
17 changed files with 806 additions and 156 deletions

View File

@@ -1,3 +1,23 @@
/*
Copyright (c) 2020 gingfrederik
Copyright (c) 2021 Gonzalo Fernandez-Victorio
Copyright (c) 2021 Basement Crowd Ltd (https://www.basementcrowd.com)
Copyright (c) 2023 Fumiama Minamoto (源文雨)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package docx
import (
@@ -12,6 +32,8 @@ type WordprocessingCanvas struct {
Whole *WPCWhole
Items []interface{}
file *Docx
}
// UnmarshalXML ...
@@ -40,7 +62,8 @@ func (c *WordprocessingCanvas) UnmarshalXML(d *xml.Decoder, start xml.StartEleme
return err
}
case "wsp":
var value WPSWordprocessingShape
var value WordprocessingShape
value.file = c.file
err = d.DecodeElement(&value, &tt)
if err != nil && !strings.HasPrefix(err.Error(), "expected") {
return err