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

Group popup creation code and apply it to more annotation types #7016

Merged

Conversation

timvandermeij
Copy link
Contributor

Fixes #7014.

@xlc
Copy link
Contributor

xlc commented Feb 23, 2016

Maybe Highlight/Underline/Squiggly/StrikeOut annotations should have a common base class? Identical code over four classes is not ideal.

@timvandermeij
Copy link
Contributor Author

Now that you brought this up, there are more types that have popups (almost all actually), so I'll update the patch to move most popup handling to the AnnotationElement base class. Thank you!

@timvandermeij timvandermeij force-pushed the annotations-missing-popup branch 5 times, most recently from 295a15c to 3cd0731 Compare February 24, 2016 22:45
@timvandermeij timvandermeij changed the title Show popups when a Popup entry is missing but title and/or contents are available Group popup creation code and apply it to more annotation types Feb 24, 2016

this.data.hasPopup = dict.has('Popup');
this.data.title = stringToPDFString(dict.get('T') || '');
this.data.contents = stringToPDFString(dict.get('Contents') || '');
Copy link
Collaborator

Choose a reason for hiding this comment

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

So, it appears that this code is repeated six times throughout the file. Would it be possible to re-factor into a helper function instead (similar to the other file)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I've done that in the new commit.

@timvandermeij timvandermeij force-pushed the annotations-missing-popup branch 2 times, most recently from 3f617a4 to c7e61e3 Compare February 24, 2016 23:18
this.data.hasPopup = dict.has('Popup');
this.data.title = stringToPDFString(dict.get('T') || '');
this.data.contents = stringToPDFString(dict.get('Contents') || '');
this._preparePopup(dict);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: I think that you can now remove the variable and simply use parameters.dict here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in the new commit.

@timvandermeij timvandermeij force-pushed the annotations-missing-popup branch from c7e61e3 to ad31e52 Compare February 24, 2016 23:36
@timvandermeij
Copy link
Contributor Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/ff467292ebce8cc/output.txt

@timvandermeij
Copy link
Contributor Author

/botio test

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.22.172.223:8877/ca5bc4ff931c980/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://107.21.233.14:8877/d7bcd5ad30b9474/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/ca5bc4ff931c980/output.txt

Total script time: 20.24 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/d7bcd5ad30b9474/output.txt

Total script time: 21.79 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: Passed

@Snuffleupagus
Copy link
Collaborator

Looks good, and much better with the helper methods added, thank you for the patch!

/botio makeref

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_makeref from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.22.172.223:8877/11da4056ff46ac2/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

Command cmd_makeref from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.21.233.14:8877/bd0b7a4f9f19e24/output.txt

Snuffleupagus added a commit that referenced this pull request Feb 25, 2016
Group popup creation code and apply it to more annotation types
@Snuffleupagus Snuffleupagus merged commit 05917b6 into mozilla:master Feb 25, 2016
@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/11da4056ff46ac2/output.txt

Total script time: 20.09 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/bd0b7a4f9f19e24/output.txt

Total script time: 21.18 mins

  • Lint: Passed
  • Make references: Passed
  • Check references: Passed

@timvandermeij timvandermeij deleted the annotations-missing-popup branch February 25, 2016 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants