修复font属性

This commit is contained in:
csh 2024-02-22 18:47:17 +08:00
parent e917dce1df
commit dbebc2805c
3 changed files with 12 additions and 8 deletions

View File

@ -620,20 +620,24 @@ End;
Function TSDocxFont.WriteSubscript(value);virtual;
Begin
pr_.VertAlign := "subscript";
if value then pr_.VertAlign := "subscript";
else if self.Subscript then pr_.VertAlign := "none";
End;
Function TSDocxFont.ReadSubscript();virtual;
Begin
return pr_.Value("VertAlign");
val := pr_.Value("VertAlign");
return val = "subscript";
End;
Function TSDocxFont.WriteSuperscript(value);virtual;
Begin
pr_.VertAlign := "supercript";
if value then pr_.VertAlign := "supercript";
else if self.Superscript then pr_.VertAlign := "none";
End;
Function TSDocxFont.ReadSuperscript();virtual;
Begin
return pr_.Value("VertAlign");
val := pr_.Value("VertAlign");
return val = "supercript";
End;
Function TSDocxFont.WriteUnderline(value);virtual;
@ -725,6 +729,6 @@ Begin
End;
Function TSDocxFont.ReadUnderlineColor();virtual;
Begin
return color_[pr_.Value("UColor")];
return color_[pr_.Value("UColor", true)];
End;

View File

@ -67,7 +67,7 @@ Begin
hash2 := hash;
for k, v in hash do
hash2[v] := k;
hash2[nil] := TSDocxEnumerations.wdColorAutomatic();
if ifnil(hash2[nil]) then hash2[nil] := TSDocxEnumerations.wdColorAutomatic();
return hash2;

View File

@ -26,7 +26,7 @@ Begin
hash2 := hash;
for k, v in hash do
hash2[v] := k;
hash2[nil] := TSDocxEnumerations.wdAuto();
if ifnil(hash[nil]) then hash2[nil] := TSDocxEnumerations.wdAuto();
return hash2;