v1.3.7
This commit is contained in:
parent
880e03c41a
commit
ced0d6b04c
|
|
@ -1,4 +1,4 @@
|
|||
// Version 1.3.6
|
||||
// Version 1.3.7
|
||||
|
||||
Function TOfficeObj(n);
|
||||
Begin
|
||||
|
|
@ -14237,12 +14237,13 @@ Type TCell = Class(TDocumentBody, TWTc)
|
|||
Function Create(node);overload;
|
||||
Begin
|
||||
Class(TDocumentBody).Create(node);
|
||||
Create(nil, 'w:tc');
|
||||
Create(node, 'w:tc');
|
||||
End;
|
||||
|
||||
Function Create(pNode, name);overload;
|
||||
Begin
|
||||
Class(TWTc).Create(pNode, 'w:tc');
|
||||
Class(TWTc).Create(nil, 'w:tc');
|
||||
InitRootNode(pNode);
|
||||
name_ := 'w:tc';
|
||||
mergeSpan_ := 0;
|
||||
pPr_ := new TwpPr();
|
||||
|
|
@ -14445,23 +14446,6 @@ Type TTable = Class(DocObject, TTableImpl)
|
|||
TblGrid.GridCol := gridArr;
|
||||
End;
|
||||
|
||||
Function RowHeight(row, height);
|
||||
Begin
|
||||
if row <= 0 or row > Rows() then return;
|
||||
node := node_.FirstChildElement('w:tr');
|
||||
cnt := row - 1;
|
||||
while(cnt) do
|
||||
begin
|
||||
node := node.NextElement('w:tr');
|
||||
cnt--;
|
||||
end
|
||||
trnode := node.FirstChildElement("w:trPr");
|
||||
if not ifObj(trnode) then trnode := node.InsertFirstChild('element', 'w:trPr');
|
||||
node := trnode.FirstChildElement('w:trHeight');
|
||||
if not ifObj(node) then node := trnode.InsertFirstChild('element', 'w:trHeight');
|
||||
node.SetAttribute('w:val', height);
|
||||
End;
|
||||
|
||||
Property Format read readFormat;
|
||||
Function readFormat();
|
||||
Begin
|
||||
|
|
@ -14519,6 +14503,45 @@ Type TTable = Class(DocObject, TTableImpl)
|
|||
TblGrid.GridCol[n-1]['obj'].W := wth;
|
||||
End;
|
||||
|
||||
/// 设置行高
|
||||
Function RowHeight(row, height);
|
||||
Begin
|
||||
if row <= 0 or row > Rows() then return;
|
||||
node := node_.FirstChildElement('w:tr');
|
||||
cnt := row - 1;
|
||||
while(cnt) do
|
||||
begin
|
||||
node := node.NextElement('w:tr');
|
||||
cnt--;
|
||||
end
|
||||
trnode := node.FirstChildElement("w:trPr");
|
||||
if not ifObj(trnode) then trnode := node.InsertFirstChild('element', 'w:trPr');
|
||||
node := trnode.FirstChildElement('w:trHeight');
|
||||
if not ifObj(node) then node := trnode.InsertFirstChild('element', 'w:trHeight');
|
||||
node.SetAttribute('w:val', height);
|
||||
End;
|
||||
|
||||
Function Height(row);
|
||||
Begin
|
||||
if row <= 0 or row > Rows() then return nil;
|
||||
node := node_.FirstChildElement('w:tr');
|
||||
cnt := row - 1;
|
||||
while(cnt) do
|
||||
begin
|
||||
node := node.NextElement('w:tr');
|
||||
cnt--;
|
||||
end
|
||||
obj := new TwTr();
|
||||
obj.InitRootNode(node);
|
||||
return obj.TrPr.Value('Height');
|
||||
End;
|
||||
|
||||
Function Width(col);
|
||||
Begin
|
||||
obj := Cell(1, col);
|
||||
return obj.Format.Value('Width');
|
||||
End;
|
||||
|
||||
///合并单元格
|
||||
///del: bool,是否删除其它单元格内容(只保留左上单元格内容)
|
||||
Function Merge(top, left, bottom, right, del);overload;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Version 1.3.6
|
||||
// Version 1.3.7
|
||||
|
||||
Type TSDocxFile = Class
|
||||
///Version: V1.0 2022-09-20
|
||||
|
|
@ -49,6 +49,7 @@ Type TSDocxFile = Class
|
|||
Function OpenFile(alias, fname, passwd);
|
||||
Begin
|
||||
if not ifObj(zipfile_) then return array(-1, 'Create ZipFile object fail.');
|
||||
if zipfile_.FilesCount() > 0 then zipfile_ := new ZipFile();
|
||||
[err, errmsg] := zipfile_.Open(alias, fname, passwd);
|
||||
if err=0 then Begin
|
||||
document_ := new docxDocument(zipfile_);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// Version 1.3.6
|
||||
// Version 1.3.7
|
||||
|
||||
Type TSExcelFile = Class
|
||||
///Version: V1.0 2022-08-08
|
||||
|
|
@ -49,8 +49,8 @@ Type TSExcelFile = Class
|
|||
///返回: [err, errmsg]
|
||||
Function OpenFile(alias, fname, passwd);
|
||||
Begin
|
||||
init();
|
||||
if not ifObj(zipfile_) then return array(-1, 'Create ZipFile object fail.');
|
||||
if zipfile_.FilesCount() > 0 then zipfile_ := new ZipFile();
|
||||
[err, errmsg] := zipfile_.Open(alias, fname, passwd);
|
||||
if err=0 then Begin
|
||||
workbook_ := new xlsxWorkBook(zipfile_);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
Type NodeInfo = class
|
||||
|
||||
public
|
||||
Function Create(p, name);
|
||||
Function Create(parentObj, name);
|
||||
Begin
|
||||
if ifObj(p) then
|
||||
NodeUri := p.NodeUri = '' ? name : (p.NodeUri + '/' + name);
|
||||
if ifObj(parentObj) then
|
||||
NodeUri := parentObj.NodeUri = '' ? name : (parentObj.NodeUri + '/' + name);
|
||||
else
|
||||
NodeUri := '';
|
||||
NodeName := name;
|
||||
|
|
@ -270,7 +270,7 @@ public
|
|||
ExtNodes;
|
||||
//Parent;
|
||||
ReplaceArr;
|
||||
RootObj;
|
||||
RootObj; // xml node
|
||||
NodeUri:string;
|
||||
children_;
|
||||
End
|
||||
|
|
|
|||
Loading…
Reference in New Issue