v1.4.7
This commit is contained in:
parent
5f1064794d
commit
d72d88d68a
|
|
@ -1,4 +1,4 @@
|
||||||
// Version 1.4.6
|
// Version 1.4.7
|
||||||
|
|
||||||
Function TOfficeObj(n);
|
Function TOfficeObj(n);
|
||||||
Begin
|
Begin
|
||||||
|
|
@ -13922,14 +13922,11 @@ Type TDocumentBody = Class(DocObject)
|
||||||
p := new TParagraph(pNode);
|
p := new TParagraph(pNode);
|
||||||
//统计数字项目编号
|
//统计数字项目编号
|
||||||
numArr := array();
|
numArr := array();
|
||||||
ilvl := -1;
|
numId := getNumPr('numId', docx, p);
|
||||||
numId := '';
|
ilvl := getNumPr('Level', docx, p);
|
||||||
|
if not ilvl then ilvl := 0;
|
||||||
if ifarray(numIds) then Begin
|
if ifarray(numIds) then Begin
|
||||||
sectPr.Append(p);
|
sectPr.Append(p);
|
||||||
numId := p.Format.NumPr.Value('numId');
|
|
||||||
lvlStr := p.Format.NumPr.Value('Level');
|
|
||||||
if not ifnil(numId) and not ifnil(lvlStr) then Begin
|
|
||||||
ilvl := Class(TSXml).SafeStrToIntDef(lvlStr, -1);
|
|
||||||
if ilvl >= 0 and ilvl < 10 then Begin
|
if ilvl >= 0 and ilvl < 10 then Begin
|
||||||
if not istable(numIds[numId]) then
|
if not istable(numIds[numId]) then
|
||||||
numIds[numId] := array(0,0,0,0,0,0,0,0,0,0);
|
numIds[numId] := array(0,0,0,0,0,0,0,0,0,0);
|
||||||
|
|
@ -13942,13 +13939,12 @@ Type TDocumentBody = Class(DocObject)
|
||||||
numArr := numIds[numId];
|
numArr := numIds[numId];
|
||||||
End;
|
End;
|
||||||
End;
|
End;
|
||||||
End;
|
|
||||||
if bHeadList then Begin //统计大纲显示(目录)
|
if bHeadList then Begin //统计大纲显示(目录)
|
||||||
styleId := p.Format.Value('StyleId', 1);
|
styleId := p.Format.Value('StyleId', 1);
|
||||||
if styleId <> '' then Begin
|
if styleId <> '' then Begin
|
||||||
obj := docx.StyleObject().GetStyleById(styleId);
|
obj := docx.StyleObject().GetStyleById(styleId);
|
||||||
if ifObj(obj) then Begin
|
if ifObj(obj) then Begin
|
||||||
level := obj.HeadingLevel();
|
level := getHeadingLevel(docx, obj);
|
||||||
iLevel := Class(TSXml).SafeStrToIntDef(level, -1);
|
iLevel := Class(TSXml).SafeStrToIntDef(level, -1);
|
||||||
if p.Text() <> "" and iLevel+1 >= UpperHeadingLevel and iLevel+1 <= LowerHeadingLevel then Begin
|
if p.Text() <> "" and iLevel+1 >= UpperHeadingLevel and iLevel+1 <= LowerHeadingLevel then Begin
|
||||||
r[ind]['Level'] := strtoint(level);
|
r[ind]['Level'] := strtoint(level);
|
||||||
|
|
@ -13989,6 +13985,40 @@ Type TDocumentBody = Class(DocObject)
|
||||||
return r;
|
return r;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
Function getNumPr(field, docx, p);
|
||||||
|
Begin
|
||||||
|
value := p.Format.NumPr.Value(field);
|
||||||
|
if value then return value;
|
||||||
|
styleId := p.Format.Value('StyleId', 1);
|
||||||
|
return getFieldByStyle(field, docx, docx.StyleObject().GetStyleById(styleid));
|
||||||
|
End;
|
||||||
|
|
||||||
|
Function getFieldByStyle(field, docx, obj);
|
||||||
|
Begin
|
||||||
|
if not ifObj(obj) then return '';
|
||||||
|
numId := obj.pPr.numPr.Value(field);
|
||||||
|
if numId = '' then
|
||||||
|
begin
|
||||||
|
id := o.Value('BasedOn');
|
||||||
|
return getNumIdByStyle(docx, docx.StyleObject().GetStyleById(id));
|
||||||
|
end
|
||||||
|
return numId;
|
||||||
|
End;
|
||||||
|
|
||||||
|
Function getHeadingLevel(docx, obj);
|
||||||
|
Begin
|
||||||
|
if not ifObj(obj) then return '';
|
||||||
|
o := obj;
|
||||||
|
level := obj.HeadingLevel();
|
||||||
|
if level = '' then
|
||||||
|
begin
|
||||||
|
id := o.Value('BasedOn');
|
||||||
|
return getHeadingLevel(docx, docx.StyleObject().GetStyleById(id));
|
||||||
|
end
|
||||||
|
return level;
|
||||||
|
End;
|
||||||
|
|
||||||
|
|
||||||
Function getPictureMaxId();
|
Function getPictureMaxId();
|
||||||
Begin
|
Begin
|
||||||
id := 0;
|
id := 0;
|
||||||
|
|
@ -15314,4 +15344,3 @@ Begin
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Version 1.4.6
|
// Version 1.4.7
|
||||||
|
|
||||||
Type TSDocxFile = Class
|
Type TSDocxFile = Class
|
||||||
///Version: V1.0 2022-09-20
|
///Version: V1.0 2022-09-20
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Version 1.4.6
|
// Version 1.4.7
|
||||||
|
|
||||||
Type TSExcelFile = Class
|
Type TSExcelFile = Class
|
||||||
///Version: V1.0 2022-08-08
|
///Version: V1.0 2022-08-08
|
||||||
|
|
|
||||||
|
|
@ -160,9 +160,9 @@ Type TTableContent = class
|
||||||
if ifObj(style) then
|
if ifObj(style) then
|
||||||
numStr := style.GetText(r[i]['ilvl'], r[i]['numArr']);
|
numStr := style.GetText(r[i]['ilvl'], r[i]['numArr']);
|
||||||
End
|
End
|
||||||
if numStr <> '' then run_t := numStr + ' ' + r[i]['Text'];
|
run_t := class(TSXml).CurCodePageToUtf8(r[i]['Text']);
|
||||||
else run_t := r[i]['Text'];
|
if numStr <> '' then run_t := numStr + ' ' + run_t;
|
||||||
r1.SetText(run_t);
|
r1.SetText(run_t, 1);
|
||||||
|
|
||||||
r2 := h.AddRun();
|
r2 := h.AddRun();
|
||||||
r2.rPr.noProof := true;
|
r2.rPr.noProof := true;
|
||||||
|
|
@ -203,7 +203,6 @@ Type TTableContent = class
|
||||||
r8.fldCharType := 'end';
|
r8.fldCharType := 'end';
|
||||||
|
|
||||||
_AddStdContent(p);
|
_AddStdContent(p);
|
||||||
|
|
||||||
End;
|
End;
|
||||||
|
|
||||||
p2 := TOfficeObj('TParagraph');
|
p2 := TOfficeObj('TParagraph');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue