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

ContentFusion can change the order of document text #61

Open
GoogleCodeExporter opened this issue Jul 24, 2015 · 0 comments
Open

ContentFusion can change the order of document text #61

GoogleCodeExporter opened this issue Jul 24, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. When processing a document with the ContentFusion class the text of the 
document can get out of order if changes are made in multiple iteration of the 
dowhile.
2. When changes are made and two TextBlocks are merged the outer loop is 
executed again (reprocessing the entire document for more changes), however, 
the prevBlock variable is not reset to the first block of the document (It 
still contains the last block of the document). This can cause block(s) at the 
beginning of the document to be merged at the end of the document. 

What is the expected output? What do you see instead?
Blocks at the beginning of the document are merged to the end of blocks at the 
end of the document. These blocks should not be merged at all or should be 
merged to the beginning of later blocks.

What version of the product are you using? On what operating system?
most recent from repository

Please provide any additional information below.
My recommendation would be moving the prevBlock instantiation inside the 
dowhile loop.

From:
TextBlock prevBlock = textBlocks.get(0);

boolean changes = false;
do {
    changes = false;
    for (ListIterator<TextBlock> it = textBlocks.listIterator(1); it.hasNext();) {

To:
boolean changes = false;
do {
    changes = false;
    TextBlock prevBlock = textBlocks.get(0);
    for (ListIterator<TextBlock> it = textBlocks.listIterator(1); it.hasNext();) {

Original issue reported on code.google.com by [email protected] on 6 Mar 2013 at 2:49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant