From 4cac47522a9778d73a944baa331142496a8b2d22 Mon Sep 17 00:00:00 2001 From: csh Date: Tue, 6 Feb 2024 14:15:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Drange=E6=9F=90=E4=BA=9B?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E8=8E=B7=E5=8F=96=E5=A4=B1=E8=B4=A5=E7=88=86?= =?UTF-8?q?=E6=A0=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docx/TSDocxRange.tsf | 1 + .../paragraphformat/TSDocxParagraphFormat.tsf | 2 +- .../TSDocxParagraphFormatRange.tsf | 76 +++++++++---------- 3 files changed, 40 insertions(+), 39 deletions(-) diff --git a/docx/TSDocxRange.tsf b/docx/TSDocxRange.tsf index 012aa1f..f12e642 100644 --- a/docx/TSDocxRange.tsf +++ b/docx/TSDocxRange.tsf @@ -729,6 +729,7 @@ End; Function TSDocxRange.WriteStyle(value); Begin paragraph_format_range_.Style := value; + paragraph_format_range_.Apply(); End; Function TSDocxRange.ReadStyle(); Begin diff --git a/docx/paragraphformat/TSDocxParagraphFormat.tsf b/docx/paragraphformat/TSDocxParagraphFormat.tsf index b8c2c57..7b96825 100644 --- a/docx/paragraphformat/TSDocxParagraphFormat.tsf +++ b/docx/paragraphformat/TSDocxParagraphFormat.tsf @@ -271,7 +271,7 @@ Function TSDocxParagraphFormat.WriteStyle(value);virtual; Begin obj := docx_.StyleObject().GetStyle(value); if not obj then obj := docx_.StyleObject().AddDefaultStyle(value); - pr_.StyleId := obj.StyleId; + pr_.StyleId := ifObj(obj) ? obj.StyleId : nil; End; Function TSDocxParagraphFormat.ReadStyle();virtual; Begin diff --git a/docx/paragraphformat/TSDocxParagraphFormatRange.tsf b/docx/paragraphformat/TSDocxParagraphFormatRange.tsf index b6e0cc4..3a7ad7b 100644 --- a/docx/paragraphformat/TSDocxParagraphFormatRange.tsf +++ b/docx/paragraphformat/TSDocxParagraphFormatRange.tsf @@ -213,7 +213,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadWordWrap();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadWordWrap)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadWordWrap)); End; Function TSDocxParagraphFormatRange.WriteWidowControl(value);override; @@ -222,7 +222,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadWidowControl();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadWidowControl)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadWidowControl)); End; Function TSDocxParagraphFormatRange.WriteTextboxTightWrap(value);override; @@ -231,7 +231,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadTextboxTightWrap();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadTextboxTightWrap)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadTextboxTightWrap)); End; Function TSDocxParagraphFormatRange.WriteTabStops(value);override; @@ -240,7 +240,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadTabStops();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadTabStops)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadTabStops)); End; Function TSDocxParagraphFormatRange.WriteStyle(value);override; @@ -249,7 +249,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadStyle();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadStyle)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadStyle)); End; Function TSDocxParagraphFormatRange.WriteSpaceBeforeAuto(value);override; @@ -258,7 +258,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadSpaceBeforeAuto();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadSpaceBeforeAuto)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadSpaceBeforeAuto)); End; Function TSDocxParagraphFormatRange.WriteSpaceBefore(value);override; @@ -267,7 +267,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadSpaceBefore();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadSpaceBefore)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadSpaceBefore)); End; Function TSDocxParagraphFormatRange.WriteSpaceAfterAuto(value);override; @@ -276,7 +276,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadSpaceAfterAuto();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadSpaceAfterAuto)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadSpaceAfterAuto)); End; Function TSDocxParagraphFormatRange.WriteSpaceAfter(value);override; @@ -285,7 +285,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadSpaceAfter();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadSpaceAfter)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadSpaceAfter)); End; // TODO @@ -299,7 +299,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadRightIndent();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadRightIndent)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadRightIndent)); End; Function TSDocxParagraphFormatRange.WriteReadingOrder(value);override; @@ -308,7 +308,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadReadingOrder();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadReadingOrder)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadReadingOrder)); End; Function TSDocxParagraphFormatRange.WritePageBreakBefore(value);override; @@ -317,7 +317,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadPageBreakBefore();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadPageBreakBefore)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadPageBreakBefore)); End; Function TSDocxParagraphFormatRange.WriteOutlineLevel(value);override; @@ -326,7 +326,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadOutlineLevel();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadOutlineLevel)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadOutlineLevel)); End; Function TSDocxParagraphFormatRange.WriteNoLineNumber(value);override; @@ -335,7 +335,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadNoLineNumber();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadNoLineNumber)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadNoLineNumber)); End; Function TSDocxParagraphFormatRange.WriteMirrorIndents(value);override; @@ -344,7 +344,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadMirrorIndents();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadMirrorIndents)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadMirrorIndents)); End; Function TSDocxParagraphFormatRange.WriteLineUnitBefore(value);override; @@ -353,7 +353,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadLineUnitBefore();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadLineUnitBefore)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadLineUnitBefore)); End; Function TSDocxParagraphFormatRange.WriteLineUnitAfter(value);override; @@ -362,7 +362,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadLineUnitAfter();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadLineUnitAfter)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadLineUnitAfter)); End; Function TSDocxParagraphFormatRange.WriteLineSpacingRule(value);override; @@ -371,7 +371,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadLineSpacingRule();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadLineSpacingRule)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadLineSpacingRule)); End; Function TSDocxParagraphFormatRange.WriteLineSpacing(value);override; @@ -380,7 +380,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadLineSpacing();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadLineSpacing)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadLineSpacing)); End; Function TSDocxParagraphFormatRange.WriteLeftIndent(value);override; @@ -389,7 +389,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadLeftIndent();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadLeftIndent)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadLeftIndent)); End; Function TSDocxParagraphFormatRange.WriteKeepWithNext(value);override; @@ -398,7 +398,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadKeepWithNext();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadKeepWithNext)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadKeepWithNext)); End; Function TSDocxParagraphFormatRange.WriteKeepTogether(value);override; @@ -407,7 +407,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadKeepTogether();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadKeepTogether)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadKeepTogether)); End; Function TSDocxParagraphFormatRange.WriteHyphenation(value);override; @@ -416,7 +416,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadHyphenation();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadHyphenation)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadHyphenation)); End; Function TSDocxParagraphFormatRange.WriteHangingPunctuation(value);override; @@ -425,7 +425,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadHangingPunctuation();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadHangingPunctuation)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadHangingPunctuation)); End; Function TSDocxParagraphFormatRange.WriteHalfWidthPunctuationOnTopOfLine(value);override; @@ -434,7 +434,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadHalfWidthPunctuationOnTopOfLine();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadHalfWidthPunctuationOnTopOfLine)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadHalfWidthPunctuationOnTopOfLine)); End; Function TSDocxParagraphFormatRange.WriteFirstLineIndent(value);override; @@ -443,7 +443,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadFirstLineIndent();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadFirstLineIndent)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadFirstLineIndent)); End; Function TSDocxParagraphFormatRange.WriteFarEastLineBreakControl(value);override; @@ -452,12 +452,12 @@ Begin End; Function TSDocxParagraphFormatRange.ReadFarEastLineBreakControl();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadFarEastLineBreakControl)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadFarEastLineBreakControl)); End; Function TSDocxParagraphFormatRange.ReadDuplicate();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadDuplicate)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadDuplicate)); End; Function TSDocxParagraphFormatRange.WriteDisableLineHeightGrid(value);override; @@ -466,7 +466,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadDisableLineHeightGrid();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadDisableLineHeightGrid)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadDisableLineHeightGrid)); End; Function TSDocxParagraphFormatRange.WriteCollapsedByDefault(value);override; @@ -475,7 +475,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadCollapsedByDefault();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadCollapsedByDefault)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadCollapsedByDefault)); End; Function TSDocxParagraphFormatRange.WriteCharacterUnitRightIndent(value);override; @@ -484,7 +484,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadCharacterUnitRightIndent();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadCharacterUnitRightIndent)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadCharacterUnitRightIndent)); End; Function TSDocxParagraphFormatRange.WriteCharacterUnitLeftIndent(value);override; @@ -493,7 +493,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadCharacterUnitLeftIndent();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadCharacterUnitLeftIndent)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadCharacterUnitLeftIndent)); End; Function TSDocxParagraphFormatRange.WriteCharacterUnitFirstLineIndent(value);override; @@ -502,7 +502,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadCharacterUnitFirstLineIndent();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadCharacterUnitFirstLineIndent)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadCharacterUnitFirstLineIndent)); End; Function TSDocxParagraphFormatRange.ReadBorders(index);override; @@ -522,7 +522,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadBaseLineAlignment();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadBaseLineAlignment)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadBaseLineAlignment)); End; Function TSDocxParagraphFormatRange.WriteAutoAdjustRightIndent(value);override; @@ -531,7 +531,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadAutoAdjustRightIndent();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadAutoAdjustRightIndent)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadAutoAdjustRightIndent)); End; Function TSDocxParagraphFormatRange.WriteAlignment(value);override; @@ -540,7 +540,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadAlignment();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadAlignment)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadAlignment)); End; Function TSDocxParagraphFormatRange.WriteAddSpaceBetweenFarEastAndDigit(value);override; @@ -549,7 +549,7 @@ Begin End; Function TSDocxParagraphFormatRange.ReadAddSpaceBetweenFarEastAndDigit();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadAddSpaceBetweenFarEastAndDigit)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadAddSpaceBetweenFarEastAndDigit)); End; Function TSDocxParagraphFormatRange.WriteAddSpaceBetweenFarEastAndAlpha(value);override; @@ -558,6 +558,6 @@ Begin End; Function TSDocxParagraphFormatRange.ReadAddSpaceBetweenFarEastAndAlpha();override; Begin - return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadAddSpaceBetweenFarEastAndAlpha)); + return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadAddSpaceBetweenFarEastAndAlpha)); End;