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

Rename SetLegacyDrawingHF to AddHeaderFooterImage #2023

Merged
merged 3 commits into from
Nov 9, 2024

Conversation

imirkin
Copy link
Contributor

@imirkin imirkin commented Nov 7, 2024

Question: should HeaderFooterGraphics be renamed to something, or OK as-is?

PR Details

Rename SetLegacyDrawingHF to SetHeaderFooterImage.

Motivation and Context

This is being done per request from @xuri. Probably fits in better with the overall naming convention.

How Has This Been Tested

go test passes. Given that this was generated with sed -i, no further testing has been done.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.20%. Comparing base (b7375bc) to head (8e79403).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2023   +/-   ##
=======================================
  Coverage   99.20%   99.20%           
=======================================
  Files          32       32           
  Lines       29880    29947   +67     
=======================================
+ Hits        29642    29709   +67     
  Misses        158      158           
  Partials       80       80           
Flag Coverage Δ
unittests 99.20% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@imirkin
Copy link
Contributor Author

imirkin commented Nov 7, 2024

BTW, it looks like it may be possible to set multiple images somehow:

https://github.com/jmcnamara/XlsxWriter/blob/main/xlsxwriter/worksheet.py#L4244

Perhaps multiple shapes in the VML? No idea, I wasn't able to follow this code. I don't need this myself, but perhaps an improvement for later.

@xuri
Copy link
Member

xuri commented Nov 8, 2024

The name HeaderFooterGraphics is fine, but I think we need to add new Position field in this data type, acceptable value is LH, CH, RH, LF, CF, RF, LHFIRST, CHFIRST, RHFIRST, LFFIRST, CFFIRST, RFFIRST for add multiple shapes in the VML. I will tried to update based on this PR in some time.

@imirkin
Copy link
Contributor Author

imirkin commented Nov 8, 2024 via email

@xuri
Copy link
Member

xuri commented Nov 8, 2024

Yep, support append VML shapes (just like form controls) to allow call SetHeaderFooterImage multiple times, that's would be better.

- Add new exported HeaderFooterImagePositionType enumeration
- An error will be return if the image format is unsupported
- Rename exported data type HeaderFooterGraphics to HeaderFooterImageOptions
- Support add and update exist header and footer images
- Changes the VML data ID to sheet ID
- Update unit tests
- Update dependencies modules
@xuri xuri added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 9, 2024
@xuri xuri linked an issue Nov 9, 2024 that may be closed by this pull request
@xuri xuri changed the title Rename SetLegacyDrawingHF to SetHeaderFooterImage Rename SetLegacyDrawingHF to AddHeaderFooterImage Nov 9, 2024
Copy link
Member

@xuri xuri left a comment

Choose a reason for hiding this comment

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

I made some changes based on your branch, now support append VML shapes by call AddHeaderFooterImage multiple times.

@xuri xuri merged commit 30d3561 into qax-os:master Nov 9, 2024
41 checks passed
vmlDrawing.go Show resolved Hide resolved
vmlDrawing.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Status: Features
Development

Successfully merging this pull request may close these issues.

Header Image
2 participants