mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 08:46:55 +08:00
1 parent
aa1fcd4cd6
commit
54995fb60e
10 files changed
+62
-22
No files matched your search
@@ -330,7 +330,14 @@ func (e *Editor) documentRoot() string {
|
||||
// 返回: bool 是否为同一文档
|
||||
func (e *Editor) sameDocument(other *Editor) bool {
|
||||
if e.source == nil || other.source == nil {
|
||||
return e.source == nil && other.source == nil
|
||||
if e.source == nil && other.source == nil {
|
||||
return true
|
||||
}
|
||||
fresh, packaged := e, other
|
||||
if fresh.source != nil {
|
||||
fresh, packaged = other, e
|
||||
}
|
||||
return len(packaged.source.reader.OFD.DocBody) == 1 && (packaged.source.fromNew || fresh.Info.DocID != "" && fresh.Info.DocID == packaged.source.info.DocID)
|
||||
}
|
||||
return e.documentRoot() == other.documentRoot() && e.source.info.DocID == other.source.info.DocID
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user