Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Html to wml enhancements #2

Open
wants to merge 2 commits into
base: vNext
Choose a base branch
from

Conversation

kostadinSpiridonov
Copy link

No description provided.

@@ -2829,9 +2829,9 @@ private static XElement[] GetSpacingProperties(XElement paragraph, HtmlToWmlConv
// todo should check based on display property
bool numItem = paragraph.Name == XhtmlNoNamespace.li;

if (numItem && marginTopProperty.IsAuto)
if (numItem && marginTopProperty != null && marginTopProperty.IsAuto)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use
`if (numItem && marginTopProperty?.IsAuto)'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason is that numItem is 'bool', but marginTopProperty?.IsAuto is 'bool?' , so '&&' operator cannot be applied to 'bool' and 'bool?'.

Thank you for your review!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (numItem && marginTopProperty?.IsAuto == true)

beforeAutospacing = "1";
if (numItem && marginBottomProperty.IsAuto)
if (numItem && marginTopProperty != null && marginBottomProperty.IsAuto)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be marginBottomProperty != null (copy/paste issue I guess)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (numItem && marginBottomProperty?.IsAuto == true)

huan086 pushed a commit to huan086/Open-Xml-PowerTools that referenced this pull request Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants