修复range某些属性获取失败爆栈问题

This commit is contained in:
csh 2024-02-06 14:15:45 +08:00
parent 5196e6424c
commit 4cac47522a
3 changed files with 40 additions and 39 deletions

View File

@ -729,6 +729,7 @@ End;
Function TSDocxRange.WriteStyle(value);
Begin
paragraph_format_range_.Style := value;
paragraph_format_range_.Apply();
End;
Function TSDocxRange.ReadStyle();
Begin

View File

@ -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

View File

@ -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;