diff --git a/TSVbaDocxHelp.docx b/TSVbaDocxHelp.docx index c54ac32..eabb5b7 100644 Binary files a/TSVbaDocxHelp.docx and b/TSVbaDocxHelp.docx differ diff --git a/docx/TSDocxCell.tsf b/docx/TSDocxCell.tsf index 0dd151e..cd795fe 100644 --- a/docx/TSDocxCell.tsf +++ b/docx/TSDocxCell.tsf @@ -394,7 +394,7 @@ End; Function TSDocxCell.WriteBottomPadding(value); Begin - tcpr_.CellMar.Bottom := 20 * bottom; + tcpr_.CellMar.Bottom := 20 * value; tcpr_.CellMar.BottomType := "dxa"; tcpr_.Update(); End; @@ -517,7 +517,7 @@ Function TSDocxCell.ReadHeight(); Begin trpr_obj := GetTrPrObject(); value := trpr_obj.Value("Height"); - return ifnil(value) ? 0 : value; + return ifnil(value) ? 0 : value / 20; End; Function TSDocxCell.WriteHeightRule(value); diff --git a/docx/TSDocxColumn.tsf b/docx/TSDocxColumn.tsf index b406f32..7c98e92 100644 --- a/docx/TSDocxColumn.tsf +++ b/docx/TSDocxColumn.tsf @@ -13,14 +13,14 @@ private cells_; public - // Properties + // Methods Function AutoFit(); Function Delete(); Function Select(); Function SetWidth(ColumnWidth, RulerStyle); Function Sort(ExcludeHeader, SortFieldType, SortOrder, CaseSensitive, BidiSort, IgnoreThe, IgnoreKashida, IgnoreDiacritics, IgnoreHe, LanguageID); - // Methods + // Properties property Borders read ReadBorders; property Cells read ReadCells; property Index read ReadIndex; diff --git a/docx/TSDocxColumns.tsf b/docx/TSDocxColumns.tsf index 49581ce..788b34f 100644 --- a/docx/TSDocxColumns.tsf +++ b/docx/TSDocxColumns.tsf @@ -68,16 +68,3 @@ Begin return table_.Cols(); End; -Function TSDocxColumns.WritePreferredWidthType(value); -Begin -End; -Function TSDocxColumns.ReadPreferredWidthType(); -Begin -End; - -Function TSDocxColumns.WritePreferredWidth(value); -Begin -End; -Function TSDocxColumns.ReadPreferredWidth(); -Begin -End; diff --git a/docx/TSDocxRange.tsf b/docx/TSDocxRange.tsf index 79aacf2..b7a1b01 100644 --- a/docx/TSDocxRange.tsf +++ b/docx/TSDocxRange.tsf @@ -399,45 +399,14 @@ Begin return table; end - psplit := function(direction); - begin - [flag, last_node, new_node] := self.BreakIntoParagraphs(direction); - if flag then - begin - document_.Paragraphs.AddParagraph(last_node, new_node, direction); - return array(flag, new_node); - end - else begin - paragraph := self.InsertNewParagraph(); - return array(flag, paragraph); - end - end - - case collapse_ of - TSDocxEnumerations.wdCollapseStart(): - [flag, paragraph] := ##psplit("before"); - - TSDocxEnumerations.wdCollapseEnd(): - [flag, paragraph] := ##psplit("after"); - - else begin - flag := true; - paragraph := range_obj_[range_obj_.Size()-1].TParagraph.Root(); - clear_flag := true; - end - end; + paragraph := self.InsertNewParagraph(); + node := paragraph.Object().Root(); data := nils(numRows, numColumns); ttable := docx_.CreateTable(data); - if flag then - begin - table := ##padd_table(ttable, paragraph); - document_.Paragraphs.AddTableToParagraphs(paragraph, table); - end - else begin - table := ##padd_table(ttable, paragraph.Object().Root()); - paragraph.Range.Clear(true); - end - if clear_flag then self.Clear(true); + table := ##padd_table(ttable, node); + document_.Paragraphs.AddTableToParagraphs(node, table); + paragraph.Range.Clear(true); + if ifnil(collapse_) then self.Clear(true); return table; End; @@ -552,11 +521,12 @@ Begin else begin range_obj_.Clear(); index := 0; + flag := 1; end end; range_obj_.SplitRun(index); tparagraph := range_obj_[index].TParagraph; - run := tparagraph.PrependRun(range_obj_[index].TRun); + run := flag = 1 ? range_obj_[0].TRun : tparagraph.PrependRun(range_obj_[index].TRun); run.Br.Type := t; run.Br.Clear := c; run.Apply(); diff --git a/docx/TSDocxTable.tsf b/docx/TSDocxTable.tsf index 0b30716..7ec5b3b 100644 --- a/docx/TSDocxTable.tsf +++ b/docx/TSDocxTable.tsf @@ -166,7 +166,7 @@ End; Function TSDocxTable.Cell(Row, Column); Begin - cell_obj := new TSDocxCell(self.Application, self.Creator, self.Parent); + cell_obj := new TSDocxCell(self.Application, self.Creator, self); cell_obj.Init(docx_, table_, Row, Column); return cell_obj; End; diff --git a/docx/utils/TSWdRange.tsf b/docx/utils/TSWdRange.tsf index 0c87c6e..b1cac0e 100644 --- a/docx/utils/TSWdRange.tsf +++ b/docx/utils/TSWdRange.tsf @@ -145,7 +145,7 @@ End; Function TSWdRange.Refresh(); Begin - if target_node_ then self.FindRangeByNode(target_node_); + self.Init(); End; Function TSWdRange.Size();