v1.5.3
This commit is contained in:
parent
3607dab833
commit
c16566d2f1
Binary file not shown.
Binary file not shown.
|
|
@ -1,5 +1,4 @@
|
|||
// Version 1.5.2
|
||||
|
||||
// Version 1.5.3
|
||||
Function TOfficeObj(n);
|
||||
Begin
|
||||
case lowercase(n) of
|
||||
|
|
@ -7,6 +6,8 @@ Begin
|
|||
return new NodeInfo("");
|
||||
"trange":
|
||||
return new TRange("");
|
||||
"tcell":
|
||||
return new TCell();
|
||||
"tfont":
|
||||
return new TFont();
|
||||
"tcomment":
|
||||
|
|
@ -5707,6 +5708,8 @@ type TwrPr=class(NodeInfo)
|
|||
Function Init();
|
||||
Begin
|
||||
rFont := new TwFont(self, 'w:rFonts');
|
||||
Bdr := new TwBorder(self, 'w:bdr');
|
||||
Shading := new TwShading(self, 'w:shd');
|
||||
Del := new TOptInfo(self, 'w:del');
|
||||
//TODO...
|
||||
End;
|
||||
|
|
@ -5715,6 +5718,8 @@ type TwrPr=class(NodeInfo)
|
|||
Begin
|
||||
RootObj := node;
|
||||
rFont.InitRootNode(node);
|
||||
Bdr.InitRootNode(node);
|
||||
Shading.InitRootNode(node);
|
||||
Del.InitRootNode(node);
|
||||
End;
|
||||
|
||||
|
|
@ -5726,6 +5731,8 @@ type TwrPr=class(NodeInfo)
|
|||
Function GetChildren(); override;
|
||||
Begin
|
||||
return array(('field':'rFont','name':rFont.NodeName,'obj':rFont,'attrEx':'','nodeType':'','attrName':'', 'desc':'', 'class':'TwFont')
|
||||
,('field':'Bdr','name':Bdr.NodeName,'obj':Bdr,'attrEx':'','nodeType':'','attrName':'', 'desc':'', 'class':'TwBorder')
|
||||
,('field':'Shading','name':Shading.NodeName,'obj':Shading,'attrEx':'','nodeType':'','attrName':'', 'desc':'底纹', 'class':'TwShading')
|
||||
,('field':'Bold','name':'w:b','obj':Bold,'attrEx':'w:val','nodeType':'empty','attrName':'', 'desc':'黑体', 'class':'')
|
||||
,('field':'noProof','name':'w:noProof','obj':noProof,'attrEx':'','nodeType':'empty','attrName':'', 'desc':'不检查拼写或语法)', 'class':'')
|
||||
,('field':'Color','name':'w:color','obj':Color,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'字体颜色', 'class':'')
|
||||
|
|
@ -5796,6 +5803,8 @@ type TwrPr=class(NodeInfo)
|
|||
|
||||
//Nodes
|
||||
rFont;
|
||||
Bdr;
|
||||
Shading;
|
||||
Bold;
|
||||
noProof;
|
||||
Color;
|
||||
|
|
@ -5986,6 +5995,7 @@ type TwpPr=class(NodeInfo)
|
|||
rPr := new TwrPr(self, 'w:rPr');
|
||||
cnfStyle := new TwCnfStyle(self, 'w:cnfStyle');
|
||||
Bdr := new TpBdr(self, 'w:pBdr');
|
||||
Shading := new TwShading(self, 'w:shd');
|
||||
//TODO...
|
||||
End;
|
||||
|
||||
|
|
@ -5997,6 +6007,7 @@ type TwpPr=class(NodeInfo)
|
|||
rPr.InitRootNode(node);
|
||||
cnfStyle.InitRootNode(node);
|
||||
Bdr.InitRootNode(node);
|
||||
Shading.InitRootNode(node);
|
||||
End;
|
||||
|
||||
Function GetAttrs(); override;
|
||||
|
|
@ -6023,8 +6034,10 @@ type TwpPr=class(NodeInfo)
|
|||
,('field':'LineSpacing','name':'w:spacing','obj':LineSpacing,'attrEx':'w:line','nodeType':'','attrName':'', 'desc':'当前文档中第一段的行距', 'class':'')
|
||||
,('field':'AfterLines','name':'w:spacing','obj':AfterLines,'attrEx':'w:afterLines','nodeType':'','attrName':'', 'desc':'段落下方的间距(以行单位为单位)', 'class':'')
|
||||
,('field':'SpaceAfter','name':'w:spacing','obj':SpaceAfter,'attrEx':'w:after','nodeType':'','attrName':'', 'desc':'当前文档中第一段的段后间距', 'class':'')
|
||||
,('field':'SpaceAfterAuto','name':'w:spacing','obj':SpaceAfterAuto,'attrEx':'w:afterAutospacing','nodeType':'','attrName':'', 'desc':'自动设置指定段落的段后间距离,设置该值为true时忽略SpaceAfter', 'class':'')
|
||||
,('field':'BeforeLines','name':'w:spacing','obj':BeforeLines,'attrEx':'w:beforeLines','nodeType':'','attrName':'', 'desc':'段落上方的间距(以行单位为单位)行单位', 'class':'')
|
||||
,('field':'SpaceBefore','name':'w:spacing','obj':SpaceBefore,'attrEx':'w:before','nodeType':'','attrName':'', 'desc':'当前文档中第一段的段前间距', 'class':'')
|
||||
,('field':'SpaceBeforeAuto','name':'w:spacing','obj':SpaceBeforeAuto,'attrEx':'w:beforeAutospacing','nodeType':'','attrName':'', 'desc':'自动设置指定段落的段前距离,设置该值为true时忽略SpaceBefore', 'class':'')
|
||||
,('field':'OutlineLevel','name':'w:outlineLvl','obj':OutlineLevel,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'设置当前文档中第一段的大纲级别', 'class':'')
|
||||
,('field':'KeepTogether','name':'w:keepLines','obj':KeepTogether,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'段落是否应保持完整且不应跨越页面边界', 'class':'')
|
||||
,('field':'KeepWithNext','name':'w:keepNext','obj':KeepWithNext,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'该段是否应与下一段保持在同一页上', 'class':'')
|
||||
|
|
@ -6033,13 +6046,24 @@ type TwpPr=class(NodeInfo)
|
|||
,('field':'TextAlignment','name':'w:textAlignment','obj':TextAlignment,'attrEx':'','nodeType':'empty','attrName':'', 'desc':'该值指示文本内容的水平对齐方式', 'class':'')
|
||||
,('field':'AdjustRightInd','name':'w:adjustRightInd','obj':AdjustRightInd,'attrEx':'w:val','nodeType':'empty','attrName':'', 'desc':'使用文档网格时自动调整右缩进', 'class':'')
|
||||
,('field':'SnapToGrid','name':'w:snapToGrid','obj':SnapToGrid,'attrEx':'w:val','nodeType':'empty','attrName':'', 'desc':'如果定义了文档网络,则对齐到网格', 'class':'')
|
||||
,('field':'AutoSpaceDE','name':'w:autoSpaceDE','obj':AutoSpaceDE,'attrEx':'','nodeType':'empty','attrName':'', 'desc':'自动调整拉丁语和东亚文本的间距', 'class':'')
|
||||
,('field':'AutoSpaceDN','name':'w:autoSpaceDN','obj':AutoSpaceDN,'attrEx':'','nodeType':'empty','attrName':'', 'desc':'自动调整东亚文本和数字的间距', 'class':'')
|
||||
,('field':'AutoSpaceDE','name':'w:autoSpaceDE','obj':AutoSpaceDE,'attrEx':'w:val','nodeType':'empty','attrName':'', 'desc':'自动调整拉丁语和东亚文本的间距', 'class':'')
|
||||
,('field':'AutoSpaceDN','name':'w:autoSpaceDN','obj':AutoSpaceDN,'attrEx':'w:val','nodeType':'empty','attrName':'', 'desc':'自动调整东亚文本和数字的间距', 'class':'')
|
||||
,('field':'Tabs','name':Tabs.NodeName,'obj':Tabs,'attrEx':'','nodeType':'','attrName':'', 'desc':'disable', 'class':'TTabStops')
|
||||
,('field':'rPr','name':rPr.NodeName,'obj':rPr,'attrEx':'','nodeType':'','attrName':'', 'desc':'disable', 'class':'TwrPr')
|
||||
,('field':'cnfStyle','name':cnfStyle.NodeName,'obj':cnfStyle,'attrEx':'','nodeType':'','attrName':'', 'desc':'段落条件格式:此元素指定格式属性的已应用于此段落,如果该段落包含在表格单元格的条件的表格样式的集。https://learn.microsoft.com/zh-cn/dotnet/api/documentformat.openxml.wordprocessing.conditionalformatstyle?view=openxml-2.8.1', 'class':'TwCnfStyle')
|
||||
,('field':'textFlow','name':'w:textFlow','obj':textFlow,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'disable', 'class':'')
|
||||
,('field':'Bdr','name':Bdr.NodeName,'obj':Bdr,'attrEx':'','nodeType':'','attrName':'', 'desc':'文字边框', 'class':'TpBdr')
|
||||
,('field':'Collapsed','name':'w15:collapsed','obj':Collapsed,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'段落格式是否默认折叠', 'class':'')
|
||||
,('field':'TopLinePunct','name':'w:topLinePunct','obj':TopLinePunct,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'行首标点符号是否改为半角字符', 'class':'')
|
||||
,('field':'OverflowPunct','name':'w:overflowPunct','obj':OverflowPunct,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'是否启用悬挂式标点', 'class':'')
|
||||
,('field':'Kinsoku','name':'w:kinsoku','obj':Kinsoku,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'是否应用东亚语言文字的换行规则', 'class':'')
|
||||
,('field':'SuppressAutoHyphens','name':'w:suppressAutoHyphens','obj':SuppressAutoHyphens,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'段落不自动断字', 'class':'')
|
||||
,('field':'SuppressLineNumbers','name':'w:suppressLineNumbers','obj':SuppressLineNumbers,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'取消段落的行号', 'class':'')
|
||||
,('field':'MirrorIndents','name':'w:mirrorIndents','obj':MirrorIndents,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'是否左右缩进宽度相同', 'class':'')
|
||||
,('field':'Bidi','name':'w:bidi','obj':Bidi,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'设置指定段落的读取次序而不改变其对齐方式', 'class':'')
|
||||
,('field':'Shading','name':Shading.NodeName,'obj':Shading,'attrEx':'','nodeType':'','attrName':'', 'desc':'表头底纹', 'class':'TwShading')
|
||||
,('field':'TextboxTightWrap','name':'w:textboxTightWrap','obj':TextboxTightWrap,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'文本环绕形状或文本框的紧密程度', 'class':'')
|
||||
,('field':'WordWrap','name':'w:wordWrap','obj':WordWrap,'attrEx':'w:val','nodeType':'','attrName':'', 'desc':'是否在指定段落或文本框架的西文单词中间断字换行', 'class':'')
|
||||
) union ExtNodes;
|
||||
End;
|
||||
|
||||
|
|
@ -6063,8 +6087,10 @@ type TwpPr=class(NodeInfo)
|
|||
LineSpacing;
|
||||
AfterLines;
|
||||
SpaceAfter;
|
||||
SpaceAfterAuto;
|
||||
BeforeLines;
|
||||
SpaceBefore;
|
||||
SpaceBeforeAuto;
|
||||
OutlineLevel;
|
||||
KeepTogether;
|
||||
KeepWithNext;
|
||||
|
|
@ -6080,6 +6106,17 @@ type TwpPr=class(NodeInfo)
|
|||
cnfStyle;
|
||||
textFlow;
|
||||
Bdr;
|
||||
Collapsed;
|
||||
TopLinePunct;
|
||||
OverflowPunct;
|
||||
Kinsoku;
|
||||
SuppressAutoHyphens;
|
||||
SuppressLineNumbers;
|
||||
MirrorIndents;
|
||||
Bidi;
|
||||
Shading;
|
||||
TextboxTightWrap;
|
||||
WordWrap;
|
||||
End;
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
|
@ -8535,7 +8572,7 @@ type TwBorder=class(NodeInfo)
|
|||
|
||||
Function GetAttrs(); override;
|
||||
Begin
|
||||
return array(("Val", "w:val", Val, "指定边框样式."),("Color", "w:color", Color, "边框颜色."),("ThemeColor", "w:themeColor", ThemeColor, "边框主题颜色."),("ThemeTint", "w:themeTint", ThemeTint, "指定应用于此边框实例提供的主题颜色(如果有)的色调值."),("Size", "w:sz", Size, "边框宽度."),("Frame", "w:frame", Frame, "指定是否应修改指定的边框,以通过将边框外观从离文本最近的边缘反转到离文本最远的边缘来创建框架效果."),("Shadow", "w:shadow", Shadow, "边框阴影."),("Space", "w:space", Space, "放置此边框的间距偏移."),("ThemeShade", "w:themeShade", ThemeShade, "边框阴影的主题颜色.")) union ExtAttr;
|
||||
return array(("Val", "w:val", Val, "指定边框样式."),("Color", "w:color", Color, "边框颜色."),("ThemeColor", "w:themeColor", ThemeColor, "边框主题颜色."),("ThemeTint", "w:themeTint", ThemeTint, "指定应用于此边框实例提供的主题颜色(如果有)的色调值."),("Size", "w:sz", Size, "边框宽度."),("Frame", "w:frame", Frame, "指定是否应修改指定的边框,以通过将边框外观从离文本最近的边缘反转到离文本最远的边缘来创建框架效果."),("Shadow", "w:shadow", Shadow, "边框阴影."),("Space", "w:space", Space, "放置此边框的间距偏移."),("ThemeShade", "w:themeShade", ThemeShade, "边框阴影的主题颜色."),("bar", "w:bar", bar, "边框属性")) union ExtAttr;
|
||||
End;
|
||||
|
||||
Function GetChildren(); override;
|
||||
|
|
@ -8553,6 +8590,7 @@ type TwBorder=class(NodeInfo)
|
|||
Shadow;
|
||||
Space;
|
||||
ThemeShade;
|
||||
bar;
|
||||
|
||||
//Nodes
|
||||
End;
|
||||
|
|
@ -9011,7 +9049,7 @@ type TpBdr=class(NodeInfo)
|
|||
left := new TwBorder(self, 'w:left');
|
||||
bottom := new TwBorder(self, 'w:bottom');
|
||||
right := new TwBorder(self, 'w:right');
|
||||
bar := new TwBorder(self, 'w:bar');
|
||||
Between := new TwBorder(self, 'w:between');
|
||||
//TODO...
|
||||
End;
|
||||
|
||||
|
|
@ -9022,7 +9060,7 @@ type TpBdr=class(NodeInfo)
|
|||
left.InitRootNode(node);
|
||||
bottom.InitRootNode(node);
|
||||
right.InitRootNode(node);
|
||||
bar.InitRootNode(node);
|
||||
Between.InitRootNode(node);
|
||||
End;
|
||||
|
||||
Function GetAttrs(); override;
|
||||
|
|
@ -9036,7 +9074,7 @@ type TpBdr=class(NodeInfo)
|
|||
,('field':'left','name':left.NodeName,'obj':left,'attrEx':'','nodeType':'','attrName':'', 'desc':'边框属性', 'class':'TwBorder')
|
||||
,('field':'bottom','name':bottom.NodeName,'obj':bottom,'attrEx':'','nodeType':'','attrName':'', 'desc':'边框属性', 'class':'TwBorder')
|
||||
,('field':'right','name':right.NodeName,'obj':right,'attrEx':'','nodeType':'','attrName':'', 'desc':'边框属性', 'class':'TwBorder')
|
||||
,('field':'bar','name':bar.NodeName,'obj':bar,'attrEx':'','nodeType':'','attrName':'', 'desc':'边框属性', 'class':'TwBorder')
|
||||
,('field':'Between','name':Between.NodeName,'obj':Between,'attrEx':'','nodeType':'','attrName':'', 'desc':'边框属性', 'class':'TwBorder')
|
||||
) union ExtNodes;
|
||||
End;
|
||||
|
||||
|
|
@ -9047,7 +9085,7 @@ type TpBdr=class(NodeInfo)
|
|||
left;
|
||||
bottom;
|
||||
right;
|
||||
bar;
|
||||
Between;
|
||||
End;
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
|
@ -11022,6 +11060,7 @@ Type TParagraph = Class(DocObject, TParagraphImpl)
|
|||
Begin
|
||||
if ifObj(node_) then
|
||||
begin
|
||||
if ifObj(node_.FirstChildElement("w:r")) then return false;
|
||||
sub_node := node_.FirstChildElement();
|
||||
if not ifObj(sub_node) then return true;
|
||||
// 兼容wps
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
// Version 1.5.2
|
||||
|
||||
// Version 1.5.3
|
||||
Type TSDocxFile = Class
|
||||
///Version: V1.0 2022-09-20
|
||||
///适用于 Microsoft Word docx格式文件
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
// Version 1.5.2
|
||||
|
||||
// Version 1.5.3
|
||||
Type TSXlsxFile = Class
|
||||
///Version: V1.0 2022-08-08
|
||||
///适用于 Microsoft Excel? 2007 及以上版本创建的电子表格文档。支持 XLSX / XLSM / XLTM / XLTX 等多种文档格式。
|
||||
|
|
@ -982,8 +981,6 @@ Type TSXlsxFile = Class
|
|||
return workbook_.GetRowOutlineLevel(class(TSXml).CurCodePageToUtf8(sheet), row);
|
||||
End;
|
||||
|
||||
///
|
||||
|
||||
///创建列的分级显示,根据给定的工作表、列名和分级参数创建组
|
||||
///sheet: string, 工作表名称
|
||||
///col: string, 列名
|
||||
|
|
|
|||
|
|
@ -108,7 +108,33 @@ Type xlsxWorkBook = Class
|
|||
Function SetCellValue(sheet, axis, val, opt);
|
||||
Begin
|
||||
o := GetSheetObj(sheet);
|
||||
if ifObj(o) then return o.SetCellValue(axis, val, opt);
|
||||
if ifObj(o) then
|
||||
begin
|
||||
if not o.CellIsExists(axis) and (ifnil(opt) or (istable(opt) and ifnil(opt['s']))) then
|
||||
begin
|
||||
[err, col, row] := CellNameToCoordinates(axis);
|
||||
xml := GetSheetXmlFile(sheet);
|
||||
cols_node := xml.FirstChildElement('worksheet').FirstChildElement('cols');
|
||||
if ifObj(cols_node) then
|
||||
begin
|
||||
col_node := cols_node.FirstChildElement();
|
||||
while ifObj(col_node) do
|
||||
begin
|
||||
min := strtoint(col_node.GetAttribute('min'));
|
||||
max := strtoint(col_node.GetAttribute('max'));
|
||||
style := col_node.GetAttribute('style');
|
||||
if col >= min and col <= max and style <> '' then
|
||||
begin
|
||||
if not istable(opt) then opt := array();
|
||||
opt['s'] := style;
|
||||
break;
|
||||
end
|
||||
col_node := col_node.NextElement();
|
||||
end
|
||||
end
|
||||
end
|
||||
ret := o.SetCellValue(axis, val, opt);
|
||||
end
|
||||
End;
|
||||
|
||||
Function GetCellRichText(sheet, axis);
|
||||
|
|
|
|||
Loading…
Reference in New Issue