修复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); Function TSDocxRange.WriteStyle(value);
Begin Begin
paragraph_format_range_.Style := value; paragraph_format_range_.Style := value;
paragraph_format_range_.Apply();
End; End;
Function TSDocxRange.ReadStyle(); Function TSDocxRange.ReadStyle();
Begin Begin

View File

@ -271,7 +271,7 @@ Function TSDocxParagraphFormat.WriteStyle(value);virtual;
Begin Begin
obj := docx_.StyleObject().GetStyle(value); obj := docx_.StyleObject().GetStyle(value);
if not obj then obj := docx_.StyleObject().AddDefaultStyle(value); if not obj then obj := docx_.StyleObject().AddDefaultStyle(value);
pr_.StyleId := obj.StyleId; pr_.StyleId := ifObj(obj) ? obj.StyleId : nil;
End; End;
Function TSDocxParagraphFormat.ReadStyle();virtual; Function TSDocxParagraphFormat.ReadStyle();virtual;
Begin Begin

View File

@ -213,7 +213,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadWordWrap();override; Function TSDocxParagraphFormatRange.ReadWordWrap();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadWordWrap)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadWordWrap));
End; End;
Function TSDocxParagraphFormatRange.WriteWidowControl(value);override; Function TSDocxParagraphFormatRange.WriteWidowControl(value);override;
@ -222,7 +222,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadWidowControl();override; Function TSDocxParagraphFormatRange.ReadWidowControl();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadWidowControl)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadWidowControl));
End; End;
Function TSDocxParagraphFormatRange.WriteTextboxTightWrap(value);override; Function TSDocxParagraphFormatRange.WriteTextboxTightWrap(value);override;
@ -231,7 +231,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadTextboxTightWrap();override; Function TSDocxParagraphFormatRange.ReadTextboxTightWrap();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadTextboxTightWrap)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadTextboxTightWrap));
End; End;
Function TSDocxParagraphFormatRange.WriteTabStops(value);override; Function TSDocxParagraphFormatRange.WriteTabStops(value);override;
@ -240,7 +240,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadTabStops();override; Function TSDocxParagraphFormatRange.ReadTabStops();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadTabStops)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadTabStops));
End; End;
Function TSDocxParagraphFormatRange.WriteStyle(value);override; Function TSDocxParagraphFormatRange.WriteStyle(value);override;
@ -249,7 +249,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadStyle();override; Function TSDocxParagraphFormatRange.ReadStyle();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadStyle)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadStyle));
End; End;
Function TSDocxParagraphFormatRange.WriteSpaceBeforeAuto(value);override; Function TSDocxParagraphFormatRange.WriteSpaceBeforeAuto(value);override;
@ -258,7 +258,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadSpaceBeforeAuto();override; Function TSDocxParagraphFormatRange.ReadSpaceBeforeAuto();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadSpaceBeforeAuto)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadSpaceBeforeAuto));
End; End;
Function TSDocxParagraphFormatRange.WriteSpaceBefore(value);override; Function TSDocxParagraphFormatRange.WriteSpaceBefore(value);override;
@ -267,7 +267,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadSpaceBefore();override; Function TSDocxParagraphFormatRange.ReadSpaceBefore();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadSpaceBefore)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadSpaceBefore));
End; End;
Function TSDocxParagraphFormatRange.WriteSpaceAfterAuto(value);override; Function TSDocxParagraphFormatRange.WriteSpaceAfterAuto(value);override;
@ -276,7 +276,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadSpaceAfterAuto();override; Function TSDocxParagraphFormatRange.ReadSpaceAfterAuto();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadSpaceAfterAuto)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadSpaceAfterAuto));
End; End;
Function TSDocxParagraphFormatRange.WriteSpaceAfter(value);override; Function TSDocxParagraphFormatRange.WriteSpaceAfter(value);override;
@ -285,7 +285,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadSpaceAfter();override; Function TSDocxParagraphFormatRange.ReadSpaceAfter();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadSpaceAfter)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadSpaceAfter));
End; End;
// TODO // TODO
@ -299,7 +299,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadRightIndent();override; Function TSDocxParagraphFormatRange.ReadRightIndent();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadRightIndent)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadRightIndent));
End; End;
Function TSDocxParagraphFormatRange.WriteReadingOrder(value);override; Function TSDocxParagraphFormatRange.WriteReadingOrder(value);override;
@ -308,7 +308,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadReadingOrder();override; Function TSDocxParagraphFormatRange.ReadReadingOrder();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadReadingOrder)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadReadingOrder));
End; End;
Function TSDocxParagraphFormatRange.WritePageBreakBefore(value);override; Function TSDocxParagraphFormatRange.WritePageBreakBefore(value);override;
@ -317,7 +317,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadPageBreakBefore();override; Function TSDocxParagraphFormatRange.ReadPageBreakBefore();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadPageBreakBefore)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadPageBreakBefore));
End; End;
Function TSDocxParagraphFormatRange.WriteOutlineLevel(value);override; Function TSDocxParagraphFormatRange.WriteOutlineLevel(value);override;
@ -326,7 +326,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadOutlineLevel();override; Function TSDocxParagraphFormatRange.ReadOutlineLevel();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadOutlineLevel)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadOutlineLevel));
End; End;
Function TSDocxParagraphFormatRange.WriteNoLineNumber(value);override; Function TSDocxParagraphFormatRange.WriteNoLineNumber(value);override;
@ -335,7 +335,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadNoLineNumber();override; Function TSDocxParagraphFormatRange.ReadNoLineNumber();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadNoLineNumber)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadNoLineNumber));
End; End;
Function TSDocxParagraphFormatRange.WriteMirrorIndents(value);override; Function TSDocxParagraphFormatRange.WriteMirrorIndents(value);override;
@ -344,7 +344,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadMirrorIndents();override; Function TSDocxParagraphFormatRange.ReadMirrorIndents();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadMirrorIndents)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadMirrorIndents));
End; End;
Function TSDocxParagraphFormatRange.WriteLineUnitBefore(value);override; Function TSDocxParagraphFormatRange.WriteLineUnitBefore(value);override;
@ -353,7 +353,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadLineUnitBefore();override; Function TSDocxParagraphFormatRange.ReadLineUnitBefore();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadLineUnitBefore)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadLineUnitBefore));
End; End;
Function TSDocxParagraphFormatRange.WriteLineUnitAfter(value);override; Function TSDocxParagraphFormatRange.WriteLineUnitAfter(value);override;
@ -362,7 +362,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadLineUnitAfter();override; Function TSDocxParagraphFormatRange.ReadLineUnitAfter();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadLineUnitAfter)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadLineUnitAfter));
End; End;
Function TSDocxParagraphFormatRange.WriteLineSpacingRule(value);override; Function TSDocxParagraphFormatRange.WriteLineSpacingRule(value);override;
@ -371,7 +371,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadLineSpacingRule();override; Function TSDocxParagraphFormatRange.ReadLineSpacingRule();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadLineSpacingRule)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadLineSpacingRule));
End; End;
Function TSDocxParagraphFormatRange.WriteLineSpacing(value);override; Function TSDocxParagraphFormatRange.WriteLineSpacing(value);override;
@ -380,7 +380,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadLineSpacing();override; Function TSDocxParagraphFormatRange.ReadLineSpacing();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadLineSpacing)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadLineSpacing));
End; End;
Function TSDocxParagraphFormatRange.WriteLeftIndent(value);override; Function TSDocxParagraphFormatRange.WriteLeftIndent(value);override;
@ -389,7 +389,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadLeftIndent();override; Function TSDocxParagraphFormatRange.ReadLeftIndent();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadLeftIndent)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadLeftIndent));
End; End;
Function TSDocxParagraphFormatRange.WriteKeepWithNext(value);override; Function TSDocxParagraphFormatRange.WriteKeepWithNext(value);override;
@ -398,7 +398,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadKeepWithNext();override; Function TSDocxParagraphFormatRange.ReadKeepWithNext();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadKeepWithNext)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadKeepWithNext));
End; End;
Function TSDocxParagraphFormatRange.WriteKeepTogether(value);override; Function TSDocxParagraphFormatRange.WriteKeepTogether(value);override;
@ -407,7 +407,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadKeepTogether();override; Function TSDocxParagraphFormatRange.ReadKeepTogether();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadKeepTogether)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadKeepTogether));
End; End;
Function TSDocxParagraphFormatRange.WriteHyphenation(value);override; Function TSDocxParagraphFormatRange.WriteHyphenation(value);override;
@ -416,7 +416,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadHyphenation();override; Function TSDocxParagraphFormatRange.ReadHyphenation();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadHyphenation)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadHyphenation));
End; End;
Function TSDocxParagraphFormatRange.WriteHangingPunctuation(value);override; Function TSDocxParagraphFormatRange.WriteHangingPunctuation(value);override;
@ -425,7 +425,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadHangingPunctuation();override; Function TSDocxParagraphFormatRange.ReadHangingPunctuation();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadHangingPunctuation)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadHangingPunctuation));
End; End;
Function TSDocxParagraphFormatRange.WriteHalfWidthPunctuationOnTopOfLine(value);override; Function TSDocxParagraphFormatRange.WriteHalfWidthPunctuationOnTopOfLine(value);override;
@ -434,7 +434,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadHalfWidthPunctuationOnTopOfLine();override; Function TSDocxParagraphFormatRange.ReadHalfWidthPunctuationOnTopOfLine();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadHalfWidthPunctuationOnTopOfLine)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadHalfWidthPunctuationOnTopOfLine));
End; End;
Function TSDocxParagraphFormatRange.WriteFirstLineIndent(value);override; Function TSDocxParagraphFormatRange.WriteFirstLineIndent(value);override;
@ -443,7 +443,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadFirstLineIndent();override; Function TSDocxParagraphFormatRange.ReadFirstLineIndent();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadFirstLineIndent)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadFirstLineIndent));
End; End;
Function TSDocxParagraphFormatRange.WriteFarEastLineBreakControl(value);override; Function TSDocxParagraphFormatRange.WriteFarEastLineBreakControl(value);override;
@ -452,12 +452,12 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadFarEastLineBreakControl();override; Function TSDocxParagraphFormatRange.ReadFarEastLineBreakControl();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadFarEastLineBreakControl)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadFarEastLineBreakControl));
End; End;
Function TSDocxParagraphFormatRange.ReadDuplicate();override; Function TSDocxParagraphFormatRange.ReadDuplicate();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadDuplicate)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadDuplicate));
End; End;
Function TSDocxParagraphFormatRange.WriteDisableLineHeightGrid(value);override; Function TSDocxParagraphFormatRange.WriteDisableLineHeightGrid(value);override;
@ -466,7 +466,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadDisableLineHeightGrid();override; Function TSDocxParagraphFormatRange.ReadDisableLineHeightGrid();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadDisableLineHeightGrid)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadDisableLineHeightGrid));
End; End;
Function TSDocxParagraphFormatRange.WriteCollapsedByDefault(value);override; Function TSDocxParagraphFormatRange.WriteCollapsedByDefault(value);override;
@ -475,7 +475,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadCollapsedByDefault();override; Function TSDocxParagraphFormatRange.ReadCollapsedByDefault();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadCollapsedByDefault)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadCollapsedByDefault));
End; End;
Function TSDocxParagraphFormatRange.WriteCharacterUnitRightIndent(value);override; Function TSDocxParagraphFormatRange.WriteCharacterUnitRightIndent(value);override;
@ -484,7 +484,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadCharacterUnitRightIndent();override; Function TSDocxParagraphFormatRange.ReadCharacterUnitRightIndent();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadCharacterUnitRightIndent)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadCharacterUnitRightIndent));
End; End;
Function TSDocxParagraphFormatRange.WriteCharacterUnitLeftIndent(value);override; Function TSDocxParagraphFormatRange.WriteCharacterUnitLeftIndent(value);override;
@ -493,7 +493,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadCharacterUnitLeftIndent();override; Function TSDocxParagraphFormatRange.ReadCharacterUnitLeftIndent();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadCharacterUnitLeftIndent)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadCharacterUnitLeftIndent));
End; End;
Function TSDocxParagraphFormatRange.WriteCharacterUnitFirstLineIndent(value);override; Function TSDocxParagraphFormatRange.WriteCharacterUnitFirstLineIndent(value);override;
@ -502,7 +502,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadCharacterUnitFirstLineIndent();override; Function TSDocxParagraphFormatRange.ReadCharacterUnitFirstLineIndent();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadCharacterUnitFirstLineIndent)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadCharacterUnitFirstLineIndent));
End; End;
Function TSDocxParagraphFormatRange.ReadBorders(index);override; Function TSDocxParagraphFormatRange.ReadBorders(index);override;
@ -522,7 +522,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadBaseLineAlignment();override; Function TSDocxParagraphFormatRange.ReadBaseLineAlignment();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadBaseLineAlignment)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadBaseLineAlignment));
End; End;
Function TSDocxParagraphFormatRange.WriteAutoAdjustRightIndent(value);override; Function TSDocxParagraphFormatRange.WriteAutoAdjustRightIndent(value);override;
@ -531,7 +531,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadAutoAdjustRightIndent();override; Function TSDocxParagraphFormatRange.ReadAutoAdjustRightIndent();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadAutoAdjustRightIndent)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadAutoAdjustRightIndent));
End; End;
Function TSDocxParagraphFormatRange.WriteAlignment(value);override; Function TSDocxParagraphFormatRange.WriteAlignment(value);override;
@ -540,7 +540,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadAlignment();override; Function TSDocxParagraphFormatRange.ReadAlignment();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadAlignment)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadAlignment));
End; End;
Function TSDocxParagraphFormatRange.WriteAddSpaceBetweenFarEastAndDigit(value);override; Function TSDocxParagraphFormatRange.WriteAddSpaceBetweenFarEastAndDigit(value);override;
@ -549,7 +549,7 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadAddSpaceBetweenFarEastAndDigit();override; Function TSDocxParagraphFormatRange.ReadAddSpaceBetweenFarEastAndDigit();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadAddSpaceBetweenFarEastAndDigit)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadAddSpaceBetweenFarEastAndDigit));
End; End;
Function TSDocxParagraphFormatRange.WriteAddSpaceBetweenFarEastAndAlpha(value);override; Function TSDocxParagraphFormatRange.WriteAddSpaceBetweenFarEastAndAlpha(value);override;
@ -558,6 +558,6 @@ Begin
End; End;
Function TSDocxParagraphFormatRange.ReadAddSpaceBetweenFarEastAndAlpha();override; Function TSDocxParagraphFormatRange.ReadAddSpaceBetweenFarEastAndAlpha();override;
Begin Begin
return CallFunction(ThisFunction(class(TSDocxParagraphFormatRange).ReadAddSpaceBetweenFarEastAndAlpha)); return CallFunction(ThisFunction(class(TSDocxParagraphFormat).ReadAddSpaceBetweenFarEastAndAlpha));
End; End;