v1.6.8
This commit is contained in:
parent
893a3a928b
commit
53d83f91ae
|
|
@ -1,4 +1,4 @@
|
||||||
// Version 1.6.7
|
// Version 1.6.8
|
||||||
Function TOfficeObj(n);
|
Function TOfficeObj(n);
|
||||||
Begin
|
Begin
|
||||||
case lowercase(n) of
|
case lowercase(n) of
|
||||||
|
|
@ -14058,7 +14058,7 @@ Type TDocumentBody = Class(DocObject)
|
||||||
if numId = '' then
|
if numId = '' then
|
||||||
begin
|
begin
|
||||||
id := o.Value('BasedOn');
|
id := o.Value('BasedOn');
|
||||||
return getNumIdByStyle(docx, docx.StyleObject().GetStyleById(id));
|
return getFieldByStyle(field, docx, docx.StyleObject().GetStyleById(id));
|
||||||
end
|
end
|
||||||
return numId;
|
return numId;
|
||||||
End;
|
End;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Version 1.6.7
|
// Version 1.6.8
|
||||||
Type TSDocxFile = Class
|
Type TSDocxFile = Class
|
||||||
///Version: V1.0 2022-09-20
|
///Version: V1.0 2022-09-20
|
||||||
///适用于 Microsoft Word docx格式文件
|
///适用于 Microsoft Word docx格式文件
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
// Version 1.6.7
|
// Version 1.6.8
|
||||||
Type TSXlsxFile = Class
|
Type TSXlsxFile = Class
|
||||||
///Version: V1.0 2022-08-08
|
///Version: V1.0 2022-08-08
|
||||||
///适用于 Microsoft Excel? 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM / XLTX 等多种文档格式。
|
///适用于 Microsoft Excel? 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM / XLTX 等多种文档格式。
|
||||||
|
|
@ -221,6 +221,8 @@ Type TSXlsxFile = Class
|
||||||
sheet_name := class(TSXml).CurCodePageToUtf8(sheet);
|
sheet_name := class(TSXml).CurCodePageToUtf8(sheet);
|
||||||
value := class(TSXml).CurCodePageToUtf8(val);
|
value := class(TSXml).CurCodePageToUtf8(val);
|
||||||
// 处理cell设定的样式
|
// 处理cell设定的样式
|
||||||
|
if not ifarray(opt) then opt := array();
|
||||||
|
workbook_.SetCellStyleOpt(sheet, axis, opt);
|
||||||
SetCellType(sheet, axis, value, opt);
|
SetCellType(sheet, axis, value, opt);
|
||||||
return workbook_.SetCellValue(sheet_name, axis, value, opt);
|
return workbook_.SetCellValue(sheet_name, axis, value, opt);
|
||||||
End;
|
End;
|
||||||
|
|
@ -1004,9 +1006,8 @@ private
|
||||||
|
|
||||||
Function SetCellType(sheet, axis, val, opt);
|
Function SetCellType(sheet, axis, val, opt);
|
||||||
Begin
|
Begin
|
||||||
if not ifarray(opt) then opt := array();
|
|
||||||
if not ifnil(opt['t']) then return;
|
if not ifnil(opt['t']) then return;
|
||||||
styleid := GetCellStyle(sheet, axis);
|
styleid := opt['s'] ? opt['s'] : GetCellStyle(sheet, axis);
|
||||||
[t, val] := style_.GetType(styleid, val);
|
[t, val] := style_.GetType(styleid, val);
|
||||||
if t then opt['t'] := t;
|
if t then opt['t'] := t;
|
||||||
End;
|
End;
|
||||||
|
|
|
||||||
|
|
@ -106,11 +106,19 @@ Type xlsxWorkBook = Class
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function SetCellValue(sheet, axis, val, opt);
|
Function SetCellValue(sheet, axis, val, opt);
|
||||||
|
Begin
|
||||||
|
o := GetSheetObj(sheet);
|
||||||
|
if ifObj(o) then
|
||||||
|
ret := o.SetCellValue(axis, val, opt);
|
||||||
|
return ret;
|
||||||
|
End;
|
||||||
|
|
||||||
|
Function SetCellStyleOpt(sheet, axis, opt);
|
||||||
Begin
|
Begin
|
||||||
o := GetSheetObj(sheet);
|
o := GetSheetObj(sheet);
|
||||||
if ifObj(o) then
|
if ifObj(o) then
|
||||||
begin
|
begin
|
||||||
if (ifnil(opt) or ifnil(opt['s'])) and not o.CellIsExists(axis) then
|
if ifnil(opt['s']) and not o.CellIsExists(axis) then
|
||||||
begin
|
begin
|
||||||
[err, col, row] := CellNameToCoordinates(axis);
|
[err, col, row] := CellNameToCoordinates(axis);
|
||||||
xml := GetSheetXmlFile(sheet);
|
xml := GetSheetXmlFile(sheet);
|
||||||
|
|
@ -125,7 +133,6 @@ Type xlsxWorkBook = Class
|
||||||
style := col_node.GetAttribute('style');
|
style := col_node.GetAttribute('style');
|
||||||
if col >= min and col <= max and style <> '' then
|
if col >= min and col <= max and style <> '' then
|
||||||
begin
|
begin
|
||||||
if not istable(opt) then opt := array();
|
|
||||||
opt['s'] := style;
|
opt['s'] := style;
|
||||||
break;
|
break;
|
||||||
end
|
end
|
||||||
|
|
@ -133,9 +140,7 @@ Type xlsxWorkBook = Class
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
ret := o.SetCellValue(axis, val, opt);
|
|
||||||
end
|
end
|
||||||
return ret;
|
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function GetCellRichText(sheet, axis);
|
Function GetCellRichText(sheet, axis);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue