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

Fix OpMergeParagraph merging paragraphs with empty annotations #877

Merged

Conversation

kossebau
Copy link
Contributor

Before it removed the <text:p/> of empty annotations. Not nice.
This fix makes sure embedded roots are not cleaned.

* @return {?Node} parent of targetNode
*/
function removeUnwantedNodes(targetNode, shouldRemove) {
function removeUnwantedNodes(targetNode, shouldRemove, shouldSkip) {
Copy link
Contributor

Choose a reason for hiding this comment

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

The introduction of the shouldSkip makes this look more and more like it should follow the existing TreeWalker pattern of using return values rather than boolean filters (e.g., return NodeFilter.REJECT = delete, NodeFilter.SKIP = skip, NodeFilter.ACCEPT = keep).

The point of ambiguity with the interface here is what happens if shouldSkip & shouldDelete are both true?

You could easily fix that in the API documentation, however.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, I see your point. Indeed would make this method more flexibel if the callee has control about how shouldSkip & shouldDelete relate to each other. Will give it a try.

@peitschie
Copy link
Contributor

Other than that small thing, the change looks fine to me. The build-bot hasn't picked this up?

@kossebau
Copy link
Contributor Author

test this please

@kogmbh-ci
Copy link

Build failed.
Refer to this link for build results: http://ci.kogmbh.com/jenkins/job/WebODF-PullReq/2340/

@kossebau
Copy link
Contributor Author

test this please

1 similar comment
@kossebau
Copy link
Contributor Author

test this please

@kogmbh-ci
Copy link

Build succeeded.
Refer to this link for build results: http://ci.kogmbh.com/jenkins/job/WebODF-PullReq/2342/

@kossebau
Copy link
Contributor Author

Buildbot needed to be fed with enough working memory again...

@peitschie So how do you like the other variant you proposed, now that you can see it in code? Myself like it slightly better than the first version, for the reason you gave.

@peitschie
Copy link
Contributor

Yep... I like this a lot better too! Thanks for your rework.

👍 Please send this 🚢 off into the ocean that is webodf master.

@kossebau kossebau force-pushed the fixOpMergeParagraphAndEmptyAnnotations branch from 86a9e0c to 45726eb Compare March 25, 2015 10:11
@kogmbh-ci
Copy link

Build succeeded.
Refer to this link for build results: http://ci.kogmbh.com/jenkins/job/WebODF-PullReq/2343/

@kossebau
Copy link
Contributor Author

Thanks for your good suggestion!
Cast off!

kossebau pushed a commit that referenced this pull request Mar 25, 2015
…tations

Fix OpMergeParagraph merging paragraphs with empty annotations
@kossebau kossebau merged commit ca7d2e6 into webodf:master Mar 25, 2015
@kossebau kossebau deleted the fixOpMergeParagraphAndEmptyAnnotations branch March 25, 2015 10:18
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.

3 participants