Commit a1653bc6 authored by Sergey Konovalov's avatar Sergey Konovalov

moveFrom/moveTo open/save to del/ins

parent 25a0c76f
...@@ -274,7 +274,9 @@ var c_oSerProp_rPrType = { ...@@ -274,7 +274,9 @@ var c_oSerProp_rPrType = {
TextFill : 32, TextFill : 32,
Del: 33, Del: 33,
Ins: 34, Ins: 34,
rPrChange: 35 rPrChange: 35,
MoveFrom: 36,
MoveTo: 37
}; };
var c_oSerProp_rowPrType = { var c_oSerProp_rowPrType = {
CantSplit:0, CantSplit:0,
...@@ -360,7 +362,9 @@ var c_oSerParType = { ...@@ -360,7 +362,9 @@ var c_oSerParType = {
Del: 12, Del: 12,
Ins: 13, Ins: 13,
Background: 14, Background: 14,
Sdt: 15 Sdt: 15,
MoveFrom: 16,
MoveTo: 17
}; };
var c_oSerDocTableType = { var c_oSerDocTableType = {
tblPr:0, tblPr:0,
...@@ -8087,6 +8091,18 @@ function Binary_rPrReader(doc, oReadResult, stream) ...@@ -8087,6 +8091,18 @@ function Binary_rPrReader(doc, oReadResult, stream)
return ReadTrackRevision(t, l, oThis.stream, oThis.trackRevision.ins, null); return ReadTrackRevision(t, l, oThis.stream, oThis.trackRevision.ins, null);
}); });
break; break;
case c_oSerProp_rPrType.MoveFrom:
this.trackRevision = {del: new CReviewInfo()};
res = this.bcr.Read1(length, function(t, l){
return ReadTrackRevision(t, l, oThis.stream, oThis.trackRevision.del, null);
});
break;
case c_oSerProp_rPrType.MoveTo:
this.trackRevision = {ins: new CReviewInfo()};
res = this.bcr.Read1(length, function(t, l){
return ReadTrackRevision(t, l, oThis.stream, oThis.trackRevision.ins, null);
});
break;
case c_oSerProp_rPrType.rPrChange: case c_oSerProp_rPrType.rPrChange:
var rPrChange = new CTextPr(); var rPrChange = new CTextPr();
var reviewInfo = new CReviewInfo(); var reviewInfo = new CReviewInfo();
...@@ -9323,6 +9339,32 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, curFoo ...@@ -9323,6 +9339,32 @@ function Binary_DocumentTableReader(doc, oReadResult, openParams, stream, curFoo
elem.Set_ReviewTypeWithInfo(reviewtype_Add, reviewInfo); elem.Set_ReviewTypeWithInfo(reviewtype_Add, reviewInfo);
} }
} }
} else if (c_oSerParType.MoveFrom == type) {
var reviewInfo = new CReviewInfo();
var startPos = oParStruct.getCurPos();
res = this.bcr.Read1(length, function(t, l){
return ReadTrackRevision(t, l, oThis.stream, reviewInfo, {parStruct: oParStruct, bdtr: oThis});
});
var endPos = oParStruct.getCurPos();
for(var i = startPos; i < endPos; ++i) {
var elem = oParStruct.GetFromContent(i);
if(elem && elem.Set_ReviewTypeWithInfo) {
elem.Set_ReviewTypeWithInfo(reviewtype_Remove, reviewInfo);
}
}
} else if (c_oSerParType.MoveTo == type) {
var reviewInfo = new CReviewInfo();
var startPos = oParStruct.getCurPos();
res = this.bcr.Read1(length, function(t, l){
return ReadTrackRevision(t, l, oThis.stream, reviewInfo, {parStruct: oParStruct, bdtr: oThis});
});
var endPos = oParStruct.getCurPos();
for(var i = startPos; i < endPos; ++i) {
var elem = oParStruct.GetFromContent(i);
if(elem && elem.Set_ReviewTypeWithInfo) {
elem.Set_ReviewTypeWithInfo(reviewtype_Add, reviewInfo);
}
}
} else if ( c_oSerParType.Sdt === type) { } else if ( c_oSerParType.Sdt === type) {
var oSdt = new AscCommonWord.CInlineLevelSdt(); var oSdt = new AscCommonWord.CInlineLevelSdt();
oSdt.SetParagraph(oParStruct.paragraph); oSdt.SetParagraph(oParStruct.paragraph);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment